@access-ci/ui 0.20.2 → 0.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{access-ci-ui-react-kdgYQZqd.js → access-ci-ui-react-BtB9wMf5.js} +1 -1
- package/dist/access-ci-ui-react.js +1 -1
- package/dist/access-ci-ui-react.umd.cjs +3 -3
- package/dist/access-ci-ui.bundle.js +1 -1
- package/dist/access-ci-ui.js +1 -1
- package/dist/access-ci-ui.umd.cjs +4 -4
- package/dist/{access-qa-bot-BktG98sn.js → access-qa-bot-B5bdzcpP.js} +1 -1
- package/dist/{icon-B7cGzEKy.js → icon-BzhlFlqK.js} +1 -1
- package/dist/{index-hNgWwhEe.js → index-BJubWi7g.js} +2 -2
- package/dist/{resource-group-detail-CFxx3za2.js → resource-group-detail-DwFSj2fT.js} +1 -1
- package/dist/{resource-group-detail-C_g3q9lq.js → resource-group-detail-uIzXwshu.js} +2 -2
- package/dist/{resource-home-Bma2Z32m.js → resource-home-D2JoGg_B.js} +96 -103
- package/dist/{resource-home-BF1by6d7.js → resource-home-dFN7d7Zu.js} +34 -41
- package/package.json +1 -1
|
@@ -288,7 +288,7 @@ Would you like to submit this security incident report?`},options:["Submit Secur
|
|
|
288
288
|
display: inline !important;
|
|
289
289
|
margin: 0 !important;
|
|
290
290
|
}
|
|
291
|
-
`;function Ow(t){if(!t)return;const e=t.getRootNode();if(!(e instanceof ShadowRoot)||e.getElementById(fA))return;const n=document.createElement("style");n.id=fA,n.textContent=_w,e.appendChild(n)}const Oa=w.forwardRef((t,e)=>{const{apiKey:n=mt.DEFAULT_API_KEY,isLoggedIn:r=!1,loginUrl:o=Tn.LOGIN_URL,userEmail:i,userName:s,accessId:a,actingUser:l,ringEffect:c,defaultOpen:u,onClose:d,open:A,onOpenChange:f,embedded:h=!1,welcome:g,qaEndpoint:p,ratingEndpoint:v,agentEndpoint:x,backendId:y,resourceContext:b,onAnalyticsEvent:E}=t,k=mt.AGENT_ENABLED,P=y||mt.BACKEND_ID,D=w.useRef(null),M=w.useRef(null),[I,_]=w.useState({}),[B,T]=w.useState(()=>({categories:[],is_authenticated:!1})),z=w.useMemo(()=>({email:i,name:s,accessId:a}),[i,s,a]);w.useEffect(()=>{Ow(M.current)},[]),w.useEffect(()=>{hw({ticketForm:I,setTicketForm:_})},[I]);const O=x||mt.AGENT_ENDPOINT,R=b?`${O}/capabilities?resource_context=${encodeURIComponent(b)}`:`${O}/capabilities`;w.useEffect(()=>{},[O,k]),w.useEffect(()=>{},[k,R,r]),w.useEffect(()=>{},[k,O,r]),w.useImperativeHandle(e,()=>({addMessage:V=>{var Z,J;(J=(Z=D.current)==null?void 0:Z.addMessage)==null||J.call(Z,V)}}));const Q=g||B?.welcome_message||Tn.WELCOME_MESSAGE,H=w.useMemo(()=>Mw(),[]),S=w.useCallback(V=>{E&&E({...V,type:V.type,timestamp:V.timestamp??Date.now(),sessionId:V.sessionId??H})},[E,H]),K=w.useCallback(V=>{E&&E({...V,type:V.type,timestamp:typeof V.timestamp=="number"?V.timestamp:Date.now(),sessionId:typeof V.sessionId=="string"?V.sessionId:H})},[E,H]),C=w.useMemo(()=>{const V=fw({welcome:Q,setTicketForm:_,trackEvent:S}),Z=kw({ticketForm:{},setTicketForm:_,userInfo:z,trackEvent:S}),J=Sw({ticketForm:{},setTicketForm:_,userInfo:z,trackEvent:S}),ee=Iw({sessionId:H,apiKey:n,trackEvent:S}),ce={...V,...Z,...J,...ee};return dw(ce,{disableOnOptions:!0})},[Q,z,H,n,r,S,B]);return B?m.jsx("div",{ref:M,children:m.jsx(Pa,{ref:D,isLoggedIn:r,allowAnonAccess:mt.ALLOW_ANON_ACCESS,actingUser:l,onAnalyticsEvent:K,apiKey:n,qaEndpoint:p||mt.QA_ENDPOINT,ratingEndpoint:v||mt.RATING_ENDPOINT,backendId:P,botName:Tn.BOT_NAME,logo:Tn.LOGO,primaryColor:Tn.PRIMARY_COLOR,secondaryColor:Tn.SECONDARY_COLOR,welcomeMessage:Q,tooltipText:Tn.TOOLTIP,turnstileSiteKey:mt.TURNSTILE_SITE_KEY,loginUrl:o,open:A,onOpenChange:f,embedded:h,footerText:"AI-powered · Privacy Notice",footerLink:"https://support.access-ci.org/tools/access-qa-tool/privacy",resourceContext:b,customFlow:C})}):m.jsx("div",{ref:M})});Oa.displayName="AccessQABot";const Tw=Object.freeze(Object.defineProperty({__proto__:null,API_CONFIG:mt,AccessQABot:Oa,BOT_CONFIG:Tn,QABot:Oa},Symbol.toStringTag,{value:"Module"}));function me({alt:t=null,name:e=null,src:n=null}){return e?m.jsx("i",{className:`icon bi bi-${e}`}):m.jsx("img",{className:"icon",alt:t,src:n})}const hA=()=>{const t=new Event("accessci-update-sections");document.dispatchEvent(t)};function nn({children:t,headerComponents:e=null,icon:n=null,sectionId:r=null,title:o}){const i=r||o.toLowerCase().replace(/[^0-9a-z]+/g,"-");return w.useLayoutEffect(()=>(hA(),hA),[]),m.jsxs("section",{id:i,"data-section-title":o,"data-section-icon":n,children:[m.jsxs("div",{className:"flex-header",children:[m.jsxs("h2",{children:[n?m.jsx(me,{name:n}):null,o]}),e?m.jsx("div",{className:"header-components",children:e}):null]}),t]})}function Lw({infoGroupId:t}){const e=rt(`https://support.access-ci.org/api/1.0/affinity_groups/${t}`);if(!e||e.error||!e.length)return;const n=ms(e[0].slack_link);return m.jsxs(nn,{title:"User Community",icon:"people-fill",children:[m.jsx("p",{children:"Join the community by participating in an affinity group! Members get update about announcements, events, and outages."}),m.jsxs("div",{className:"button-group",children:[m.jsxs("a",{href:e[0].url,className:"btn secondary",children:[m.jsx(me,{name:"person-plus-fill"})," Join Affinity Group"]}),n?m.jsxs("a",{href:n,className:"btn",children:[m.jsx(me,{name:"slack"})," Connect on Slack"]}):null,m.jsxs("a",{href:"#questions-and-answers",className:"btn",children:[m.jsx(me,{name:"chat-fill"})," Ask and Answer Questions"]})]})]})}function Nw({infoGroupId:t}){const e=Ur(t),n=rt(e&&e.infoResourceIds.length?`https://operations-api.access-ci.org/wh2/cider/v1/info_resourceid/${e.infoResourceIds[0]}/?format=json`:null);if(!e)return;const{accessAllocated:r,name:o,description:i,imageUri:s,organizations:a}=e,l=r?"https://allocations.access-ci.org/get-your-first-project":null,c=n&&n.results?(n.results.compute||n.results.storage||{}).user_guide_url:null;return m.jsxs("div",{className:"resource-group-description",children:[s?m.jsx("img",{className:"resource-group-feature-image",src:s}):null,m.jsx("h1",{children:e.name}),a.map(u=>m.jsx("p",{children:m.jsxs("a",{href:u.organization_url||"#",children:[u.organization_favicon_url?m.jsx(me,{alt:u.organization_name,src:u.organization_favicon_url}):null,u.organization_name]})},u.organization_name)),i?m.jsx("p",{children:i}):null,m.jsxs("div",{style:{marginTop:"1rem"},children:[l?m.jsxs("a",{href:l,className:"btn secondary lg",children:[m.jsx(me,{name:"check2-circle"})," Get Started with ",o]}):null,c?m.jsxs("a",{href:c,className:"btn lg",children:[m.jsx(me,{name:"book"})," User Guide"]}):null]})]})}function Qw({column:t,row:e,style:n={}}){const r=t.format?t.format(e[t.key],e):e[t.key],o=["cell"];return t.class&&o.push(t.class),t.rowClass&&o.push(t.rowClass(e)),m.jsx("td",{className:o.join(" "),style:n,children:r})}const Fw={text:Qw};function yi({columns:t,rows:e,classes:n,frozenColumns:r=0,maxHeight:o=400,minWidth:i,rowClasses:s=[],scrollResetOnUpdate:a=!1}){const l=w.useRef();w.useLayoutEffect(()=>{l.current&&a&&(l.current.scrollTop=0)},[e]);const c=[0];for(let h=0;h<r;h++)c[h+1]=c[h]+(t[h].width||100);const u=(h,g)=>h<r?{position:"sticky",left:`${c[h]}px`,minWidth:`${t[h].width||100}px`,width:`${t[h].width||100}px`,zIndex:g||1}:{},d=t.map((h,g)=>m.jsx("th",{className:h.headerClass||h.class||"",style:u(g,100),children:h.formatHeader?h.formatHeader(h.name,h):h.name},h.key)),A=e.map((h,g)=>{const p=t.map((v,x)=>{const y=Fw[v.type||"text"];return m.jsx(y,{column:v,row:h,style:u(x)},v.key)});return m.jsx("tr",{className:s[g]||"",children:p},g)}),f={};return i&&(f.minWidth=i),m.jsx("div",{className:`grid ${n||""}`,style:{maxHeight:Number.isInteger(o)?`${o}px`:o||null},ref:l,children:m.jsxs("table",{className:"table",style:f,children:[m.jsx("thead",{children:m.jsx("tr",{children:d})}),m.jsx("tbody",{children:A})]})})}function zw({infoGroupId:t}){const e=rt(`https://support.access-ci.org/api/1.0/affinity_groups/${t}`),n=e&&!e.error&&e.length?e[0].field_ask_ci_locale:null,r=n?`${n}.json`:null,o=rt(r);if(!o||o.error||!o.topic_list||!o.topic_list.topics||!o.topic_list.topics.length)return;const i=[{key:"title",name:"Topic",format:(a,l)=>m.jsxs(m.Fragment,{children:[l.pinned?m.jsx(me,{name:"pin-fill"}):null,m.jsx("a",{href:`https://ask.cyberinfrastructure.org/t/${l.slug}/${l.id}`,children:a})]})},{key:"posts_count",name:"Posts",format:a=>a.toLocaleString("en-us")},{key:"bumped_at",name:"Last Update",format:a=>new Date(a).toLocaleString("en-US",{dateStyle:"medium"})}],s=[m.jsx("a",{href:n,className:"btn secondary",children:"Ask a Question"},"ask"),m.jsx("a",{href:n,className:"btn",children:"View All Topics"},"all")];return m.jsx(nn,{title:"Questions and Answers",icon:"chat-fill",headerComponents:s,children:m.jsx(yi,{columns:i,rows:o.topic_list.topics.slice(0,5)})})}var lt="top",Dt="bottom",Bt="right",ct="left",Ta="auto",co=[lt,Dt,Bt,ct],wr="start",uo="end",Hw="clippingParents",pA="viewport",Ao="popper",Rw="reference",gA=co.reduce(function(t,e){return t.concat([e+"-"+wr,e+"-"+uo])},[]),mA=[].concat(co,[Ta]).reduce(function(t,e){return t.concat([e,e+"-"+wr,e+"-"+uo])},[]),Uw="beforeRead",jw="read",Vw="afterRead",Ww="beforeMain",Yw="main",qw="afterMain",Kw="beforeWrite",Gw="write",Xw="afterWrite",Jw=[Uw,jw,Vw,Ww,Yw,qw,Kw,Gw,Xw];function rn(t){return t?(t.nodeName||"").toLowerCase():null}function bt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function $n(t){var e=bt(t).Element;return t instanceof e||t instanceof Element}function It(t){var e=bt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function La(t){if(typeof ShadowRoot>"u")return!1;var e=bt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Zw(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!It(i)||!rn(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function $w(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!It(o)||!rn(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const bA={name:"applyStyles",enabled:!0,phase:"write",fn:Zw,effect:$w,requires:["computeStyles"]};function on(t){return t.split("-")[0]}var er=Math.max,vi=Math.min,xr=Math.round;function Na(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function yA(){return!/^((?!chrome|android).)*safari/i.test(Na())}function kr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&It(t)&&(o=t.offsetWidth>0&&xr(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&xr(r.height)/t.offsetHeight||1);var s=$n(t)?bt(t):window,a=s.visualViewport,l=!yA()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,d=r.width/o,A=r.height/i;return{width:d,height:A,top:u,right:c+d,bottom:u+A,left:c,x:c,y:u}}function Qa(t){var e=kr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function vA(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&La(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function yn(t){return bt(t).getComputedStyle(t)}function ex(t){return["table","td","th"].indexOf(rn(t))>=0}function Ln(t){return(($n(t)?t.ownerDocument:t.document)||window.document).documentElement}function wi(t){return rn(t)==="html"?t:t.assignedSlot||t.parentNode||(La(t)?t.host:null)||Ln(t)}function wA(t){return!It(t)||yn(t).position==="fixed"?null:t.offsetParent}function tx(t){var e=/firefox/i.test(Na()),n=/Trident/i.test(Na());if(n&&It(t)){var r=yn(t);if(r.position==="fixed")return null}var o=wi(t);for(La(o)&&(o=o.host);It(o)&&["html","body"].indexOf(rn(o))<0;){var i=yn(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function fo(t){for(var e=bt(t),n=wA(t);n&&ex(n)&&yn(n).position==="static";)n=wA(n);return n&&(rn(n)==="html"||rn(n)==="body"&&yn(n).position==="static")?e:n||tx(t)||e}function Fa(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ho(t,e,n){return er(t,vi(e,n))}function nx(t,e,n){var r=ho(t,e,n);return r>n?n:r}function xA(){return{top:0,right:0,bottom:0,left:0}}function kA(t){return Object.assign({},xA(),t)}function EA(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var rx=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,kA(typeof e!="number"?e:EA(e,co))};function ox(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=on(n.placement),l=Fa(a),c=[ct,Bt].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=rx(o.padding,n),A=Qa(i),f=l==="y"?lt:ct,h=l==="y"?Dt:Bt,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],p=s[l]-n.rects.reference[l],v=fo(i),x=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=g/2-p/2,b=d[f],E=x-A[u]-d[h],k=x/2-A[u]/2+y,P=ho(b,k,E),D=l;n.modifiersData[r]=(e={},e[D]=P,e.centerOffset=P-k,e)}}function ix(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||vA(e.elements.popper,o)&&(e.elements.arrow=o))}const sx={name:"arrow",enabled:!0,phase:"main",fn:ox,effect:ix,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Er(t){return t.split("-")[1]}var ax={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lx(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:xr(n*o)/o||0,y:xr(r*o)/o||0}}function SA(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,A=s.x,f=A===void 0?0:A,h=s.y,g=h===void 0?0:h,p=typeof u=="function"?u({x:f,y:g}):{x:f,y:g};f=p.x,g=p.y;var v=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),y=ct,b=lt,E=window;if(c){var k=fo(n),P="clientHeight",D="clientWidth";if(k===bt(n)&&(k=Ln(n),yn(k).position!=="static"&&a==="absolute"&&(P="scrollHeight",D="scrollWidth")),k=k,o===lt||(o===ct||o===Bt)&&i===uo){b=Dt;var M=d&&k===E&&E.visualViewport?E.visualViewport.height:k[P];g-=M-r.height,g*=l?1:-1}if(o===ct||(o===lt||o===Dt)&&i===uo){y=Bt;var I=d&&k===E&&E.visualViewport?E.visualViewport.width:k[D];f-=I-r.width,f*=l?1:-1}}var _=Object.assign({position:a},c&&ax),B=u===!0?lx({x:f,y:g},bt(n)):{x:f,y:g};if(f=B.x,g=B.y,l){var T;return Object.assign({},_,(T={},T[b]=x?"0":"",T[y]=v?"0":"",T.transform=(E.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",T))}return Object.assign({},_,(e={},e[b]=x?g+"px":"",e[y]=v?f+"px":"",e.transform="",e))}function cx(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:on(e.placement),variation:Er(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,SA(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,SA(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const ux={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cx,data:{}};var xi={passive:!0};function dx(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=bt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,xi)}),a&&l.addEventListener("resize",n.update,xi),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,xi)}),a&&l.removeEventListener("resize",n.update,xi)}}const Ax={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:dx,data:{}};var fx={left:"right",right:"left",bottom:"top",top:"bottom"};function ki(t){return t.replace(/left|right|bottom|top/g,function(e){return fx[e]})}var hx={start:"end",end:"start"};function CA(t){return t.replace(/start|end/g,function(e){return hx[e]})}function za(t){var e=bt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ha(t){return kr(Ln(t)).left+za(t).scrollLeft}function px(t,e){var n=bt(t),r=Ln(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=yA();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Ha(t),y:l}}function gx(t){var e,n=Ln(t),r=za(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=er(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=er(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Ha(t),l=-r.scrollTop;return yn(o||n).direction==="rtl"&&(a+=er(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Ra(t){var e=yn(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function PA(t){return["html","body","#document"].indexOf(rn(t))>=0?t.ownerDocument.body:It(t)&&Ra(t)?t:PA(wi(t))}function po(t,e){var n;e===void 0&&(e=[]);var r=PA(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=bt(r),s=o?[i].concat(i.visualViewport||[],Ra(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(po(wi(s)))}function Ua(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mx(t,e){var n=kr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function DA(t,e,n){return e===pA?Ua(px(t,n)):$n(e)?mx(e,n):Ua(gx(Ln(t)))}function bx(t){var e=po(wi(t)),n=["absolute","fixed"].indexOf(yn(t).position)>=0,r=n&&It(t)?fo(t):t;return $n(r)?e.filter(function(o){return $n(o)&&vA(o,r)&&rn(o)!=="body"}):[]}function yx(t,e,n,r){var o=e==="clippingParents"?bx(t):[].concat(e),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=DA(t,c,r);return l.top=er(u.top,l.top),l.right=vi(u.right,l.right),l.bottom=vi(u.bottom,l.bottom),l.left=er(u.left,l.left),l},DA(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function BA(t){var e=t.reference,n=t.element,r=t.placement,o=r?on(r):null,i=r?Er(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case lt:l={x:s,y:e.y-n.height};break;case Dt:l={x:s,y:e.y+e.height};break;case Bt:l={x:e.x+e.width,y:a};break;case ct:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?Fa(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case wr:l[c]=l[c]-(e[u]/2-n[u]/2);break;case uo:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function go(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,a=n.boundary,l=a===void 0?Hw:a,c=n.rootBoundary,u=c===void 0?pA:c,d=n.elementContext,A=d===void 0?Ao:d,f=n.altBoundary,h=f===void 0?!1:f,g=n.padding,p=g===void 0?0:g,v=kA(typeof p!="number"?p:EA(p,co)),x=A===Ao?Rw:Ao,y=t.rects.popper,b=t.elements[h?x:A],E=yx($n(b)?b:b.contextElement||Ln(t.elements.popper),l,u,s),k=kr(t.elements.reference),P=BA({reference:k,element:y,placement:o}),D=Ua(Object.assign({},y,P)),M=A===Ao?D:k,I={top:E.top-M.top+v.top,bottom:M.bottom-E.bottom+v.bottom,left:E.left-M.left+v.left,right:M.right-E.right+v.right},_=t.modifiersData.offset;if(A===Ao&&_){var B=_[o];Object.keys(I).forEach(function(T){var z=[Bt,Dt].indexOf(T)>=0?1:-1,O=[lt,Dt].indexOf(T)>=0?"y":"x";I[T]+=B[O]*z})}return I}function vx(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?mA:l,u=Er(r),d=u?a?gA:gA.filter(function(h){return Er(h)===u}):co,A=d.filter(function(h){return c.indexOf(h)>=0});A.length===0&&(A=d);var f=A.reduce(function(h,g){return h[g]=go(t,{placement:g,boundary:o,rootBoundary:i,padding:s})[on(g)],h},{});return Object.keys(f).sort(function(h,g){return f[h]-f[g]})}function wx(t){if(on(t)===Ta)return[];var e=ki(t);return[CA(t),e,CA(e)]}function xx(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,A=n.altBoundary,f=n.flipVariations,h=f===void 0?!0:f,g=n.allowedAutoPlacements,p=e.options.placement,v=on(p),x=v===p,y=l||(x||!h?[ki(p)]:wx(p)),b=[p].concat(y).reduce(function(J,ee){return J.concat(on(ee)===Ta?vx(e,{placement:ee,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:g}):ee)},[]),E=e.rects.reference,k=e.rects.popper,P=new Map,D=!0,M=b[0],I=0;I<b.length;I++){var _=b[I],B=on(_),T=Er(_)===wr,z=[lt,Dt].indexOf(B)>=0,O=z?"width":"height",R=go(e,{placement:_,boundary:u,rootBoundary:d,altBoundary:A,padding:c}),Q=z?T?Bt:ct:T?Dt:lt;E[O]>k[O]&&(Q=ki(Q));var H=ki(Q),S=[];if(i&&S.push(R[B]<=0),a&&S.push(R[Q]<=0,R[H]<=0),S.every(function(J){return J})){M=_,D=!1;break}P.set(_,S)}if(D)for(var K=h?3:1,C=function(ee){var ce=b.find(function(Ae){var Le=P.get(Ae);if(Le)return Le.slice(0,ee).every(function(De){return De})});if(ce)return M=ce,"break"},V=K;V>0;V--){var Z=C(V);if(Z==="break")break}e.placement!==M&&(e.modifiersData[r]._skip=!0,e.placement=M,e.reset=!0)}}const kx={name:"flip",enabled:!0,phase:"main",fn:xx,requiresIfExists:["offset"],data:{_skip:!1}};function IA(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function MA(t){return[lt,Bt,Dt,ct].some(function(e){return t[e]>=0})}function Ex(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=go(e,{elementContext:"reference"}),a=go(e,{altBoundary:!0}),l=IA(s,r),c=IA(a,o,i),u=MA(l),d=MA(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const Sx={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ex};function Cx(t,e,n){var r=on(t),o=[ct,lt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[ct,Bt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Px(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=mA.reduce(function(u,d){return u[d]=Cx(d,e.rects,i),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const Dx={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Px};function Bx(t){var e=t.state,n=t.name;e.modifiersData[n]=BA({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const Ix={name:"popperOffsets",enabled:!0,phase:"read",fn:Bx,data:{}};function Mx(t){return t==="x"?"y":"x"}function _x(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,A=n.tether,f=A===void 0?!0:A,h=n.tetherOffset,g=h===void 0?0:h,p=go(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=on(e.placement),x=Er(e.placement),y=!x,b=Fa(v),E=Mx(b),k=e.modifiersData.popperOffsets,P=e.rects.reference,D=e.rects.popper,M=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,I=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(k){if(i){var T,z=b==="y"?lt:ct,O=b==="y"?Dt:Bt,R=b==="y"?"height":"width",Q=k[b],H=Q+p[z],S=Q-p[O],K=f?-D[R]/2:0,C=x===wr?P[R]:D[R],V=x===wr?-D[R]:-P[R],Z=e.elements.arrow,J=f&&Z?Qa(Z):{width:0,height:0},ee=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:xA(),ce=ee[z],Ae=ee[O],Le=ho(0,P[R],J[R]),De=y?P[R]/2-K-Le-ce-I.mainAxis:C-Le-ce-I.mainAxis,Be=y?-P[R]/2+K+Le+Ae+I.mainAxis:V+Le+Ae+I.mainAxis,qe=e.elements.arrow&&fo(e.elements.arrow),q=qe?b==="y"?qe.clientTop||0:qe.clientLeft||0:0,G=(T=_?.[b])!=null?T:0,fe=Q+De-G-q,le=Q+Be-G,xe=ho(f?vi(H,fe):H,Q,f?er(S,le):S);k[b]=xe,B[b]=xe-Q}if(a){var he,ke=b==="x"?lt:ct,Ne=b==="x"?Dt:Bt,_e=k[E],ot=E==="y"?"height":"width",Se=_e+p[ke],ge=_e-p[Ne],Lt=[lt,ct].indexOf(v)!==-1,tt=(he=_?.[E])!=null?he:0,Rt=Lt?Se:_e-P[ot]-D[ot]-tt+I.altAxis,kt=Lt?_e+P[ot]+D[ot]-tt-I.altAxis:ge,nt=f&&Lt?nx(Rt,_e,kt):ho(f?Rt:Se,_e,f?kt:ge);k[E]=nt,B[E]=nt-_e}e.modifiersData[r]=B}}const Ox={name:"preventOverflow",enabled:!0,phase:"main",fn:_x,requiresIfExists:["offset"]};function Tx(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Lx(t){return t===bt(t)||!It(t)?za(t):Tx(t)}function Nx(t){var e=t.getBoundingClientRect(),n=xr(e.width)/t.offsetWidth||1,r=xr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Qx(t,e,n){n===void 0&&(n=!1);var r=It(e),o=It(e)&&Nx(e),i=Ln(e),s=kr(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((rn(e)!=="body"||Ra(i))&&(a=Lx(e)),It(e)?(l=kr(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=Ha(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Fx(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function zx(t){var e=Fx(t);return Jw.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function Hx(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Rx(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var _A={placement:"bottom",modifiers:[],strategy:"absolute"};function OA(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Ux(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?_A:o;return function(a,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},_A,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],A=!1,f={state:u,setOptions:function(v){var x=typeof v=="function"?v(u.options):v;g(),u.options=Object.assign({},i,u.options,x),u.scrollParents={reference:$n(a)?po(a):a.contextElement?po(a.contextElement):[],popper:po(l)};var y=zx(Rx([].concat(r,u.options.modifiers)));return u.orderedModifiers=y.filter(function(b){return b.enabled}),h(),f.update()},forceUpdate:function(){if(!A){var v=u.elements,x=v.reference,y=v.popper;if(OA(x,y)){u.rects={reference:Qx(x,fo(y),u.options.strategy==="fixed"),popper:Qa(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(I){return u.modifiersData[I.name]=Object.assign({},I.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var E=u.orderedModifiers[b],k=E.fn,P=E.options,D=P===void 0?{}:P,M=E.name;typeof k=="function"&&(u=k({state:u,options:D,name:M,instance:f})||u)}}}},update:Hx(function(){return new Promise(function(p){f.forceUpdate(),p(u)})}),destroy:function(){g(),A=!0}};if(!OA(a,l))return f;f.setOptions(c).then(function(p){!A&&c.onFirstUpdate&&c.onFirstUpdate(p)});function h(){u.orderedModifiers.forEach(function(p){var v=p.name,x=p.options,y=x===void 0?{}:x,b=p.effect;if(typeof b=="function"){var E=b({state:u,name:v,instance:f,options:y}),k=function(){};d.push(E||k)}})}function g(){d.forEach(function(p){return p()}),d=[]}return f}}var jx=[Ax,Ix,ux,bA,Dx,kx,Ox,sx,Sx],Vx=Ux({defaultModifiers:jx}),Wx="tippy-box",TA="tippy-content",Yx="tippy-backdrop",LA="tippy-arrow",NA="tippy-svg-arrow",tr={passive:!0,capture:!0},QA=function(){return document.body};function qx(t,e){return{}.hasOwnProperty.call(t,e)}function ja(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Va(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function FA(t,e){return typeof t=="function"?t.apply(void 0,e):t}function zA(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function Kx(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function Gx(t){return t.split(/\s+/).filter(Boolean)}function Sr(t){return[].concat(t)}function HA(t,e){t.indexOf(e)===-1&&t.push(e)}function Xx(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function Jx(t){return t.split("-")[0]}function Ei(t){return[].slice.call(t)}function RA(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function mo(){return document.createElement("div")}function bo(t){return["Element","Fragment"].some(function(e){return Va(t,e)})}function Zx(t){return Va(t,"NodeList")}function $x(t){return Va(t,"MouseEvent")}function e1(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function t1(t){return bo(t)?[t]:Zx(t)?Ei(t):Array.isArray(t)?t:Ei(document.querySelectorAll(t))}function Wa(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function UA(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function n1(t){var e,n=Sr(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function r1(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,l=a.interactiveBorder,c=Jx(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,A=c==="top"?u.bottom.y:0,f=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,g=i.top-r+d>l,p=r-i.bottom-A>l,v=i.left-n+f>l,x=n-i.right-h>l;return g||p||v||x})}function Ya(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function jA(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var sn={isTouch:!1},VA=0;function o1(){sn.isTouch||(sn.isTouch=!0,window.performance&&document.addEventListener("mousemove",WA))}function WA(){var t=performance.now();t-VA<20&&(sn.isTouch=!1,document.removeEventListener("mousemove",WA)),VA=t}function i1(){var t=document.activeElement;if(e1(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function s1(){document.addEventListener("touchstart",o1,tr),window.addEventListener("blur",i1)}var a1=typeof window<"u"&&typeof document<"u",l1=a1?!!window.msCrypto:!1;function Cr(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function YA(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function c1(t){return YA(`
|
|
291
|
+
`;function Ow(t){if(!t)return;const e=t.getRootNode();if(!(e instanceof ShadowRoot)||e.getElementById(fA))return;const n=document.createElement("style");n.id=fA,n.textContent=_w,e.appendChild(n)}const Oa=w.forwardRef((t,e)=>{const{apiKey:n=mt.DEFAULT_API_KEY,isLoggedIn:r=!1,loginUrl:o=Tn.LOGIN_URL,userEmail:i,userName:s,accessId:a,actingUser:l,ringEffect:c,defaultOpen:u,onClose:d,open:A,onOpenChange:f,embedded:h=!1,welcome:g,qaEndpoint:p,ratingEndpoint:v,agentEndpoint:x,backendId:y,resourceContext:b,onAnalyticsEvent:E}=t,k=mt.AGENT_ENABLED,P=y||mt.BACKEND_ID,D=w.useRef(null),M=w.useRef(null),[I,_]=w.useState({}),[B,T]=w.useState(()=>({categories:[],is_authenticated:!1})),z=w.useMemo(()=>({email:i,name:s,accessId:a}),[i,s,a]);w.useEffect(()=>{Ow(M.current)},[]),w.useEffect(()=>{hw({ticketForm:I,setTicketForm:_})},[I]);const O=x||mt.AGENT_ENDPOINT,R=b?`${O}/capabilities?resource_context=${encodeURIComponent(b)}`:`${O}/capabilities`;w.useEffect(()=>{},[O,k]),w.useEffect(()=>{},[k,R,r]),w.useEffect(()=>{},[k,O,r]),w.useImperativeHandle(e,()=>({addMessage:V=>{var Z,J;(J=(Z=D.current)==null?void 0:Z.addMessage)==null||J.call(Z,V)}}));const Q=g||B?.welcome_message||Tn.WELCOME_MESSAGE,H=w.useMemo(()=>Mw(),[]),S=w.useCallback(V=>{E&&E({...V,type:V.type,timestamp:V.timestamp??Date.now(),sessionId:V.sessionId??H})},[E,H]),K=w.useCallback(V=>{E&&E({...V,type:V.type,timestamp:typeof V.timestamp=="number"?V.timestamp:Date.now(),sessionId:typeof V.sessionId=="string"?V.sessionId:H})},[E,H]),C=w.useMemo(()=>{const V=fw({welcome:Q,setTicketForm:_,trackEvent:S}),Z=kw({ticketForm:{},setTicketForm:_,userInfo:z,trackEvent:S}),J=Sw({ticketForm:{},setTicketForm:_,userInfo:z,trackEvent:S}),ee=Iw({sessionId:H,apiKey:n,trackEvent:S}),ce={...V,...Z,...J,...ee};return dw(ce,{disableOnOptions:!0})},[Q,z,H,n,r,S,B]);return B?m.jsx("div",{ref:M,children:m.jsx(Pa,{ref:D,isLoggedIn:r,allowAnonAccess:mt.ALLOW_ANON_ACCESS,actingUser:l,onAnalyticsEvent:K,apiKey:n,qaEndpoint:p||mt.QA_ENDPOINT,ratingEndpoint:v||mt.RATING_ENDPOINT,backendId:P,botName:Tn.BOT_NAME,logo:Tn.LOGO,primaryColor:Tn.PRIMARY_COLOR,secondaryColor:Tn.SECONDARY_COLOR,welcomeMessage:Q,tooltipText:Tn.TOOLTIP,turnstileSiteKey:mt.TURNSTILE_SITE_KEY,loginUrl:o,open:A,onOpenChange:f,embedded:h,footerText:"AI-powered · Privacy Notice",footerLink:"https://support.access-ci.org/tools/access-qa-tool/privacy",resourceContext:b,customFlow:C})}):m.jsx("div",{ref:M})});Oa.displayName="AccessQABot";const Tw=Object.freeze(Object.defineProperty({__proto__:null,API_CONFIG:mt,AccessQABot:Oa,BOT_CONFIG:Tn,QABot:Oa},Symbol.toStringTag,{value:"Module"}));function be({alt:t=null,name:e=null,src:n=null}){return e?m.jsx("i",{className:`icon bi bi-${e}`}):m.jsx("img",{className:"icon",alt:t,src:n})}const hA=()=>{const t=new Event("accessci-update-sections");document.dispatchEvent(t)};function nn({children:t,headerComponents:e=null,icon:n=null,sectionId:r=null,title:o}){const i=r||o.toLowerCase().replace(/[^0-9a-z]+/g,"-");return w.useLayoutEffect(()=>(hA(),hA),[]),m.jsxs("section",{id:i,"data-section-title":o,"data-section-icon":n,children:[m.jsxs("div",{className:"flex-header",children:[m.jsxs("h2",{children:[n?m.jsx(be,{name:n}):null,o]}),e?m.jsx("div",{className:"header-components",children:e}):null]}),t]})}function Lw({infoGroupId:t}){const e=rt(`https://support.access-ci.org/api/1.0/affinity_groups/${t}`);if(!e||e.error||!e.length)return;const n=ms(e[0].slack_link);return m.jsxs(nn,{title:"User Community",icon:"people-fill",children:[m.jsx("p",{children:"Join the community by participating in an affinity group! Members get update about announcements, events, and outages."}),m.jsxs("div",{className:"button-group",children:[m.jsxs("a",{href:e[0].url,className:"btn secondary",children:[m.jsx(be,{name:"person-plus-fill"})," Join Affinity Group"]}),n?m.jsxs("a",{href:n,className:"btn",children:[m.jsx(be,{name:"slack"})," Connect on Slack"]}):null,m.jsxs("a",{href:"#questions-and-answers",className:"btn",children:[m.jsx(be,{name:"chat-fill"})," Ask and Answer Questions"]})]})]})}function Nw({infoGroupId:t}){const e=Ur(t),n=rt(e&&e.infoResourceIds.length?`https://operations-api.access-ci.org/wh2/cider/v1/info_resourceid/${e.infoResourceIds[0]}/?format=json`:null);if(!e)return;const{accessAllocated:r,name:o,description:i,imageUri:s,organizations:a}=e,l=r?"https://allocations.access-ci.org/get-your-first-project":null,c=n&&n.results?(n.results.compute||n.results.storage||{}).user_guide_url:null;return m.jsxs("div",{className:"resource-group-description",children:[s?m.jsx("img",{className:"resource-group-feature-image",src:s}):null,m.jsx("h1",{children:e.name}),a.map(u=>m.jsx("p",{children:m.jsxs("a",{href:u.organization_url||"#",children:[u.organization_favicon_url?m.jsx(be,{alt:u.organization_name,src:u.organization_favicon_url}):null,u.organization_name]})},u.organization_name)),i?m.jsx("p",{children:i}):null,m.jsxs("div",{style:{marginTop:"1rem"},children:[l?m.jsxs("a",{href:l,className:"btn secondary lg",children:[m.jsx(be,{name:"check2-circle"})," Get Started with ",o]}):null,c?m.jsxs("a",{href:c,className:"btn lg",children:[m.jsx(be,{name:"book"})," User Guide"]}):null]})]})}function Qw({column:t,row:e,style:n={}}){const r=t.format?t.format(e[t.key],e):e[t.key],o=["cell"];return t.class&&o.push(t.class),t.rowClass&&o.push(t.rowClass(e)),m.jsx("td",{className:o.join(" "),style:n,children:r})}const Fw={text:Qw};function yi({columns:t,rows:e,classes:n,frozenColumns:r=0,maxHeight:o=400,minWidth:i,rowClasses:s=[],scrollResetOnUpdate:a=!1}){const l=w.useRef();w.useLayoutEffect(()=>{l.current&&a&&(l.current.scrollTop=0)},[e]);const c=[0];for(let h=0;h<r;h++)c[h+1]=c[h]+(t[h].width||100);const u=(h,g)=>h<r?{position:"sticky",left:`${c[h]}px`,minWidth:`${t[h].width||100}px`,width:`${t[h].width||100}px`,zIndex:g||1}:{},d=t.map((h,g)=>m.jsx("th",{className:h.headerClass||h.class||"",style:u(g,100),children:h.formatHeader?h.formatHeader(h.name,h):h.name},h.key)),A=e.map((h,g)=>{const p=t.map((v,x)=>{const y=Fw[v.type||"text"];return m.jsx(y,{column:v,row:h,style:u(x)},v.key)});return m.jsx("tr",{className:s[g]||"",children:p},g)}),f={};return i&&(f.minWidth=i),m.jsx("div",{className:`grid ${n||""}`,style:{maxHeight:Number.isInteger(o)?`${o}px`:o||null},ref:l,children:m.jsxs("table",{className:"table",style:f,children:[m.jsx("thead",{children:m.jsx("tr",{children:d})}),m.jsx("tbody",{children:A})]})})}function zw({infoGroupId:t}){const e=rt(`https://support.access-ci.org/api/1.0/affinity_groups/${t}`),n=e&&!e.error&&e.length?e[0].field_ask_ci_locale:null,r=n?`${n}.json`:null,o=rt(r);if(!o||o.error||!o.topic_list||!o.topic_list.topics||!o.topic_list.topics.length)return;const i=[{key:"title",name:"Topic",format:(a,l)=>m.jsxs(m.Fragment,{children:[l.pinned?m.jsx(be,{name:"pin-fill"}):null,m.jsx("a",{href:`https://ask.cyberinfrastructure.org/t/${l.slug}/${l.id}`,children:a})]})},{key:"posts_count",name:"Posts",format:a=>a.toLocaleString("en-us")},{key:"bumped_at",name:"Last Update",format:a=>new Date(a).toLocaleString("en-US",{dateStyle:"medium"})}],s=[m.jsx("a",{href:n,className:"btn secondary",children:"Ask a Question"},"ask"),m.jsx("a",{href:n,className:"btn",children:"View All Topics"},"all")];return m.jsx(nn,{title:"Questions and Answers",icon:"chat-fill",headerComponents:s,children:m.jsx(yi,{columns:i,rows:o.topic_list.topics.slice(0,5)})})}var lt="top",Dt="bottom",Bt="right",ct="left",Ta="auto",co=[lt,Dt,Bt,ct],wr="start",uo="end",Hw="clippingParents",pA="viewport",Ao="popper",Rw="reference",gA=co.reduce(function(t,e){return t.concat([e+"-"+wr,e+"-"+uo])},[]),mA=[].concat(co,[Ta]).reduce(function(t,e){return t.concat([e,e+"-"+wr,e+"-"+uo])},[]),Uw="beforeRead",jw="read",Vw="afterRead",Ww="beforeMain",Yw="main",qw="afterMain",Kw="beforeWrite",Gw="write",Xw="afterWrite",Jw=[Uw,jw,Vw,Ww,Yw,qw,Kw,Gw,Xw];function rn(t){return t?(t.nodeName||"").toLowerCase():null}function bt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function $n(t){var e=bt(t).Element;return t instanceof e||t instanceof Element}function It(t){var e=bt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function La(t){if(typeof ShadowRoot>"u")return!1;var e=bt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Zw(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!It(i)||!rn(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function $w(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!It(o)||!rn(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const bA={name:"applyStyles",enabled:!0,phase:"write",fn:Zw,effect:$w,requires:["computeStyles"]};function on(t){return t.split("-")[0]}var er=Math.max,vi=Math.min,xr=Math.round;function Na(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function yA(){return!/^((?!chrome|android).)*safari/i.test(Na())}function kr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&It(t)&&(o=t.offsetWidth>0&&xr(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&xr(r.height)/t.offsetHeight||1);var s=$n(t)?bt(t):window,a=s.visualViewport,l=!yA()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,d=r.width/o,A=r.height/i;return{width:d,height:A,top:u,right:c+d,bottom:u+A,left:c,x:c,y:u}}function Qa(t){var e=kr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function vA(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&La(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function yn(t){return bt(t).getComputedStyle(t)}function ex(t){return["table","td","th"].indexOf(rn(t))>=0}function Ln(t){return(($n(t)?t.ownerDocument:t.document)||window.document).documentElement}function wi(t){return rn(t)==="html"?t:t.assignedSlot||t.parentNode||(La(t)?t.host:null)||Ln(t)}function wA(t){return!It(t)||yn(t).position==="fixed"?null:t.offsetParent}function tx(t){var e=/firefox/i.test(Na()),n=/Trident/i.test(Na());if(n&&It(t)){var r=yn(t);if(r.position==="fixed")return null}var o=wi(t);for(La(o)&&(o=o.host);It(o)&&["html","body"].indexOf(rn(o))<0;){var i=yn(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function fo(t){for(var e=bt(t),n=wA(t);n&&ex(n)&&yn(n).position==="static";)n=wA(n);return n&&(rn(n)==="html"||rn(n)==="body"&&yn(n).position==="static")?e:n||tx(t)||e}function Fa(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ho(t,e,n){return er(t,vi(e,n))}function nx(t,e,n){var r=ho(t,e,n);return r>n?n:r}function xA(){return{top:0,right:0,bottom:0,left:0}}function kA(t){return Object.assign({},xA(),t)}function EA(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var rx=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,kA(typeof e!="number"?e:EA(e,co))};function ox(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=on(n.placement),l=Fa(a),c=[ct,Bt].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=rx(o.padding,n),A=Qa(i),f=l==="y"?lt:ct,h=l==="y"?Dt:Bt,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],p=s[l]-n.rects.reference[l],v=fo(i),x=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=g/2-p/2,b=d[f],E=x-A[u]-d[h],k=x/2-A[u]/2+y,P=ho(b,k,E),D=l;n.modifiersData[r]=(e={},e[D]=P,e.centerOffset=P-k,e)}}function ix(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||vA(e.elements.popper,o)&&(e.elements.arrow=o))}const sx={name:"arrow",enabled:!0,phase:"main",fn:ox,effect:ix,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Er(t){return t.split("-")[1]}var ax={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lx(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:xr(n*o)/o||0,y:xr(r*o)/o||0}}function SA(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,A=s.x,f=A===void 0?0:A,h=s.y,g=h===void 0?0:h,p=typeof u=="function"?u({x:f,y:g}):{x:f,y:g};f=p.x,g=p.y;var v=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),y=ct,b=lt,E=window;if(c){var k=fo(n),P="clientHeight",D="clientWidth";if(k===bt(n)&&(k=Ln(n),yn(k).position!=="static"&&a==="absolute"&&(P="scrollHeight",D="scrollWidth")),k=k,o===lt||(o===ct||o===Bt)&&i===uo){b=Dt;var M=d&&k===E&&E.visualViewport?E.visualViewport.height:k[P];g-=M-r.height,g*=l?1:-1}if(o===ct||(o===lt||o===Dt)&&i===uo){y=Bt;var I=d&&k===E&&E.visualViewport?E.visualViewport.width:k[D];f-=I-r.width,f*=l?1:-1}}var _=Object.assign({position:a},c&&ax),B=u===!0?lx({x:f,y:g},bt(n)):{x:f,y:g};if(f=B.x,g=B.y,l){var T;return Object.assign({},_,(T={},T[b]=x?"0":"",T[y]=v?"0":"",T.transform=(E.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",T))}return Object.assign({},_,(e={},e[b]=x?g+"px":"",e[y]=v?f+"px":"",e.transform="",e))}function cx(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:on(e.placement),variation:Er(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,SA(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,SA(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const ux={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cx,data:{}};var xi={passive:!0};function dx(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=bt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,xi)}),a&&l.addEventListener("resize",n.update,xi),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,xi)}),a&&l.removeEventListener("resize",n.update,xi)}}const Ax={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:dx,data:{}};var fx={left:"right",right:"left",bottom:"top",top:"bottom"};function ki(t){return t.replace(/left|right|bottom|top/g,function(e){return fx[e]})}var hx={start:"end",end:"start"};function CA(t){return t.replace(/start|end/g,function(e){return hx[e]})}function za(t){var e=bt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ha(t){return kr(Ln(t)).left+za(t).scrollLeft}function px(t,e){var n=bt(t),r=Ln(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=yA();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Ha(t),y:l}}function gx(t){var e,n=Ln(t),r=za(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=er(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=er(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Ha(t),l=-r.scrollTop;return yn(o||n).direction==="rtl"&&(a+=er(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Ra(t){var e=yn(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function PA(t){return["html","body","#document"].indexOf(rn(t))>=0?t.ownerDocument.body:It(t)&&Ra(t)?t:PA(wi(t))}function po(t,e){var n;e===void 0&&(e=[]);var r=PA(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=bt(r),s=o?[i].concat(i.visualViewport||[],Ra(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(po(wi(s)))}function Ua(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mx(t,e){var n=kr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function DA(t,e,n){return e===pA?Ua(px(t,n)):$n(e)?mx(e,n):Ua(gx(Ln(t)))}function bx(t){var e=po(wi(t)),n=["absolute","fixed"].indexOf(yn(t).position)>=0,r=n&&It(t)?fo(t):t;return $n(r)?e.filter(function(o){return $n(o)&&vA(o,r)&&rn(o)!=="body"}):[]}function yx(t,e,n,r){var o=e==="clippingParents"?bx(t):[].concat(e),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=DA(t,c,r);return l.top=er(u.top,l.top),l.right=vi(u.right,l.right),l.bottom=vi(u.bottom,l.bottom),l.left=er(u.left,l.left),l},DA(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function BA(t){var e=t.reference,n=t.element,r=t.placement,o=r?on(r):null,i=r?Er(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case lt:l={x:s,y:e.y-n.height};break;case Dt:l={x:s,y:e.y+e.height};break;case Bt:l={x:e.x+e.width,y:a};break;case ct:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?Fa(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case wr:l[c]=l[c]-(e[u]/2-n[u]/2);break;case uo:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function go(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,a=n.boundary,l=a===void 0?Hw:a,c=n.rootBoundary,u=c===void 0?pA:c,d=n.elementContext,A=d===void 0?Ao:d,f=n.altBoundary,h=f===void 0?!1:f,g=n.padding,p=g===void 0?0:g,v=kA(typeof p!="number"?p:EA(p,co)),x=A===Ao?Rw:Ao,y=t.rects.popper,b=t.elements[h?x:A],E=yx($n(b)?b:b.contextElement||Ln(t.elements.popper),l,u,s),k=kr(t.elements.reference),P=BA({reference:k,element:y,placement:o}),D=Ua(Object.assign({},y,P)),M=A===Ao?D:k,I={top:E.top-M.top+v.top,bottom:M.bottom-E.bottom+v.bottom,left:E.left-M.left+v.left,right:M.right-E.right+v.right},_=t.modifiersData.offset;if(A===Ao&&_){var B=_[o];Object.keys(I).forEach(function(T){var z=[Bt,Dt].indexOf(T)>=0?1:-1,O=[lt,Dt].indexOf(T)>=0?"y":"x";I[T]+=B[O]*z})}return I}function vx(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?mA:l,u=Er(r),d=u?a?gA:gA.filter(function(h){return Er(h)===u}):co,A=d.filter(function(h){return c.indexOf(h)>=0});A.length===0&&(A=d);var f=A.reduce(function(h,g){return h[g]=go(t,{placement:g,boundary:o,rootBoundary:i,padding:s})[on(g)],h},{});return Object.keys(f).sort(function(h,g){return f[h]-f[g]})}function wx(t){if(on(t)===Ta)return[];var e=ki(t);return[CA(t),e,CA(e)]}function xx(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,A=n.altBoundary,f=n.flipVariations,h=f===void 0?!0:f,g=n.allowedAutoPlacements,p=e.options.placement,v=on(p),x=v===p,y=l||(x||!h?[ki(p)]:wx(p)),b=[p].concat(y).reduce(function(J,ee){return J.concat(on(ee)===Ta?vx(e,{placement:ee,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:g}):ee)},[]),E=e.rects.reference,k=e.rects.popper,P=new Map,D=!0,M=b[0],I=0;I<b.length;I++){var _=b[I],B=on(_),T=Er(_)===wr,z=[lt,Dt].indexOf(B)>=0,O=z?"width":"height",R=go(e,{placement:_,boundary:u,rootBoundary:d,altBoundary:A,padding:c}),Q=z?T?Bt:ct:T?Dt:lt;E[O]>k[O]&&(Q=ki(Q));var H=ki(Q),S=[];if(i&&S.push(R[B]<=0),a&&S.push(R[Q]<=0,R[H]<=0),S.every(function(J){return J})){M=_,D=!1;break}P.set(_,S)}if(D)for(var K=h?3:1,C=function(ee){var ce=b.find(function(Ae){var Le=P.get(Ae);if(Le)return Le.slice(0,ee).every(function(De){return De})});if(ce)return M=ce,"break"},V=K;V>0;V--){var Z=C(V);if(Z==="break")break}e.placement!==M&&(e.modifiersData[r]._skip=!0,e.placement=M,e.reset=!0)}}const kx={name:"flip",enabled:!0,phase:"main",fn:xx,requiresIfExists:["offset"],data:{_skip:!1}};function IA(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function MA(t){return[lt,Bt,Dt,ct].some(function(e){return t[e]>=0})}function Ex(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=go(e,{elementContext:"reference"}),a=go(e,{altBoundary:!0}),l=IA(s,r),c=IA(a,o,i),u=MA(l),d=MA(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const Sx={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ex};function Cx(t,e,n){var r=on(t),o=[ct,lt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[ct,Bt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Px(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=mA.reduce(function(u,d){return u[d]=Cx(d,e.rects,i),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const Dx={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Px};function Bx(t){var e=t.state,n=t.name;e.modifiersData[n]=BA({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const Ix={name:"popperOffsets",enabled:!0,phase:"read",fn:Bx,data:{}};function Mx(t){return t==="x"?"y":"x"}function _x(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,A=n.tether,f=A===void 0?!0:A,h=n.tetherOffset,g=h===void 0?0:h,p=go(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=on(e.placement),x=Er(e.placement),y=!x,b=Fa(v),E=Mx(b),k=e.modifiersData.popperOffsets,P=e.rects.reference,D=e.rects.popper,M=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,I=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(k){if(i){var T,z=b==="y"?lt:ct,O=b==="y"?Dt:Bt,R=b==="y"?"height":"width",Q=k[b],H=Q+p[z],S=Q-p[O],K=f?-D[R]/2:0,C=x===wr?P[R]:D[R],V=x===wr?-D[R]:-P[R],Z=e.elements.arrow,J=f&&Z?Qa(Z):{width:0,height:0},ee=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:xA(),ce=ee[z],Ae=ee[O],Le=ho(0,P[R],J[R]),De=y?P[R]/2-K-Le-ce-I.mainAxis:C-Le-ce-I.mainAxis,Be=y?-P[R]/2+K+Le+Ae+I.mainAxis:V+Le+Ae+I.mainAxis,qe=e.elements.arrow&&fo(e.elements.arrow),q=qe?b==="y"?qe.clientTop||0:qe.clientLeft||0:0,G=(T=_?.[b])!=null?T:0,fe=Q+De-G-q,le=Q+Be-G,xe=ho(f?vi(H,fe):H,Q,f?er(S,le):S);k[b]=xe,B[b]=xe-Q}if(a){var he,ke=b==="x"?lt:ct,Ne=b==="x"?Dt:Bt,_e=k[E],ot=E==="y"?"height":"width",Se=_e+p[ke],ge=_e-p[Ne],Lt=[lt,ct].indexOf(v)!==-1,tt=(he=_?.[E])!=null?he:0,Rt=Lt?Se:_e-P[ot]-D[ot]-tt+I.altAxis,kt=Lt?_e+P[ot]+D[ot]-tt-I.altAxis:ge,nt=f&&Lt?nx(Rt,_e,kt):ho(f?Rt:Se,_e,f?kt:ge);k[E]=nt,B[E]=nt-_e}e.modifiersData[r]=B}}const Ox={name:"preventOverflow",enabled:!0,phase:"main",fn:_x,requiresIfExists:["offset"]};function Tx(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Lx(t){return t===bt(t)||!It(t)?za(t):Tx(t)}function Nx(t){var e=t.getBoundingClientRect(),n=xr(e.width)/t.offsetWidth||1,r=xr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Qx(t,e,n){n===void 0&&(n=!1);var r=It(e),o=It(e)&&Nx(e),i=Ln(e),s=kr(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((rn(e)!=="body"||Ra(i))&&(a=Lx(e)),It(e)?(l=kr(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=Ha(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Fx(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function zx(t){var e=Fx(t);return Jw.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function Hx(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Rx(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var _A={placement:"bottom",modifiers:[],strategy:"absolute"};function OA(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Ux(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?_A:o;return function(a,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},_A,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],A=!1,f={state:u,setOptions:function(v){var x=typeof v=="function"?v(u.options):v;g(),u.options=Object.assign({},i,u.options,x),u.scrollParents={reference:$n(a)?po(a):a.contextElement?po(a.contextElement):[],popper:po(l)};var y=zx(Rx([].concat(r,u.options.modifiers)));return u.orderedModifiers=y.filter(function(b){return b.enabled}),h(),f.update()},forceUpdate:function(){if(!A){var v=u.elements,x=v.reference,y=v.popper;if(OA(x,y)){u.rects={reference:Qx(x,fo(y),u.options.strategy==="fixed"),popper:Qa(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(I){return u.modifiersData[I.name]=Object.assign({},I.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var E=u.orderedModifiers[b],k=E.fn,P=E.options,D=P===void 0?{}:P,M=E.name;typeof k=="function"&&(u=k({state:u,options:D,name:M,instance:f})||u)}}}},update:Hx(function(){return new Promise(function(p){f.forceUpdate(),p(u)})}),destroy:function(){g(),A=!0}};if(!OA(a,l))return f;f.setOptions(c).then(function(p){!A&&c.onFirstUpdate&&c.onFirstUpdate(p)});function h(){u.orderedModifiers.forEach(function(p){var v=p.name,x=p.options,y=x===void 0?{}:x,b=p.effect;if(typeof b=="function"){var E=b({state:u,name:v,instance:f,options:y}),k=function(){};d.push(E||k)}})}function g(){d.forEach(function(p){return p()}),d=[]}return f}}var jx=[Ax,Ix,ux,bA,Dx,kx,Ox,sx,Sx],Vx=Ux({defaultModifiers:jx}),Wx="tippy-box",TA="tippy-content",Yx="tippy-backdrop",LA="tippy-arrow",NA="tippy-svg-arrow",tr={passive:!0,capture:!0},QA=function(){return document.body};function qx(t,e){return{}.hasOwnProperty.call(t,e)}function ja(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Va(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function FA(t,e){return typeof t=="function"?t.apply(void 0,e):t}function zA(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function Kx(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function Gx(t){return t.split(/\s+/).filter(Boolean)}function Sr(t){return[].concat(t)}function HA(t,e){t.indexOf(e)===-1&&t.push(e)}function Xx(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function Jx(t){return t.split("-")[0]}function Ei(t){return[].slice.call(t)}function RA(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function mo(){return document.createElement("div")}function bo(t){return["Element","Fragment"].some(function(e){return Va(t,e)})}function Zx(t){return Va(t,"NodeList")}function $x(t){return Va(t,"MouseEvent")}function e1(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function t1(t){return bo(t)?[t]:Zx(t)?Ei(t):Array.isArray(t)?t:Ei(document.querySelectorAll(t))}function Wa(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function UA(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function n1(t){var e,n=Sr(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function r1(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,l=a.interactiveBorder,c=Jx(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,A=c==="top"?u.bottom.y:0,f=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,g=i.top-r+d>l,p=r-i.bottom-A>l,v=i.left-n+f>l,x=n-i.right-h>l;return g||p||v||x})}function Ya(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function jA(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var sn={isTouch:!1},VA=0;function o1(){sn.isTouch||(sn.isTouch=!0,window.performance&&document.addEventListener("mousemove",WA))}function WA(){var t=performance.now();t-VA<20&&(sn.isTouch=!1,document.removeEventListener("mousemove",WA)),VA=t}function i1(){var t=document.activeElement;if(e1(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function s1(){document.addEventListener("touchstart",o1,tr),window.addEventListener("blur",i1)}var a1=typeof window<"u"&&typeof document<"u",l1=a1?!!window.msCrypto:!1;function Cr(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function YA(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function c1(t){return YA(`
|
|
292
292
|
%ctippy.js
|
|
293
293
|
|
|
294
294
|
%c`+YA(t)+`
|
|
@@ -308,6 +308,6 @@ Would you like to submit this security incident report?`},options:["Submit Secur
|
|
|
308
308
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
309
309
|
|
|
310
310
|
`,`1) content: element.innerHTML
|
|
311
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=o.reduce(function(l,c){var u=c&&b1(c,r);return u&&l.push(u),l},[]);return bo(t)?a[0]:a}vo.defaultProps=yt,vo.setDefaultProps=h1,vo.currentInput=sn,Object.assign({},bA,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),vo.setDefaultProps({render:ef});function y1({color:t="var(--contrast-6)",icon:e="info-circle-fill",tooltip:n}){const r=w.useRef(null);return w.useLayoutEffect(()=>{r.current&&vo(r.current,{content:n,theme:"access",appendTo:r.current.parentElement})},[r.current]),m.jsx("button",{className:"info-tip",style:{color:t},ref:r,children:m.jsx(me,{name:e})})}function v1({infoGroupId:t}){const e=rt(`https://support.access-ci.org/api/1.0/kb/${t}`);if(!(!e||e.error||!e.length))return m.jsx(nn,{title:"Documentation",icon:"book",children:m.jsx("ul",{children:e.map(({title:n,description:r,link:o})=>m.jsxs("li",{children:[m.jsx("a",{href:ic(o),children:n}),r?m.jsx(y1,{tooltip:ms(r)}):null]},n))})})}function w1({children:t,icon:e="megaphone-fill"}){return m.jsxs("div",{className:"alert",children:[e?m.jsx(me,{name:e}):null,m.jsx("div",{className:"alert-body",children:t})]})}function x1({children:t}){const[e,n]=w.useState(!1);return m.jsxs("div",{className:`expand-text ${e?"expanded":"contracted"}`,children:[t,m.jsxs("button",{className:"expand-button",onClick:()=>n(!e),children:[m.jsx(me,{name:`caret-${e?"up":"left"}-fill`}),e?"Less":"More"]})]})}function k1({date__end:t,date__start:e,description:n,location:r,registration:o,speaker:i,title:s}){const a=o,l=a?m.jsx("a",{href:a,children:s}):s,c=[];let u=null;const d=e,A=t;if(d){const f=new Date(d),h=new Date(A||d),[g,p]=[f,h].map(k=>k.toLocaleString("en-US",{dateStyle:"long"})),[v,x]=[f,h].map(k=>k.toLocaleString("en-US",{timeStyle:"short"})),y=f.toLocaleTimeString("en-US",{timeZoneName:"short"}).split(" ")[2],b=[`${g},`,v];(x!=v||p!=g)&&(b.push("-"),p!=g&&b.push(`${p},`),b.push(x)),b.push(`(${y})`),c.push(m.jsx(me,{name:"calendar"}),b.join(" ")),i&&c.push(m.jsx(me,{name:"people-fill"}),i),r&&c.push(m.jsx(me,{name:"geo-alt-fill"}),r);const E=f.toLocaleString("en-US",{dateStyle:"medium"}).split(",")[0].split(" ").map(k=>m.jsx("span",{children:k},k));u=a?m.jsx("a",{href:a,className:"event-icon",children:E}):m.jsx("div",{className:"event-icon",children:E})}return m.jsxs("div",{className:"event",children:[u,m.jsxs("div",{className:"event-details",children:[m.jsx("h3",{children:l}),c.length?m.jsx("div",{className:"event-metadata",children:c}):null,n?m.jsx(x1,{children:m.jsx("div",{children:bs(n)})}):null]})]})}function E1({infoGroupId:t}){const e=Ur(t),n=rt("https://operations-api.access-ci.org/wh2/news/v1/affiliation/access-ci.org/current_outages/"),r=rt("https://operations-api.access-ci.org/wh2/news/v1/affiliation/access-ci.org/future_outages/"),o=rt(`https://support.access-ci.org/api/1.1/events/ag/${t}`),i=gs([e,n,r],(a,l,c)=>[...l.results,...c.results].filter(u=>u.AffectedResources.some(d=>a.infoResourceIds.includes(d.ResourceID))),[]),s=gs([o],a=>a.filter(l=>new Date(l.date__start)>=new Date),[]);if(!(!i.length&&!s.length))return m.jsxs(nn,{title:"Announcements and Events",icon:"calendar3",children:[i.map(({Subject:a,Content:l})=>m.jsxs(w1,{children:[a," ",m.jsx("a",{href:"https://operations.access-ci.org/infrastructure_news_view",children:"Learn more."})]},a)),s.map(a=>m.jsx(k1,{...a},a.title))]})}function S1({children:t,headingLevel:e=2,title:n}){const[r,o]=w.useState(!1),i=`h${e}`;return m.jsxs("div",{className:"accordion",children:[m.jsx(i,{className:"accordion-heading",children:m.jsxs("button",{"aria-expanded":r,onClick:()=>o(!r),children:[n,m.jsx(me,{name:r?"caret-up-fill":"caret-down-fill"})]})}),m.jsx("div",{className:"accordion-content",style:{display:r?"block":"none"},children:t})]})}function C1({resource_descriptive_name:t,resource_description:e,compute:n,storage:r}){const o=(n||r||{}).recommended_use;return m.jsxs(S1,{title:t,children:[e?bs(e):null,o?m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:"Recommended Use"}),bs(o)]}):null]})}function P1({infoGroupId:t}){const e=Ur(t),n=rt(e?e.infoResourceIds.map(l=>`https://operations-api.access-ci.org/wh2/cider/v1/info_resourceid/${l}/?format=json`):null,{defaultValue:[]}),r=n.filter(l=>l.results&&l.results.cider_type=="Compute").map(l=>({...l.results.compute,key:l.results.info_resourceid,name:l.results.resource_descriptive_name,format:(c,u)=>{const d=l.results.compute[u.attr];return u.format&&d?u.format(d,u):d||m.jsx(m.Fragment,{children:"—"})}})),o=n.length?[{name:"Nodes",attr:"node_count",format:l=>l.toLocaleString("en-us")},{name:"CPU Type",attr:"cpu_type"},{name:"CPU Speed",attr:"cpu_speed_ghz",format:l=>`${l} Ghz`},{name:"CPU Cores per Node",attr:"cpu_count_per_node"},{name:"RAM per CPU Core",attr:"memory_per_cpu_gb",format:l=>`${l.toLocaleString("en-us")} GB`},{name:"GPU",attr:"gpu_description"},{name:"Local Storage per Node",attr:"local_storage_per_node_gb",format:l=>`${l.toLocaleString("en-us")} GB`},{name:"Network Interconnect",attr:"interconnect"},{name:"Operating System",attr:"operating_system"},{name:"Batch System",attr:"batch_system"}].filter(l=>r.some(c=>c[l.attr])):[],i={key:"name",name:"Attribute",format:l=>m.jsx("strong",{children:l})},s=r.length>0&&o.length>0,a={compute:[],storage:[],other:[]};for(let{results:l}of n)(a[l.cider_type.toLowerCase()]||a.other).push(m.jsx(C1,{...l},l.resource_descriptive_name));return m.jsxs(m.Fragment,{children:[s||a.compute.length>0?m.jsxs(nn,{title:"Compute Resources",icon:"cpu-fill",children:[a.compute,s&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:"Specifications"}),m.jsx(yi,{columns:[i,...r],rows:o,maxHeight:null})]})]}):null,a.storage.length>0?m.jsx(nn,{title:"Storage Resources",icon:"hdd-fill",children:a.storage}):null,a.other.length>0?m.jsx(nn,{title:"Other Resources",icon:"stars",children:a.other}):null]})}function tf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function nf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tf(Object(n),!0).forEach(function(r){B1(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tf(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ci(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ci=function(e){return typeof e}:Ci=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ci(t)}function Pi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D1(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Di(t,e,n){return e&&D1(t.prototype,e),t}function B1(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ja(t,e)}function Pr(t){return Pr=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Pr(t)}function Ja(t,e){return Ja=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},Ja(t,e)}function M1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _1(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function O1(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _1(t)}function T1(t){var e=M1();return function(){var r=Pr(t),o;if(e){var i=Pr(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return O1(this,o)}}function L1(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=Pr(t),t!==null););return t}function Bi(){return typeof Reflect<"u"&&Reflect.get?Bi=Reflect.get:Bi=function(e,n,r){var o=L1(e,n);if(o){var i=Object.getOwnPropertyDescriptor(o,n);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Bi.apply(this,arguments)}var N1={type:"slider",startAt:0,perView:1,focusAt:0,gap:10,autoplay:!1,hoverpause:!0,keyboard:!0,bound:!1,swipeThreshold:80,dragThreshold:120,perSwipe:"",touchRatio:.5,touchAngle:45,animationDuration:400,rewind:!0,rewindDuration:800,animationTimingFunc:"cubic-bezier(.165, .840, .440, 1)",waitForTransition:!0,throttle:10,direction:"ltr",peek:0,cloningRatio:1,breakpoints:{},classes:{swipeable:"glide--swipeable",dragging:"glide--dragging",direction:{ltr:"glide--ltr",rtl:"glide--rtl"},type:{slider:"glide--slider",carousel:"glide--carousel"},slide:{clone:"glide__slide--clone",active:"glide__slide--active"},arrow:{disabled:"glide__arrow--disabled"},nav:{active:"glide__bullet--active"}}};function Nn(t){console.error("[Glide warn]: ".concat(t))}function zt(t){return parseInt(t)}function Za(t){return typeof t=="string"}function wo(t){var e=Ci(t);return e==="function"||e==="object"&&!!t}function Ii(t){return typeof t=="function"}function Q1(t){return typeof t>"u"}function $a(t){return t.constructor===Array}function F1(t,e,n){var r={};for(var o in e)Ii(e[o])?r[o]=e[o](t,r,n):Nn("Extension must be a function");for(var i in r)Ii(r[i].mount)&&r[i].mount();return r}function He(t,e,n){Object.defineProperty(t,e,n)}function rf(t,e){var n=Object.assign({},t,e);if(e.hasOwnProperty("classes")){n.classes=Object.assign({},t.classes,e.classes);var r=["direction","type","slide","arrow","nav"];r.forEach(function(o){e.classes.hasOwnProperty(o)&&(n.classes[o]=nf(nf({},t.classes[o]),e.classes[o]))})}return e.hasOwnProperty("breakpoints")&&(n.breakpoints=Object.assign({},t.breakpoints,e.breakpoints)),n}var z1=(function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pi(this,t),this.events=e,this.hop=e.hasOwnProperty}return Di(t,[{key:"on",value:function(n,r){if($a(n)){for(var o=0;o<n.length;o++)this.on(n[o],r);return}this.hop.call(this.events,n)||(this.events[n]=[]);var i=this.events[n].push(r)-1;return{remove:function(){delete this.events[n][i]}}}},{key:"emit",value:function(n,r){if($a(n)){for(var o=0;o<n.length;o++)this.emit(n[o],r);return}this.hop.call(this.events,n)&&this.events[n].forEach(function(i){i(r||{})})}}]),t})(),H1=(function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Pi(this,t),this._c={},this._t=[],this._e=new z1,this.disabled=!1,this.selector=e,this.settings=rf(N1,n),this.index=this.settings.startAt}return Di(t,[{key:"mount",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._e.emit("mount.before"),wo(n)?this._c=F1(this,n,this._e):Nn("You need to provide a object on `mount()`"),this._e.emit("mount.after"),this}},{key:"mutate",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return $a(n)?this._t=n:Nn("You need to provide a array on `mutate()`"),this}},{key:"update",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.settings=rf(this.settings,n),n.hasOwnProperty("startAt")&&(this.index=n.startAt),this._e.emit("update"),this}},{key:"go",value:function(n){return this._c.Run.make(n),this}},{key:"move",value:function(n){return this._c.Transition.disable(),this._c.Move.make(n),this}},{key:"destroy",value:function(){return this._e.emit("destroy"),this}},{key:"play",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n&&(this.settings.autoplay=n),this._e.emit("play"),this}},{key:"pause",value:function(){return this._e.emit("pause"),this}},{key:"disable",value:function(){return this.disabled=!0,this}},{key:"enable",value:function(){return this.disabled=!1,this}},{key:"on",value:function(n,r){return this._e.on(n,r),this}},{key:"isType",value:function(n){return this.settings.type===n}},{key:"settings",get:function(){return this._o},set:function(n){wo(n)?this._o=n:Nn("Options must be an `object` instance.")}},{key:"index",get:function(){return this._i},set:function(n){this._i=zt(n)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(n){this._d=!!n}}]),t})();function R1(t,e,n){var r={mount:function(){this._o=!1},make:function(c){var u=this;t.disabled||(!t.settings.waitForTransition||t.disable(),this.move=c,n.emit("run.before",this.move),this.calculate(),n.emit("run",this.move),e.Transition.after(function(){u.isStart()&&n.emit("run.start",u.move),u.isEnd()&&n.emit("run.end",u.move),u.isOffset()&&(u._o=!1,n.emit("run.offset",u.move)),n.emit("run.after",u.move),t.enable()}))},calculate:function(){var c=this.move,u=this.length,d=c.steps,A=c.direction,f=1;if(A==="="){if(t.settings.bound&&zt(d)>u){t.index=u;return}t.index=d;return}if(A===">"&&d===">"){t.index=u;return}if(A==="<"&&d==="<"){t.index=0;return}if(A==="|"&&(f=t.settings.perView||1),A===">"||A==="|"&&d===">"){var h=o(f);h>u&&(this._o=!0),t.index=i(h,f);return}if(A==="<"||A==="|"&&d==="<"){var g=s(f);g<0&&(this._o=!0),t.index=a(g,f);return}Nn("Invalid direction pattern [".concat(A).concat(d,"] has been used"))},isStart:function(){return t.index<=0},isEnd:function(){return t.index>=this.length},isOffset:function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return c?this._o?c==="|>"?this.move.direction==="|"&&this.move.steps===">":c==="|<"?this.move.direction==="|"&&this.move.steps==="<":this.move.direction===c:!1:this._o},isBound:function(){return t.isType("slider")&&t.settings.focusAt!=="center"&&t.settings.bound}};function o(l){var c=t.index;return t.isType("carousel")?c+l:c+(l-c%l)}function i(l,c){var u=r.length;return l<=u?l:t.isType("carousel")?l-(u+1):t.settings.rewind?r.isBound()&&!r.isEnd()?u:0:r.isBound()?u:Math.floor(u/c)*c}function s(l){var c=t.index;if(t.isType("carousel"))return c-l;var u=Math.ceil(c/l);return(u-1)*l}function a(l,c){var u=r.length;return l>=0?l:t.isType("carousel")?l+(u+1):t.settings.rewind?r.isBound()&&r.isStart()?u:Math.floor(u/c)*c:0}return He(r,"move",{get:function(){return this._m},set:function(c){var u=c.substr(1);this._m={direction:c.substr(0,1),steps:u?zt(u)?zt(u):u:0}}}),He(r,"length",{get:function(){var c=t.settings,u=e.Html.slides.length;return this.isBound()?u-1-(zt(c.perView)-1)+zt(c.focusAt):u-1}}),He(r,"offset",{get:function(){return this._o}}),r}function of(){return new Date().getTime()}function sf(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,o,i,s,a=0,l=function(){a=n.leading===!1?0:of(),r=null,s=t.apply(o,i),r||(o=i=null)},c=function(){var d=of();!a&&n.leading===!1&&(a=d);var A=e-(d-a);return o=this,i=arguments,A<=0||A>e?(r&&(clearTimeout(r),r=null),a=d,s=t.apply(o,i),r||(o=i=null)):!r&&n.trailing!==!1&&(r=setTimeout(l,A)),s};return c.cancel=function(){clearTimeout(r),a=0,r=o=i=null},c}var Mi={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function U1(t,e,n){var r={apply:function(i){for(var s=0,a=i.length;s<a;s++){var l=i[s].style,c=e.Direction.value;s!==0?l[Mi[c][0]]="".concat(this.value/2,"px"):l[Mi[c][0]]="",s!==i.length-1?l[Mi[c][1]]="".concat(this.value/2,"px"):l[Mi[c][1]]=""}},remove:function(i){for(var s=0,a=i.length;s<a;s++){var l=i[s].style;l.marginLeft="",l.marginRight=""}}};return He(r,"value",{get:function(){return zt(t.settings.gap)}}),He(r,"grow",{get:function(){return r.value*e.Sizes.length}}),He(r,"reductor",{get:function(){var i=t.settings.perView;return r.value*(i-1)/i}}),n.on(["build.after","update"],sf(function(){r.apply(e.Html.wrapper.children)},30)),n.on("destroy",function(){r.remove(e.Html.wrapper.children)}),r}function af(t){if(t&&t.parentNode){for(var e=t.parentNode.firstChild,n=[];e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}return[]}function el(t){return Array.prototype.slice.call(t)}var j1='[data-glide-el="track"]';function V1(t,e,n){var r={mount:function(){this.root=t.selector,this.track=this.root.querySelector(j1),this.collectSlides()},collectSlides:function(){this.slides=el(this.wrapper.children).filter(function(i){return!i.classList.contains(t.settings.classes.slide.clone)})}};return He(r,"root",{get:function(){return r._r},set:function(i){Za(i)&&(i=document.querySelector(i)),i!==null?r._r=i:Nn("Root element must be a existing Html node")}}),He(r,"track",{get:function(){return r._t},set:function(i){r._t=i}}),He(r,"wrapper",{get:function(){return r.track.children[0]}}),n.on("update",function(){r.collectSlides()}),r}function W1(t,e,n){var r={mount:function(){this.value=t.settings.peek}};return He(r,"value",{get:function(){return r._v},set:function(i){wo(i)?(i.before=zt(i.before),i.after=zt(i.after)):i=zt(i),r._v=i}}),He(r,"reductor",{get:function(){var i=r.value,s=t.settings.perView;return wo(i)?i.before/s+i.after/s:i*2/s}}),n.on(["resize","update"],function(){r.mount()}),r}function Y1(t,e,n){var r={mount:function(){this._o=0},make:function(){var i=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.offset=s,n.emit("move",{movement:this.value}),e.Transition.after(function(){n.emit("move.after",{movement:i.value})})}};return He(r,"offset",{get:function(){return r._o},set:function(i){r._o=Q1(i)?0:zt(i)}}),He(r,"translate",{get:function(){return e.Sizes.slideWidth*t.index}}),He(r,"value",{get:function(){var i=this.offset,s=this.translate;return e.Direction.is("rtl")?s+i:s-i}}),n.on(["build.before","run"],function(){r.make()}),r}function q1(t,e,n){var r={setupSlides:function(){for(var i="".concat(this.slideWidth,"px"),s=e.Html.slides,a=0;a<s.length;a++)s[a].style.width=i},setupWrapper:function(){e.Html.wrapper.style.width="".concat(this.wrapperSize,"px")},remove:function(){for(var i=e.Html.slides,s=0;s<i.length;s++)i[s].style.width="";e.Html.wrapper.style.width=""}};return He(r,"length",{get:function(){return e.Html.slides.length}}),He(r,"width",{get:function(){return e.Html.track.offsetWidth}}),He(r,"wrapperSize",{get:function(){return r.slideWidth*r.length+e.Gaps.grow+e.Clones.grow}}),He(r,"slideWidth",{get:function(){return r.width/t.settings.perView-e.Peek.reductor-e.Gaps.reductor}}),n.on(["build.before","resize","update"],function(){r.setupSlides(),r.setupWrapper()}),n.on("destroy",function(){r.remove()}),r}function K1(t,e,n){var r={mount:function(){n.emit("build.before"),this.typeClass(),this.activeClass(),n.emit("build.after")},typeClass:function(){e.Html.root.classList.add(t.settings.classes.type[t.settings.type])},activeClass:function(){var i=t.settings.classes,s=e.Html.slides[t.index];s&&(s.classList.add(i.slide.active),af(s).forEach(function(a){a.classList.remove(i.slide.active)}))},removeClasses:function(){var i=t.settings.classes,s=i.type,a=i.slide;e.Html.root.classList.remove(s[t.settings.type]),e.Html.slides.forEach(function(l){l.classList.remove(a.active)})}};return n.on(["destroy","update"],function(){r.removeClasses()}),n.on(["resize","update"],function(){r.mount()}),n.on("move.after",function(){r.activeClass()}),r}function G1(t,e,n){var r={mount:function(){this.items=[],t.isType("carousel")&&(this.items=this.collect())},collect:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=e.Html.slides,a=t.settings,l=a.perView,c=a.classes,u=a.cloningRatio;if(s.length>0)for(var d=+!!t.settings.peek,A=l+d+Math.round(l/2),f=s.slice(0,A).reverse(),h=s.slice(A*-1),g=0;g<Math.max(u,Math.floor(l/s.length));g++){for(var p=0;p<f.length;p++){var v=f[p].cloneNode(!0);v.classList.add(c.slide.clone),i.push(v)}for(var x=0;x<h.length;x++){var y=h[x].cloneNode(!0);y.classList.add(c.slide.clone),i.unshift(y)}}return i},append:function(){for(var i=this.items,s=e.Html,a=s.wrapper,l=s.slides,c=Math.floor(i.length/2),u=i.slice(0,c).reverse(),d=i.slice(c*-1).reverse(),A="".concat(e.Sizes.slideWidth,"px"),f=0;f<d.length;f++)a.appendChild(d[f]);for(var h=0;h<u.length;h++)a.insertBefore(u[h],l[0]);for(var g=0;g<i.length;g++)i[g].style.width=A},remove:function(){for(var i=this.items,s=0;s<i.length;s++)e.Html.wrapper.removeChild(i[s])}};return He(r,"grow",{get:function(){return(e.Sizes.slideWidth+e.Gaps.value)*r.items.length}}),n.on("update",function(){r.remove(),r.mount(),r.append()}),n.on("build.before",function(){t.isType("carousel")&&r.append()}),n.on("destroy",function(){r.remove()}),r}var lf=(function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pi(this,t),this.listeners=e}return Di(t,[{key:"on",value:function(n,r,o){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;Za(n)&&(n=[n]);for(var s=0;s<n.length;s++)this.listeners[n[s]]=o,r.addEventListener(n[s],this.listeners[n[s]],i)}},{key:"off",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Za(n)&&(n=[n]);for(var i=0;i<n.length;i++)r.removeEventListener(n[i],this.listeners[n[i]],o)}},{key:"destroy",value:function(){delete this.listeners}}]),t})();function X1(t,e,n){var r=new lf,o={mount:function(){this.bind()},bind:function(){r.on("resize",window,sf(function(){n.emit("resize")},t.settings.throttle))},unbind:function(){r.off("resize",window)}};return n.on("destroy",function(){o.unbind(),r.destroy()}),o}var J1=["ltr","rtl"],Z1={">":"<","<":">","=":"="};function $1(t,e,n){var r={mount:function(){this.value=t.settings.direction},resolve:function(i){var s=i.slice(0,1);return this.is("rtl")?i.split(s).join(Z1[s]):i},is:function(i){return this.value===i},addClass:function(){e.Html.root.classList.add(t.settings.classes.direction[this.value])},removeClass:function(){e.Html.root.classList.remove(t.settings.classes.direction[this.value])}};return He(r,"value",{get:function(){return r._v},set:function(i){J1.indexOf(i)>-1?r._v=i:Nn("Direction value must be `ltr` or `rtl`")}}),n.on(["destroy","update"],function(){r.removeClass()}),n.on("update",function(){r.mount()}),n.on(["build.before","update"],function(){r.addClass()}),r}function e2(t,e){return{modify:function(r){return e.Direction.is("rtl")?-r:r}}}function t2(t,e){return{modify:function(r){var o=Math.floor(r/e.Sizes.slideWidth);return r+e.Gaps.value*o}}}function n2(t,e){return{modify:function(r){return r+e.Clones.grow/2}}}function r2(t,e){return{modify:function(r){if(t.settings.focusAt>=0){var o=e.Peek.value;return wo(o)?r-o.before:r-o}return r}}}function o2(t,e){return{modify:function(r){var o=e.Gaps.value,i=e.Sizes.width,s=t.settings.focusAt,a=e.Sizes.slideWidth;return s==="center"?r-(i/2-a/2):r-a*s-o*s}}}function i2(t,e,n){var r=[t2,n2,r2,o2].concat(t._t,[e2]);return{mutate:function(i){for(var s=0;s<r.length;s++){var a=r[s];Ii(a)&&Ii(a().modify)?i=a(t,e,n).modify(i):Nn("Transformer should be a function that returns an object with `modify()` method")}return i}}}function s2(t,e,n){var r={set:function(i){var s=i2(t,e).mutate(i),a="translate3d(".concat(-1*s,"px, 0px, 0px)");e.Html.wrapper.style.mozTransform=a,e.Html.wrapper.style.webkitTransform=a,e.Html.wrapper.style.transform=a},remove:function(){e.Html.wrapper.style.transform=""},getStartIndex:function(){var i=e.Sizes.length,s=t.index,a=t.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?i+(s-a):(s+a)%i},getTravelDistance:function(){var i=e.Sizes.slideWidth*t.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?i*-1:i}};return n.on("move",function(o){if(!t.isType("carousel")||!e.Run.isOffset())return r.set(o.movement);e.Transition.after(function(){n.emit("translate.jump"),r.set(e.Sizes.slideWidth*t.index)});var i=e.Sizes.slideWidth*e.Translate.getStartIndex();return r.set(i-e.Translate.getTravelDistance())}),n.on("destroy",function(){r.remove()}),r}function a2(t,e,n){var r=!1,o={compose:function(s){var a=t.settings;return r?"".concat(s," 0ms ").concat(a.animationTimingFunc):"".concat(s," ").concat(this.duration,"ms ").concat(a.animationTimingFunc)},set:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";e.Html.wrapper.style.transition=this.compose(s)},remove:function(){e.Html.wrapper.style.transition=""},after:function(s){setTimeout(function(){s()},this.duration)},enable:function(){r=!1,this.set()},disable:function(){r=!0,this.set()}};return He(o,"duration",{get:function(){var s=t.settings;return t.isType("slider")&&e.Run.offset?s.rewindDuration:s.animationDuration}}),n.on("move",function(){o.set()}),n.on(["build.before","resize","translate.jump"],function(){o.disable()}),n.on("run",function(){o.enable()}),n.on("destroy",function(){o.remove()}),o}var cf=!1;try{var uf=Object.defineProperty({},"passive",{get:function(){cf=!0}});window.addEventListener("testPassive",null,uf),window.removeEventListener("testPassive",null,uf)}catch{}var df=cf,l2='[data-glide-el="controls[nav]"]',tl='[data-glide-el^="controls"]',c2="".concat(tl,' [data-glide-dir*="<"]'),u2="".concat(tl,' [data-glide-dir*=">"]');function d2(t,e,n){var r=new lf,o=df?{passive:!0}:!1,i={mount:function(){this._n=e.Html.root.querySelectorAll(l2),this._c=e.Html.root.querySelectorAll(tl),this._arrowControls={previous:e.Html.root.querySelectorAll(c2),next:e.Html.root.querySelectorAll(u2)},this.addBindings()},setActive:function(){for(var a=0;a<this._n.length;a++)this.addClass(this._n[a].children)},removeActive:function(){for(var a=0;a<this._n.length;a++)this.removeClass(this._n[a].children)},addClass:function(a){var l=t.settings,c=a[t.index];c&&(c.classList.add(l.classes.nav.active),af(c).forEach(function(u){u.classList.remove(l.classes.nav.active)}))},removeClass:function(a){var l=a[t.index];l?.classList.remove(t.settings.classes.nav.active)},setArrowState:function(){if(!t.settings.rewind){var a=i._arrowControls.next,l=i._arrowControls.previous;this.resetArrowState(a,l),t.index===0&&this.disableArrow(l),t.index===e.Run.length&&this.disableArrow(a)}},resetArrowState:function(){for(var a=t.settings,l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];c.forEach(function(d){el(d).forEach(function(A){A.classList.remove(a.classes.arrow.disabled)})})},disableArrow:function(){for(var a=t.settings,l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];c.forEach(function(d){el(d).forEach(function(A){A.classList.add(a.classes.arrow.disabled)})})},addBindings:function(){for(var a=0;a<this._c.length;a++)this.bind(this._c[a].children)},removeBindings:function(){for(var a=0;a<this._c.length;a++)this.unbind(this._c[a].children)},bind:function(a){for(var l=0;l<a.length;l++)r.on("click",a[l],this.click),r.on("touchstart",a[l],this.click,o)},unbind:function(a){for(var l=0;l<a.length;l++)r.off(["click","touchstart"],a[l])},click:function(a){!df&&a.type==="touchstart"&&a.preventDefault();var l=a.currentTarget.getAttribute("data-glide-dir");e.Run.make(e.Direction.resolve(l))}};return He(i,"items",{get:function(){return i._c}}),n.on(["mount.after","move.after"],function(){i.setActive()}),n.on(["mount.after","run"],function(){i.setArrowState()}),n.on("destroy",function(){i.removeBindings(),i.removeActive(),r.destroy()}),i}var A2={Html:V1,Translate:s2,Transition:a2,Direction:$1,Peek:W1,Sizes:q1,Gaps:U1,Move:Y1,Clones:G1,Resize:X1,Build:K1,Run:R1},f2=(function(t){I1(n,t);var e=T1(n);function n(){return Pi(this,n),e.apply(this,arguments)}return Di(n,[{key:"mount",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Bi(Pr(n.prototype),"mount",this).call(this,Object.assign({},A2,o))}}]),n})(H1);function _i({children:t,cssClass:e=""}){const n=w.useRef(null);return w.useEffect(()=>{n.current&&new f2(n.current).mount({Controls:d2})},[]),m.jsx("section",{className:`carousel ${e}`,children:m.jsxs("div",{className:"glide",ref:n,children:[m.jsx("div",{className:"glide__track","data-glide-el":"track",children:m.jsx("ul",{className:"glide__slides",children:t})}),m.jsxs("div",{className:"glide__arrows","data-glide-el":"controls",children:[m.jsx("button",{className:"glide__arrow glide__arrow--left","data-glide-dir":"<",children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:m.jsx("path",{d:"M0 12l10.975 11 2.848-2.828-6.176-6.176H24v-3.992H7.646l6.176-6.176L10.975 1 0 12z"})})}),m.jsx("button",{className:"glide__arrow glide__arrow--right","data-glide-dir":">",children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:m.jsx("path",{d:"M13.025 1l-2.847 2.828 6.176 6.176h-16.354v3.992h16.354l-6.176 6.176 2.847 2.828 10.975-11z"})})})]})]})})}function Af({children:t}){return m.jsx("li",{className:"glide__slide",children:t})}function h2({title:t,description:e,linkText:n,linkURI:r,imageURI:o,imageAltText:i}){return m.jsx(Af,{children:m.jsxs("span",{className:"slide-inner",children:[o&&m.jsx("a",{href:r,className:"slide-image",children:m.jsx("img",{src:o,alt:i})}),m.jsxs("span",{className:"slide-text",children:[t&&m.jsx("h2",{children:t}),e&&m.jsx("p",{children:e}),n&&m.jsx("a",{href:r,children:n})]})]})})}_i.Slide=Af,_i.ImageSlide=h2;function p2({children:t,maxHeight:e="400px"}){return m.jsx("div",{className:"scroll-text",children:m.jsx("div",{className:"scroll-text-inner",style:{maxHeight:e},children:t})})}const g2="https://allocations.access-ci.org/current-projects.json";function Oi({icon:t,text:e,title:n}){if(e)return m.jsxs("abbr",{className:"project-meta",title:n,children:[m.jsx(me,{name:t}),e]})}function m2({infoGroupId:t}){const e=Ur(t),n=rt(e?`${g2}?${e.infoResourceIds.map(o=>`info_resourceids[]=${o}`).join("&")}`:null);if(!n||!n.projects||!n.projects.length)return null;const r=[{key:"resourceName",name:"Resource"},{key:"allocation",name:"Current Allocation",format:(o,i)=>i.units=="[Yes = 1, No = 0]"?o==1?"Yes":"No":`${o.toLocaleString("en-us")} ${i.units||""}`}];return m.jsx(nn,{title:"Recent Projects",icon:"pc-display",children:m.jsx(_i,{cssclassName:"carousel-projects",children:n.projects.map(o=>m.jsxs(_i.Slide,{children:[m.jsx("h3",{children:o.requestTitle}),m.jsxs("div",{className:"project-metadata",children:[m.jsx(Oi,{icon:"cash-coin",text:o.allocationType,title:"Allocation Type"}),m.jsx(Oi,{icon:"person-fill",text:`${o.pi} (${o.piInstitution})`,title:"Primary Investigator"}),m.jsx(Oi,{icon:"folder",text:o.fos,title:"Field of Science"}),m.jsx(Oi,{icon:"calendar-range",text:[o.beginDate,o.endDate].map(i=>new Date(i).toLocaleString("en-US",{dateStyle:"medium"})).join(" to "),title:"Project Dates"})]}),m.jsxs(p2,{children:[m.jsx("p",{children:o.abstract}),m.jsx(yi,{columns:r,rows:o.resources,maxHeight:null})]})]},o.requestTitle))})})}function xo(t){return t+.5|0}const Qn=(t,e,n)=>Math.max(Math.min(t,n),e);function ko(t){return Qn(xo(t*2.55),0,255)}function Fn(t){return Qn(xo(t*255),0,255)}function wn(t){return Qn(xo(t/2.55)/100,0,1)}function ff(t){return Qn(xo(t*100),0,100)}const Mt={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},nl=[..."0123456789ABCDEF"],b2=t=>nl[t&15],y2=t=>nl[(t&240)>>4]+nl[t&15],Ti=t=>(t&240)>>4===(t&15),v2=t=>Ti(t.r)&&Ti(t.g)&&Ti(t.b)&&Ti(t.a);function w2(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&Mt[t[1]]*17,g:255&Mt[t[2]]*17,b:255&Mt[t[3]]*17,a:e===5?Mt[t[4]]*17:255}:(e===7||e===9)&&(n={r:Mt[t[1]]<<4|Mt[t[2]],g:Mt[t[3]]<<4|Mt[t[4]],b:Mt[t[5]]<<4|Mt[t[6]],a:e===9?Mt[t[7]]<<4|Mt[t[8]]:255})),n}const x2=(t,e)=>t<255?e(t):"";function k2(t){var e=v2(t)?b2:y2;return t?"#"+e(t.r)+e(t.g)+e(t.b)+x2(t.a,e):void 0}const E2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hf(t,e,n){const r=e*Math.min(n,1-n),o=(i,s=(i+t/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[o(0),o(8),o(4)]}function S2(t,e,n){const r=(o,i=(o+t/60)%6)=>n-n*e*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function C2(t,e,n){const r=hf(t,1,.5);let o;for(e+n>1&&(o=1/(e+n),e*=o,n*=o),o=0;o<3;o++)r[o]*=1-e-n,r[o]+=e;return r}function P2(t,e,n,r,o){return t===o?(e-n)/r+(e<n?6:0):e===o?(n-t)/r+2:(t-e)/r+4}function rl(t){const n=t.r/255,r=t.g/255,o=t.b/255,i=Math.max(n,r,o),s=Math.min(n,r,o),a=(i+s)/2;let l,c,u;return i!==s&&(u=i-s,c=a>.5?u/(2-i-s):u/(i+s),l=P2(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function ol(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(Fn)}function il(t,e,n){return ol(hf,t,e,n)}function D2(t,e,n){return ol(C2,t,e,n)}function B2(t,e,n){return ol(S2,t,e,n)}function pf(t){return(t%360+360)%360}function I2(t){const e=E2.exec(t);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?ko(+e[5]):Fn(+e[5]));const o=pf(+e[2]),i=+e[3]/100,s=+e[4]/100;return e[1]==="hwb"?r=D2(o,i,s):e[1]==="hsv"?r=B2(o,i,s):r=il(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function M2(t,e){var n=rl(t);n[0]=pf(n[0]+e),n=il(n),t.r=n[0],t.g=n[1],t.b=n[2]}function _2(t){if(!t)return;const e=rl(t),n=e[0],r=ff(e[1]),o=ff(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${o}%, ${wn(t.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const gf={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"},mf={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 O2(){const t={},e=Object.keys(mf),n=Object.keys(gf);let r,o,i,s,a;for(r=0;r<e.length;r++){for(s=a=e[r],o=0;o<n.length;o++)i=n[o],a=a.replace(i,gf[i]);i=parseInt(mf[s],16),t[a]=[i>>16&255,i>>8&255,i&255]}return t}let Li;function T2(t){Li||(Li=O2(),Li.transparent=[0,0,0,0]);const e=Li[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const L2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function N2(t){const e=L2.exec(t);let n=255,r,o,i;if(e){if(e[7]!==r){const s=+e[7];n=e[8]?ko(s):Qn(s*255,0,255)}return r=+e[1],o=+e[3],i=+e[5],r=255&(e[2]?ko(r):Qn(r,0,255)),o=255&(e[4]?ko(o):Qn(o,0,255)),i=255&(e[6]?ko(i):Qn(i,0,255)),{r,g:o,b:i,a:n}}}function Q2(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${wn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const sl=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Dr=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function F2(t,e,n){const r=Dr(wn(t.r)),o=Dr(wn(t.g)),i=Dr(wn(t.b));return{r:Fn(sl(r+n*(Dr(wn(e.r))-r))),g:Fn(sl(o+n*(Dr(wn(e.g))-o))),b:Fn(sl(i+n*(Dr(wn(e.b))-i))),a:t.a+n*(e.a-t.a)}}function Ni(t,e,n){if(t){let r=rl(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,e===0?360:1)),r=il(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function bf(t,e){return t&&Object.assign(e||{},t)}function yf(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Fn(t[3]))):(e=bf(t,{r:0,g:0,b:0,a:1}),e.a=Fn(e.a)),e}function z2(t){return t.charAt(0)==="r"?N2(t):I2(t)}class Eo{constructor(e){if(e instanceof Eo)return e;const n=typeof e;let r;n==="object"?r=yf(e):n==="string"&&(r=w2(e)||T2(e)||z2(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=bf(this._rgb);return e&&(e.a=wn(e.a)),e}set rgb(e){this._rgb=yf(e)}rgbString(){return this._valid?Q2(this._rgb):void 0}hexString(){return this._valid?k2(this._rgb):void 0}hslString(){return this._valid?_2(this._rgb):void 0}mix(e,n){if(e){const r=this.rgb,o=e.rgb;let i;const s=n===i?.5:n,a=2*s-1,l=r.a-o.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,r.r=255&c*r.r+i*o.r+.5,r.g=255&c*r.g+i*o.g+.5,r.b=255&c*r.b+i*o.b+.5,r.a=s*r.a+(1-s)*o.a,this.rgb=r}return this}interpolate(e,n){return e&&(this._rgb=F2(this._rgb,e._rgb,n)),this}clone(){return new Eo(this.rgb)}alpha(e){return this._rgb.a=Fn(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=xo(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ni(this._rgb,2,e),this}darken(e){return Ni(this._rgb,2,-e),this}saturate(e){return Ni(this._rgb,1,e),this}desaturate(e){return Ni(this._rgb,1,-e),this}rotate(e){return M2(this._rgb,e),this}}function xn(){}const H2=(()=>{let t=0;return()=>t++})();function Pe(t){return t==null}function We(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function be(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function _t(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function an(t,e){return _t(t)?t:e}function ye(t,e){return typeof t>"u"?e:t}const R2=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,vf=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Te(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Ee(t,e,n,r){let o,i,s;if(We(t))for(i=t.length,o=0;o<i;o++)e.call(n,t[o],o);else if(be(t))for(s=Object.keys(t),i=s.length,o=0;o<i;o++)e.call(n,t[s[o]],s[o])}function Qi(t,e){let n,r,o,i;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(o=t[n],i=e[n],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0}function Fi(t){if(We(t))return t.map(Fi);if(be(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let o=0;for(;o<r;++o)e[n[o]]=Fi(t[n[o]]);return e}return t}function wf(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function U2(t,e,n,r){if(!wf(t))return;const o=e[t],i=n[t];be(o)&&be(i)?So(o,i,r):e[t]=Fi(i)}function So(t,e,n){const r=We(e)?e:[e],o=r.length;if(!be(t))return t;n=n||{};const i=n.merger||U2;let s;for(let a=0;a<o;++a){if(s=r[a],!be(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)i(l[c],t,s,n)}return t}function Co(t,e){return So(t,e,{merger:j2})}function j2(t,e,n){if(!wf(t))return;const r=e[t],o=n[t];be(r)&&be(o)?Co(r,o):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Fi(o))}const xf={"":t=>t,x:t=>t.x,y:t=>t.y};function V2(t){const e=t.split("."),n=[];let r="";for(const o of e)r+=o,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function W2(t){const e=V2(t);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function zn(t,e){return(xf[e]||(xf[e]=W2(e)))(t)}function al(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Po=t=>typeof t<"u",Hn=t=>typeof t=="function",kf=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function Y2(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Ye=Math.PI,vt=2*Ye,zi=Number.POSITIVE_INFINITY,q2=Ye/180,wt=Ye/2,nr=Ye/4,Ef=Ye*2/3,Sf=Math.log10,Rn=Math.sign;function Hi(t,e,n){return Math.abs(t-e)<n}function Cf(t){const e=Math.round(t);t=Hi(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Sf(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function K2(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r===0&&(e.push(r),e.push(t/r));return n===(n|0)&&e.push(n),e.sort((o,i)=>o-i).pop(),e}function G2(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Ri(t){return!G2(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function X2(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function J2(t,e,n){let r,o,i;for(r=0,o=t.length;r<o;r++)i=t[r][n],isNaN(i)||(e.min=Math.min(e.min,i),e.max=Math.max(e.max,i))}function ln(t){return t*(Ye/180)}function Z2(t){return t*(180/Ye)}function Pf(t){if(!_t(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function $2(t,e){const n=e.x-t.x,r=e.y-t.y,o=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*Ye&&(i+=vt),{angle:i,distance:o}}function ek(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function rr(t){return(t%vt+vt)%vt}function ll(t,e,n,r){const o=rr(t),i=rr(e),s=rr(n),a=rr(i-o),l=rr(s-o),c=rr(o-i),u=rr(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function Ht(t,e,n){return Math.max(e,Math.min(n,t))}function tk(t){return Ht(t,-32768,32767)}function Br(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function cl(t,e,n){n=n||(s=>t[s]<e);let r=t.length-1,o=0,i;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const ul=(t,e,n,r)=>cl(t,n,r?o=>{const i=t[o][e];return i<n||i===n&&t[o+1][e]===n}:o=>t[o][e]<n),nk=(t,e,n)=>cl(t,n,r=>t[r][e]>=n);function rk(t,e,n){let r=0,o=t.length;for(;r<o&&t[r]<e;)r++;for(;o>r&&t[o-1]>n;)o--;return r>0||o<t.length?t.slice(r,o):t}const Df=["push","pop","shift","splice","unshift"];function ok(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Df.forEach(n=>{const r="_onData"+al(n),o=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...i){const s=o.apply(this,i);return t._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...i)}),s}})})}function Bf(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(e);o!==-1&&r.splice(o,1),!(r.length>0)&&(Df.forEach(i=>{delete t[i]}),delete t._chartjs)}function If(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Mf=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function _f(t,e){let n=[],r=!1;return function(...o){n=o,r||(r=!0,Mf.call(window,()=>{r=!1,t.apply(e,n)}))}}function ik(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const dl=t=>t==="start"?"left":t==="end"?"right":"center",$e=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,sk=(t,e,n,r)=>t===(r?"left":"right")?n:t==="center"?(e+n)/2:e,Ui=t=>t===0||t===1,Of=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*vt/n)),Tf=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*vt/n)+1,Do={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*wt)+1,easeOutSine:t=>Math.sin(t*wt),easeInOutSine:t=>-.5*(Math.cos(Ye*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=>Ui(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=>Ui(t)?t:Of(t,.075,.3),easeOutElastic:t=>Ui(t)?t:Tf(t,.075,.3),easeInOutElastic(t){return Ui(t)?t:t<.5?.5*Of(t*2,.1125,.45):.5+.5*Tf(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 e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Do.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?Do.easeInBounce(t*2)*.5:Do.easeOutBounce(t*2-1)*.5+.5};function Lf(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Nf(t){return Lf(t)?t:new Eo(t)}function Al(t){return Lf(t)?t:new Eo(t).saturate(.5).darken(.1).hexString()}const ak=["x","y","borderWidth","radius","tension"],lk=["color","borderColor","backgroundColor"];function ck(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:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:lk},numbers:{type:"number",properties:ak}}),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:e=>e|0}}}})}function uk(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Qf=new Map;function dk(t,e){e=e||{};const n=t+JSON.stringify(e);let r=Qf.get(n);return r||(r=new Intl.NumberFormat(t,e),Qf.set(n,r)),r}function ji(t,e,n){return dk(e,n).format(t)}const Ak={values(t){return We(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const r=this.chart.options.locale;let o,i=t;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(o="scientific"),i=fk(t,n)}const s=Sf(Math.abs(i)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:o,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ji(t,r,l)}};function fk(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var Ff={formatters:Ak};function hk(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:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.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:Ff.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:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const or=Object.create(null),fl=Object.create(null);function Bo(t,e){if(!e)return t;const n=e.split(".");for(let r=0,o=n.length;r<o;++r){const i=n[r];t=t[i]||(t[i]=Object.create(null))}return t}function hl(t,e,n){return typeof e=="string"?So(Bo(t,e),n):So(Bo(t,""),e)}class pk{constructor(e,n){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=r=>r.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=(r,o)=>Al(o.backgroundColor),this.hoverBorderColor=(r,o)=>Al(o.borderColor),this.hoverColor=(r,o)=>Al(o.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(e),this.apply(n)}set(e,n){return hl(this,e,n)}get(e){return Bo(this,e)}describe(e,n){return hl(fl,e,n)}override(e,n){return hl(or,e,n)}route(e,n,r,o){const i=Bo(this,e),s=Bo(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[o];return be(l)?Object.assign({},c,l):ye(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var ze=new pk({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ck,uk,hk]);function gk(t){return!t||Pe(t.size)||Pe(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function zf(t,e,n,r,o){let i=e[o];return i||(i=e[o]=t.measureText(o).width,n.push(o)),i>r&&(r=i),r}function ir(t,e,n){const r=t.currentDevicePixelRatio,o=n!==0?Math.max(n/2,.5):0;return Math.round((e-o)*r)/r+o}function Hf(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Rf(t,e,n,r){Uf(t,e,n,r,null)}function Uf(t,e,n,r,o){let i,s,a,l,c,u,d,A;const f=e.pointStyle,h=e.rotation,g=e.radius;let p=(h||0)*q2;if(f&&typeof f=="object"&&(i=f.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){t.save(),t.translate(n,r),t.rotate(p),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),t.restore();return}if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:o?t.ellipse(n,r,o/2,g,0,0,vt):t.arc(n,r,g,0,vt),t.closePath();break;case"triangle":u=o?o/2:g,t.moveTo(n+Math.sin(p)*u,r-Math.cos(p)*g),p+=Ef,t.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*g),p+=Ef,t.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*g),t.closePath();break;case"rectRounded":c=g*.516,l=g-c,s=Math.cos(p+nr)*l,d=Math.cos(p+nr)*(o?o/2-c:l),a=Math.sin(p+nr)*l,A=Math.sin(p+nr)*(o?o/2-c:l),t.arc(n-d,r-a,c,p-Ye,p-wt),t.arc(n+A,r-s,c,p-wt,p),t.arc(n+d,r+a,c,p,p+wt),t.arc(n-A,r+s,c,p+wt,p+Ye),t.closePath();break;case"rect":if(!h){l=Math.SQRT1_2*g,u=o?o/2:l,t.rect(n-u,r-l,2*u,2*l);break}p+=nr;case"rectRot":d=Math.cos(p)*(o?o/2:g),s=Math.cos(p)*g,a=Math.sin(p)*g,A=Math.sin(p)*(o?o/2:g),t.moveTo(n-d,r-a),t.lineTo(n+A,r-s),t.lineTo(n+d,r+a),t.lineTo(n-A,r+s),t.closePath();break;case"crossRot":p+=nr;case"cross":d=Math.cos(p)*(o?o/2:g),s=Math.cos(p)*g,a=Math.sin(p)*g,A=Math.sin(p)*(o?o/2:g),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+A,r-s),t.lineTo(n-A,r+s);break;case"star":d=Math.cos(p)*(o?o/2:g),s=Math.cos(p)*g,a=Math.sin(p)*g,A=Math.sin(p)*(o?o/2:g),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+A,r-s),t.lineTo(n-A,r+s),p+=nr,d=Math.cos(p)*(o?o/2:g),s=Math.cos(p)*g,a=Math.sin(p)*g,A=Math.sin(p)*(o?o/2:g),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+A,r-s),t.lineTo(n-A,r+s);break;case"line":s=o?o/2:Math.cos(p)*g,a=Math.sin(p)*g,t.moveTo(n-s,r-a),t.lineTo(n+s,r+a);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(p)*(o?o/2:g),r+Math.sin(p)*g);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function jf(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function pl(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function gl(t){t.restore()}function mk(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Pe(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function bk(t,e,n,r,o){if(o.strikethrough||o.underline){const i=t.measureText(r),s=e-i.actualBoundingBoxLeft,a=e+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=o.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=o.decorationWidth||2,t.moveTo(s,u),t.lineTo(a,u),t.stroke()}}function yk(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function Io(t,e,n,r,o,i={}){const s=We(e)?e:[e],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(t.save(),t.font=o.string,mk(t,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&yk(t,i.backdrop),a&&(i.strokeColor&&(t.strokeStyle=i.strokeColor),Pe(i.strokeWidth)||(t.lineWidth=i.strokeWidth),t.strokeText(c,n,r,i.maxWidth)),t.fillText(c,n,r,i.maxWidth),bk(t,n,r,c,i),r+=Number(o.lineHeight);t.restore()}function Vi(t,e){const{x:n,y:r,w:o,h:i,radius:s}=e;t.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*Ye,Ye,!0),t.lineTo(n,r+i-s.bottomLeft),t.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,Ye,wt,!0),t.lineTo(n+o-s.bottomRight,r+i),t.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,wt,0,!0),t.lineTo(n+o,r+s.topRight),t.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-wt,!0),t.lineTo(n+s.topLeft,r)}const vk=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,wk=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function xk(t,e){const n=(""+t).match(vk);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const kk=t=>+t||0;function Vf(t,e){const n={},r=be(e),o=r?Object.keys(e):e,i=be(t)?r?s=>ye(t[s],t[e[s]]):s=>t[s]:()=>t;for(const s of o)n[s]=kk(i(s));return n}function Wf(t){return Vf(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ir(t){return Vf(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ot(t){const e=Wf(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function et(t,e){t=t||{},e=e||ze.font;let n=ye(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let r=ye(t.style,e.style);r&&!(""+r).match(wk)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:ye(t.family,e.family),lineHeight:xk(ye(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:ye(t.weight,e.weight),string:""};return o.string=gk(o),o}function Wi(t,e,n,r){let o,i,s;for(o=0,i=t.length;o<i;++o)if(s=t[o],s!==void 0&&s!==void 0)return s}function Ek(t,e,n){const{min:r,max:o}=t,i=vf(e,(o-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(i)),max:s(o,i)}}function Mr(t,e){return Object.assign(Object.create(t),e)}function ml(t,e=[""],n,r,o=()=>t[0]){const i=n||t;typeof r>"u"&&(r=Xf("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>ml([a,...t],e,i,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return qf(a,l,()=>_k(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return Jf(a).includes(l)},ownKeys(a){return Jf(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function _r(t,e,n,r){const o={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Yf(t,r),setContext:i=>_r(t,i,n,r),override:i=>_r(t.override(i),e,n,r)};return new Proxy(o,{deleteProperty(i,s){return delete i[s],delete t[s],!0},get(i,s,a){return qf(i,s,()=>Ck(i,s,a))},getOwnPropertyDescriptor(i,s){return i._descriptors.allKeys?Reflect.has(t,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,s)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(i,s){return Reflect.has(t,s)},ownKeys(){return Reflect.ownKeys(t)},set(i,s,a){return t[s]=a,delete i[s],!0}})}function Yf(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:n,indexable:r,isScriptable:Hn(n)?n:()=>n,isIndexable:Hn(r)?r:()=>r}}const Sk=(t,e)=>t?t+al(e):e,bl=(t,e)=>be(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function qf(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const r=n();return t[e]=r,r}function Ck(t,e,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=t;let a=r[e];return Hn(a)&&s.isScriptable(e)&&(a=Pk(e,a,t,n)),We(a)&&a.length&&(a=Dk(e,a,t,s.isIndexable)),bl(e,a)&&(a=_r(a,o,i&&i[e],s)),a}function Pk(t,e,n,r){const{_proxy:o,_context:i,_subProxy:s,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(i,s||r);return a.delete(t),bl(t,l)&&(l=yl(o._scopes,o,t,l)),l}function Dk(t,e,n,r){const{_proxy:o,_context:i,_subProxy:s,_descriptors:a}=n;if(typeof i.index<"u"&&r(t))return e[i.index%e.length];if(be(e[0])){const l=e,c=o._scopes.filter(u=>u!==l);e=[];for(const u of l){const d=yl(c,o,t,u);e.push(_r(d,i,s&&s[t],a))}}return e}function Kf(t,e,n){return Hn(t)?t(e,n):t}const Bk=(t,e)=>t===!0?e:typeof t=="string"?zn(e,t):void 0;function Ik(t,e,n,r,o){for(const i of e){const s=Bk(n,i);if(s){t.add(s);const a=Kf(s._fallback,n,o);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function yl(t,e,n,r){const o=e._rootScopes,i=Kf(e._fallback,n,r),s=[...t,...o],a=new Set;a.add(r);let l=Gf(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=Gf(a,s,i,l,r),l===null)?!1:ml(Array.from(a),[""],o,i,()=>Mk(e,n,r))}function Gf(t,e,n,r,o){for(;n;)n=Ik(t,e,n,r,o);return n}function Mk(t,e,n){const r=t._getTarget();e in r||(r[e]={});const o=r[e];return We(o)&&be(n)?n:o||{}}function _k(t,e,n,r){let o;for(const i of e)if(o=Xf(Sk(i,t),n),typeof o<"u")return bl(t,o)?yl(n,r,t,o):o}function Xf(t,e){for(const n of e){if(!n)continue;const r=n[t];if(typeof r<"u")return r}}function Jf(t){let e=t._keys;return e||(e=t._keys=Ok(t._scopes)),e}function Ok(t){const e=new Set;for(const n of t)for(const r of Object.keys(n).filter(o=>!o.startsWith("_")))e.add(r);return Array.from(e)}function Tk(t,e,n,r){const{iScale:o}=t,{key:i="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=e[c],s[a]={r:o.parse(zn(u,i),c)};return s}function vl(){return typeof window<"u"&&typeof document<"u"}function wl(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Yi(t,e,n){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*e.parentNode[n])):r=t,r}const qi=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Lk(t,e){return qi(t).getPropertyValue(e)}const Nk=["top","right","bottom","left"];function sr(t,e,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=Nk[o];r[i]=parseFloat(t[e+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Qk=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function Fk(t,e){const n=t.touches,r=n&&n.length?n[0]:t,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(Qk(o,i,t.target))a=o,l=i;else{const c=e.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function ar(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:r}=e,o=qi(n),i=o.boxSizing==="border-box",s=sr(o,"padding"),a=sr(o,"border","width"),{x:l,y:c,box:u}=Fk(t,n),d=s.left+(u&&a.left),A=s.top+(u&&a.top);let{width:f,height:h}=e;return i&&(f-=s.width+a.width,h-=s.height+a.height),{x:Math.round((l-d)/f*n.width/r),y:Math.round((c-A)/h*n.height/r)}}function zk(t,e,n){let r,o;if(e===void 0||n===void 0){const i=t&&wl(t);if(!i)e=t.clientWidth,n=t.clientHeight;else{const s=i.getBoundingClientRect(),a=qi(i),l=sr(a,"border","width"),c=sr(a,"padding");e=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Yi(a.maxWidth,i,"clientWidth"),o=Yi(a.maxHeight,i,"clientHeight")}}return{width:e,height:n,maxWidth:r||zi,maxHeight:o||zi}}const Un=t=>Math.round(t*10)/10;function Hk(t,e,n,r){const o=qi(t),i=sr(o,"margin"),s=Yi(o.maxWidth,t,"clientWidth")||zi,a=Yi(o.maxHeight,t,"clientHeight")||zi,l=zk(t,e,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const A=sr(o,"border","width"),f=sr(o,"padding");c-=f.width+A.width,u-=f.height+A.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=Un(Math.min(c,s,l.maxWidth)),u=Un(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Un(c/2)),(e!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Un(Math.floor(u*r))),{width:c,height:u}}function Zf(t,e,n){const r=e||1,o=Un(t.height*r),i=Un(t.width*r);t.height=Un(t.height),t.width=Un(t.width);const s=t.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${t.height}px`,s.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||s.height!==o||s.width!==i?(t.currentDevicePixelRatio=r,s.height=o,s.width=i,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const Rk=(function(){let t=!1;try{const e={get passive(){return t=!0,!1}};vl()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t})();function $f(t,e){const n=Lk(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const Uk=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},jk=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Or(t,e,n){return t?Uk(e,n):jk()}function eh(t,e){let n,r;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function th(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ki(t,e,n){return t.options.clip?t[n]:e[n]}function Vk(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:Ki(n,e,"left"),right:Ki(n,e,"right"),top:Ki(r,e,"top"),bottom:Ki(r,e,"bottom")}:e}function Wk(t,e){const n=e._clip;if(n.disabled)return!1;const r=Vk(e,t.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:r.bottom+(n.bottom===!0?0:n.bottom)}}class Yk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,o){const i=n.listeners[o],s=n.duration;i.forEach(a=>a({chart:e,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Mf.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,o)=>{if(!r.running||!r.items.length)return;const i=r.items;let s=i.length-1,a=!1,l;for(;s>=0;--s)l=i[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(e),a=!0):(i[s]=i[i.length-1],i.pop());a&&(o.draw(),this._notify(o,r,e,"progress")),i.length||(r.running=!1,this._notify(o,r,e,"complete"),r.initial=!1),n+=i.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,o)=>Math.max(r,o._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const r=n.items;let o=r.length-1;for(;o>=0;--o)r[o].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var kn=new Yk;const nh="transparent",qk={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=Nf(t||nh),o=r.valid&&Nf(e||nh);return o&&o.valid?o.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class Kk{constructor(e,n,r,o){const i=n[r];o=Wi([e.to,o,i,e.from]);const s=Wi([e.from,i,o]);this._active=!0,this._fn=e.fn||qk[e.type||typeof s],this._easing=Do[e.easing]||Do.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=s,this._to=o,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const o=this._target[this._prop],i=r-this._start,s=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(s,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=Wi([e.to,n,o,e.from]),this._from=Wi([e.from,o,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,o=this._prop,i=this._from,s=this._loop,a=this._to;let l;if(this._active=i!==a&&(s||n<r),!this._active){this._target[o]=a,this._notify(!0);return}if(n<0){this._target[o]=i;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[o]=this._fn(i,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let o=0;o<r.length;o++)r[o][n]()}}class rh{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!be(e))return;const n=Object.keys(ze.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(o=>{const i=e[o];if(!be(i))return;const s={};for(const a of n)s[a]=i[a];(We(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(e,n){const r=n.options,o=Xk(e,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&Gk(e.options.$animations,r).then(()=>{e.options=r},()=>{}),i}_createAnimations(e,n){const r=this._properties,o=[],i=e.$animations||(e.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(e,n));continue}const u=n[c];let d=i[c];const A=r.get(c);if(d)if(A&&d.active()){d.update(A,u,a);continue}else d.cancel();if(!A||!A.duration){e[c]=u;continue}i[c]=d=new Kk(A,e,c,u),o.push(d)}return o}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return kn.add(this._chart,r),!0}}function Gk(t,e){const n=[],r=Object.keys(e);for(let o=0;o<r.length;o++){const i=t[r[o]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function Xk(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function oh(t,e){const n=t&&t.options||{},r=n.reverse,o=n.min===void 0?e:0,i=n.max===void 0?e:0;return{start:r?i:o,end:r?o:i}}function Jk(t,e,n){if(n===!1)return!1;const r=oh(t,n),o=oh(e,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function Zk(t){let e,n,r,o;return be(t)?(e=t.top,n=t.right,r=t.bottom,o=t.left):e=n=r=o=t,{top:e,right:n,bottom:r,left:o,disabled:t===!1}}function ih(t,e){const n=[],r=t._getSortedDatasetMetas(e);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function sh(t,e,n,r={}){const o=t.keys,i=r.mode==="single";let s,a,l,c;if(e===null)return;let u=!1;for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(u=!0,r.all)continue;break}c=t.values[l],_t(c)&&(i||e===0||Rn(e)===Rn(c))&&(e+=c)}return!u&&!r.all?0:e}function $k(t,e){const{iScale:n,vScale:r}=e,o=n.axis==="x"?"x":"y",i=r.axis==="x"?"x":"y",s=Object.keys(t),a=new Array(s.length);let l,c,u;for(l=0,c=s.length;l<c;++l)u=s[l],a[l]={[o]:u,[i]:t[u]};return a}function xl(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function eE(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function tE(t){const{min:e,max:n,minDefined:r,maxDefined:o}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function nE(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function ah(t,e,n,r){for(const o of e.getMatchingVisibleMetas(r).reverse()){const i=t[o.index];if(n&&i>0||!n&&i<0)return o.index}return null}function lh(t,e){const{chart:n,_cachedMeta:r}=t,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:a}=r,l=i.axis,c=s.axis,u=eE(i,s,r),d=e.length;let A;for(let f=0;f<d;++f){const h=e[f],{[l]:g,[c]:p}=h,v=h._stacks||(h._stacks={});A=v[c]=nE(o,u,g),A[a]=p,A._top=ah(A,s,!0,r.type),A._bottom=ah(A,s,!1,r.type);const x=A._visualValues||(A._visualValues={});x[a]=p}}function kl(t,e){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function rE(t,e){return Mr(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function oE(t,e,n){return Mr(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Mo(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const o of e){const i=o._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const El=t=>t==="reset"||t==="none",ch=(t,e)=>e?t:Object.assign({},t),iE=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:ih(n,!0),values:null};class Gi{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,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(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=xl(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&&Mo(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,A,f,h)=>d==="x"?A:d==="r"?h:f,i=n.xAxisID=ye(r.xAxisID,kl(e,"x")),s=n.yAxisID=ye(r.yAxisID,kl(e,"y")),a=n.rAxisID=ye(r.rAxisID,kl(e,"r")),l=n.indexAxis,c=n.iAxisID=o(l,i,s,a),u=n.vAxisID=o(l,s,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Bf(this._data,this),e._stacked&&Mo(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(be(n)){const o=this._cachedMeta;this._data=$k(n,o)}else if(r!==n){if(r){Bf(r,this);const o=this._cachedMeta;Mo(o),o._parsed=[]}n&&Object.isExtensible(n)&&ok(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,r=this.getDataset();let o=!1;this._dataCheck();const i=n._stacked;n._stacked=xl(n.vScale,n),n.stack!==r.stack&&(o=!0,Mo(n),n.stack=r.stack),this._resyncElements(e),(o||i!==n._stacked)&&(lh(this,n._parsed),n._stacked=xl(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:o}=this,{iScale:i,_stacked:s}=r,a=i.axis;let l=e===0&&n===o.length?!0:r._sorted,c=e>0&&r._parsed[e-1],u,d,A;if(this._parsing===!1)r._parsed=o,r._sorted=!0,A=o;else{We(o[e])?A=this.parseArrayData(r,o,e,n):be(o[e])?A=this.parseObjectData(r,o,e,n):A=this.parsePrimitiveData(r,o,e,n);const f=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+e]=d=A[u],l&&(f()&&(l=!1),c=d);r._sorted=l}s&&lh(this,A)}parsePrimitiveData(e,n,r,o){const{iScale:i,vScale:s}=e,a=i.axis,l=s.axis,c=i.getLabels(),u=i===s,d=new Array(o);let A,f,h;for(A=0,f=o;A<f;++A)h=A+r,d[A]={[a]:u||i.parse(c[h],h),[l]:s.parse(n[h],h)};return d}parseArrayData(e,n,r,o){const{xScale:i,yScale:s}=e,a=new Array(o);let l,c,u,d;for(l=0,c=o;l<c;++l)u=l+r,d=n[u],a[l]={x:i.parse(d[0],u),y:s.parse(d[1],u)};return a}parseObjectData(e,n,r,o){const{xScale:i,yScale:s}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,d,A,f;for(u=0,d=o;u<d;++u)A=u+r,f=n[A],c[u]={x:i.parse(zn(f,a),A),y:s.parse(zn(f,l),A)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const o=this.chart,i=this._cachedMeta,s=n[e.axis],a={keys:ih(o,!0),values:n._stacks[e.axis]._visualValues};return sh(a,s,i.index,{mode:r})}updateRangeFromParsed(e,n,r,o){const i=r[n.axis];let s=i===null?NaN:i;const a=o&&r._stacks[n.axis];o&&a&&(o.values=a,s=sh(o,i,this._cachedMeta.index)),e.min=Math.min(e.min,s),e.max=Math.max(e.max,s)}getMinMax(e,n){const r=this._cachedMeta,o=r._parsed,i=r._sorted&&e===r.iScale,s=o.length,a=this._getOtherScale(e),l=iE(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=tE(a);let A,f;function h(){f=o[A];const g=f[a.axis];return!_t(f[e.axis])||u>g||d<g}for(A=0;A<s&&!(!h()&&(this.updateRangeFromParsed(c,e,f,l),i));++A);if(i){for(A=s-1;A>=0;--A)if(!h()){this.updateRangeFromParsed(c,e,f,l);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let o,i,s;for(o=0,i=n.length;o<i;++o)s=n[o][e.axis],_t(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,o=n.vScale,i=this.getParsed(e);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=Zk(ye(this.options.clip,Jk(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,o=r.data||[],i=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||o.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(e,i,a,l),u=a;u<a+l;++u){const d=o[u];d.hidden||(d.active&&c?s.push(d):d.draw(e,i))}for(u=0;u<s.length;++u)s[u].draw(e,i)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const o=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const s=this._cachedMeta.data[e];i=s.$context||(s.$context=oE(this.getContext(),e,s)),i.parsed=this.getParsed(e),i.raw=o.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=rE(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const o=n==="active",i=this._cachedDataOpts,s=e+"-"+n,a=i[s],l=this.enableOptionSharing&&Po(r);if(a)return ch(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,e),d=o?[`${e}Hover`,"hover",e,""]:[e,""],A=c.getOptionScopes(this.getDataset(),u),f=Object.keys(ze.elements[e]),h=()=>this.getContext(r,o,n),g=c.resolveNamedOptions(A,f,h,d);return g.$shared&&(g.$shared=l,i[s]=Object.freeze(ch(g,l))),g}_resolveAnimations(e,n,r){const o=this.chart,i=this._cachedDataOpts,s=`animation-${n}`,a=i[s];if(a)return a;let l;if(o.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),A=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(A,this.getContext(e,r,n))}const c=new rh(o,l&&l.animations);return l&&l._cacheable&&(i[s]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||El(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),o=this._sharedOptions,i=this.getSharedOptions(r),s=this.includeOptions(n,i)||i!==o;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:s}}updateElement(e,n,r,o){El(o)?Object.assign(e,r):this._resolveAnimations(n,o).update(e,r)}updateSharedOptions(e,n,r){e&&!El(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,o){e.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(e,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const o=r.length,i=n.length,s=Math.min(i,o);s&&this.parse(0,s),i>o?this._insertElements(o,i-o,e):i<o&&this._removeElements(i,o-i)}_insertElements(e,n,r=!0){const o=this._cachedMeta,i=o.data,s=e+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(i),a=e;a<s;++a)i[a]=new this.dataElementType;this._parsing&&l(o._parsed),this.parse(e,n),r&&this.updateElements(i,e,n,"reset")}updateElements(e,n,r,o){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const o=r._parsed.splice(e,n);r._stacked&&Mo(r,o)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,o]=e;this[n](r,o)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const 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,n){n&&this._sync(["_removeElements",e,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function sE(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let r=[];for(let o=0,i=n.length;o<i;o++)r=r.concat(n[o].controller.getAllParsedValues(t));t._cache.$bar=If(r.sort((o,i)=>o-i))}return t._cache.$bar}function aE(t){const e=t.iScale,n=sE(e,t.type);let r=e._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(Po(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(o=0,i=n.length;o<i;++o)s=e.getPixelForValue(n[o]),l();for(a=void 0,o=0,i=e.ticks.length;o<i;++o)s=e.getPixelForTick(o),l();return r}function lE(t,e,n,r){const o=n.barThickness;let i,s;return Pe(o)?(i=e.min*n.categoryPercentage,s=n.barPercentage):(i=o*r,s=1),{chunk:i/r,ratio:s,start:e.pixels[t]-i/2}}function cE(t,e,n,r){const o=e.pixels,i=o[t];let s=t>0?o[t-1]:null,a=t<o.length-1?o[t+1]:null;const l=n.categoryPercentage;s===null&&(s=i-(a===null?e.end-e.start:a-i)),a===null&&(a=i+i-s);const c=i-(i-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function uE(t,e,n,r){const o=n.parse(t[0],r),i=n.parse(t[1],r),s=Math.min(o,i),a=Math.max(o,i);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:o,end:i,min:s,max:a}}function uh(t,e,n,r){return We(t)?uE(t,e,n,r):e[n.axis]=n.parse(t,r),e}function dh(t,e,n,r){const o=t.iScale,i=t.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,d,A;for(c=n,u=n+r;c<u;++c)A=e[c],d={},d[o.axis]=a||o.parse(s[c],c),l.push(uh(A,d,i,c));return l}function Sl(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function dE(t,e,n){return t!==0?Rn(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function AE(t){let e,n,r,o,i;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:e,top:o,bottom:i}}function fE(t,e,n,r){let o=e.borderSkipped;const i={};if(!o){t.borderSkipped=i;return}if(o===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=AE(t);o==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[Ah(u,s,a,l)]=!0,o=c)),i[Ah(o,s,a,l)]=!0,t.borderSkipped=i}function Ah(t,e,n,r){return r?(t=hE(t,e,n),t=fh(t,n,e)):t=fh(t,e,n),t}function hE(t,e,n){return t===e?n:t===n?e:t}function fh(t,e,n){return t==="start"?e:t==="end"?n:t}function pE(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class gE extends Gi{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,n,r,o){return dh(e,n,r,o)}parseArrayData(e,n,r,o){return dh(e,n,r,o)}parseObjectData(e,n,r,o){const{iScale:i,vScale:s}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,u=s.axis==="x"?a:l,d=[];let A,f,h,g;for(A=r,f=r+o;A<f;++A)g=n[A],h={},h[i.axis]=i.parse(zn(g,c),A),d.push(uh(zn(g,u),h,s,A));return d}updateRangeFromParsed(e,n,r,o){super.updateRangeFromParsed(e,n,r,o);const i=r._custom;i&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:r,vScale:o}=n,i=this.getParsed(e),s=i._custom,a=Sl(s)?"["+s.start+", "+s.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,r,o){const i=o==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:A}=this._getSharedOptions(n,o);for(let f=n;f<n+r;f++){const h=this.getParsed(f),g=i||Pe(h[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,u),v=(h._stacks||{})[a.axis],x={horizontal:c,base:g.base,enableBorderRadius:!v||Sl(h._custom)||s===v._top||s===v._bottom,x:c?g.head:p.center,y:c?p.center:g.head,height:c?p.size:Math.abs(g.size),width:c?Math.abs(g.size):p.size};A&&(x.options=d||this.resolveDataElementOptions(f,e[f].active?"active":o));const y=x.options||e[f].options;fE(x,y,v,s),pE(x,y,u.ratio),this.updateElement(e[f],f,x,o)}}_getStacks(e,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),i=r.options.stacked,s=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=u=>{const d=u._parsed.find(f=>f[r.axis]===l),A=d&&d[u.vScale.axis];if(Pe(A)||isNaN(A))return!0};for(const u of o)if(!(n!==void 0&&c(u))&&((i===!1||s.indexOf(u.stack)===-1||i===void 0&&u.stack===void 0)&&s.push(u.stack),u.index===e))break;return s.length||s.push(void 0),s}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(r=>e[r].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)e[ye(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,r){const o=this._getStacks(e,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const e=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,s;for(i=0,s=n.data.length;i<s;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=e.barThickness;return{min:a||aE(n),pixels:o,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:r,index:o},options:{base:i,minBarLength:s}}=this,a=i||0,l=this.getParsed(e),c=l._custom,u=Sl(c);let d=l[n.axis],A=0,f=r?this.applyStack(n,l,r):d,h,g;f!==d&&(A=f-d,f=d),u&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&Rn(d)!==Rn(c.barEnd)&&(A=0),A+=d);const p=!Pe(i)&&!u?i:A;let v=n.getPixelForValue(p);if(this.chart.getDataVisibility(e)?h=n.getPixelForValue(A+f):h=v,g=h-v,Math.abs(g)<s){g=dE(g,n,a)*s,d===a&&(v-=g/2);const x=n.getPixelForDecimal(0),y=n.getPixelForDecimal(1),b=Math.min(x,y),E=Math.max(x,y);v=Math.max(Math.min(v,E),b),h=v+g,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(h)-n.getValueForPixel(v))}if(v===n.getPixelForValue(a)){const x=Rn(g)*n.getLineWidthForValue(a)/2;v+=x,g-=x}return{size:g,base:v,head:h,center:h+g/2}}_calculateBarIndexPixels(e,n){const r=n.scale,o=this.options,i=o.skipNull,s=ye(o.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const u=i?this._getStackCount(e):n.stackCount,d=o.barThickness==="flex"?cE(e,n,o,u*c):lE(e,n,o,u*c),A=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(ye(A,this.getFirstScaleIdForIndexAxis())),h=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+f;a=d.start+d.chunk*h+d.chunk/2,l=Math.min(s,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(e)[r.axis],e),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const e=this._cachedMeta,n=e.vScale,r=e.data,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&!r[i].hidden&&r[i].draw(this._ctx)}}function mE(t,e,n){let r=1,o=1,i=0,s=0;if(e<vt){const a=t,l=a+e,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),A=Math.sin(l),f=(y,b,E)=>ll(y,a,l,!0)?1:Math.max(b,b*n,E,E*n),h=(y,b,E)=>ll(y,a,l,!0)?-1:Math.min(b,b*n,E,E*n),g=f(0,c,d),p=f(wt,u,A),v=h(Ye,c,d),x=h(Ye+wt,u,A);r=(g-v)/2,o=(p-x)/2,i=-(g+v)/2,s=-(p+x)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class bE extends Gi{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){const n=e.data,{labels:{pointStyle:r,textAlign:o,color:i,useBorderRadius:s,borderRadius:a}}=e.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const d=e.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:o,pointStyle:r,borderRadius:s&&(a||d.borderRadius),index:c}}):[]}},onClick(e,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const r=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let i=l=>+r[l];if(be(r[e])){const{key:l="value"}=this._parsing;i=c=>+zn(r[c],l)}let s,a;for(s=e,a=e+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return ln(this.options.rotation-90)}_getCircumference(){return ln(this.options.circumference)}_getRotationExtents(){let e=vt,n=-vt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const o=this.chart.getDatasetMeta(r).controller,i=o._getRotation(),s=o._getCircumference();e=Math.min(e,i),n=Math.max(n,i+s)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:r}=n,o=this._cachedMeta,i=o.data,s=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(R2(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:A,ratioY:f,offsetX:h,offsetY:g}=mE(d,u,l),p=(r.width-s)/A,v=(r.height-s)/f,x=Math.max(Math.min(p,v)/2,0),y=vf(this.options.radius,x),b=Math.max(y*l,0),E=(y-b)/this._getVisibleDatasetWeightTotal();this.offsetX=h*y,this.offsetY=g*y,o.total=this.calculateTotal(),this.outerRadius=y-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*c,0),this.updateElements(i,0,i.length,e)}_circumference(e,n){const r=this.options,o=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(e)||o._parsed[e]===null||o.data[e].hidden?0:this.calculateCircumference(o._parsed[e]*i/vt)}updateElements(e,n,r,o){const i=o==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,A=i&&c.animateScale,f=A?0:this.innerRadius,h=A?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(n,o);let v=this._getRotation(),x;for(x=0;x<n;++x)v+=this._circumference(x,i);for(x=n;x<n+r;++x){const y=this._circumference(x,i),b=e[x],E={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+y,circumference:y,outerRadius:h,innerRadius:f};p&&(E.options=g||this.resolveDataElementOptions(x,b.active?"active":o)),v+=y,this.updateElement(b,x,E,o)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let r=0,o;for(o=0;o<n.length;o++){const i=e._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?vt*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=ji(n._parsed[e],r.options.locale);return{label:o[e]||"",value:i}}getMaxBorderWidth(e){let n=0;const r=this.chart;let o,i,s,a,l;if(!e){for(o=0,i=r.data.datasets.length;o<i;++o)if(r.isDatasetVisible(o)){s=r.getDatasetMeta(o),e=s.data,a=s.controller;break}}if(!e)return 0;for(o=0,i=e.length;o<i;++o)l=a.resolveDataElementOptions(o),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let r=0,o=e.length;r<o;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let r=0;r<e;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(e){return Math.max(ye(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class yE extends Gi{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){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=e.legend.options;return n.labels.map((i,s)=>{const l=e.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=ji(n._parsed[e].r,r.options.locale);return{label:o[e]||"",value:i}}parseObjectData(e,n,r,o){return Tk.bind(this)(e,n,r,o)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((r,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,r=e.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),s=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),a=(i-s)/e.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,n,r,o){const i=o==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,A=c.getIndexAngle(0)-.5*Ye;let f=A,h;const g=360/this.countVisibleElements();for(h=0;h<n;++h)f+=this._computeAngle(h,o,g);for(h=n;h<n+r;h++){const p=e[h];let v=f,x=f+this._computeAngle(h,o,g),y=s.getDataVisibility(h)?c.getDistanceFromCenterForValue(this.getParsed(h).r):0;f=x,i&&(l.animateScale&&(y=0),l.animateRotate&&(v=x=A));const b={x:u,y:d,innerRadius:0,outerRadius:y,startAngle:v,endAngle:x,options:this.resolveDataElementOptions(h,p.active?"active":o)};this.updateElement(p,h,b,o)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((r,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(e,n,r){return this.chart.getDataVisibility(e)?ln(this.resolveDataElementOptions(e,n).angle||r):0}}function lr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Cl{static override(e){Object.assign(Cl.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return lr()}parse(){return lr()}format(){return lr()}add(){return lr()}diff(){return lr()}startOf(){return lr()}endOf(){return lr()}}var vE={_date:Cl};function wE(t,e,n,r){const{controller:o,data:i,_sorted:s}=t,a=o._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&s&&i.length){const c=a._reversePixels?nk:ul;if(r){if(o._sharedOptions){const u=i[0],d=typeof u.getRange=="function"&&u.getRange(e);if(d){const A=c(i,e,n-d),f=c(i,e,n+d);return{lo:A.lo,hi:f.hi}}}}else{const u=c(i,e,n);if(l){const{vScale:d}=o._cachedMeta,{_parsed:A}=t,f=A.slice(0,u.lo+1).reverse().findIndex(g=>!Pe(g[d.axis]));u.lo-=Math.max(0,f);const h=A.slice(u.hi).findIndex(g=>!Pe(g[d.axis]));u.hi+=Math.max(0,h)}return u}}return{lo:0,hi:i.length-1}}function Xi(t,e,n,r,o){const i=t.getSortedVisibleDatasetMetas(),s=n[e];for(let a=0,l=i.length;a<l;++a){const{index:c,data:u}=i[a],{lo:d,hi:A}=wE(i[a],e,s,o);for(let f=d;f<=A;++f){const h=u[f];h.skip||r(h,c,f)}}}function xE(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,o){const i=e?Math.abs(r.x-o.x):0,s=n?Math.abs(r.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(s,2))}}function Pl(t,e,n,r,o){const i=[];return!o&&!t.isPointInArea(e)||Xi(t,n,e,function(a,l,c){!o&&!jf(a,t.chartArea,0)||a.inRange(e.x,e.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function kE(t,e,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=$2(s,{x:e.x,y:e.y});ll(d,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return Xi(t,n,e,i),o}function EE(t,e,n,r,o,i){let s=[];const a=xE(n);let l=Number.POSITIVE_INFINITY;function c(u,d,A){const f=u.inRange(e.x,e.y,o);if(r&&!f)return;const h=u.getCenterPoint(o);if(!(!!i||t.isPointInArea(h))&&!f)return;const p=a(e,h);p<l?(s=[{element:u,datasetIndex:d,index:A}],l=p):p===l&&s.push({element:u,datasetIndex:d,index:A})}return Xi(t,n,e,c),s}function Dl(t,e,n,r,o,i){return!i&&!t.isPointInArea(e)?[]:n==="r"&&!r?kE(t,e,n,o):EE(t,e,n,r,o,i)}function hh(t,e,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Xi(t,n,e,(l,c,u)=>{l[s]&&l[s](e[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(e.x,e.y,o))}),r&&!a?[]:i}var SE={modes:{index(t,e,n,r){const o=ar(e,t),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Pl(t,o,i,r,s):Dl(t,o,i,!1,r,s),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(t,e,n,r){const o=ar(e,t),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Pl(t,o,i,r,s):Dl(t,o,i,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=t.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(t,e,n,r){const o=ar(e,t),i=n.axis||"xy",s=n.includeInvisible||!1;return Pl(t,o,i,r,s)},nearest(t,e,n,r){const o=ar(e,t),i=n.axis||"xy",s=n.includeInvisible||!1;return Dl(t,o,i,n.intersect,r,s)},x(t,e,n,r){const o=ar(e,t);return hh(t,o,"x",n.intersect,r)},y(t,e,n,r){const o=ar(e,t);return hh(t,o,"y",n.intersect,r)}}};const ph=["left","top","right","bottom"];function _o(t,e){return t.filter(n=>n.pos===e)}function gh(t,e){return t.filter(n=>ph.indexOf(n.pos)===-1&&n.box.axis===e)}function Oo(t,e){return t.sort((n,r)=>{const o=e?r:n,i=e?n:r;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function CE(t){const e=[];let n,r,o,i,s,a;for(n=0,r=(t||[]).length;n<r;++n)o=t[n],{position:i,options:{stack:s,stackWeight:a=1}}=o,e.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:s&&i+s,stackWeight:a});return e}function PE(t){const e={};for(const n of t){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!ph.includes(o))continue;const s=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=i}return e}function DE(t,e){const n=PE(t),{vBoxMaxWidth:r,hBoxMaxHeight:o}=e;let i,s,a;for(i=0,s=t.length;i<s;++i){a=t[i];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&e.availableWidth,a.height=o):(a.width=r,a.height=u?u*o:l&&e.availableHeight)}return n}function BE(t){const e=CE(t),n=Oo(e.filter(c=>c.box.fullSize),!0),r=Oo(_o(e,"left"),!0),o=Oo(_o(e,"right")),i=Oo(_o(e,"top"),!0),s=Oo(_o(e,"bottom")),a=gh(e,"x"),l=gh(e,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:_o(e,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function mh(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function bh(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function IE(t,e,n,r){const{pos:o,box:i}=n,s=t.maxPadding;if(!be(o)){n.size&&(t[o]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?i.height:i.width),n.size=d.size/d.count,t[o]+=n.size}i.getPadding&&bh(s,i.getPadding());const a=Math.max(0,e.outerWidth-mh(s,t,"left","right")),l=Math.max(0,e.outerHeight-mh(s,t,"top","bottom")),c=a!==t.w,u=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function ME(t){const e=t.maxPadding;function n(r){const o=Math.max(e[r]-t[r],0);return t[r]+=o,o}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function _E(t,e){const n=e.maxPadding;function r(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(s=>{i[s]=Math.max(e[s],n[s])}),i}return r(t?["left","right"]:["top","bottom"])}function To(t,e,n,r){const o=[];let i,s,a,l,c,u;for(i=0,s=t.length,c=0;i<s;++i){a=t[i],l=a.box,l.update(a.width||e.w,a.height||e.h,_E(a.horizontal,e));const{same:d,other:A}=IE(e,n,a,r);c|=d&&o.length,u=u||A,l.fullSize||o.push(a)}return c&&To(o,e,n,r)||u}function Ji(t,e,n,r,o){t.top=n,t.left=e,t.right=e+r,t.bottom=n+o,t.width=r,t.height=o}function yh(t,e,n,r){const o=n.padding;let{x:i,y:s}=e;for(const a of t){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=e.w*u,A=c.size||l.height;Po(c.start)&&(s=c.start),l.fullSize?Ji(l,o.left,s,n.outerWidth-o.right-o.left,A):Ji(l,e.left+c.placed,s,d,A),c.start=s,c.placed+=d,s=l.bottom}else{const d=e.h*u,A=c.size||l.width;Po(c.start)&&(i=c.start),l.fullSize?Ji(l,i,o.top,A,n.outerHeight-o.bottom-o.top):Ji(l,i,e.top+c.placed,A,d),c.start=i,c.placed+=d,i=l.right}}e.x=i,e.y=s}var Tt={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const o=Ot(t.options.layout.padding),i=Math.max(e-o.width,0),s=Math.max(n-o.height,0),a=BE(t.boxes),l=a.vertical,c=a.horizontal;Ee(t.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),A=Object.assign({},o);bh(A,Ot(r));const f=Object.assign({maxPadding:A,w:i,h:s,x:o.left,y:o.top},o),h=DE(l.concat(c),d);To(a.fullSize,f,d,h),To(l,f,d,h),To(c,f,d,h)&&To(l,f,d,h),ME(f),yh(a.leftAndTop,f,d,h),f.x+=f.w,f.y+=f.h,yh(a.rightAndBottom,f,d,h),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Ee(a.chartArea,g=>{const p=g.box;Object.assign(p,t.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class vh{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,o){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,o?Math.floor(n/o):r)}}isAttached(e){return!0}updateConfig(e){}}class OE extends vh{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Zi="$chartjs",TE={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},wh=t=>t===null||t==="";function LE(t,e){const n=t.style,r=t.getAttribute("height"),o=t.getAttribute("width");if(t[Zi]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",wh(o)){const i=$f(t,"width");i!==void 0&&(t.width=i)}if(wh(r))if(t.style.height==="")t.height=t.width/(e||2);else{const i=$f(t,"height");i!==void 0&&(t.height=i)}return t}const xh=Rk?{passive:!0}:!1;function NE(t,e,n){t&&t.addEventListener(e,n,xh)}function QE(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,xh)}function FE(t,e){const n=TE[t.type]||t.type,{x:r,y:o}=ar(t,e);return{type:n,chart:e,native:t,x:r!==void 0?r:null,y:o!==void 0?o:null}}function $i(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function zE(t,e,n){const r=t.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||$i(a.addedNodes,r),s=s&&!$i(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function HE(t,e,n){const r=t.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||$i(a.removedNodes,r),s=s&&!$i(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Lo=new Map;let kh=0;function Eh(){const t=window.devicePixelRatio;t!==kh&&(kh=t,Lo.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function RE(t,e){Lo.size||window.addEventListener("resize",Eh),Lo.set(t,e)}function UE(t){Lo.delete(t),Lo.size||window.removeEventListener("resize",Eh)}function jE(t,e,n){const r=t.canvas,o=r&&wl(r);if(!o)return;const i=_f((a,l)=>{const c=o.clientWidth;n(a,l),c<o.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return s.observe(o),RE(t,i),s}function Bl(t,e,n){n&&n.disconnect(),e==="resize"&&UE(t)}function VE(t,e,n){const r=t.canvas,o=_f(i=>{t.ctx!==null&&n(FE(i,t))},t);return NE(r,e,o),o}class WE extends vh{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(LE(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[Zi])return!1;const r=n[Zi].initial;["height","width"].forEach(i=>{const s=r[i];Pe(s)?n.removeAttribute(i):n.setAttribute(i,s)});const o=r.style||{};return Object.keys(o).forEach(i=>{n.style[i]=o[i]}),n.width=n.width,delete n[Zi],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const o=e.$proxies||(e.$proxies={}),s={attach:zE,detach:HE,resize:jE}[n]||VE;o[n]=s(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),o=r[n];if(!o)return;({attach:Bl,detach:Bl,resize:Bl}[n]||QE)(e,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,o){return Hk(e,n,r,o)}isAttached(e){const n=e&&wl(e);return!!(n&&n.isConnected)}}function YE(t){return!vl()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?OE:WE}let Tr=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return Ri(this.x)&&Ri(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const o={};return e.forEach(i=>{o[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),o}};function qE(t,e){const n=t.options.ticks,r=KE(t),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?XE(e):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return JE(e,c,i,s/o),c;const u=GE(i,e,o);if(s>0){let d,A;const f=s>1?Math.round((l-a)/(s-1)):null;for(es(e,c,u,Pe(f)?0:a-f,a),d=0,A=s-1;d<A;d++)es(e,c,u,i[d],i[d+1]);return es(e,c,u,l,Pe(f)?e.length:l+f),c}return es(e,c,u),c}function KE(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),o=t._maxLength/n;return Math.floor(Math.min(r,o))}function GE(t,e,n){const r=ZE(t),o=e.length/n;if(!r)return Math.max(o,1);const i=K2(r);for(let s=0,a=i.length-1;s<a;s++){const l=i[s];if(l>o)return l}return Math.max(o,1)}function XE(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}function JE(t,e,n,r){let o=0,i=n[0],s;for(r=Math.ceil(r),s=0;s<t.length;s++)s===i&&(e.push(t[s]),o++,i=n[o*r])}function es(t,e,n,r,o){const i=ye(r,0),s=Math.min(ye(o,t.length),t.length);let a=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(c=Math.max(i,0);c<s;c++)c===u&&(e.push(t[c]),a++,u=Math.round(i+a*n))}function ZE(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}const $E=t=>t==="left"?"right":t==="right"?"left":t,Sh=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,Ch=(t,e)=>Math.min(e||t,t);function Ph(t,e){const n=[],r=t.length/e,o=t.length;let i=0;for(;i<o;i+=r)n.push(t[Math.floor(i)]);return n}function eS(t,e,n){const r=t.ticks.length,o=Math.min(e,r-1),i=t._startPixel,s=t._endPixel,a=1e-6;let l=t.getPixelForTick(o),c;if(!(n&&(r===1?c=Math.max(l-i,s-l):e===0?c=(t.getPixelForTick(1)-l)/2:c=(l-t.getPixelForTick(o-1))/2,l+=o<e?c:-c,l<i-a||l>s+a)))return l}function tS(t,e){Ee(t,n=>{const r=n.gc,o=r.length/2;let i;if(o>e){for(i=0;i<o;++i)delete n.data[r[i]];r.splice(0,o)}})}function No(t){return t.drawTicks?t.tickLength:0}function Dh(t,e){if(!t.display)return 0;const n=et(t.font,e),r=Ot(t.padding);return(We(t.text)?t.text.length:1)*n.lineHeight+r.height}function nS(t,e){return Mr(t,{scale:e,type:"scale"})}function rS(t,e,n){return Mr(t,{tick:n,index:e,type:"tick"})}function oS(t,e,n){let r=dl(t);return(n&&e!=="right"||!n&&e==="right")&&(r=$E(r)),r}function iS(t,e,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=t,{chartArea:c,scales:u}=l;let d=0,A,f,h;const g=s-o,p=a-i;if(t.isHorizontal()){if(f=$e(r,i,a),be(n)){const v=Object.keys(n)[0],x=n[v];h=u[v].getPixelForValue(x)+g-e}else n==="center"?h=(c.bottom+c.top)/2+g-e:h=Sh(t,n,e);A=a-i}else{if(be(n)){const v=Object.keys(n)[0],x=n[v];f=u[v].getPixelForValue(x)-p+e}else n==="center"?f=(c.left+c.right)/2-p+e:f=Sh(t,n,e);h=$e(r,s,o),d=n==="left"?-wt:wt}return{titleX:f,titleY:h,maxWidth:A,rotation:d}}class Lr extends Tr{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:r,_suggestedMax:o}=this;return e=an(e,Number.POSITIVE_INFINITY),n=an(n,Number.NEGATIVE_INFINITY),r=an(r,Number.POSITIVE_INFINITY),o=an(o,Number.NEGATIVE_INFINITY),{min:an(e,r),max:an(n,o),minDefined:_t(e),maxDefined:_t(n)}}getMinMax(e){let{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds(),s;if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,e),o||(n=Math.min(n,s.min)),i||(r=Math.max(r,s.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:an(n,an(r,n)),max:an(r,an(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Te(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:o,grace:i,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ek(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Ph(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=qE(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Te(this.options.afterUpdate,[this])}beforeSetDimensions(){Te(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(){Te(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Te(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Te(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,o,i;for(r=0,o=e.length;r<o;r++)i=e[r],i.label=Te(n.callback,[i.value,r,e],this)}afterTickToLabelConversion(){Te(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Te(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=Ch(this.ticks.length,e.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let s=o,a,l,c;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),d=u.widest.width,A=u.highest.height,f=Ht(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/r:f/(r-1),d+6>a&&(a=f/(r-(e.offset?.5:1)),l=this.maxHeight-No(e.grid)-n.padding-Dh(e.title,this.chart.options.font),c=Math.sqrt(d*d+A*A),s=Z2(Math.min(Math.asin(Ht((u.highest.height+6)/a,-1,1)),Math.asin(Ht(l/c,-1,1))-Math.asin(Ht(A/c,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){Te(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Te(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:o,grid:i}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=Dh(o,n.options.font);if(a?(e.width=this.maxWidth,e.height=No(i)+l):(e.height=this.maxHeight,e.width=No(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:A}=this._getLabelSizes(),f=r.padding*2,h=ln(this.labelRotation),g=Math.cos(h),p=Math.sin(h);if(a){const v=r.mirror?0:p*d.width+g*A.height;e.height=Math.min(this.maxHeight,e.height+v+f)}else{const v=r.mirror?0:g*d.width+p*A.height;e.width=Math.min(this.maxWidth,e.width+v+f)}this._calculatePadding(c,u,p,g)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,r,o){const{ticks:{align:i,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let A=0,f=0;l?c?(A=o*e.width,f=r*n.height):(A=r*e.height,f=o*n.width):i==="start"?f=n.width:i==="end"?A=e.width:i!=="inner"&&(A=e.width/2,f=n.width/2),this.paddingLeft=Math.max((A-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=e.height/2;i==="start"?(u=0,d=e.height):i==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){Te(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,r;for(n=0,r=e.length;n<r;n++)Pe(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Ph(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:o,_longestTextCache:i}=this,s=[],a=[],l=Math.floor(n/Ch(n,r));let c=0,u=0,d,A,f,h,g,p,v,x,y,b,E;for(d=0;d<n;d+=l){if(h=e[d].label,g=this._resolveTickFontOptions(d),o.font=p=g.string,v=i[p]=i[p]||{data:{},gc:[]},x=g.lineHeight,y=b=0,!Pe(h)&&!We(h))y=zf(o,v.data,v.gc,y,h),b=x;else if(We(h))for(A=0,f=h.length;A<f;++A)E=h[A],!Pe(E)&&!We(E)&&(y=zf(o,v.data,v.gc,y,E),b+=x);s.push(y),a.push(b),c=Math.max(y,c),u=Math.max(b,u)}tS(i,n);const k=s.indexOf(c),P=a.indexOf(u),D=M=>({width:s[M]||0,height:a[M]||0});return{first:D(0),last:D(n-1),widest:D(k),highest:D(P),widths:s,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return tk(this._alignToPixels?ir(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const r=n[e];return r.$context||(r.$context=rS(this.getContext(),e,r))}return this.$context||(this.$context=nS(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=ln(this.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=this._getLabelSizes(),s=e.autoSkipPadding||0,a=i?i.widest.width+s:0,l=i?i.highest.height+s:0;return this.isHorizontal()?l*r>a*o?a/r:l/o:l*o<a*r?l/r:a/o}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:s,border:a}=o,l=i.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),A=No(i),f=[],h=a.setContext(this.getContext()),g=h.display?h.width:0,p=g/2,v=function(R){return ir(r,R,g)};let x,y,b,E,k,P,D,M,I,_,B,T;if(s==="top")x=v(this.bottom),P=this.bottom-A,M=x-p,_=v(e.top)+p,T=e.bottom;else if(s==="bottom")x=v(this.top),_=e.top,T=v(e.bottom)-p,P=x+p,M=this.top+A;else if(s==="left")x=v(this.right),k=this.right-A,D=x-p,I=v(e.left)+p,B=e.right;else if(s==="right")x=v(this.left),I=e.left,B=v(e.right)-p,k=x+p,D=this.left+A;else if(n==="x"){if(s==="center")x=v((e.top+e.bottom)/2+.5);else if(be(s)){const R=Object.keys(s)[0],Q=s[R];x=v(this.chart.scales[R].getPixelForValue(Q))}_=e.top,T=e.bottom,P=x+p,M=P+A}else if(n==="y"){if(s==="center")x=v((e.left+e.right)/2);else if(be(s)){const R=Object.keys(s)[0],Q=s[R];x=v(this.chart.scales[R].getPixelForValue(Q))}k=x-p,D=k-A,I=e.left,B=e.right}const z=ye(o.ticks.maxTicksLimit,d),O=Math.max(1,Math.ceil(d/z));for(y=0;y<d;y+=O){const R=this.getContext(y),Q=i.setContext(R),H=a.setContext(R),S=Q.lineWidth,K=Q.color,C=H.dash||[],V=H.dashOffset,Z=Q.tickWidth,J=Q.tickColor,ee=Q.tickBorderDash||[],ce=Q.tickBorderDashOffset;b=eS(this,y,l),b!==void 0&&(E=ir(r,b,S),c?k=D=I=B=E:P=M=_=T=E,f.push({tx1:k,ty1:P,tx2:D,ty2:M,x1:I,y1:_,x2:B,y2:T,width:S,color:K,borderDash:C,borderDashOffset:V,tickWidth:Z,tickColor:J,tickBorderDash:ee,tickBorderDashOffset:ce}))}return this._ticksLength=d,this._borderValue=x,f}_computeLabelItems(e){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=i,A=No(r.grid),f=A+u,h=d?-u:f,g=-ln(this.labelRotation),p=[];let v,x,y,b,E,k,P,D,M,I,_,B,T="middle";if(o==="top")k=this.bottom-h,P=this._getXAxisLabelAlignment();else if(o==="bottom")k=this.top+h,P=this._getXAxisLabelAlignment();else if(o==="left"){const O=this._getYAxisLabelAlignment(A);P=O.textAlign,E=O.x}else if(o==="right"){const O=this._getYAxisLabelAlignment(A);P=O.textAlign,E=O.x}else if(n==="x"){if(o==="center")k=(e.top+e.bottom)/2+f;else if(be(o)){const O=Object.keys(o)[0],R=o[O];k=this.chart.scales[O].getPixelForValue(R)+f}P=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(e.left+e.right)/2-f;else if(be(o)){const O=Object.keys(o)[0],R=o[O];E=this.chart.scales[O].getPixelForValue(R)}P=this._getYAxisLabelAlignment(A).textAlign}n==="y"&&(l==="start"?T="top":l==="end"&&(T="bottom"));const z=this._getLabelSizes();for(v=0,x=a.length;v<x;++v){y=a[v],b=y.label;const O=i.setContext(this.getContext(v));D=this.getPixelForTick(v)+i.labelOffset,M=this._resolveTickFontOptions(v),I=M.lineHeight,_=We(b)?b.length:1;const R=_/2,Q=O.color,H=O.textStrokeColor,S=O.textStrokeWidth;let K=P;s?(E=D,P==="inner"&&(v===x-1?K=this.options.reverse?"left":"right":v===0?K=this.options.reverse?"right":"left":K="center"),o==="top"?c==="near"||g!==0?B=-_*I+I/2:c==="center"?B=-z.highest.height/2-R*I+I:B=-z.highest.height+I/2:c==="near"||g!==0?B=I/2:c==="center"?B=z.highest.height/2-R*I:B=z.highest.height-_*I,d&&(B*=-1),g!==0&&!O.showLabelBackdrop&&(E+=I/2*Math.sin(g))):(k=D,B=(1-_)*I/2);let C;if(O.showLabelBackdrop){const V=Ot(O.backdropPadding),Z=z.heights[v],J=z.widths[v];let ee=B-V.top,ce=0-V.left;switch(T){case"middle":ee-=Z/2;break;case"bottom":ee-=Z;break}switch(P){case"center":ce-=J/2;break;case"right":ce-=J;break;case"inner":v===x-1?ce-=J:v>0&&(ce-=J/2);break}C={left:ce,top:ee,width:J+V.width,height:Z+V.height,color:O.backdropColor}}p.push({label:b,font:M,textOffset:B,options:{rotation:g,color:Q,strokeColor:H,strokeWidth:S,textAlign:K,textBaseline:T,translation:[E,k],backdrop:C}})}return p}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-ln(this.labelRotation))return e==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,s=this._getLabelSizes(),a=e+i,l=s.widest.width;let c,u;return n==="left"?o?(u=this.right+i,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?o?(u=this.left+i,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:r,top:o,width:i,height:s}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,o,i,s),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===e);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,s;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(i=0,s=o.length;i<s;++i){const l=o[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.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(){const{chart:e,ctx:n,options:{border:r,grid:o}}=this,i=r.setContext(this.getContext()),s=r.display?i.width:0;if(!s)return;const a=o.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,A;this.isHorizontal()?(c=ir(e,this.left,s)-s/2,u=ir(e,this.right,a)+a/2,d=A=l):(d=ir(e,this.top,s)-s/2,A=ir(e,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,A),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&pl(r,o);const i=this.getLabelItems(e);for(const s of i){const a=s.options,l=s.font,c=s.label,u=s.textOffset;Io(r,c,0,u,l,a)}o&&gl(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=et(r.font),s=Ot(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||be(n)?(l+=s.bottom,We(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:A}=iS(this,l,n,a);Io(e,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:A,textAlign:oS(a,n,o),textBaseline:"middle",translation:[c,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,r=ye(e.grid&&e.grid.z,-1),o=ye(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Lr.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];let i,s;for(i=0,s=n.length;i<s;++i){const a=n[i];a[r]===this.id&&(!e||a.type===e)&&o.push(a)}return o}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return et(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ts{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let r;lS(n)&&(r=this.register(n));const o=this.items,i=e.id,s=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in o||(o[i]=e,sS(e,s,r),this.override&&ze.override(e.id,e.overrides)),s}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,o=this.scope;r in n&&delete n[r],o&&r in ze[o]&&(delete ze[o][r],this.override&&delete or[r])}}function sS(t,e,n){const r=So(Object.create(null),[n?ze.get(n):{},ze.get(e),t.defaults]);ze.set(e,r),t.defaultRoutes&&aS(e,t.defaultRoutes),t.descriptors&&ze.describe(e,t.descriptors)}function aS(t,e){Object.keys(e).forEach(n=>{const r=n.split("."),o=r.pop(),i=[t].concat(r).join("."),s=e[n].split("."),a=s.pop(),l=s.join(".");ze.route(i,o,l,a)})}function lS(t){return"id"in t&&"defaults"in t}class cS{constructor(){this.controllers=new ts(Gi,"datasets",!0),this.elements=new ts(Tr,"elements"),this.plugins=new ts(Object,"plugins"),this.scales=new ts(Lr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,r){[...n].forEach(o=>{const i=r||this._getRegistryForType(o);r||i.isForType(o)||i===this.plugins&&o.id?this._exec(e,i,o):Ee(o,s=>{const a=r||this._getRegistryForType(s);this._exec(e,a,s)})})}_exec(e,n,r){const o=al(e);Te(r["before"+o],[],r),n[e](r),Te(r["after"+o],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const o=n.get(e);if(o===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return o}}var cn=new cS;class uS{constructor(){this._init=void 0}notify(e,n,r,o){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const i=o?this._descriptors(e).filter(o):this._descriptors(e),s=this._notify(i,e,n,r);return n==="afterDestroy"&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),s}_notify(e,n,r,o){o=o||{};for(const i of e){const s=i.plugin,a=s[r],l=[n,o,i.options];if(Te(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){Pe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const r=e&&e.config,o=ye(r.options&&r.options.plugins,{}),i=dS(r);return o===!1&&!n?[]:fS(e,i,o,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,o=(i,s)=>i.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(o(n,r),e,"stop"),this._notify(o(r,n),e,"start")}}function dS(t){const e={},n=[],r=Object.keys(cn.plugins.items);for(let i=0;i<r.length;i++)n.push(cn.getPlugin(r[i]));const o=t.plugins||[];for(let i=0;i<o.length;i++){const s=o[i];n.indexOf(s)===-1&&(n.push(s),e[s.id]=!0)}return{plugins:n,localIds:e}}function AS(t,e){return!e&&t===!1?null:t===!0?{}:t}function fS(t,{plugins:e,localIds:n},r,o){const i=[],s=t.getContext();for(const a of e){const l=a.id,c=AS(r[l],o);c!==null&&i.push({plugin:a,options:hS(t.config,{plugin:a,local:n[l]},c,s)})}return i}function hS(t,{plugin:e,local:n},r,o){const i=t.pluginScopeKeys(e),s=t.getOptionScopes(r,i);return n&&e.defaults&&s.push(e.defaults),t.createResolver(s,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Il(t,e){const n=ze.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function pS(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function gS(t,e){return t===e?"_index_":"_value_"}function Bh(t){if(t==="x"||t==="y"||t==="r")return t}function mS(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Ml(t,...e){if(Bh(t))return t;for(const n of e){const r=n.axis||mS(n.position)||t.length>1&&Bh(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Ih(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function bS(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return Ih(t,"x",n[0])||Ih(t,"y",n[0])}return{}}function yS(t,e){const n=or[t.type]||{scales:{}},r=e.scales||{},o=Il(t.type,e),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!be(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=Ml(s,a,bS(s,t),ze.scales[a.type]),c=gS(l,o),u=n.scales||{};i[s]=Co(Object.create(null),[{axis:l},a,u[l],u[c]])}),t.data.datasets.forEach(s=>{const a=s.type||t.type,l=s.indexAxis||Il(a,e),u=(or[a]||{}).scales||{};Object.keys(u).forEach(d=>{const A=pS(d,l),f=s[A+"AxisID"]||A;i[f]=i[f]||Object.create(null),Co(i[f],[{axis:A},r[f],u[d]])})}),Object.keys(i).forEach(s=>{const a=i[s];Co(a,[ze.scales[a.type],ze.scale])}),i}function Mh(t){const e=t.options||(t.options={});e.plugins=ye(e.plugins,{}),e.scales=yS(t,e)}function _h(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function vS(t){return t=t||{},t.data=_h(t.data),Mh(t),t}const Oh=new Map,Th=new Set;function ns(t,e){let n=Oh.get(t);return n||(n=e(),Oh.set(t,n),Th.add(n)),n}const Qo=(t,e,n)=>{const r=zn(e,n);r!==void 0&&t.add(r)};let wS=class{constructor(e){this._config=vS(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=_h(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Mh(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ns(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return ns(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return ns(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return ns(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let o=r.get(e);return(!o||n)&&(o=new Map,r.set(e,o)),o}getOptionScopes(e,n,r){const{options:o,type:i}=this,s=this._cachedScopes(e,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{e&&(l.add(e),u.forEach(d=>Qo(l,e,d))),u.forEach(d=>Qo(l,o,d)),u.forEach(d=>Qo(l,or[i]||{},d)),u.forEach(d=>Qo(l,ze,d)),u.forEach(d=>Qo(l,fl,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Th.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,or[n]||{},ze.datasets[n]||{},{type:n},ze,fl]}resolveNamedOptions(e,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=Lh(this._resolverCache,e,o);let l=s;if(kS(s,n)){i.$shared=!1,r=Hn(r)?r():r;const c=this.createResolver(e,r,a);l=_r(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(e,n,r=[""],o){const{resolver:i}=Lh(this._resolverCache,e,r);return be(n)?_r(i,n,void 0,o):i}};function Lh(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const o=n.join();let i=r.get(o);return i||(i={resolver:ml(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const xS=t=>be(t)&&Object.getOwnPropertyNames(t).some(e=>Hn(t[e]));function kS(t,e){const{isScriptable:n,isIndexable:r}=Yf(t);for(const o of e){const i=n(o),s=r(o),a=(s||i)&&t[o];if(i&&(Hn(a)||xS(a))||s&&We(a))return!0}return!1}var ES="4.5.1";const SS=["top","bottom","left","right","chartArea"];function Nh(t,e){return t==="top"||t==="bottom"||SS.indexOf(t)===-1&&e==="x"}function Qh(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function Fh(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Te(n&&n.onComplete,[t],e)}function CS(t){const e=t.chart,n=e.options.animation;Te(n&&n.onProgress,[t],e)}function zh(t){return vl()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const rs={},Hh=t=>{const e=zh(t);return Object.values(rs).filter(n=>n.canvas===e).pop()};function PS(t,e,n){const r=Object.keys(t);for(const o of r){const i=+o;if(i>=e){const s=t[o];delete t[o],(n>0||i>e)&&(t[i+n]=s)}}}function DS(t,e,n,r){return!n||t.type==="mouseout"?null:r?e:t}let _l=class{static defaults=ze;static instances=rs;static overrides=or;static registry=cn;static version=ES;static getChart=Hh;static register(...e){cn.add(...e),Rh()}static unregister(...e){cn.remove(...e),Rh()}constructor(e,n){const r=this.config=new wS(n),o=zh(e),i=Hh(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||YE(o)),this.platform.updateConfig(r);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=H2(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,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 uS,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ik(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],rs[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}kn.listen(this,"complete",Fh),kn.listen(this,"progress",CS),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return Pe(e)?n&&i?i:o?r/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 cn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Zf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Hf(this.canvas,this.ctx),this}stop(){return kn.stop(this),this}resize(e,n){kn.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,o=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(o,e,n,i),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Zf(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Te(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ee(n,(r,o)=>{r.id=o})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,o=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let i=[];n&&(i=i.concat(Object.keys(n).map(s=>{const a=n[s],l=Ml(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ee(i,s=>{const a=s.options,l=a.id,c=Ml(l,a),u=ye(a.type,s.dtype);(a.position===void 0||Nh(a.position,c)!==Nh(s.dposition))&&(a.position=s.dposition),o[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const A=cn.getScale(u);d=new A({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,e)}),Ee(o,(s,a)=>{s||delete r[a]}),Ee(r,s=>{Tt.configure(this,s,s.options),Tt.addBox(this,s)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((o,i)=>o.index-i.index),r>n){for(let o=n;o<r;++o)this._destroyDatasetMeta(o);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(Qh("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,o)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,o;for(this._removeUnreferencedMetasets(),r=0,o=n.length;r<o;r++){const i=n[r];let s=this.getDatasetMeta(r);const a=i.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=i.indexAxis||Il(a,this.options),s.order=i.order||0,s.index=r,s.label=""+i.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=cn.getController(a),{datasetElementType:c,dataElementType:u}=ze.datasets[a];Object.assign(l,{dataElementType:cn.getElement(u),datasetElementType:c&&cn.getElement(c)}),s.controller=new l(this,r),e.push(s.controller)}}return this._updateMetasets(),e}_resetElements(){Ee(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),A=!o&&i.indexOf(d)===-1;d.buildOrUpdateElements(A),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||Ee(i,c=>{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Qh("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ee(this.scales,e=>{Tt.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!kf(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:o,count:i}of n){const s=r==="_removeElements"?-i:i;PS(e,o,s)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(e.filter(s=>s[0]===i).map((s,a)=>a+","+s.splice(1).join(","))),o=r(0);for(let i=1;i<n;i++)if(!kf(o,r(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Tt.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ee(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Hn(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),o={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(r.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(kn.has(this)?this.attached&&!kn.running(this)&&kn.start(this):(this.draw(),Fh({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,o)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,r=[];let o,i;for(o=0,i=n.length;o<i;++o){const s=n[o];(!e||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,r={meta:e,index:e.index,cancelable:!0},o=Wk(this,e);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(o&&pl(n,o),e.controller.draw(),o&&gl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return jf(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,o){const i=SE.modes[n];return typeof i=="function"?i(this,e,r,o):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let o=r.filter(i=>i&&i._dataset===n).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},r.push(o)),o}getContext(){return this.$context||(this.$context=Mr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const o=r?"show":"hide",i=this.getDatasetMeta(e),s=i.controller._resolveAnimations(void 0,o);Po(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),s.update(i,{visible:r}),this.update(a=>a.datasetIndex===e?o:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),kn.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Hf(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete rs[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,r=(i,s)=>{n.addEventListener(this,i,s),e[i]=s},o=(i,s,a)=>{i.offsetX=s,i.offsetY=a,this._eventHandler(i)};Ee(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),e[l]=c},o=(l,c)=>{e[l]&&(n.removeEventListener(this,l,c),delete e[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{o("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",s)};s=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Ee(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Ee(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const o=r?"set":"remove";let i,s,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){s=e[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:i,index:s})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[s],index:s}});!Qi(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const o=this.options.hover,i=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=i(n,e),a=r?e:i(e,n);s.length&&this.updateHoverStyle(s,o.mode,!1),a.length&&o.mode&&this.updateHoverStyle(a,o.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},o=s=>(s.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:o=[],options:i}=this,s=n,a=this._getActiveElements(e,o,r,s),l=Y2(e),c=DS(e,this._lastEvent,r,l);r&&(this._lastEvent=null,Te(i.onHover,[e,a,this],this),l&&Te(i.onClick,[e,a,this],this));const u=!Qi(a,o);return(u||n)&&(this._active=a,this._updateHoverStyles(a,o,n)),this._lastEvent=c,u}_getActiveElements(e,n,r,o){if(e.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,o)}};function Rh(){return Ee(_l.instances,t=>t._plugins.invalidate())}function Uh(t,e){const{x:n,y:r,base:o,width:i,height:s}=t.getProps(["x","y","base","width","height"],e);let a,l,c,u,d;return t.horizontal?(d=s/2,a=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,a=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:a,top:c,right:l,bottom:u}}function jn(t,e,n,r){return t?0:Ht(e,n,r)}function BS(t,e,n){const r=t.options.borderWidth,o=t.borderSkipped,i=Wf(r);return{t:jn(o.top,i.top,0,n),r:jn(o.right,i.right,0,e),b:jn(o.bottom,i.bottom,0,n),l:jn(o.left,i.left,0,e)}}function IS(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,i=Ir(o),s=Math.min(e,n),a=t.borderSkipped,l=r||be(o);return{topLeft:jn(!l||a.top||a.left,i.topLeft,0,s),topRight:jn(!l||a.top||a.right,i.topRight,0,s),bottomLeft:jn(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:jn(!l||a.bottom||a.right,i.bottomRight,0,s)}}function MS(t){const e=Uh(t),n=e.right-e.left,r=e.bottom-e.top,o=BS(t,n/2,r/2),i=IS(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:i},inner:{x:e.left+o.l,y:e.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function Ol(t,e,n,r){const o=e===null,i=n===null,a=t&&!(o&&i)&&Uh(t,r);return a&&(o||Br(e,a.left,a.right))&&(i||Br(n,a.top,a.bottom))}function _S(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function OS(t,e){t.rect(e.x,e.y,e.w,e.h)}function Tl(t,e,n={}){const r=t.x!==n.x?-e:0,o=t.y!==n.y?-e:0,i=(t.x+t.w!==n.x+n.w?e:0)-r,s=(t.y+t.h!==n.y+n.h?e:0)-o;return{x:t.x+r,y:t.y+o,w:t.w+i,h:t.h+s,radius:t.radius}}class TS extends Tr{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:r,backgroundColor:o}}=this,{inner:i,outer:s}=MS(this),a=_S(s.radius)?Vi:OS;e.save(),(s.w!==i.w||s.h!==i.h)&&(e.beginPath(),a(e,Tl(s,n,i)),e.clip(),a(e,Tl(i,-n,s)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),a(e,Tl(i,n)),e.fillStyle=o,e.fill(),e.restore()}inRange(e,n,r){return Ol(this,e,n,r)}inXRange(e,n){return Ol(this,e,null,n)}inYRange(e,n){return Ol(this,null,e,n)}getCenterPoint(e){const{x:n,y:r,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(n+o)/2:n,y:i?r:(r+o)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}const Ll=["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)"],jh=Ll.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Vh(t){return Ll[t%Ll.length]}function Wh(t){return jh[t%jh.length]}function LS(t,e){return t.borderColor=Vh(e),t.backgroundColor=Wh(e),++e}function NS(t,e){return t.backgroundColor=t.data.map(()=>Vh(e++)),e}function QS(t,e){return t.backgroundColor=t.data.map(()=>Wh(e++)),e}function FS(t){let e=0;return(n,r)=>{const o=t.getDatasetMeta(r).controller;o instanceof bE?e=NS(n,e):o instanceof yE?e=QS(n,e):o&&(e=LS(n,e))}}function Yh(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function zS(t){return t&&(t.borderColor||t.backgroundColor)}function HS(){return ze.borderColor!=="rgba(0,0,0,0.1)"||ze.backgroundColor!=="rgba(0,0,0,0.1)"}var RS={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=t.config,{elements:i}=o,s=Yh(r)||zS(o)||i&&Yh(i)||HS();if(!n.forceOverride&&s)return;const a=FS(t);r.forEach(a)}};const qh=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},US=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Kh extends Tr{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n,r){this.maxWidth=e,this.maxHeight=n,this._margins=r,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(){const e=this.options.labels||{};let n=Te(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(r=>e.filter(r,this.chart.data))),e.sort&&(n=n.sort((r,o)=>e.sort(r,o,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const r=e.labels,o=et(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=qh(r,i);let c,u;n.font=o.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,i,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,o,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,r,o){const{ctx:i,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=o+a;let d=e;i.textAlign="left",i.textBaseline="middle";let A=-1,f=-u;return this.legendItems.forEach((h,g)=>{const p=r+n/2+i.measureText(h.text).width;(g===0||c[c.length-1]+p+2*a>s)&&(d+=u,c[c.length-(g>0?0:1)]=0,f+=u,A++),l[g]={left:0,top:f,row:A,width:p,height:o},c[c.length-1]+=p+a}),d}_fitCols(e,n,r,o){const{ctx:i,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-e;let d=a,A=0,f=0,h=0,g=0;return this.legendItems.forEach((p,v)=>{const{itemWidth:x,itemHeight:y}=jS(r,n,i,p,o);v>0&&f+y+2*a>u&&(d+=A+a,c.push({width:A,height:f}),h+=A+a,g++,A=f=0),l[v]={left:h,top:f,col:g,width:x,height:y},A=Math.max(A,x),f+=y+a}),d+=A,c.push({width:A,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Or(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=$e(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=$e(r,this.left+o,this.right-this.lineWidths[a])),c.top+=this.top+e+o,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+o}else{let a=0,l=$e(r,this.top+e+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=$e(r,this.top+e+o,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+o,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;pl(e,this),this._draw(),gl(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=e,a=ze.color,l=Or(e.rtl,this.left,this.width),c=et(s.font),{padding:u}=s,d=c.size,A=d/2;let f;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:h,boxHeight:g,itemHeight:p}=qh(s,d),v=function(k,P,D){if(isNaN(h)||h<=0||isNaN(g)||g<0)return;o.save();const M=ye(D.lineWidth,1);if(o.fillStyle=ye(D.fillStyle,a),o.lineCap=ye(D.lineCap,"butt"),o.lineDashOffset=ye(D.lineDashOffset,0),o.lineJoin=ye(D.lineJoin,"miter"),o.lineWidth=M,o.strokeStyle=ye(D.strokeStyle,a),o.setLineDash(ye(D.lineDash,[])),s.usePointStyle){const I={radius:g*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:M},_=l.xPlus(k,h/2),B=P+A;Uf(o,I,_,B,s.pointStyleWidth&&h)}else{const I=P+Math.max((d-g)/2,0),_=l.leftForLtr(k,h),B=Ir(D.borderRadius);o.beginPath(),Object.values(B).some(T=>T!==0)?Vi(o,{x:_,y:I,w:h,h:g,radius:B}):o.rect(_,I,h,g),o.fill(),M!==0&&o.stroke()}o.restore()},x=function(k,P,D){Io(o,D.text,k,P+p/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},y=this.isHorizontal(),b=this._computeTitleHeight();y?f={x:$e(i,this.left+u,this.right-r[0]),y:this.top+u+b,line:0}:f={x:this.left+u,y:$e(i,this.top+b+u,this.bottom-n[0].height),line:0},eh(this.ctx,e.textDirection);const E=p+u;this.legendItems.forEach((k,P)=>{o.strokeStyle=k.fontColor,o.fillStyle=k.fontColor;const D=o.measureText(k.text).width,M=l.textAlign(k.textAlign||(k.textAlign=s.textAlign)),I=h+A+D;let _=f.x,B=f.y;l.setWidth(this.width),y?P>0&&_+I+u>this.right&&(B=f.y+=E,f.line++,_=f.x=$e(i,this.left+u,this.right-r[f.line])):P>0&&B+E>this.bottom&&(_=f.x=_+n[f.line].width+u,f.line++,B=f.y=$e(i,this.top+b+u,this.bottom-n[f.line].height));const T=l.x(_);if(v(T,B,k),_=sk(M,_+h+A,y?_+I:this.right,e.rtl),x(l.x(_),B,k),y)f.x+=I+u;else if(typeof k.text!="string"){const z=c.lineHeight;f.y+=Gh(k,z)+u}else f.y+=E}),th(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,r=et(n.font),o=Ot(n.padding);if(!n.display)return;const i=Or(e.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=o.top+l;let u,d=this.left,A=this.width;if(this.isHorizontal())A=Math.max(...this.lineWidths),u=this.top+c,d=$e(e.align,d,this.right-A);else{const h=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);u=c+$e(e.align,this.top,this.bottom-h-e.labels.padding-this._computeTitleHeight())}const f=$e(a,d,d+A);s.textAlign=i.textAlign(dl(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Io(s,n.text,f,u,r)}_computeTitleHeight(){const e=this.options.title,n=et(e.font),r=Ot(e.padding);return e.display?n.lineHeight+r.height:0}_getLegendItemAt(e,n){let r,o,i;if(Br(e,this.left,this.right)&&Br(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Br(e,o.left,o.left+o.width)&&Br(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(e){const n=this.options;if(!YS(e.type,n))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const o=this._hoveredItem,i=US(o,r);o&&!i&&Te(n.onLeave,[e,o,this],this),this._hoveredItem=r,r&&!i&&Te(n.onHover,[e,r,this],this)}else r&&Te(n.onClick,[e,r,this],this)}}function jS(t,e,n,r,o){const i=VS(r,t,e,n),s=WS(o,r,e.lineHeight);return{itemWidth:i,itemHeight:s}}function VS(t,e,n,r){let o=t.text;return o&&typeof o!="string"&&(o=o.reduce((i,s)=>i.length>s.length?i:s)),e+n.size/2+r.measureText(o).width}function WS(t,e,n){let r=t;return typeof e.text!="string"&&(r=Gh(e,n)),r}function Gh(t,e){const n=t.text?t.text.length:0;return e*n}function YS(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var qS={id:"legend",_element:Kh,start(t,e,n){const r=t.legend=new Kh({ctx:t.ctx,options:n,chart:t});Tt.configure(t,r,n),Tt.addBox(t,r)},stop(t){Tt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;Tt.configure(t,r,n),r.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const r=e.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),e.hidden=!0):(o.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:s,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ot(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:o||c.textAlign,borderRadius:s&&(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)}}};class Xh extends Tr{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const o=We(r.text)?r.text.length:1;this._padding=Ot(r.padding);const i=o*et(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:r,bottom:o,right:i,options:s}=this,a=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=$e(a,r,i),d=n+e,c=i-r):(s.position==="left"?(u=r+e,d=$e(a,o,n),l=Ye*-.5):(u=i-e,d=$e(a,n,o),l=Ye*.5),c=o-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const r=et(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);Io(e,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:dl(n.align),textBaseline:"middle",translation:[s,a]})}}function KS(t,e){const n=new Xh({ctx:t.ctx,options:e,chart:t});Tt.configure(t,n,e),Tt.addBox(t,n),t.titleBlock=n}var GS={id:"title",_element:Xh,start(t,e,n){KS(t,n)},stop(t){const e=t.titleBlock;Tt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;Tt.configure(t,r,n),r.options=n},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}};const Fo={average(t){if(!t.length)return!1;let e,n,r=new Set,o=0,i=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),o+=l.y,++i}}return i===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:o/i}},nearest(t,e){if(!t.length)return!1;let n=e.x,r=e.y,o=Number.POSITIVE_INFINITY,i,s,a;for(i=0,s=t.length;i<s;++i){const l=t[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=ek(e,c);u<o&&(o=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function un(t,e){return e&&(We(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function En(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
311
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=o.reduce(function(l,c){var u=c&&b1(c,r);return u&&l.push(u),l},[]);return bo(t)?a[0]:a}vo.defaultProps=yt,vo.setDefaultProps=h1,vo.currentInput=sn,Object.assign({},bA,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),vo.setDefaultProps({render:ef});function y1({color:t="var(--contrast-6)",icon:e="info-circle-fill",tooltip:n}){const r=w.useRef(null);return w.useLayoutEffect(()=>{r.current&&vo(r.current,{content:n,theme:"access",appendTo:r.current.parentElement})},[r.current]),m.jsx("button",{className:"info-tip",style:{color:t},ref:r,children:m.jsx(be,{name:e})})}function v1({infoGroupId:t}){const e=rt(`https://support.access-ci.org/api/1.0/kb/${t}`);if(!(!e||e.error||!e.length))return m.jsx(nn,{title:"Documentation",icon:"book",children:m.jsx("ul",{children:e.map(({title:n,description:r,link:o})=>m.jsxs("li",{children:[m.jsx("a",{href:ic(o),children:n}),r?m.jsx(y1,{tooltip:ms(r)}):null]},n))})})}function w1({children:t,icon:e="megaphone-fill"}){return m.jsxs("div",{className:"alert",children:[e?m.jsx(be,{name:e}):null,m.jsx("div",{className:"alert-body",children:t})]})}function x1({children:t}){const[e,n]=w.useState(!1);return m.jsxs("div",{className:`expand-text ${e?"expanded":"contracted"}`,children:[t,m.jsxs("button",{className:"expand-button",onClick:()=>n(!e),children:[m.jsx(be,{name:`caret-${e?"up":"left"}-fill`}),e?"Less":"More"]})]})}function k1({date__end:t,date__start:e,description:n,location:r,registration:o,speaker:i,title:s}){const a=o,l=a?m.jsx("a",{href:a,children:s}):s,c=[];let u=null;const d=e,A=t;if(d){const f=new Date(d),h=new Date(A||d),[g,p]=[f,h].map(k=>k.toLocaleString("en-US",{dateStyle:"long"})),[v,x]=[f,h].map(k=>k.toLocaleString("en-US",{timeStyle:"short"})),y=f.toLocaleTimeString("en-US",{timeZoneName:"short"}).split(" ")[2],b=[`${g},`,v];(x!=v||p!=g)&&(b.push("-"),p!=g&&b.push(`${p},`),b.push(x)),b.push(`(${y})`),c.push(m.jsx(be,{name:"calendar"}),b.join(" ")),i&&c.push(m.jsx(be,{name:"people-fill"}),i),r&&c.push(m.jsx(be,{name:"geo-alt-fill"}),r);const E=f.toLocaleString("en-US",{dateStyle:"medium"}).split(",")[0].split(" ").map(k=>m.jsx("span",{children:k},k));u=a?m.jsx("a",{href:a,className:"event-icon",children:E}):m.jsx("div",{className:"event-icon",children:E})}return m.jsxs("div",{className:"event",children:[u,m.jsxs("div",{className:"event-details",children:[m.jsx("h3",{children:l}),c.length?m.jsx("div",{className:"event-metadata",children:c}):null,n?m.jsx(x1,{children:m.jsx("div",{children:bs(n)})}):null]})]})}function E1({infoGroupId:t}){const e=Ur(t),n=rt("https://operations-api.access-ci.org/wh2/news/v1/affiliation/access-ci.org/current_outages/"),r=rt("https://operations-api.access-ci.org/wh2/news/v1/affiliation/access-ci.org/future_outages/"),o=rt(`https://support.access-ci.org/api/1.1/events/ag/${t}`),i=gs([e,n,r],(a,l,c)=>[...l.results,...c.results].filter(u=>u.AffectedResources.some(d=>a.infoResourceIds.includes(d.ResourceID))),[]),s=gs([o],a=>a.filter(l=>new Date(l.date__start)>=new Date),[]);if(!(!i.length&&!s.length))return m.jsxs(nn,{title:"Announcements and Events",icon:"calendar3",children:[i.map(({Subject:a,Content:l})=>m.jsxs(w1,{children:[a," ",m.jsx("a",{href:"https://operations.access-ci.org/infrastructure_news_view",children:"Learn more."})]},a)),s.map(a=>m.jsx(k1,{...a},a.title))]})}function S1({children:t,headingLevel:e=2,title:n}){const[r,o]=w.useState(!1),i=`h${e}`;return m.jsxs("div",{className:"accordion",children:[m.jsx(i,{className:"accordion-heading",children:m.jsxs("button",{"aria-expanded":r,onClick:()=>o(!r),children:[n,m.jsx(be,{name:r?"caret-up-fill":"caret-down-fill"})]})}),m.jsx("div",{className:"accordion-content",style:{display:r?"block":"none"},children:t})]})}function C1({resource_descriptive_name:t,resource_description:e,compute:n,storage:r}){const o=(n||r||{}).recommended_use;return m.jsxs(S1,{title:t,children:[e?bs(e):null,o?m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:"Recommended Use"}),bs(o)]}):null]})}function P1({infoGroupId:t}){const e=Ur(t),n=rt(e?e.infoResourceIds.map(l=>`https://operations-api.access-ci.org/wh2/cider/v1/info_resourceid/${l}/?format=json`):null,{defaultValue:[]}),r=n.filter(l=>l.results&&l.results.cider_type=="Compute").map(l=>({...l.results.compute,key:l.results.info_resourceid,name:l.results.resource_descriptive_name,format:(c,u)=>{const d=l.results.compute[u.attr];return u.format&&d?u.format(d,u):d||m.jsx(m.Fragment,{children:"—"})}})),o=n.length?[{name:"Nodes",attr:"node_count",format:l=>l.toLocaleString("en-us")},{name:"CPU Type",attr:"cpu_type"},{name:"CPU Speed",attr:"cpu_speed_ghz",format:l=>`${l} Ghz`},{name:"CPU Cores per Node",attr:"cpu_count_per_node"},{name:"RAM per CPU Core",attr:"memory_per_cpu_gb",format:l=>`${l.toLocaleString("en-us")} GB`},{name:"GPU",attr:"gpu_description"},{name:"Local Storage per Node",attr:"local_storage_per_node_gb",format:l=>`${l.toLocaleString("en-us")} GB`},{name:"Network Interconnect",attr:"interconnect"},{name:"Operating System",attr:"operating_system"},{name:"Batch System",attr:"batch_system"}].filter(l=>r.some(c=>c[l.attr])):[],i={key:"name",name:"Attribute",format:l=>m.jsx("strong",{children:l})},s=r.length>0&&o.length>0,a={compute:[],storage:[],other:[]};for(let{results:l}of n)(a[l.cider_type.toLowerCase()]||a.other).push(m.jsx(C1,{...l},l.resource_descriptive_name));return m.jsxs(m.Fragment,{children:[s||a.compute.length>0?m.jsxs(nn,{title:"Compute Resources",icon:"cpu-fill",children:[a.compute,s&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:"Specifications"}),m.jsx(yi,{columns:[i,...r],rows:o,maxHeight:null})]})]}):null,a.storage.length>0?m.jsx(nn,{title:"Storage Resources",icon:"hdd-fill",children:a.storage}):null,a.other.length>0?m.jsx(nn,{title:"Other Resources",icon:"stars",children:a.other}):null]})}function tf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function nf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tf(Object(n),!0).forEach(function(r){B1(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tf(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ci(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ci=function(e){return typeof e}:Ci=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ci(t)}function Pi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D1(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Di(t,e,n){return e&&D1(t.prototype,e),t}function B1(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ja(t,e)}function Pr(t){return Pr=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Pr(t)}function Ja(t,e){return Ja=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},Ja(t,e)}function M1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _1(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function O1(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _1(t)}function T1(t){var e=M1();return function(){var r=Pr(t),o;if(e){var i=Pr(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return O1(this,o)}}function L1(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=Pr(t),t!==null););return t}function Bi(){return typeof Reflect<"u"&&Reflect.get?Bi=Reflect.get:Bi=function(e,n,r){var o=L1(e,n);if(o){var i=Object.getOwnPropertyDescriptor(o,n);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Bi.apply(this,arguments)}var N1={type:"slider",startAt:0,perView:1,focusAt:0,gap:10,autoplay:!1,hoverpause:!0,keyboard:!0,bound:!1,swipeThreshold:80,dragThreshold:120,perSwipe:"",touchRatio:.5,touchAngle:45,animationDuration:400,rewind:!0,rewindDuration:800,animationTimingFunc:"cubic-bezier(.165, .840, .440, 1)",waitForTransition:!0,throttle:10,direction:"ltr",peek:0,cloningRatio:1,breakpoints:{},classes:{swipeable:"glide--swipeable",dragging:"glide--dragging",direction:{ltr:"glide--ltr",rtl:"glide--rtl"},type:{slider:"glide--slider",carousel:"glide--carousel"},slide:{clone:"glide__slide--clone",active:"glide__slide--active"},arrow:{disabled:"glide__arrow--disabled"},nav:{active:"glide__bullet--active"}}};function Nn(t){console.error("[Glide warn]: ".concat(t))}function zt(t){return parseInt(t)}function Za(t){return typeof t=="string"}function wo(t){var e=Ci(t);return e==="function"||e==="object"&&!!t}function Ii(t){return typeof t=="function"}function Q1(t){return typeof t>"u"}function $a(t){return t.constructor===Array}function F1(t,e,n){var r={};for(var o in e)Ii(e[o])?r[o]=e[o](t,r,n):Nn("Extension must be a function");for(var i in r)Ii(r[i].mount)&&r[i].mount();return r}function He(t,e,n){Object.defineProperty(t,e,n)}function rf(t,e){var n=Object.assign({},t,e);if(e.hasOwnProperty("classes")){n.classes=Object.assign({},t.classes,e.classes);var r=["direction","type","slide","arrow","nav"];r.forEach(function(o){e.classes.hasOwnProperty(o)&&(n.classes[o]=nf(nf({},t.classes[o]),e.classes[o]))})}return e.hasOwnProperty("breakpoints")&&(n.breakpoints=Object.assign({},t.breakpoints,e.breakpoints)),n}var z1=(function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pi(this,t),this.events=e,this.hop=e.hasOwnProperty}return Di(t,[{key:"on",value:function(n,r){if($a(n)){for(var o=0;o<n.length;o++)this.on(n[o],r);return}this.hop.call(this.events,n)||(this.events[n]=[]);var i=this.events[n].push(r)-1;return{remove:function(){delete this.events[n][i]}}}},{key:"emit",value:function(n,r){if($a(n)){for(var o=0;o<n.length;o++)this.emit(n[o],r);return}this.hop.call(this.events,n)&&this.events[n].forEach(function(i){i(r||{})})}}]),t})(),H1=(function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Pi(this,t),this._c={},this._t=[],this._e=new z1,this.disabled=!1,this.selector=e,this.settings=rf(N1,n),this.index=this.settings.startAt}return Di(t,[{key:"mount",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._e.emit("mount.before"),wo(n)?this._c=F1(this,n,this._e):Nn("You need to provide a object on `mount()`"),this._e.emit("mount.after"),this}},{key:"mutate",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return $a(n)?this._t=n:Nn("You need to provide a array on `mutate()`"),this}},{key:"update",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.settings=rf(this.settings,n),n.hasOwnProperty("startAt")&&(this.index=n.startAt),this._e.emit("update"),this}},{key:"go",value:function(n){return this._c.Run.make(n),this}},{key:"move",value:function(n){return this._c.Transition.disable(),this._c.Move.make(n),this}},{key:"destroy",value:function(){return this._e.emit("destroy"),this}},{key:"play",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n&&(this.settings.autoplay=n),this._e.emit("play"),this}},{key:"pause",value:function(){return this._e.emit("pause"),this}},{key:"disable",value:function(){return this.disabled=!0,this}},{key:"enable",value:function(){return this.disabled=!1,this}},{key:"on",value:function(n,r){return this._e.on(n,r),this}},{key:"isType",value:function(n){return this.settings.type===n}},{key:"settings",get:function(){return this._o},set:function(n){wo(n)?this._o=n:Nn("Options must be an `object` instance.")}},{key:"index",get:function(){return this._i},set:function(n){this._i=zt(n)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(n){this._d=!!n}}]),t})();function R1(t,e,n){var r={mount:function(){this._o=!1},make:function(c){var u=this;t.disabled||(!t.settings.waitForTransition||t.disable(),this.move=c,n.emit("run.before",this.move),this.calculate(),n.emit("run",this.move),e.Transition.after(function(){u.isStart()&&n.emit("run.start",u.move),u.isEnd()&&n.emit("run.end",u.move),u.isOffset()&&(u._o=!1,n.emit("run.offset",u.move)),n.emit("run.after",u.move),t.enable()}))},calculate:function(){var c=this.move,u=this.length,d=c.steps,A=c.direction,f=1;if(A==="="){if(t.settings.bound&&zt(d)>u){t.index=u;return}t.index=d;return}if(A===">"&&d===">"){t.index=u;return}if(A==="<"&&d==="<"){t.index=0;return}if(A==="|"&&(f=t.settings.perView||1),A===">"||A==="|"&&d===">"){var h=o(f);h>u&&(this._o=!0),t.index=i(h,f);return}if(A==="<"||A==="|"&&d==="<"){var g=s(f);g<0&&(this._o=!0),t.index=a(g,f);return}Nn("Invalid direction pattern [".concat(A).concat(d,"] has been used"))},isStart:function(){return t.index<=0},isEnd:function(){return t.index>=this.length},isOffset:function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return c?this._o?c==="|>"?this.move.direction==="|"&&this.move.steps===">":c==="|<"?this.move.direction==="|"&&this.move.steps==="<":this.move.direction===c:!1:this._o},isBound:function(){return t.isType("slider")&&t.settings.focusAt!=="center"&&t.settings.bound}};function o(l){var c=t.index;return t.isType("carousel")?c+l:c+(l-c%l)}function i(l,c){var u=r.length;return l<=u?l:t.isType("carousel")?l-(u+1):t.settings.rewind?r.isBound()&&!r.isEnd()?u:0:r.isBound()?u:Math.floor(u/c)*c}function s(l){var c=t.index;if(t.isType("carousel"))return c-l;var u=Math.ceil(c/l);return(u-1)*l}function a(l,c){var u=r.length;return l>=0?l:t.isType("carousel")?l+(u+1):t.settings.rewind?r.isBound()&&r.isStart()?u:Math.floor(u/c)*c:0}return He(r,"move",{get:function(){return this._m},set:function(c){var u=c.substr(1);this._m={direction:c.substr(0,1),steps:u?zt(u)?zt(u):u:0}}}),He(r,"length",{get:function(){var c=t.settings,u=e.Html.slides.length;return this.isBound()?u-1-(zt(c.perView)-1)+zt(c.focusAt):u-1}}),He(r,"offset",{get:function(){return this._o}}),r}function of(){return new Date().getTime()}function sf(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,o,i,s,a=0,l=function(){a=n.leading===!1?0:of(),r=null,s=t.apply(o,i),r||(o=i=null)},c=function(){var d=of();!a&&n.leading===!1&&(a=d);var A=e-(d-a);return o=this,i=arguments,A<=0||A>e?(r&&(clearTimeout(r),r=null),a=d,s=t.apply(o,i),r||(o=i=null)):!r&&n.trailing!==!1&&(r=setTimeout(l,A)),s};return c.cancel=function(){clearTimeout(r),a=0,r=o=i=null},c}var Mi={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function U1(t,e,n){var r={apply:function(i){for(var s=0,a=i.length;s<a;s++){var l=i[s].style,c=e.Direction.value;s!==0?l[Mi[c][0]]="".concat(this.value/2,"px"):l[Mi[c][0]]="",s!==i.length-1?l[Mi[c][1]]="".concat(this.value/2,"px"):l[Mi[c][1]]=""}},remove:function(i){for(var s=0,a=i.length;s<a;s++){var l=i[s].style;l.marginLeft="",l.marginRight=""}}};return He(r,"value",{get:function(){return zt(t.settings.gap)}}),He(r,"grow",{get:function(){return r.value*e.Sizes.length}}),He(r,"reductor",{get:function(){var i=t.settings.perView;return r.value*(i-1)/i}}),n.on(["build.after","update"],sf(function(){r.apply(e.Html.wrapper.children)},30)),n.on("destroy",function(){r.remove(e.Html.wrapper.children)}),r}function af(t){if(t&&t.parentNode){for(var e=t.parentNode.firstChild,n=[];e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}return[]}function el(t){return Array.prototype.slice.call(t)}var j1='[data-glide-el="track"]';function V1(t,e,n){var r={mount:function(){this.root=t.selector,this.track=this.root.querySelector(j1),this.collectSlides()},collectSlides:function(){this.slides=el(this.wrapper.children).filter(function(i){return!i.classList.contains(t.settings.classes.slide.clone)})}};return He(r,"root",{get:function(){return r._r},set:function(i){Za(i)&&(i=document.querySelector(i)),i!==null?r._r=i:Nn("Root element must be a existing Html node")}}),He(r,"track",{get:function(){return r._t},set:function(i){r._t=i}}),He(r,"wrapper",{get:function(){return r.track.children[0]}}),n.on("update",function(){r.collectSlides()}),r}function W1(t,e,n){var r={mount:function(){this.value=t.settings.peek}};return He(r,"value",{get:function(){return r._v},set:function(i){wo(i)?(i.before=zt(i.before),i.after=zt(i.after)):i=zt(i),r._v=i}}),He(r,"reductor",{get:function(){var i=r.value,s=t.settings.perView;return wo(i)?i.before/s+i.after/s:i*2/s}}),n.on(["resize","update"],function(){r.mount()}),r}function Y1(t,e,n){var r={mount:function(){this._o=0},make:function(){var i=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.offset=s,n.emit("move",{movement:this.value}),e.Transition.after(function(){n.emit("move.after",{movement:i.value})})}};return He(r,"offset",{get:function(){return r._o},set:function(i){r._o=Q1(i)?0:zt(i)}}),He(r,"translate",{get:function(){return e.Sizes.slideWidth*t.index}}),He(r,"value",{get:function(){var i=this.offset,s=this.translate;return e.Direction.is("rtl")?s+i:s-i}}),n.on(["build.before","run"],function(){r.make()}),r}function q1(t,e,n){var r={setupSlides:function(){for(var i="".concat(this.slideWidth,"px"),s=e.Html.slides,a=0;a<s.length;a++)s[a].style.width=i},setupWrapper:function(){e.Html.wrapper.style.width="".concat(this.wrapperSize,"px")},remove:function(){for(var i=e.Html.slides,s=0;s<i.length;s++)i[s].style.width="";e.Html.wrapper.style.width=""}};return He(r,"length",{get:function(){return e.Html.slides.length}}),He(r,"width",{get:function(){return e.Html.track.offsetWidth}}),He(r,"wrapperSize",{get:function(){return r.slideWidth*r.length+e.Gaps.grow+e.Clones.grow}}),He(r,"slideWidth",{get:function(){return r.width/t.settings.perView-e.Peek.reductor-e.Gaps.reductor}}),n.on(["build.before","resize","update"],function(){r.setupSlides(),r.setupWrapper()}),n.on("destroy",function(){r.remove()}),r}function K1(t,e,n){var r={mount:function(){n.emit("build.before"),this.typeClass(),this.activeClass(),n.emit("build.after")},typeClass:function(){e.Html.root.classList.add(t.settings.classes.type[t.settings.type])},activeClass:function(){var i=t.settings.classes,s=e.Html.slides[t.index];s&&(s.classList.add(i.slide.active),af(s).forEach(function(a){a.classList.remove(i.slide.active)}))},removeClasses:function(){var i=t.settings.classes,s=i.type,a=i.slide;e.Html.root.classList.remove(s[t.settings.type]),e.Html.slides.forEach(function(l){l.classList.remove(a.active)})}};return n.on(["destroy","update"],function(){r.removeClasses()}),n.on(["resize","update"],function(){r.mount()}),n.on("move.after",function(){r.activeClass()}),r}function G1(t,e,n){var r={mount:function(){this.items=[],t.isType("carousel")&&(this.items=this.collect())},collect:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=e.Html.slides,a=t.settings,l=a.perView,c=a.classes,u=a.cloningRatio;if(s.length>0)for(var d=+!!t.settings.peek,A=l+d+Math.round(l/2),f=s.slice(0,A).reverse(),h=s.slice(A*-1),g=0;g<Math.max(u,Math.floor(l/s.length));g++){for(var p=0;p<f.length;p++){var v=f[p].cloneNode(!0);v.classList.add(c.slide.clone),i.push(v)}for(var x=0;x<h.length;x++){var y=h[x].cloneNode(!0);y.classList.add(c.slide.clone),i.unshift(y)}}return i},append:function(){for(var i=this.items,s=e.Html,a=s.wrapper,l=s.slides,c=Math.floor(i.length/2),u=i.slice(0,c).reverse(),d=i.slice(c*-1).reverse(),A="".concat(e.Sizes.slideWidth,"px"),f=0;f<d.length;f++)a.appendChild(d[f]);for(var h=0;h<u.length;h++)a.insertBefore(u[h],l[0]);for(var g=0;g<i.length;g++)i[g].style.width=A},remove:function(){for(var i=this.items,s=0;s<i.length;s++)e.Html.wrapper.removeChild(i[s])}};return He(r,"grow",{get:function(){return(e.Sizes.slideWidth+e.Gaps.value)*r.items.length}}),n.on("update",function(){r.remove(),r.mount(),r.append()}),n.on("build.before",function(){t.isType("carousel")&&r.append()}),n.on("destroy",function(){r.remove()}),r}var lf=(function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pi(this,t),this.listeners=e}return Di(t,[{key:"on",value:function(n,r,o){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;Za(n)&&(n=[n]);for(var s=0;s<n.length;s++)this.listeners[n[s]]=o,r.addEventListener(n[s],this.listeners[n[s]],i)}},{key:"off",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Za(n)&&(n=[n]);for(var i=0;i<n.length;i++)r.removeEventListener(n[i],this.listeners[n[i]],o)}},{key:"destroy",value:function(){delete this.listeners}}]),t})();function X1(t,e,n){var r=new lf,o={mount:function(){this.bind()},bind:function(){r.on("resize",window,sf(function(){n.emit("resize")},t.settings.throttle))},unbind:function(){r.off("resize",window)}};return n.on("destroy",function(){o.unbind(),r.destroy()}),o}var J1=["ltr","rtl"],Z1={">":"<","<":">","=":"="};function $1(t,e,n){var r={mount:function(){this.value=t.settings.direction},resolve:function(i){var s=i.slice(0,1);return this.is("rtl")?i.split(s).join(Z1[s]):i},is:function(i){return this.value===i},addClass:function(){e.Html.root.classList.add(t.settings.classes.direction[this.value])},removeClass:function(){e.Html.root.classList.remove(t.settings.classes.direction[this.value])}};return He(r,"value",{get:function(){return r._v},set:function(i){J1.indexOf(i)>-1?r._v=i:Nn("Direction value must be `ltr` or `rtl`")}}),n.on(["destroy","update"],function(){r.removeClass()}),n.on("update",function(){r.mount()}),n.on(["build.before","update"],function(){r.addClass()}),r}function e2(t,e){return{modify:function(r){return e.Direction.is("rtl")?-r:r}}}function t2(t,e){return{modify:function(r){var o=Math.floor(r/e.Sizes.slideWidth);return r+e.Gaps.value*o}}}function n2(t,e){return{modify:function(r){return r+e.Clones.grow/2}}}function r2(t,e){return{modify:function(r){if(t.settings.focusAt>=0){var o=e.Peek.value;return wo(o)?r-o.before:r-o}return r}}}function o2(t,e){return{modify:function(r){var o=e.Gaps.value,i=e.Sizes.width,s=t.settings.focusAt,a=e.Sizes.slideWidth;return s==="center"?r-(i/2-a/2):r-a*s-o*s}}}function i2(t,e,n){var r=[t2,n2,r2,o2].concat(t._t,[e2]);return{mutate:function(i){for(var s=0;s<r.length;s++){var a=r[s];Ii(a)&&Ii(a().modify)?i=a(t,e,n).modify(i):Nn("Transformer should be a function that returns an object with `modify()` method")}return i}}}function s2(t,e,n){var r={set:function(i){var s=i2(t,e).mutate(i),a="translate3d(".concat(-1*s,"px, 0px, 0px)");e.Html.wrapper.style.mozTransform=a,e.Html.wrapper.style.webkitTransform=a,e.Html.wrapper.style.transform=a},remove:function(){e.Html.wrapper.style.transform=""},getStartIndex:function(){var i=e.Sizes.length,s=t.index,a=t.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?i+(s-a):(s+a)%i},getTravelDistance:function(){var i=e.Sizes.slideWidth*t.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?i*-1:i}};return n.on("move",function(o){if(!t.isType("carousel")||!e.Run.isOffset())return r.set(o.movement);e.Transition.after(function(){n.emit("translate.jump"),r.set(e.Sizes.slideWidth*t.index)});var i=e.Sizes.slideWidth*e.Translate.getStartIndex();return r.set(i-e.Translate.getTravelDistance())}),n.on("destroy",function(){r.remove()}),r}function a2(t,e,n){var r=!1,o={compose:function(s){var a=t.settings;return r?"".concat(s," 0ms ").concat(a.animationTimingFunc):"".concat(s," ").concat(this.duration,"ms ").concat(a.animationTimingFunc)},set:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";e.Html.wrapper.style.transition=this.compose(s)},remove:function(){e.Html.wrapper.style.transition=""},after:function(s){setTimeout(function(){s()},this.duration)},enable:function(){r=!1,this.set()},disable:function(){r=!0,this.set()}};return He(o,"duration",{get:function(){var s=t.settings;return t.isType("slider")&&e.Run.offset?s.rewindDuration:s.animationDuration}}),n.on("move",function(){o.set()}),n.on(["build.before","resize","translate.jump"],function(){o.disable()}),n.on("run",function(){o.enable()}),n.on("destroy",function(){o.remove()}),o}var cf=!1;try{var uf=Object.defineProperty({},"passive",{get:function(){cf=!0}});window.addEventListener("testPassive",null,uf),window.removeEventListener("testPassive",null,uf)}catch{}var df=cf,l2='[data-glide-el="controls[nav]"]',tl='[data-glide-el^="controls"]',c2="".concat(tl,' [data-glide-dir*="<"]'),u2="".concat(tl,' [data-glide-dir*=">"]');function d2(t,e,n){var r=new lf,o=df?{passive:!0}:!1,i={mount:function(){this._n=e.Html.root.querySelectorAll(l2),this._c=e.Html.root.querySelectorAll(tl),this._arrowControls={previous:e.Html.root.querySelectorAll(c2),next:e.Html.root.querySelectorAll(u2)},this.addBindings()},setActive:function(){for(var a=0;a<this._n.length;a++)this.addClass(this._n[a].children)},removeActive:function(){for(var a=0;a<this._n.length;a++)this.removeClass(this._n[a].children)},addClass:function(a){var l=t.settings,c=a[t.index];c&&(c.classList.add(l.classes.nav.active),af(c).forEach(function(u){u.classList.remove(l.classes.nav.active)}))},removeClass:function(a){var l=a[t.index];l?.classList.remove(t.settings.classes.nav.active)},setArrowState:function(){if(!t.settings.rewind){var a=i._arrowControls.next,l=i._arrowControls.previous;this.resetArrowState(a,l),t.index===0&&this.disableArrow(l),t.index===e.Run.length&&this.disableArrow(a)}},resetArrowState:function(){for(var a=t.settings,l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];c.forEach(function(d){el(d).forEach(function(A){A.classList.remove(a.classes.arrow.disabled)})})},disableArrow:function(){for(var a=t.settings,l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];c.forEach(function(d){el(d).forEach(function(A){A.classList.add(a.classes.arrow.disabled)})})},addBindings:function(){for(var a=0;a<this._c.length;a++)this.bind(this._c[a].children)},removeBindings:function(){for(var a=0;a<this._c.length;a++)this.unbind(this._c[a].children)},bind:function(a){for(var l=0;l<a.length;l++)r.on("click",a[l],this.click),r.on("touchstart",a[l],this.click,o)},unbind:function(a){for(var l=0;l<a.length;l++)r.off(["click","touchstart"],a[l])},click:function(a){!df&&a.type==="touchstart"&&a.preventDefault();var l=a.currentTarget.getAttribute("data-glide-dir");e.Run.make(e.Direction.resolve(l))}};return He(i,"items",{get:function(){return i._c}}),n.on(["mount.after","move.after"],function(){i.setActive()}),n.on(["mount.after","run"],function(){i.setArrowState()}),n.on("destroy",function(){i.removeBindings(),i.removeActive(),r.destroy()}),i}var A2={Html:V1,Translate:s2,Transition:a2,Direction:$1,Peek:W1,Sizes:q1,Gaps:U1,Move:Y1,Clones:G1,Resize:X1,Build:K1,Run:R1},f2=(function(t){I1(n,t);var e=T1(n);function n(){return Pi(this,n),e.apply(this,arguments)}return Di(n,[{key:"mount",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Bi(Pr(n.prototype),"mount",this).call(this,Object.assign({},A2,o))}}]),n})(H1);function _i({children:t,cssClass:e=""}){const n=w.useRef(null);return w.useEffect(()=>{n.current&&new f2(n.current).mount({Controls:d2})},[]),m.jsx("section",{className:`carousel ${e}`,children:m.jsxs("div",{className:"glide",ref:n,children:[m.jsx("div",{className:"glide__track","data-glide-el":"track",children:m.jsx("ul",{className:"glide__slides",children:t})}),m.jsxs("div",{className:"glide__arrows","data-glide-el":"controls",children:[m.jsx("button",{className:"glide__arrow glide__arrow--left","data-glide-dir":"<",children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:m.jsx("path",{d:"M0 12l10.975 11 2.848-2.828-6.176-6.176H24v-3.992H7.646l6.176-6.176L10.975 1 0 12z"})})}),m.jsx("button",{className:"glide__arrow glide__arrow--right","data-glide-dir":">",children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:m.jsx("path",{d:"M13.025 1l-2.847 2.828 6.176 6.176h-16.354v3.992h16.354l-6.176 6.176 2.847 2.828 10.975-11z"})})})]})]})})}function Af({children:t}){return m.jsx("li",{className:"glide__slide",children:t})}function h2({title:t,description:e,linkText:n,linkURI:r,imageURI:o,imageAltText:i}){return m.jsx(Af,{children:m.jsxs("span",{className:"slide-inner",children:[o&&m.jsx("a",{href:r,className:"slide-image",children:m.jsx("img",{src:o,alt:i})}),m.jsxs("span",{className:"slide-text",children:[t&&m.jsx("h2",{children:t}),e&&m.jsx("p",{children:e}),n&&m.jsx("a",{href:r,children:n})]})]})})}_i.Slide=Af,_i.ImageSlide=h2;function p2({children:t,maxHeight:e="400px"}){return m.jsx("div",{className:"scroll-text",children:m.jsx("div",{className:"scroll-text-inner",style:{maxHeight:e},children:t})})}const g2="https://allocations.access-ci.org/current-projects.json";function Oi({icon:t,text:e,title:n}){if(e)return m.jsxs("abbr",{className:"project-meta",title:n,children:[m.jsx(be,{name:t}),e]})}function m2({infoGroupId:t}){const e=Ur(t),n=rt(e?`${g2}?${e.infoResourceIds.map(o=>`info_resourceids[]=${o}`).join("&")}`:null);if(!n||!n.projects||!n.projects.length)return null;const r=[{key:"resourceName",name:"Resource"},{key:"allocation",name:"Current Allocation",format:(o,i)=>i.units=="[Yes = 1, No = 0]"?o==1?"Yes":"No":`${o.toLocaleString("en-us")} ${i.units||""}`}];return m.jsx(nn,{title:"Recent Projects",icon:"pc-display",children:m.jsx(_i,{cssclassName:"carousel-projects",children:n.projects.map(o=>m.jsxs(_i.Slide,{children:[m.jsx("h3",{children:o.requestTitle}),m.jsxs("div",{className:"project-metadata",children:[m.jsx(Oi,{icon:"cash-coin",text:o.allocationType,title:"Allocation Type"}),m.jsx(Oi,{icon:"person-fill",text:`${o.pi} (${o.piInstitution})`,title:"Primary Investigator"}),m.jsx(Oi,{icon:"folder",text:o.fos,title:"Field of Science"}),m.jsx(Oi,{icon:"calendar-range",text:[o.beginDate,o.endDate].map(i=>new Date(i).toLocaleString("en-US",{dateStyle:"medium"})).join(" to "),title:"Project Dates"})]}),m.jsxs(p2,{children:[m.jsx("p",{children:o.abstract}),m.jsx(yi,{columns:r,rows:o.resources,maxHeight:null})]})]},o.requestTitle))})})}function xo(t){return t+.5|0}const Qn=(t,e,n)=>Math.max(Math.min(t,n),e);function ko(t){return Qn(xo(t*2.55),0,255)}function Fn(t){return Qn(xo(t*255),0,255)}function wn(t){return Qn(xo(t/2.55)/100,0,1)}function ff(t){return Qn(xo(t*100),0,100)}const Mt={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},nl=[..."0123456789ABCDEF"],b2=t=>nl[t&15],y2=t=>nl[(t&240)>>4]+nl[t&15],Ti=t=>(t&240)>>4===(t&15),v2=t=>Ti(t.r)&&Ti(t.g)&&Ti(t.b)&&Ti(t.a);function w2(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&Mt[t[1]]*17,g:255&Mt[t[2]]*17,b:255&Mt[t[3]]*17,a:e===5?Mt[t[4]]*17:255}:(e===7||e===9)&&(n={r:Mt[t[1]]<<4|Mt[t[2]],g:Mt[t[3]]<<4|Mt[t[4]],b:Mt[t[5]]<<4|Mt[t[6]],a:e===9?Mt[t[7]]<<4|Mt[t[8]]:255})),n}const x2=(t,e)=>t<255?e(t):"";function k2(t){var e=v2(t)?b2:y2;return t?"#"+e(t.r)+e(t.g)+e(t.b)+x2(t.a,e):void 0}const E2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hf(t,e,n){const r=e*Math.min(n,1-n),o=(i,s=(i+t/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[o(0),o(8),o(4)]}function S2(t,e,n){const r=(o,i=(o+t/60)%6)=>n-n*e*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function C2(t,e,n){const r=hf(t,1,.5);let o;for(e+n>1&&(o=1/(e+n),e*=o,n*=o),o=0;o<3;o++)r[o]*=1-e-n,r[o]+=e;return r}function P2(t,e,n,r,o){return t===o?(e-n)/r+(e<n?6:0):e===o?(n-t)/r+2:(t-e)/r+4}function rl(t){const n=t.r/255,r=t.g/255,o=t.b/255,i=Math.max(n,r,o),s=Math.min(n,r,o),a=(i+s)/2;let l,c,u;return i!==s&&(u=i-s,c=a>.5?u/(2-i-s):u/(i+s),l=P2(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function ol(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(Fn)}function il(t,e,n){return ol(hf,t,e,n)}function D2(t,e,n){return ol(C2,t,e,n)}function B2(t,e,n){return ol(S2,t,e,n)}function pf(t){return(t%360+360)%360}function I2(t){const e=E2.exec(t);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?ko(+e[5]):Fn(+e[5]));const o=pf(+e[2]),i=+e[3]/100,s=+e[4]/100;return e[1]==="hwb"?r=D2(o,i,s):e[1]==="hsv"?r=B2(o,i,s):r=il(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function M2(t,e){var n=rl(t);n[0]=pf(n[0]+e),n=il(n),t.r=n[0],t.g=n[1],t.b=n[2]}function _2(t){if(!t)return;const e=rl(t),n=e[0],r=ff(e[1]),o=ff(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${o}%, ${wn(t.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const gf={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"},mf={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 O2(){const t={},e=Object.keys(mf),n=Object.keys(gf);let r,o,i,s,a;for(r=0;r<e.length;r++){for(s=a=e[r],o=0;o<n.length;o++)i=n[o],a=a.replace(i,gf[i]);i=parseInt(mf[s],16),t[a]=[i>>16&255,i>>8&255,i&255]}return t}let Li;function T2(t){Li||(Li=O2(),Li.transparent=[0,0,0,0]);const e=Li[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const L2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function N2(t){const e=L2.exec(t);let n=255,r,o,i;if(e){if(e[7]!==r){const s=+e[7];n=e[8]?ko(s):Qn(s*255,0,255)}return r=+e[1],o=+e[3],i=+e[5],r=255&(e[2]?ko(r):Qn(r,0,255)),o=255&(e[4]?ko(o):Qn(o,0,255)),i=255&(e[6]?ko(i):Qn(i,0,255)),{r,g:o,b:i,a:n}}}function Q2(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${wn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const sl=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Dr=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function F2(t,e,n){const r=Dr(wn(t.r)),o=Dr(wn(t.g)),i=Dr(wn(t.b));return{r:Fn(sl(r+n*(Dr(wn(e.r))-r))),g:Fn(sl(o+n*(Dr(wn(e.g))-o))),b:Fn(sl(i+n*(Dr(wn(e.b))-i))),a:t.a+n*(e.a-t.a)}}function Ni(t,e,n){if(t){let r=rl(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,e===0?360:1)),r=il(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function bf(t,e){return t&&Object.assign(e||{},t)}function yf(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Fn(t[3]))):(e=bf(t,{r:0,g:0,b:0,a:1}),e.a=Fn(e.a)),e}function z2(t){return t.charAt(0)==="r"?N2(t):I2(t)}class Eo{constructor(e){if(e instanceof Eo)return e;const n=typeof e;let r;n==="object"?r=yf(e):n==="string"&&(r=w2(e)||T2(e)||z2(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=bf(this._rgb);return e&&(e.a=wn(e.a)),e}set rgb(e){this._rgb=yf(e)}rgbString(){return this._valid?Q2(this._rgb):void 0}hexString(){return this._valid?k2(this._rgb):void 0}hslString(){return this._valid?_2(this._rgb):void 0}mix(e,n){if(e){const r=this.rgb,o=e.rgb;let i;const s=n===i?.5:n,a=2*s-1,l=r.a-o.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,r.r=255&c*r.r+i*o.r+.5,r.g=255&c*r.g+i*o.g+.5,r.b=255&c*r.b+i*o.b+.5,r.a=s*r.a+(1-s)*o.a,this.rgb=r}return this}interpolate(e,n){return e&&(this._rgb=F2(this._rgb,e._rgb,n)),this}clone(){return new Eo(this.rgb)}alpha(e){return this._rgb.a=Fn(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=xo(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ni(this._rgb,2,e),this}darken(e){return Ni(this._rgb,2,-e),this}saturate(e){return Ni(this._rgb,1,e),this}desaturate(e){return Ni(this._rgb,1,-e),this}rotate(e){return M2(this._rgb,e),this}}function xn(){}const H2=(()=>{let t=0;return()=>t++})();function Pe(t){return t==null}function We(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function me(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function _t(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function an(t,e){return _t(t)?t:e}function ye(t,e){return typeof t>"u"?e:t}const R2=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,vf=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Te(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Ee(t,e,n,r){let o,i,s;if(We(t))for(i=t.length,o=0;o<i;o++)e.call(n,t[o],o);else if(me(t))for(s=Object.keys(t),i=s.length,o=0;o<i;o++)e.call(n,t[s[o]],s[o])}function Qi(t,e){let n,r,o,i;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(o=t[n],i=e[n],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0}function Fi(t){if(We(t))return t.map(Fi);if(me(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let o=0;for(;o<r;++o)e[n[o]]=Fi(t[n[o]]);return e}return t}function wf(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function U2(t,e,n,r){if(!wf(t))return;const o=e[t],i=n[t];me(o)&&me(i)?So(o,i,r):e[t]=Fi(i)}function So(t,e,n){const r=We(e)?e:[e],o=r.length;if(!me(t))return t;n=n||{};const i=n.merger||U2;let s;for(let a=0;a<o;++a){if(s=r[a],!me(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)i(l[c],t,s,n)}return t}function Co(t,e){return So(t,e,{merger:j2})}function j2(t,e,n){if(!wf(t))return;const r=e[t],o=n[t];me(r)&&me(o)?Co(r,o):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Fi(o))}const xf={"":t=>t,x:t=>t.x,y:t=>t.y};function V2(t){const e=t.split("."),n=[];let r="";for(const o of e)r+=o,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function W2(t){const e=V2(t);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function zn(t,e){return(xf[e]||(xf[e]=W2(e)))(t)}function al(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Po=t=>typeof t<"u",Hn=t=>typeof t=="function",kf=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function Y2(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Ye=Math.PI,vt=2*Ye,zi=Number.POSITIVE_INFINITY,q2=Ye/180,wt=Ye/2,nr=Ye/4,Ef=Ye*2/3,Sf=Math.log10,Rn=Math.sign;function Hi(t,e,n){return Math.abs(t-e)<n}function Cf(t){const e=Math.round(t);t=Hi(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Sf(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function K2(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r===0&&(e.push(r),e.push(t/r));return n===(n|0)&&e.push(n),e.sort((o,i)=>o-i).pop(),e}function G2(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Ri(t){return!G2(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function X2(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function J2(t,e,n){let r,o,i;for(r=0,o=t.length;r<o;r++)i=t[r][n],isNaN(i)||(e.min=Math.min(e.min,i),e.max=Math.max(e.max,i))}function ln(t){return t*(Ye/180)}function Z2(t){return t*(180/Ye)}function Pf(t){if(!_t(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function $2(t,e){const n=e.x-t.x,r=e.y-t.y,o=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*Ye&&(i+=vt),{angle:i,distance:o}}function ek(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function rr(t){return(t%vt+vt)%vt}function ll(t,e,n,r){const o=rr(t),i=rr(e),s=rr(n),a=rr(i-o),l=rr(s-o),c=rr(o-i),u=rr(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function Ht(t,e,n){return Math.max(e,Math.min(n,t))}function tk(t){return Ht(t,-32768,32767)}function Br(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function cl(t,e,n){n=n||(s=>t[s]<e);let r=t.length-1,o=0,i;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const ul=(t,e,n,r)=>cl(t,n,r?o=>{const i=t[o][e];return i<n||i===n&&t[o+1][e]===n}:o=>t[o][e]<n),nk=(t,e,n)=>cl(t,n,r=>t[r][e]>=n);function rk(t,e,n){let r=0,o=t.length;for(;r<o&&t[r]<e;)r++;for(;o>r&&t[o-1]>n;)o--;return r>0||o<t.length?t.slice(r,o):t}const Df=["push","pop","shift","splice","unshift"];function ok(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Df.forEach(n=>{const r="_onData"+al(n),o=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...i){const s=o.apply(this,i);return t._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...i)}),s}})})}function Bf(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(e);o!==-1&&r.splice(o,1),!(r.length>0)&&(Df.forEach(i=>{delete t[i]}),delete t._chartjs)}function If(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Mf=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function _f(t,e){let n=[],r=!1;return function(...o){n=o,r||(r=!0,Mf.call(window,()=>{r=!1,t.apply(e,n)}))}}function ik(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const dl=t=>t==="start"?"left":t==="end"?"right":"center",$e=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,sk=(t,e,n,r)=>t===(r?"left":"right")?n:t==="center"?(e+n)/2:e,Ui=t=>t===0||t===1,Of=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*vt/n)),Tf=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*vt/n)+1,Do={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*wt)+1,easeOutSine:t=>Math.sin(t*wt),easeInOutSine:t=>-.5*(Math.cos(Ye*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=>Ui(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=>Ui(t)?t:Of(t,.075,.3),easeOutElastic:t=>Ui(t)?t:Tf(t,.075,.3),easeInOutElastic(t){return Ui(t)?t:t<.5?.5*Of(t*2,.1125,.45):.5+.5*Tf(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 e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Do.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?Do.easeInBounce(t*2)*.5:Do.easeOutBounce(t*2-1)*.5+.5};function Lf(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Nf(t){return Lf(t)?t:new Eo(t)}function Al(t){return Lf(t)?t:new Eo(t).saturate(.5).darken(.1).hexString()}const ak=["x","y","borderWidth","radius","tension"],lk=["color","borderColor","backgroundColor"];function ck(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:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:lk},numbers:{type:"number",properties:ak}}),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:e=>e|0}}}})}function uk(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Qf=new Map;function dk(t,e){e=e||{};const n=t+JSON.stringify(e);let r=Qf.get(n);return r||(r=new Intl.NumberFormat(t,e),Qf.set(n,r)),r}function ji(t,e,n){return dk(e,n).format(t)}const Ak={values(t){return We(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const r=this.chart.options.locale;let o,i=t;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(o="scientific"),i=fk(t,n)}const s=Sf(Math.abs(i)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:o,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ji(t,r,l)}};function fk(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var Ff={formatters:Ak};function hk(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:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.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:Ff.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:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const or=Object.create(null),fl=Object.create(null);function Bo(t,e){if(!e)return t;const n=e.split(".");for(let r=0,o=n.length;r<o;++r){const i=n[r];t=t[i]||(t[i]=Object.create(null))}return t}function hl(t,e,n){return typeof e=="string"?So(Bo(t,e),n):So(Bo(t,""),e)}class pk{constructor(e,n){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=r=>r.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=(r,o)=>Al(o.backgroundColor),this.hoverBorderColor=(r,o)=>Al(o.borderColor),this.hoverColor=(r,o)=>Al(o.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(e),this.apply(n)}set(e,n){return hl(this,e,n)}get(e){return Bo(this,e)}describe(e,n){return hl(fl,e,n)}override(e,n){return hl(or,e,n)}route(e,n,r,o){const i=Bo(this,e),s=Bo(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[o];return me(l)?Object.assign({},c,l):ye(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var ze=new pk({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ck,uk,hk]);function gk(t){return!t||Pe(t.size)||Pe(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function zf(t,e,n,r,o){let i=e[o];return i||(i=e[o]=t.measureText(o).width,n.push(o)),i>r&&(r=i),r}function ir(t,e,n){const r=t.currentDevicePixelRatio,o=n!==0?Math.max(n/2,.5):0;return Math.round((e-o)*r)/r+o}function Hf(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Rf(t,e,n,r){Uf(t,e,n,r,null)}function Uf(t,e,n,r,o){let i,s,a,l,c,u,d,A;const f=e.pointStyle,h=e.rotation,g=e.radius;let p=(h||0)*q2;if(f&&typeof f=="object"&&(i=f.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){t.save(),t.translate(n,r),t.rotate(p),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),t.restore();return}if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:o?t.ellipse(n,r,o/2,g,0,0,vt):t.arc(n,r,g,0,vt),t.closePath();break;case"triangle":u=o?o/2:g,t.moveTo(n+Math.sin(p)*u,r-Math.cos(p)*g),p+=Ef,t.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*g),p+=Ef,t.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*g),t.closePath();break;case"rectRounded":c=g*.516,l=g-c,s=Math.cos(p+nr)*l,d=Math.cos(p+nr)*(o?o/2-c:l),a=Math.sin(p+nr)*l,A=Math.sin(p+nr)*(o?o/2-c:l),t.arc(n-d,r-a,c,p-Ye,p-wt),t.arc(n+A,r-s,c,p-wt,p),t.arc(n+d,r+a,c,p,p+wt),t.arc(n-A,r+s,c,p+wt,p+Ye),t.closePath();break;case"rect":if(!h){l=Math.SQRT1_2*g,u=o?o/2:l,t.rect(n-u,r-l,2*u,2*l);break}p+=nr;case"rectRot":d=Math.cos(p)*(o?o/2:g),s=Math.cos(p)*g,a=Math.sin(p)*g,A=Math.sin(p)*(o?o/2:g),t.moveTo(n-d,r-a),t.lineTo(n+A,r-s),t.lineTo(n+d,r+a),t.lineTo(n-A,r+s),t.closePath();break;case"crossRot":p+=nr;case"cross":d=Math.cos(p)*(o?o/2:g),s=Math.cos(p)*g,a=Math.sin(p)*g,A=Math.sin(p)*(o?o/2:g),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+A,r-s),t.lineTo(n-A,r+s);break;case"star":d=Math.cos(p)*(o?o/2:g),s=Math.cos(p)*g,a=Math.sin(p)*g,A=Math.sin(p)*(o?o/2:g),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+A,r-s),t.lineTo(n-A,r+s),p+=nr,d=Math.cos(p)*(o?o/2:g),s=Math.cos(p)*g,a=Math.sin(p)*g,A=Math.sin(p)*(o?o/2:g),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+A,r-s),t.lineTo(n-A,r+s);break;case"line":s=o?o/2:Math.cos(p)*g,a=Math.sin(p)*g,t.moveTo(n-s,r-a),t.lineTo(n+s,r+a);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(p)*(o?o/2:g),r+Math.sin(p)*g);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function jf(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function pl(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function gl(t){t.restore()}function mk(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Pe(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function bk(t,e,n,r,o){if(o.strikethrough||o.underline){const i=t.measureText(r),s=e-i.actualBoundingBoxLeft,a=e+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=o.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=o.decorationWidth||2,t.moveTo(s,u),t.lineTo(a,u),t.stroke()}}function yk(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function Io(t,e,n,r,o,i={}){const s=We(e)?e:[e],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(t.save(),t.font=o.string,mk(t,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&yk(t,i.backdrop),a&&(i.strokeColor&&(t.strokeStyle=i.strokeColor),Pe(i.strokeWidth)||(t.lineWidth=i.strokeWidth),t.strokeText(c,n,r,i.maxWidth)),t.fillText(c,n,r,i.maxWidth),bk(t,n,r,c,i),r+=Number(o.lineHeight);t.restore()}function Vi(t,e){const{x:n,y:r,w:o,h:i,radius:s}=e;t.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*Ye,Ye,!0),t.lineTo(n,r+i-s.bottomLeft),t.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,Ye,wt,!0),t.lineTo(n+o-s.bottomRight,r+i),t.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,wt,0,!0),t.lineTo(n+o,r+s.topRight),t.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-wt,!0),t.lineTo(n+s.topLeft,r)}const vk=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,wk=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function xk(t,e){const n=(""+t).match(vk);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const kk=t=>+t||0;function Vf(t,e){const n={},r=me(e),o=r?Object.keys(e):e,i=me(t)?r?s=>ye(t[s],t[e[s]]):s=>t[s]:()=>t;for(const s of o)n[s]=kk(i(s));return n}function Wf(t){return Vf(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ir(t){return Vf(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ot(t){const e=Wf(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function et(t,e){t=t||{},e=e||ze.font;let n=ye(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let r=ye(t.style,e.style);r&&!(""+r).match(wk)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:ye(t.family,e.family),lineHeight:xk(ye(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:ye(t.weight,e.weight),string:""};return o.string=gk(o),o}function Wi(t,e,n,r){let o,i,s;for(o=0,i=t.length;o<i;++o)if(s=t[o],s!==void 0&&s!==void 0)return s}function Ek(t,e,n){const{min:r,max:o}=t,i=vf(e,(o-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(i)),max:s(o,i)}}function Mr(t,e){return Object.assign(Object.create(t),e)}function ml(t,e=[""],n,r,o=()=>t[0]){const i=n||t;typeof r>"u"&&(r=Xf("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>ml([a,...t],e,i,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return qf(a,l,()=>_k(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return Jf(a).includes(l)},ownKeys(a){return Jf(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function _r(t,e,n,r){const o={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Yf(t,r),setContext:i=>_r(t,i,n,r),override:i=>_r(t.override(i),e,n,r)};return new Proxy(o,{deleteProperty(i,s){return delete i[s],delete t[s],!0},get(i,s,a){return qf(i,s,()=>Ck(i,s,a))},getOwnPropertyDescriptor(i,s){return i._descriptors.allKeys?Reflect.has(t,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,s)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(i,s){return Reflect.has(t,s)},ownKeys(){return Reflect.ownKeys(t)},set(i,s,a){return t[s]=a,delete i[s],!0}})}function Yf(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:n,indexable:r,isScriptable:Hn(n)?n:()=>n,isIndexable:Hn(r)?r:()=>r}}const Sk=(t,e)=>t?t+al(e):e,bl=(t,e)=>me(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function qf(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const r=n();return t[e]=r,r}function Ck(t,e,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=t;let a=r[e];return Hn(a)&&s.isScriptable(e)&&(a=Pk(e,a,t,n)),We(a)&&a.length&&(a=Dk(e,a,t,s.isIndexable)),bl(e,a)&&(a=_r(a,o,i&&i[e],s)),a}function Pk(t,e,n,r){const{_proxy:o,_context:i,_subProxy:s,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(i,s||r);return a.delete(t),bl(t,l)&&(l=yl(o._scopes,o,t,l)),l}function Dk(t,e,n,r){const{_proxy:o,_context:i,_subProxy:s,_descriptors:a}=n;if(typeof i.index<"u"&&r(t))return e[i.index%e.length];if(me(e[0])){const l=e,c=o._scopes.filter(u=>u!==l);e=[];for(const u of l){const d=yl(c,o,t,u);e.push(_r(d,i,s&&s[t],a))}}return e}function Kf(t,e,n){return Hn(t)?t(e,n):t}const Bk=(t,e)=>t===!0?e:typeof t=="string"?zn(e,t):void 0;function Ik(t,e,n,r,o){for(const i of e){const s=Bk(n,i);if(s){t.add(s);const a=Kf(s._fallback,n,o);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function yl(t,e,n,r){const o=e._rootScopes,i=Kf(e._fallback,n,r),s=[...t,...o],a=new Set;a.add(r);let l=Gf(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=Gf(a,s,i,l,r),l===null)?!1:ml(Array.from(a),[""],o,i,()=>Mk(e,n,r))}function Gf(t,e,n,r,o){for(;n;)n=Ik(t,e,n,r,o);return n}function Mk(t,e,n){const r=t._getTarget();e in r||(r[e]={});const o=r[e];return We(o)&&me(n)?n:o||{}}function _k(t,e,n,r){let o;for(const i of e)if(o=Xf(Sk(i,t),n),typeof o<"u")return bl(t,o)?yl(n,r,t,o):o}function Xf(t,e){for(const n of e){if(!n)continue;const r=n[t];if(typeof r<"u")return r}}function Jf(t){let e=t._keys;return e||(e=t._keys=Ok(t._scopes)),e}function Ok(t){const e=new Set;for(const n of t)for(const r of Object.keys(n).filter(o=>!o.startsWith("_")))e.add(r);return Array.from(e)}function Tk(t,e,n,r){const{iScale:o}=t,{key:i="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=e[c],s[a]={r:o.parse(zn(u,i),c)};return s}function vl(){return typeof window<"u"&&typeof document<"u"}function wl(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Yi(t,e,n){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*e.parentNode[n])):r=t,r}const qi=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Lk(t,e){return qi(t).getPropertyValue(e)}const Nk=["top","right","bottom","left"];function sr(t,e,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=Nk[o];r[i]=parseFloat(t[e+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Qk=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function Fk(t,e){const n=t.touches,r=n&&n.length?n[0]:t,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(Qk(o,i,t.target))a=o,l=i;else{const c=e.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function ar(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:r}=e,o=qi(n),i=o.boxSizing==="border-box",s=sr(o,"padding"),a=sr(o,"border","width"),{x:l,y:c,box:u}=Fk(t,n),d=s.left+(u&&a.left),A=s.top+(u&&a.top);let{width:f,height:h}=e;return i&&(f-=s.width+a.width,h-=s.height+a.height),{x:Math.round((l-d)/f*n.width/r),y:Math.round((c-A)/h*n.height/r)}}function zk(t,e,n){let r,o;if(e===void 0||n===void 0){const i=t&&wl(t);if(!i)e=t.clientWidth,n=t.clientHeight;else{const s=i.getBoundingClientRect(),a=qi(i),l=sr(a,"border","width"),c=sr(a,"padding");e=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Yi(a.maxWidth,i,"clientWidth"),o=Yi(a.maxHeight,i,"clientHeight")}}return{width:e,height:n,maxWidth:r||zi,maxHeight:o||zi}}const Un=t=>Math.round(t*10)/10;function Hk(t,e,n,r){const o=qi(t),i=sr(o,"margin"),s=Yi(o.maxWidth,t,"clientWidth")||zi,a=Yi(o.maxHeight,t,"clientHeight")||zi,l=zk(t,e,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const A=sr(o,"border","width"),f=sr(o,"padding");c-=f.width+A.width,u-=f.height+A.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=Un(Math.min(c,s,l.maxWidth)),u=Un(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Un(c/2)),(e!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Un(Math.floor(u*r))),{width:c,height:u}}function Zf(t,e,n){const r=e||1,o=Un(t.height*r),i=Un(t.width*r);t.height=Un(t.height),t.width=Un(t.width);const s=t.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${t.height}px`,s.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||s.height!==o||s.width!==i?(t.currentDevicePixelRatio=r,s.height=o,s.width=i,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const Rk=(function(){let t=!1;try{const e={get passive(){return t=!0,!1}};vl()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t})();function $f(t,e){const n=Lk(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const Uk=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},jk=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Or(t,e,n){return t?Uk(e,n):jk()}function eh(t,e){let n,r;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function th(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ki(t,e,n){return t.options.clip?t[n]:e[n]}function Vk(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:Ki(n,e,"left"),right:Ki(n,e,"right"),top:Ki(r,e,"top"),bottom:Ki(r,e,"bottom")}:e}function Wk(t,e){const n=e._clip;if(n.disabled)return!1;const r=Vk(e,t.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:r.bottom+(n.bottom===!0?0:n.bottom)}}class Yk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,o){const i=n.listeners[o],s=n.duration;i.forEach(a=>a({chart:e,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Mf.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,o)=>{if(!r.running||!r.items.length)return;const i=r.items;let s=i.length-1,a=!1,l;for(;s>=0;--s)l=i[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(e),a=!0):(i[s]=i[i.length-1],i.pop());a&&(o.draw(),this._notify(o,r,e,"progress")),i.length||(r.running=!1,this._notify(o,r,e,"complete"),r.initial=!1),n+=i.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,o)=>Math.max(r,o._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const r=n.items;let o=r.length-1;for(;o>=0;--o)r[o].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var kn=new Yk;const nh="transparent",qk={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=Nf(t||nh),o=r.valid&&Nf(e||nh);return o&&o.valid?o.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class Kk{constructor(e,n,r,o){const i=n[r];o=Wi([e.to,o,i,e.from]);const s=Wi([e.from,i,o]);this._active=!0,this._fn=e.fn||qk[e.type||typeof s],this._easing=Do[e.easing]||Do.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=s,this._to=o,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const o=this._target[this._prop],i=r-this._start,s=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(s,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=Wi([e.to,n,o,e.from]),this._from=Wi([e.from,o,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,o=this._prop,i=this._from,s=this._loop,a=this._to;let l;if(this._active=i!==a&&(s||n<r),!this._active){this._target[o]=a,this._notify(!0);return}if(n<0){this._target[o]=i;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[o]=this._fn(i,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let o=0;o<r.length;o++)r[o][n]()}}class rh{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!me(e))return;const n=Object.keys(ze.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(o=>{const i=e[o];if(!me(i))return;const s={};for(const a of n)s[a]=i[a];(We(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(e,n){const r=n.options,o=Xk(e,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&Gk(e.options.$animations,r).then(()=>{e.options=r},()=>{}),i}_createAnimations(e,n){const r=this._properties,o=[],i=e.$animations||(e.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(e,n));continue}const u=n[c];let d=i[c];const A=r.get(c);if(d)if(A&&d.active()){d.update(A,u,a);continue}else d.cancel();if(!A||!A.duration){e[c]=u;continue}i[c]=d=new Kk(A,e,c,u),o.push(d)}return o}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return kn.add(this._chart,r),!0}}function Gk(t,e){const n=[],r=Object.keys(e);for(let o=0;o<r.length;o++){const i=t[r[o]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function Xk(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function oh(t,e){const n=t&&t.options||{},r=n.reverse,o=n.min===void 0?e:0,i=n.max===void 0?e:0;return{start:r?i:o,end:r?o:i}}function Jk(t,e,n){if(n===!1)return!1;const r=oh(t,n),o=oh(e,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function Zk(t){let e,n,r,o;return me(t)?(e=t.top,n=t.right,r=t.bottom,o=t.left):e=n=r=o=t,{top:e,right:n,bottom:r,left:o,disabled:t===!1}}function ih(t,e){const n=[],r=t._getSortedDatasetMetas(e);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function sh(t,e,n,r={}){const o=t.keys,i=r.mode==="single";let s,a,l,c;if(e===null)return;let u=!1;for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(u=!0,r.all)continue;break}c=t.values[l],_t(c)&&(i||e===0||Rn(e)===Rn(c))&&(e+=c)}return!u&&!r.all?0:e}function $k(t,e){const{iScale:n,vScale:r}=e,o=n.axis==="x"?"x":"y",i=r.axis==="x"?"x":"y",s=Object.keys(t),a=new Array(s.length);let l,c,u;for(l=0,c=s.length;l<c;++l)u=s[l],a[l]={[o]:u,[i]:t[u]};return a}function xl(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function eE(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function tE(t){const{min:e,max:n,minDefined:r,maxDefined:o}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function nE(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function ah(t,e,n,r){for(const o of e.getMatchingVisibleMetas(r).reverse()){const i=t[o.index];if(n&&i>0||!n&&i<0)return o.index}return null}function lh(t,e){const{chart:n,_cachedMeta:r}=t,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:a}=r,l=i.axis,c=s.axis,u=eE(i,s,r),d=e.length;let A;for(let f=0;f<d;++f){const h=e[f],{[l]:g,[c]:p}=h,v=h._stacks||(h._stacks={});A=v[c]=nE(o,u,g),A[a]=p,A._top=ah(A,s,!0,r.type),A._bottom=ah(A,s,!1,r.type);const x=A._visualValues||(A._visualValues={});x[a]=p}}function kl(t,e){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function rE(t,e){return Mr(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function oE(t,e,n){return Mr(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Mo(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const o of e){const i=o._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const El=t=>t==="reset"||t==="none",ch=(t,e)=>e?t:Object.assign({},t),iE=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:ih(n,!0),values:null};class Gi{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,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(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=xl(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&&Mo(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,A,f,h)=>d==="x"?A:d==="r"?h:f,i=n.xAxisID=ye(r.xAxisID,kl(e,"x")),s=n.yAxisID=ye(r.yAxisID,kl(e,"y")),a=n.rAxisID=ye(r.rAxisID,kl(e,"r")),l=n.indexAxis,c=n.iAxisID=o(l,i,s,a),u=n.vAxisID=o(l,s,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Bf(this._data,this),e._stacked&&Mo(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(me(n)){const o=this._cachedMeta;this._data=$k(n,o)}else if(r!==n){if(r){Bf(r,this);const o=this._cachedMeta;Mo(o),o._parsed=[]}n&&Object.isExtensible(n)&&ok(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,r=this.getDataset();let o=!1;this._dataCheck();const i=n._stacked;n._stacked=xl(n.vScale,n),n.stack!==r.stack&&(o=!0,Mo(n),n.stack=r.stack),this._resyncElements(e),(o||i!==n._stacked)&&(lh(this,n._parsed),n._stacked=xl(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:o}=this,{iScale:i,_stacked:s}=r,a=i.axis;let l=e===0&&n===o.length?!0:r._sorted,c=e>0&&r._parsed[e-1],u,d,A;if(this._parsing===!1)r._parsed=o,r._sorted=!0,A=o;else{We(o[e])?A=this.parseArrayData(r,o,e,n):me(o[e])?A=this.parseObjectData(r,o,e,n):A=this.parsePrimitiveData(r,o,e,n);const f=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+e]=d=A[u],l&&(f()&&(l=!1),c=d);r._sorted=l}s&&lh(this,A)}parsePrimitiveData(e,n,r,o){const{iScale:i,vScale:s}=e,a=i.axis,l=s.axis,c=i.getLabels(),u=i===s,d=new Array(o);let A,f,h;for(A=0,f=o;A<f;++A)h=A+r,d[A]={[a]:u||i.parse(c[h],h),[l]:s.parse(n[h],h)};return d}parseArrayData(e,n,r,o){const{xScale:i,yScale:s}=e,a=new Array(o);let l,c,u,d;for(l=0,c=o;l<c;++l)u=l+r,d=n[u],a[l]={x:i.parse(d[0],u),y:s.parse(d[1],u)};return a}parseObjectData(e,n,r,o){const{xScale:i,yScale:s}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,d,A,f;for(u=0,d=o;u<d;++u)A=u+r,f=n[A],c[u]={x:i.parse(zn(f,a),A),y:s.parse(zn(f,l),A)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const o=this.chart,i=this._cachedMeta,s=n[e.axis],a={keys:ih(o,!0),values:n._stacks[e.axis]._visualValues};return sh(a,s,i.index,{mode:r})}updateRangeFromParsed(e,n,r,o){const i=r[n.axis];let s=i===null?NaN:i;const a=o&&r._stacks[n.axis];o&&a&&(o.values=a,s=sh(o,i,this._cachedMeta.index)),e.min=Math.min(e.min,s),e.max=Math.max(e.max,s)}getMinMax(e,n){const r=this._cachedMeta,o=r._parsed,i=r._sorted&&e===r.iScale,s=o.length,a=this._getOtherScale(e),l=iE(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=tE(a);let A,f;function h(){f=o[A];const g=f[a.axis];return!_t(f[e.axis])||u>g||d<g}for(A=0;A<s&&!(!h()&&(this.updateRangeFromParsed(c,e,f,l),i));++A);if(i){for(A=s-1;A>=0;--A)if(!h()){this.updateRangeFromParsed(c,e,f,l);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let o,i,s;for(o=0,i=n.length;o<i;++o)s=n[o][e.axis],_t(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,o=n.vScale,i=this.getParsed(e);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=Zk(ye(this.options.clip,Jk(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,o=r.data||[],i=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||o.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(e,i,a,l),u=a;u<a+l;++u){const d=o[u];d.hidden||(d.active&&c?s.push(d):d.draw(e,i))}for(u=0;u<s.length;++u)s[u].draw(e,i)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const o=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const s=this._cachedMeta.data[e];i=s.$context||(s.$context=oE(this.getContext(),e,s)),i.parsed=this.getParsed(e),i.raw=o.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=rE(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const o=n==="active",i=this._cachedDataOpts,s=e+"-"+n,a=i[s],l=this.enableOptionSharing&&Po(r);if(a)return ch(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,e),d=o?[`${e}Hover`,"hover",e,""]:[e,""],A=c.getOptionScopes(this.getDataset(),u),f=Object.keys(ze.elements[e]),h=()=>this.getContext(r,o,n),g=c.resolveNamedOptions(A,f,h,d);return g.$shared&&(g.$shared=l,i[s]=Object.freeze(ch(g,l))),g}_resolveAnimations(e,n,r){const o=this.chart,i=this._cachedDataOpts,s=`animation-${n}`,a=i[s];if(a)return a;let l;if(o.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),A=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(A,this.getContext(e,r,n))}const c=new rh(o,l&&l.animations);return l&&l._cacheable&&(i[s]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||El(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),o=this._sharedOptions,i=this.getSharedOptions(r),s=this.includeOptions(n,i)||i!==o;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:s}}updateElement(e,n,r,o){El(o)?Object.assign(e,r):this._resolveAnimations(n,o).update(e,r)}updateSharedOptions(e,n,r){e&&!El(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,o){e.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(e,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const o=r.length,i=n.length,s=Math.min(i,o);s&&this.parse(0,s),i>o?this._insertElements(o,i-o,e):i<o&&this._removeElements(i,o-i)}_insertElements(e,n,r=!0){const o=this._cachedMeta,i=o.data,s=e+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(i),a=e;a<s;++a)i[a]=new this.dataElementType;this._parsing&&l(o._parsed),this.parse(e,n),r&&this.updateElements(i,e,n,"reset")}updateElements(e,n,r,o){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const o=r._parsed.splice(e,n);r._stacked&&Mo(r,o)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,o]=e;this[n](r,o)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const 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,n){n&&this._sync(["_removeElements",e,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function sE(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let r=[];for(let o=0,i=n.length;o<i;o++)r=r.concat(n[o].controller.getAllParsedValues(t));t._cache.$bar=If(r.sort((o,i)=>o-i))}return t._cache.$bar}function aE(t){const e=t.iScale,n=sE(e,t.type);let r=e._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(Po(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(o=0,i=n.length;o<i;++o)s=e.getPixelForValue(n[o]),l();for(a=void 0,o=0,i=e.ticks.length;o<i;++o)s=e.getPixelForTick(o),l();return r}function lE(t,e,n,r){const o=n.barThickness;let i,s;return Pe(o)?(i=e.min*n.categoryPercentage,s=n.barPercentage):(i=o*r,s=1),{chunk:i/r,ratio:s,start:e.pixels[t]-i/2}}function cE(t,e,n,r){const o=e.pixels,i=o[t];let s=t>0?o[t-1]:null,a=t<o.length-1?o[t+1]:null;const l=n.categoryPercentage;s===null&&(s=i-(a===null?e.end-e.start:a-i)),a===null&&(a=i+i-s);const c=i-(i-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function uE(t,e,n,r){const o=n.parse(t[0],r),i=n.parse(t[1],r),s=Math.min(o,i),a=Math.max(o,i);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:o,end:i,min:s,max:a}}function uh(t,e,n,r){return We(t)?uE(t,e,n,r):e[n.axis]=n.parse(t,r),e}function dh(t,e,n,r){const o=t.iScale,i=t.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,d,A;for(c=n,u=n+r;c<u;++c)A=e[c],d={},d[o.axis]=a||o.parse(s[c],c),l.push(uh(A,d,i,c));return l}function Sl(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function dE(t,e,n){return t!==0?Rn(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function AE(t){let e,n,r,o,i;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:e,top:o,bottom:i}}function fE(t,e,n,r){let o=e.borderSkipped;const i={};if(!o){t.borderSkipped=i;return}if(o===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=AE(t);o==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[Ah(u,s,a,l)]=!0,o=c)),i[Ah(o,s,a,l)]=!0,t.borderSkipped=i}function Ah(t,e,n,r){return r?(t=hE(t,e,n),t=fh(t,n,e)):t=fh(t,e,n),t}function hE(t,e,n){return t===e?n:t===n?e:t}function fh(t,e,n){return t==="start"?e:t==="end"?n:t}function pE(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class gE extends Gi{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,n,r,o){return dh(e,n,r,o)}parseArrayData(e,n,r,o){return dh(e,n,r,o)}parseObjectData(e,n,r,o){const{iScale:i,vScale:s}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,u=s.axis==="x"?a:l,d=[];let A,f,h,g;for(A=r,f=r+o;A<f;++A)g=n[A],h={},h[i.axis]=i.parse(zn(g,c),A),d.push(uh(zn(g,u),h,s,A));return d}updateRangeFromParsed(e,n,r,o){super.updateRangeFromParsed(e,n,r,o);const i=r._custom;i&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:r,vScale:o}=n,i=this.getParsed(e),s=i._custom,a=Sl(s)?"["+s.start+", "+s.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,r,o){const i=o==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:A}=this._getSharedOptions(n,o);for(let f=n;f<n+r;f++){const h=this.getParsed(f),g=i||Pe(h[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,u),v=(h._stacks||{})[a.axis],x={horizontal:c,base:g.base,enableBorderRadius:!v||Sl(h._custom)||s===v._top||s===v._bottom,x:c?g.head:p.center,y:c?p.center:g.head,height:c?p.size:Math.abs(g.size),width:c?Math.abs(g.size):p.size};A&&(x.options=d||this.resolveDataElementOptions(f,e[f].active?"active":o));const y=x.options||e[f].options;fE(x,y,v,s),pE(x,y,u.ratio),this.updateElement(e[f],f,x,o)}}_getStacks(e,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),i=r.options.stacked,s=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=u=>{const d=u._parsed.find(f=>f[r.axis]===l),A=d&&d[u.vScale.axis];if(Pe(A)||isNaN(A))return!0};for(const u of o)if(!(n!==void 0&&c(u))&&((i===!1||s.indexOf(u.stack)===-1||i===void 0&&u.stack===void 0)&&s.push(u.stack),u.index===e))break;return s.length||s.push(void 0),s}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(r=>e[r].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)e[ye(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,r){const o=this._getStacks(e,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const e=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,s;for(i=0,s=n.data.length;i<s;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=e.barThickness;return{min:a||aE(n),pixels:o,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:r,index:o},options:{base:i,minBarLength:s}}=this,a=i||0,l=this.getParsed(e),c=l._custom,u=Sl(c);let d=l[n.axis],A=0,f=r?this.applyStack(n,l,r):d,h,g;f!==d&&(A=f-d,f=d),u&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&Rn(d)!==Rn(c.barEnd)&&(A=0),A+=d);const p=!Pe(i)&&!u?i:A;let v=n.getPixelForValue(p);if(this.chart.getDataVisibility(e)?h=n.getPixelForValue(A+f):h=v,g=h-v,Math.abs(g)<s){g=dE(g,n,a)*s,d===a&&(v-=g/2);const x=n.getPixelForDecimal(0),y=n.getPixelForDecimal(1),b=Math.min(x,y),E=Math.max(x,y);v=Math.max(Math.min(v,E),b),h=v+g,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(h)-n.getValueForPixel(v))}if(v===n.getPixelForValue(a)){const x=Rn(g)*n.getLineWidthForValue(a)/2;v+=x,g-=x}return{size:g,base:v,head:h,center:h+g/2}}_calculateBarIndexPixels(e,n){const r=n.scale,o=this.options,i=o.skipNull,s=ye(o.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const u=i?this._getStackCount(e):n.stackCount,d=o.barThickness==="flex"?cE(e,n,o,u*c):lE(e,n,o,u*c),A=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(ye(A,this.getFirstScaleIdForIndexAxis())),h=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+f;a=d.start+d.chunk*h+d.chunk/2,l=Math.min(s,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(e)[r.axis],e),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const e=this._cachedMeta,n=e.vScale,r=e.data,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&!r[i].hidden&&r[i].draw(this._ctx)}}function mE(t,e,n){let r=1,o=1,i=0,s=0;if(e<vt){const a=t,l=a+e,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),A=Math.sin(l),f=(y,b,E)=>ll(y,a,l,!0)?1:Math.max(b,b*n,E,E*n),h=(y,b,E)=>ll(y,a,l,!0)?-1:Math.min(b,b*n,E,E*n),g=f(0,c,d),p=f(wt,u,A),v=h(Ye,c,d),x=h(Ye+wt,u,A);r=(g-v)/2,o=(p-x)/2,i=-(g+v)/2,s=-(p+x)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class bE extends Gi{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){const n=e.data,{labels:{pointStyle:r,textAlign:o,color:i,useBorderRadius:s,borderRadius:a}}=e.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const d=e.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:o,pointStyle:r,borderRadius:s&&(a||d.borderRadius),index:c}}):[]}},onClick(e,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const r=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let i=l=>+r[l];if(me(r[e])){const{key:l="value"}=this._parsing;i=c=>+zn(r[c],l)}let s,a;for(s=e,a=e+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return ln(this.options.rotation-90)}_getCircumference(){return ln(this.options.circumference)}_getRotationExtents(){let e=vt,n=-vt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const o=this.chart.getDatasetMeta(r).controller,i=o._getRotation(),s=o._getCircumference();e=Math.min(e,i),n=Math.max(n,i+s)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:r}=n,o=this._cachedMeta,i=o.data,s=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(R2(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:A,ratioY:f,offsetX:h,offsetY:g}=mE(d,u,l),p=(r.width-s)/A,v=(r.height-s)/f,x=Math.max(Math.min(p,v)/2,0),y=vf(this.options.radius,x),b=Math.max(y*l,0),E=(y-b)/this._getVisibleDatasetWeightTotal();this.offsetX=h*y,this.offsetY=g*y,o.total=this.calculateTotal(),this.outerRadius=y-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*c,0),this.updateElements(i,0,i.length,e)}_circumference(e,n){const r=this.options,o=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(e)||o._parsed[e]===null||o.data[e].hidden?0:this.calculateCircumference(o._parsed[e]*i/vt)}updateElements(e,n,r,o){const i=o==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,A=i&&c.animateScale,f=A?0:this.innerRadius,h=A?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(n,o);let v=this._getRotation(),x;for(x=0;x<n;++x)v+=this._circumference(x,i);for(x=n;x<n+r;++x){const y=this._circumference(x,i),b=e[x],E={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+y,circumference:y,outerRadius:h,innerRadius:f};p&&(E.options=g||this.resolveDataElementOptions(x,b.active?"active":o)),v+=y,this.updateElement(b,x,E,o)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let r=0,o;for(o=0;o<n.length;o++){const i=e._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?vt*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=ji(n._parsed[e],r.options.locale);return{label:o[e]||"",value:i}}getMaxBorderWidth(e){let n=0;const r=this.chart;let o,i,s,a,l;if(!e){for(o=0,i=r.data.datasets.length;o<i;++o)if(r.isDatasetVisible(o)){s=r.getDatasetMeta(o),e=s.data,a=s.controller;break}}if(!e)return 0;for(o=0,i=e.length;o<i;++o)l=a.resolveDataElementOptions(o),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let r=0,o=e.length;r<o;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let r=0;r<e;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(e){return Math.max(ye(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class yE extends Gi{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){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=e.legend.options;return n.labels.map((i,s)=>{const l=e.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=ji(n._parsed[e].r,r.options.locale);return{label:o[e]||"",value:i}}parseObjectData(e,n,r,o){return Tk.bind(this)(e,n,r,o)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((r,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,r=e.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),s=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),a=(i-s)/e.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,n,r,o){const i=o==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,A=c.getIndexAngle(0)-.5*Ye;let f=A,h;const g=360/this.countVisibleElements();for(h=0;h<n;++h)f+=this._computeAngle(h,o,g);for(h=n;h<n+r;h++){const p=e[h];let v=f,x=f+this._computeAngle(h,o,g),y=s.getDataVisibility(h)?c.getDistanceFromCenterForValue(this.getParsed(h).r):0;f=x,i&&(l.animateScale&&(y=0),l.animateRotate&&(v=x=A));const b={x:u,y:d,innerRadius:0,outerRadius:y,startAngle:v,endAngle:x,options:this.resolveDataElementOptions(h,p.active?"active":o)};this.updateElement(p,h,b,o)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((r,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(e,n,r){return this.chart.getDataVisibility(e)?ln(this.resolveDataElementOptions(e,n).angle||r):0}}function lr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Cl{static override(e){Object.assign(Cl.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return lr()}parse(){return lr()}format(){return lr()}add(){return lr()}diff(){return lr()}startOf(){return lr()}endOf(){return lr()}}var vE={_date:Cl};function wE(t,e,n,r){const{controller:o,data:i,_sorted:s}=t,a=o._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&s&&i.length){const c=a._reversePixels?nk:ul;if(r){if(o._sharedOptions){const u=i[0],d=typeof u.getRange=="function"&&u.getRange(e);if(d){const A=c(i,e,n-d),f=c(i,e,n+d);return{lo:A.lo,hi:f.hi}}}}else{const u=c(i,e,n);if(l){const{vScale:d}=o._cachedMeta,{_parsed:A}=t,f=A.slice(0,u.lo+1).reverse().findIndex(g=>!Pe(g[d.axis]));u.lo-=Math.max(0,f);const h=A.slice(u.hi).findIndex(g=>!Pe(g[d.axis]));u.hi+=Math.max(0,h)}return u}}return{lo:0,hi:i.length-1}}function Xi(t,e,n,r,o){const i=t.getSortedVisibleDatasetMetas(),s=n[e];for(let a=0,l=i.length;a<l;++a){const{index:c,data:u}=i[a],{lo:d,hi:A}=wE(i[a],e,s,o);for(let f=d;f<=A;++f){const h=u[f];h.skip||r(h,c,f)}}}function xE(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,o){const i=e?Math.abs(r.x-o.x):0,s=n?Math.abs(r.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(s,2))}}function Pl(t,e,n,r,o){const i=[];return!o&&!t.isPointInArea(e)||Xi(t,n,e,function(a,l,c){!o&&!jf(a,t.chartArea,0)||a.inRange(e.x,e.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function kE(t,e,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=$2(s,{x:e.x,y:e.y});ll(d,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return Xi(t,n,e,i),o}function EE(t,e,n,r,o,i){let s=[];const a=xE(n);let l=Number.POSITIVE_INFINITY;function c(u,d,A){const f=u.inRange(e.x,e.y,o);if(r&&!f)return;const h=u.getCenterPoint(o);if(!(!!i||t.isPointInArea(h))&&!f)return;const p=a(e,h);p<l?(s=[{element:u,datasetIndex:d,index:A}],l=p):p===l&&s.push({element:u,datasetIndex:d,index:A})}return Xi(t,n,e,c),s}function Dl(t,e,n,r,o,i){return!i&&!t.isPointInArea(e)?[]:n==="r"&&!r?kE(t,e,n,o):EE(t,e,n,r,o,i)}function hh(t,e,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Xi(t,n,e,(l,c,u)=>{l[s]&&l[s](e[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(e.x,e.y,o))}),r&&!a?[]:i}var SE={modes:{index(t,e,n,r){const o=ar(e,t),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Pl(t,o,i,r,s):Dl(t,o,i,!1,r,s),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(t,e,n,r){const o=ar(e,t),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Pl(t,o,i,r,s):Dl(t,o,i,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=t.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(t,e,n,r){const o=ar(e,t),i=n.axis||"xy",s=n.includeInvisible||!1;return Pl(t,o,i,r,s)},nearest(t,e,n,r){const o=ar(e,t),i=n.axis||"xy",s=n.includeInvisible||!1;return Dl(t,o,i,n.intersect,r,s)},x(t,e,n,r){const o=ar(e,t);return hh(t,o,"x",n.intersect,r)},y(t,e,n,r){const o=ar(e,t);return hh(t,o,"y",n.intersect,r)}}};const ph=["left","top","right","bottom"];function _o(t,e){return t.filter(n=>n.pos===e)}function gh(t,e){return t.filter(n=>ph.indexOf(n.pos)===-1&&n.box.axis===e)}function Oo(t,e){return t.sort((n,r)=>{const o=e?r:n,i=e?n:r;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function CE(t){const e=[];let n,r,o,i,s,a;for(n=0,r=(t||[]).length;n<r;++n)o=t[n],{position:i,options:{stack:s,stackWeight:a=1}}=o,e.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:s&&i+s,stackWeight:a});return e}function PE(t){const e={};for(const n of t){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!ph.includes(o))continue;const s=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=i}return e}function DE(t,e){const n=PE(t),{vBoxMaxWidth:r,hBoxMaxHeight:o}=e;let i,s,a;for(i=0,s=t.length;i<s;++i){a=t[i];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&e.availableWidth,a.height=o):(a.width=r,a.height=u?u*o:l&&e.availableHeight)}return n}function BE(t){const e=CE(t),n=Oo(e.filter(c=>c.box.fullSize),!0),r=Oo(_o(e,"left"),!0),o=Oo(_o(e,"right")),i=Oo(_o(e,"top"),!0),s=Oo(_o(e,"bottom")),a=gh(e,"x"),l=gh(e,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:_o(e,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function mh(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function bh(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function IE(t,e,n,r){const{pos:o,box:i}=n,s=t.maxPadding;if(!me(o)){n.size&&(t[o]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?i.height:i.width),n.size=d.size/d.count,t[o]+=n.size}i.getPadding&&bh(s,i.getPadding());const a=Math.max(0,e.outerWidth-mh(s,t,"left","right")),l=Math.max(0,e.outerHeight-mh(s,t,"top","bottom")),c=a!==t.w,u=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function ME(t){const e=t.maxPadding;function n(r){const o=Math.max(e[r]-t[r],0);return t[r]+=o,o}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function _E(t,e){const n=e.maxPadding;function r(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(s=>{i[s]=Math.max(e[s],n[s])}),i}return r(t?["left","right"]:["top","bottom"])}function To(t,e,n,r){const o=[];let i,s,a,l,c,u;for(i=0,s=t.length,c=0;i<s;++i){a=t[i],l=a.box,l.update(a.width||e.w,a.height||e.h,_E(a.horizontal,e));const{same:d,other:A}=IE(e,n,a,r);c|=d&&o.length,u=u||A,l.fullSize||o.push(a)}return c&&To(o,e,n,r)||u}function Ji(t,e,n,r,o){t.top=n,t.left=e,t.right=e+r,t.bottom=n+o,t.width=r,t.height=o}function yh(t,e,n,r){const o=n.padding;let{x:i,y:s}=e;for(const a of t){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=e.w*u,A=c.size||l.height;Po(c.start)&&(s=c.start),l.fullSize?Ji(l,o.left,s,n.outerWidth-o.right-o.left,A):Ji(l,e.left+c.placed,s,d,A),c.start=s,c.placed+=d,s=l.bottom}else{const d=e.h*u,A=c.size||l.width;Po(c.start)&&(i=c.start),l.fullSize?Ji(l,i,o.top,A,n.outerHeight-o.bottom-o.top):Ji(l,i,e.top+c.placed,A,d),c.start=i,c.placed+=d,i=l.right}}e.x=i,e.y=s}var Tt={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const o=Ot(t.options.layout.padding),i=Math.max(e-o.width,0),s=Math.max(n-o.height,0),a=BE(t.boxes),l=a.vertical,c=a.horizontal;Ee(t.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),A=Object.assign({},o);bh(A,Ot(r));const f=Object.assign({maxPadding:A,w:i,h:s,x:o.left,y:o.top},o),h=DE(l.concat(c),d);To(a.fullSize,f,d,h),To(l,f,d,h),To(c,f,d,h)&&To(l,f,d,h),ME(f),yh(a.leftAndTop,f,d,h),f.x+=f.w,f.y+=f.h,yh(a.rightAndBottom,f,d,h),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Ee(a.chartArea,g=>{const p=g.box;Object.assign(p,t.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class vh{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,o){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,o?Math.floor(n/o):r)}}isAttached(e){return!0}updateConfig(e){}}class OE extends vh{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Zi="$chartjs",TE={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},wh=t=>t===null||t==="";function LE(t,e){const n=t.style,r=t.getAttribute("height"),o=t.getAttribute("width");if(t[Zi]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",wh(o)){const i=$f(t,"width");i!==void 0&&(t.width=i)}if(wh(r))if(t.style.height==="")t.height=t.width/(e||2);else{const i=$f(t,"height");i!==void 0&&(t.height=i)}return t}const xh=Rk?{passive:!0}:!1;function NE(t,e,n){t&&t.addEventListener(e,n,xh)}function QE(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,xh)}function FE(t,e){const n=TE[t.type]||t.type,{x:r,y:o}=ar(t,e);return{type:n,chart:e,native:t,x:r!==void 0?r:null,y:o!==void 0?o:null}}function $i(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function zE(t,e,n){const r=t.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||$i(a.addedNodes,r),s=s&&!$i(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function HE(t,e,n){const r=t.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||$i(a.removedNodes,r),s=s&&!$i(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Lo=new Map;let kh=0;function Eh(){const t=window.devicePixelRatio;t!==kh&&(kh=t,Lo.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function RE(t,e){Lo.size||window.addEventListener("resize",Eh),Lo.set(t,e)}function UE(t){Lo.delete(t),Lo.size||window.removeEventListener("resize",Eh)}function jE(t,e,n){const r=t.canvas,o=r&&wl(r);if(!o)return;const i=_f((a,l)=>{const c=o.clientWidth;n(a,l),c<o.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return s.observe(o),RE(t,i),s}function Bl(t,e,n){n&&n.disconnect(),e==="resize"&&UE(t)}function VE(t,e,n){const r=t.canvas,o=_f(i=>{t.ctx!==null&&n(FE(i,t))},t);return NE(r,e,o),o}class WE extends vh{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(LE(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[Zi])return!1;const r=n[Zi].initial;["height","width"].forEach(i=>{const s=r[i];Pe(s)?n.removeAttribute(i):n.setAttribute(i,s)});const o=r.style||{};return Object.keys(o).forEach(i=>{n.style[i]=o[i]}),n.width=n.width,delete n[Zi],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const o=e.$proxies||(e.$proxies={}),s={attach:zE,detach:HE,resize:jE}[n]||VE;o[n]=s(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),o=r[n];if(!o)return;({attach:Bl,detach:Bl,resize:Bl}[n]||QE)(e,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,o){return Hk(e,n,r,o)}isAttached(e){const n=e&&wl(e);return!!(n&&n.isConnected)}}function YE(t){return!vl()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?OE:WE}let Tr=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return Ri(this.x)&&Ri(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const o={};return e.forEach(i=>{o[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),o}};function qE(t,e){const n=t.options.ticks,r=KE(t),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?XE(e):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return JE(e,c,i,s/o),c;const u=GE(i,e,o);if(s>0){let d,A;const f=s>1?Math.round((l-a)/(s-1)):null;for(es(e,c,u,Pe(f)?0:a-f,a),d=0,A=s-1;d<A;d++)es(e,c,u,i[d],i[d+1]);return es(e,c,u,l,Pe(f)?e.length:l+f),c}return es(e,c,u),c}function KE(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),o=t._maxLength/n;return Math.floor(Math.min(r,o))}function GE(t,e,n){const r=ZE(t),o=e.length/n;if(!r)return Math.max(o,1);const i=K2(r);for(let s=0,a=i.length-1;s<a;s++){const l=i[s];if(l>o)return l}return Math.max(o,1)}function XE(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}function JE(t,e,n,r){let o=0,i=n[0],s;for(r=Math.ceil(r),s=0;s<t.length;s++)s===i&&(e.push(t[s]),o++,i=n[o*r])}function es(t,e,n,r,o){const i=ye(r,0),s=Math.min(ye(o,t.length),t.length);let a=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(c=Math.max(i,0);c<s;c++)c===u&&(e.push(t[c]),a++,u=Math.round(i+a*n))}function ZE(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}const $E=t=>t==="left"?"right":t==="right"?"left":t,Sh=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,Ch=(t,e)=>Math.min(e||t,t);function Ph(t,e){const n=[],r=t.length/e,o=t.length;let i=0;for(;i<o;i+=r)n.push(t[Math.floor(i)]);return n}function eS(t,e,n){const r=t.ticks.length,o=Math.min(e,r-1),i=t._startPixel,s=t._endPixel,a=1e-6;let l=t.getPixelForTick(o),c;if(!(n&&(r===1?c=Math.max(l-i,s-l):e===0?c=(t.getPixelForTick(1)-l)/2:c=(l-t.getPixelForTick(o-1))/2,l+=o<e?c:-c,l<i-a||l>s+a)))return l}function tS(t,e){Ee(t,n=>{const r=n.gc,o=r.length/2;let i;if(o>e){for(i=0;i<o;++i)delete n.data[r[i]];r.splice(0,o)}})}function No(t){return t.drawTicks?t.tickLength:0}function Dh(t,e){if(!t.display)return 0;const n=et(t.font,e),r=Ot(t.padding);return(We(t.text)?t.text.length:1)*n.lineHeight+r.height}function nS(t,e){return Mr(t,{scale:e,type:"scale"})}function rS(t,e,n){return Mr(t,{tick:n,index:e,type:"tick"})}function oS(t,e,n){let r=dl(t);return(n&&e!=="right"||!n&&e==="right")&&(r=$E(r)),r}function iS(t,e,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=t,{chartArea:c,scales:u}=l;let d=0,A,f,h;const g=s-o,p=a-i;if(t.isHorizontal()){if(f=$e(r,i,a),me(n)){const v=Object.keys(n)[0],x=n[v];h=u[v].getPixelForValue(x)+g-e}else n==="center"?h=(c.bottom+c.top)/2+g-e:h=Sh(t,n,e);A=a-i}else{if(me(n)){const v=Object.keys(n)[0],x=n[v];f=u[v].getPixelForValue(x)-p+e}else n==="center"?f=(c.left+c.right)/2-p+e:f=Sh(t,n,e);h=$e(r,s,o),d=n==="left"?-wt:wt}return{titleX:f,titleY:h,maxWidth:A,rotation:d}}class Lr extends Tr{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:r,_suggestedMax:o}=this;return e=an(e,Number.POSITIVE_INFINITY),n=an(n,Number.NEGATIVE_INFINITY),r=an(r,Number.POSITIVE_INFINITY),o=an(o,Number.NEGATIVE_INFINITY),{min:an(e,r),max:an(n,o),minDefined:_t(e),maxDefined:_t(n)}}getMinMax(e){let{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds(),s;if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,e),o||(n=Math.min(n,s.min)),i||(r=Math.max(r,s.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:an(n,an(r,n)),max:an(r,an(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Te(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:o,grace:i,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ek(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Ph(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=qE(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Te(this.options.afterUpdate,[this])}beforeSetDimensions(){Te(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(){Te(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Te(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Te(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,o,i;for(r=0,o=e.length;r<o;r++)i=e[r],i.label=Te(n.callback,[i.value,r,e],this)}afterTickToLabelConversion(){Te(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Te(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=Ch(this.ticks.length,e.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let s=o,a,l,c;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),d=u.widest.width,A=u.highest.height,f=Ht(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/r:f/(r-1),d+6>a&&(a=f/(r-(e.offset?.5:1)),l=this.maxHeight-No(e.grid)-n.padding-Dh(e.title,this.chart.options.font),c=Math.sqrt(d*d+A*A),s=Z2(Math.min(Math.asin(Ht((u.highest.height+6)/a,-1,1)),Math.asin(Ht(l/c,-1,1))-Math.asin(Ht(A/c,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){Te(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Te(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:o,grid:i}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=Dh(o,n.options.font);if(a?(e.width=this.maxWidth,e.height=No(i)+l):(e.height=this.maxHeight,e.width=No(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:A}=this._getLabelSizes(),f=r.padding*2,h=ln(this.labelRotation),g=Math.cos(h),p=Math.sin(h);if(a){const v=r.mirror?0:p*d.width+g*A.height;e.height=Math.min(this.maxHeight,e.height+v+f)}else{const v=r.mirror?0:g*d.width+p*A.height;e.width=Math.min(this.maxWidth,e.width+v+f)}this._calculatePadding(c,u,p,g)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,r,o){const{ticks:{align:i,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let A=0,f=0;l?c?(A=o*e.width,f=r*n.height):(A=r*e.height,f=o*n.width):i==="start"?f=n.width:i==="end"?A=e.width:i!=="inner"&&(A=e.width/2,f=n.width/2),this.paddingLeft=Math.max((A-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=e.height/2;i==="start"?(u=0,d=e.height):i==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){Te(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,r;for(n=0,r=e.length;n<r;n++)Pe(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Ph(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:o,_longestTextCache:i}=this,s=[],a=[],l=Math.floor(n/Ch(n,r));let c=0,u=0,d,A,f,h,g,p,v,x,y,b,E;for(d=0;d<n;d+=l){if(h=e[d].label,g=this._resolveTickFontOptions(d),o.font=p=g.string,v=i[p]=i[p]||{data:{},gc:[]},x=g.lineHeight,y=b=0,!Pe(h)&&!We(h))y=zf(o,v.data,v.gc,y,h),b=x;else if(We(h))for(A=0,f=h.length;A<f;++A)E=h[A],!Pe(E)&&!We(E)&&(y=zf(o,v.data,v.gc,y,E),b+=x);s.push(y),a.push(b),c=Math.max(y,c),u=Math.max(b,u)}tS(i,n);const k=s.indexOf(c),P=a.indexOf(u),D=M=>({width:s[M]||0,height:a[M]||0});return{first:D(0),last:D(n-1),widest:D(k),highest:D(P),widths:s,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return tk(this._alignToPixels?ir(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const r=n[e];return r.$context||(r.$context=rS(this.getContext(),e,r))}return this.$context||(this.$context=nS(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=ln(this.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=this._getLabelSizes(),s=e.autoSkipPadding||0,a=i?i.widest.width+s:0,l=i?i.highest.height+s:0;return this.isHorizontal()?l*r>a*o?a/r:l/o:l*o<a*r?l/r:a/o}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:s,border:a}=o,l=i.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),A=No(i),f=[],h=a.setContext(this.getContext()),g=h.display?h.width:0,p=g/2,v=function(R){return ir(r,R,g)};let x,y,b,E,k,P,D,M,I,_,B,T;if(s==="top")x=v(this.bottom),P=this.bottom-A,M=x-p,_=v(e.top)+p,T=e.bottom;else if(s==="bottom")x=v(this.top),_=e.top,T=v(e.bottom)-p,P=x+p,M=this.top+A;else if(s==="left")x=v(this.right),k=this.right-A,D=x-p,I=v(e.left)+p,B=e.right;else if(s==="right")x=v(this.left),I=e.left,B=v(e.right)-p,k=x+p,D=this.left+A;else if(n==="x"){if(s==="center")x=v((e.top+e.bottom)/2+.5);else if(me(s)){const R=Object.keys(s)[0],Q=s[R];x=v(this.chart.scales[R].getPixelForValue(Q))}_=e.top,T=e.bottom,P=x+p,M=P+A}else if(n==="y"){if(s==="center")x=v((e.left+e.right)/2);else if(me(s)){const R=Object.keys(s)[0],Q=s[R];x=v(this.chart.scales[R].getPixelForValue(Q))}k=x-p,D=k-A,I=e.left,B=e.right}const z=ye(o.ticks.maxTicksLimit,d),O=Math.max(1,Math.ceil(d/z));for(y=0;y<d;y+=O){const R=this.getContext(y),Q=i.setContext(R),H=a.setContext(R),S=Q.lineWidth,K=Q.color,C=H.dash||[],V=H.dashOffset,Z=Q.tickWidth,J=Q.tickColor,ee=Q.tickBorderDash||[],ce=Q.tickBorderDashOffset;b=eS(this,y,l),b!==void 0&&(E=ir(r,b,S),c?k=D=I=B=E:P=M=_=T=E,f.push({tx1:k,ty1:P,tx2:D,ty2:M,x1:I,y1:_,x2:B,y2:T,width:S,color:K,borderDash:C,borderDashOffset:V,tickWidth:Z,tickColor:J,tickBorderDash:ee,tickBorderDashOffset:ce}))}return this._ticksLength=d,this._borderValue=x,f}_computeLabelItems(e){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=i,A=No(r.grid),f=A+u,h=d?-u:f,g=-ln(this.labelRotation),p=[];let v,x,y,b,E,k,P,D,M,I,_,B,T="middle";if(o==="top")k=this.bottom-h,P=this._getXAxisLabelAlignment();else if(o==="bottom")k=this.top+h,P=this._getXAxisLabelAlignment();else if(o==="left"){const O=this._getYAxisLabelAlignment(A);P=O.textAlign,E=O.x}else if(o==="right"){const O=this._getYAxisLabelAlignment(A);P=O.textAlign,E=O.x}else if(n==="x"){if(o==="center")k=(e.top+e.bottom)/2+f;else if(me(o)){const O=Object.keys(o)[0],R=o[O];k=this.chart.scales[O].getPixelForValue(R)+f}P=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(e.left+e.right)/2-f;else if(me(o)){const O=Object.keys(o)[0],R=o[O];E=this.chart.scales[O].getPixelForValue(R)}P=this._getYAxisLabelAlignment(A).textAlign}n==="y"&&(l==="start"?T="top":l==="end"&&(T="bottom"));const z=this._getLabelSizes();for(v=0,x=a.length;v<x;++v){y=a[v],b=y.label;const O=i.setContext(this.getContext(v));D=this.getPixelForTick(v)+i.labelOffset,M=this._resolveTickFontOptions(v),I=M.lineHeight,_=We(b)?b.length:1;const R=_/2,Q=O.color,H=O.textStrokeColor,S=O.textStrokeWidth;let K=P;s?(E=D,P==="inner"&&(v===x-1?K=this.options.reverse?"left":"right":v===0?K=this.options.reverse?"right":"left":K="center"),o==="top"?c==="near"||g!==0?B=-_*I+I/2:c==="center"?B=-z.highest.height/2-R*I+I:B=-z.highest.height+I/2:c==="near"||g!==0?B=I/2:c==="center"?B=z.highest.height/2-R*I:B=z.highest.height-_*I,d&&(B*=-1),g!==0&&!O.showLabelBackdrop&&(E+=I/2*Math.sin(g))):(k=D,B=(1-_)*I/2);let C;if(O.showLabelBackdrop){const V=Ot(O.backdropPadding),Z=z.heights[v],J=z.widths[v];let ee=B-V.top,ce=0-V.left;switch(T){case"middle":ee-=Z/2;break;case"bottom":ee-=Z;break}switch(P){case"center":ce-=J/2;break;case"right":ce-=J;break;case"inner":v===x-1?ce-=J:v>0&&(ce-=J/2);break}C={left:ce,top:ee,width:J+V.width,height:Z+V.height,color:O.backdropColor}}p.push({label:b,font:M,textOffset:B,options:{rotation:g,color:Q,strokeColor:H,strokeWidth:S,textAlign:K,textBaseline:T,translation:[E,k],backdrop:C}})}return p}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-ln(this.labelRotation))return e==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,s=this._getLabelSizes(),a=e+i,l=s.widest.width;let c,u;return n==="left"?o?(u=this.right+i,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?o?(u=this.left+i,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:r,top:o,width:i,height:s}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,o,i,s),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===e);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,s;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(i=0,s=o.length;i<s;++i){const l=o[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.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(){const{chart:e,ctx:n,options:{border:r,grid:o}}=this,i=r.setContext(this.getContext()),s=r.display?i.width:0;if(!s)return;const a=o.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,A;this.isHorizontal()?(c=ir(e,this.left,s)-s/2,u=ir(e,this.right,a)+a/2,d=A=l):(d=ir(e,this.top,s)-s/2,A=ir(e,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,A),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&pl(r,o);const i=this.getLabelItems(e);for(const s of i){const a=s.options,l=s.font,c=s.label,u=s.textOffset;Io(r,c,0,u,l,a)}o&&gl(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=et(r.font),s=Ot(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||me(n)?(l+=s.bottom,We(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:A}=iS(this,l,n,a);Io(e,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:A,textAlign:oS(a,n,o),textBaseline:"middle",translation:[c,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,r=ye(e.grid&&e.grid.z,-1),o=ye(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Lr.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];let i,s;for(i=0,s=n.length;i<s;++i){const a=n[i];a[r]===this.id&&(!e||a.type===e)&&o.push(a)}return o}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return et(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ts{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let r;lS(n)&&(r=this.register(n));const o=this.items,i=e.id,s=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in o||(o[i]=e,sS(e,s,r),this.override&&ze.override(e.id,e.overrides)),s}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,o=this.scope;r in n&&delete n[r],o&&r in ze[o]&&(delete ze[o][r],this.override&&delete or[r])}}function sS(t,e,n){const r=So(Object.create(null),[n?ze.get(n):{},ze.get(e),t.defaults]);ze.set(e,r),t.defaultRoutes&&aS(e,t.defaultRoutes),t.descriptors&&ze.describe(e,t.descriptors)}function aS(t,e){Object.keys(e).forEach(n=>{const r=n.split("."),o=r.pop(),i=[t].concat(r).join("."),s=e[n].split("."),a=s.pop(),l=s.join(".");ze.route(i,o,l,a)})}function lS(t){return"id"in t&&"defaults"in t}class cS{constructor(){this.controllers=new ts(Gi,"datasets",!0),this.elements=new ts(Tr,"elements"),this.plugins=new ts(Object,"plugins"),this.scales=new ts(Lr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,r){[...n].forEach(o=>{const i=r||this._getRegistryForType(o);r||i.isForType(o)||i===this.plugins&&o.id?this._exec(e,i,o):Ee(o,s=>{const a=r||this._getRegistryForType(s);this._exec(e,a,s)})})}_exec(e,n,r){const o=al(e);Te(r["before"+o],[],r),n[e](r),Te(r["after"+o],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const o=n.get(e);if(o===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return o}}var cn=new cS;class uS{constructor(){this._init=void 0}notify(e,n,r,o){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const i=o?this._descriptors(e).filter(o):this._descriptors(e),s=this._notify(i,e,n,r);return n==="afterDestroy"&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),s}_notify(e,n,r,o){o=o||{};for(const i of e){const s=i.plugin,a=s[r],l=[n,o,i.options];if(Te(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){Pe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const r=e&&e.config,o=ye(r.options&&r.options.plugins,{}),i=dS(r);return o===!1&&!n?[]:fS(e,i,o,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,o=(i,s)=>i.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(o(n,r),e,"stop"),this._notify(o(r,n),e,"start")}}function dS(t){const e={},n=[],r=Object.keys(cn.plugins.items);for(let i=0;i<r.length;i++)n.push(cn.getPlugin(r[i]));const o=t.plugins||[];for(let i=0;i<o.length;i++){const s=o[i];n.indexOf(s)===-1&&(n.push(s),e[s.id]=!0)}return{plugins:n,localIds:e}}function AS(t,e){return!e&&t===!1?null:t===!0?{}:t}function fS(t,{plugins:e,localIds:n},r,o){const i=[],s=t.getContext();for(const a of e){const l=a.id,c=AS(r[l],o);c!==null&&i.push({plugin:a,options:hS(t.config,{plugin:a,local:n[l]},c,s)})}return i}function hS(t,{plugin:e,local:n},r,o){const i=t.pluginScopeKeys(e),s=t.getOptionScopes(r,i);return n&&e.defaults&&s.push(e.defaults),t.createResolver(s,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Il(t,e){const n=ze.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function pS(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function gS(t,e){return t===e?"_index_":"_value_"}function Bh(t){if(t==="x"||t==="y"||t==="r")return t}function mS(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Ml(t,...e){if(Bh(t))return t;for(const n of e){const r=n.axis||mS(n.position)||t.length>1&&Bh(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Ih(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function bS(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return Ih(t,"x",n[0])||Ih(t,"y",n[0])}return{}}function yS(t,e){const n=or[t.type]||{scales:{}},r=e.scales||{},o=Il(t.type,e),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!me(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=Ml(s,a,bS(s,t),ze.scales[a.type]),c=gS(l,o),u=n.scales||{};i[s]=Co(Object.create(null),[{axis:l},a,u[l],u[c]])}),t.data.datasets.forEach(s=>{const a=s.type||t.type,l=s.indexAxis||Il(a,e),u=(or[a]||{}).scales||{};Object.keys(u).forEach(d=>{const A=pS(d,l),f=s[A+"AxisID"]||A;i[f]=i[f]||Object.create(null),Co(i[f],[{axis:A},r[f],u[d]])})}),Object.keys(i).forEach(s=>{const a=i[s];Co(a,[ze.scales[a.type],ze.scale])}),i}function Mh(t){const e=t.options||(t.options={});e.plugins=ye(e.plugins,{}),e.scales=yS(t,e)}function _h(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function vS(t){return t=t||{},t.data=_h(t.data),Mh(t),t}const Oh=new Map,Th=new Set;function ns(t,e){let n=Oh.get(t);return n||(n=e(),Oh.set(t,n),Th.add(n)),n}const Qo=(t,e,n)=>{const r=zn(e,n);r!==void 0&&t.add(r)};let wS=class{constructor(e){this._config=vS(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=_h(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Mh(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ns(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return ns(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return ns(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return ns(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let o=r.get(e);return(!o||n)&&(o=new Map,r.set(e,o)),o}getOptionScopes(e,n,r){const{options:o,type:i}=this,s=this._cachedScopes(e,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{e&&(l.add(e),u.forEach(d=>Qo(l,e,d))),u.forEach(d=>Qo(l,o,d)),u.forEach(d=>Qo(l,or[i]||{},d)),u.forEach(d=>Qo(l,ze,d)),u.forEach(d=>Qo(l,fl,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Th.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,or[n]||{},ze.datasets[n]||{},{type:n},ze,fl]}resolveNamedOptions(e,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=Lh(this._resolverCache,e,o);let l=s;if(kS(s,n)){i.$shared=!1,r=Hn(r)?r():r;const c=this.createResolver(e,r,a);l=_r(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(e,n,r=[""],o){const{resolver:i}=Lh(this._resolverCache,e,r);return me(n)?_r(i,n,void 0,o):i}};function Lh(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const o=n.join();let i=r.get(o);return i||(i={resolver:ml(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const xS=t=>me(t)&&Object.getOwnPropertyNames(t).some(e=>Hn(t[e]));function kS(t,e){const{isScriptable:n,isIndexable:r}=Yf(t);for(const o of e){const i=n(o),s=r(o),a=(s||i)&&t[o];if(i&&(Hn(a)||xS(a))||s&&We(a))return!0}return!1}var ES="4.5.1";const SS=["top","bottom","left","right","chartArea"];function Nh(t,e){return t==="top"||t==="bottom"||SS.indexOf(t)===-1&&e==="x"}function Qh(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function Fh(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Te(n&&n.onComplete,[t],e)}function CS(t){const e=t.chart,n=e.options.animation;Te(n&&n.onProgress,[t],e)}function zh(t){return vl()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const rs={},Hh=t=>{const e=zh(t);return Object.values(rs).filter(n=>n.canvas===e).pop()};function PS(t,e,n){const r=Object.keys(t);for(const o of r){const i=+o;if(i>=e){const s=t[o];delete t[o],(n>0||i>e)&&(t[i+n]=s)}}}function DS(t,e,n,r){return!n||t.type==="mouseout"?null:r?e:t}let _l=class{static defaults=ze;static instances=rs;static overrides=or;static registry=cn;static version=ES;static getChart=Hh;static register(...e){cn.add(...e),Rh()}static unregister(...e){cn.remove(...e),Rh()}constructor(e,n){const r=this.config=new wS(n),o=zh(e),i=Hh(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||YE(o)),this.platform.updateConfig(r);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=H2(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,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 uS,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ik(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],rs[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}kn.listen(this,"complete",Fh),kn.listen(this,"progress",CS),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return Pe(e)?n&&i?i:o?r/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 cn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Zf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Hf(this.canvas,this.ctx),this}stop(){return kn.stop(this),this}resize(e,n){kn.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,o=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(o,e,n,i),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Zf(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Te(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ee(n,(r,o)=>{r.id=o})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,o=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let i=[];n&&(i=i.concat(Object.keys(n).map(s=>{const a=n[s],l=Ml(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ee(i,s=>{const a=s.options,l=a.id,c=Ml(l,a),u=ye(a.type,s.dtype);(a.position===void 0||Nh(a.position,c)!==Nh(s.dposition))&&(a.position=s.dposition),o[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const A=cn.getScale(u);d=new A({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,e)}),Ee(o,(s,a)=>{s||delete r[a]}),Ee(r,s=>{Tt.configure(this,s,s.options),Tt.addBox(this,s)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((o,i)=>o.index-i.index),r>n){for(let o=n;o<r;++o)this._destroyDatasetMeta(o);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(Qh("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,o)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,o;for(this._removeUnreferencedMetasets(),r=0,o=n.length;r<o;r++){const i=n[r];let s=this.getDatasetMeta(r);const a=i.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=i.indexAxis||Il(a,this.options),s.order=i.order||0,s.index=r,s.label=""+i.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=cn.getController(a),{datasetElementType:c,dataElementType:u}=ze.datasets[a];Object.assign(l,{dataElementType:cn.getElement(u),datasetElementType:c&&cn.getElement(c)}),s.controller=new l(this,r),e.push(s.controller)}}return this._updateMetasets(),e}_resetElements(){Ee(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),A=!o&&i.indexOf(d)===-1;d.buildOrUpdateElements(A),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||Ee(i,c=>{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Qh("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ee(this.scales,e=>{Tt.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!kf(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:o,count:i}of n){const s=r==="_removeElements"?-i:i;PS(e,o,s)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(e.filter(s=>s[0]===i).map((s,a)=>a+","+s.splice(1).join(","))),o=r(0);for(let i=1;i<n;i++)if(!kf(o,r(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Tt.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ee(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Hn(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),o={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(r.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(kn.has(this)?this.attached&&!kn.running(this)&&kn.start(this):(this.draw(),Fh({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,o)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,r=[];let o,i;for(o=0,i=n.length;o<i;++o){const s=n[o];(!e||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,r={meta:e,index:e.index,cancelable:!0},o=Wk(this,e);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(o&&pl(n,o),e.controller.draw(),o&&gl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return jf(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,o){const i=SE.modes[n];return typeof i=="function"?i(this,e,r,o):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let o=r.filter(i=>i&&i._dataset===n).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},r.push(o)),o}getContext(){return this.$context||(this.$context=Mr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const o=r?"show":"hide",i=this.getDatasetMeta(e),s=i.controller._resolveAnimations(void 0,o);Po(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),s.update(i,{visible:r}),this.update(a=>a.datasetIndex===e?o:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),kn.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Hf(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete rs[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,r=(i,s)=>{n.addEventListener(this,i,s),e[i]=s},o=(i,s,a)=>{i.offsetX=s,i.offsetY=a,this._eventHandler(i)};Ee(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),e[l]=c},o=(l,c)=>{e[l]&&(n.removeEventListener(this,l,c),delete e[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{o("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",s)};s=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Ee(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Ee(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const o=r?"set":"remove";let i,s,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){s=e[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:i,index:s})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[s],index:s}});!Qi(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const o=this.options.hover,i=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=i(n,e),a=r?e:i(e,n);s.length&&this.updateHoverStyle(s,o.mode,!1),a.length&&o.mode&&this.updateHoverStyle(a,o.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},o=s=>(s.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:o=[],options:i}=this,s=n,a=this._getActiveElements(e,o,r,s),l=Y2(e),c=DS(e,this._lastEvent,r,l);r&&(this._lastEvent=null,Te(i.onHover,[e,a,this],this),l&&Te(i.onClick,[e,a,this],this));const u=!Qi(a,o);return(u||n)&&(this._active=a,this._updateHoverStyles(a,o,n)),this._lastEvent=c,u}_getActiveElements(e,n,r,o){if(e.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,o)}};function Rh(){return Ee(_l.instances,t=>t._plugins.invalidate())}function Uh(t,e){const{x:n,y:r,base:o,width:i,height:s}=t.getProps(["x","y","base","width","height"],e);let a,l,c,u,d;return t.horizontal?(d=s/2,a=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,a=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:a,top:c,right:l,bottom:u}}function jn(t,e,n,r){return t?0:Ht(e,n,r)}function BS(t,e,n){const r=t.options.borderWidth,o=t.borderSkipped,i=Wf(r);return{t:jn(o.top,i.top,0,n),r:jn(o.right,i.right,0,e),b:jn(o.bottom,i.bottom,0,n),l:jn(o.left,i.left,0,e)}}function IS(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,i=Ir(o),s=Math.min(e,n),a=t.borderSkipped,l=r||me(o);return{topLeft:jn(!l||a.top||a.left,i.topLeft,0,s),topRight:jn(!l||a.top||a.right,i.topRight,0,s),bottomLeft:jn(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:jn(!l||a.bottom||a.right,i.bottomRight,0,s)}}function MS(t){const e=Uh(t),n=e.right-e.left,r=e.bottom-e.top,o=BS(t,n/2,r/2),i=IS(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:i},inner:{x:e.left+o.l,y:e.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function Ol(t,e,n,r){const o=e===null,i=n===null,a=t&&!(o&&i)&&Uh(t,r);return a&&(o||Br(e,a.left,a.right))&&(i||Br(n,a.top,a.bottom))}function _S(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function OS(t,e){t.rect(e.x,e.y,e.w,e.h)}function Tl(t,e,n={}){const r=t.x!==n.x?-e:0,o=t.y!==n.y?-e:0,i=(t.x+t.w!==n.x+n.w?e:0)-r,s=(t.y+t.h!==n.y+n.h?e:0)-o;return{x:t.x+r,y:t.y+o,w:t.w+i,h:t.h+s,radius:t.radius}}class TS extends Tr{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:r,backgroundColor:o}}=this,{inner:i,outer:s}=MS(this),a=_S(s.radius)?Vi:OS;e.save(),(s.w!==i.w||s.h!==i.h)&&(e.beginPath(),a(e,Tl(s,n,i)),e.clip(),a(e,Tl(i,-n,s)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),a(e,Tl(i,n)),e.fillStyle=o,e.fill(),e.restore()}inRange(e,n,r){return Ol(this,e,n,r)}inXRange(e,n){return Ol(this,e,null,n)}inYRange(e,n){return Ol(this,null,e,n)}getCenterPoint(e){const{x:n,y:r,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(n+o)/2:n,y:i?r:(r+o)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}const Ll=["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)"],jh=Ll.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Vh(t){return Ll[t%Ll.length]}function Wh(t){return jh[t%jh.length]}function LS(t,e){return t.borderColor=Vh(e),t.backgroundColor=Wh(e),++e}function NS(t,e){return t.backgroundColor=t.data.map(()=>Vh(e++)),e}function QS(t,e){return t.backgroundColor=t.data.map(()=>Wh(e++)),e}function FS(t){let e=0;return(n,r)=>{const o=t.getDatasetMeta(r).controller;o instanceof bE?e=NS(n,e):o instanceof yE?e=QS(n,e):o&&(e=LS(n,e))}}function Yh(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function zS(t){return t&&(t.borderColor||t.backgroundColor)}function HS(){return ze.borderColor!=="rgba(0,0,0,0.1)"||ze.backgroundColor!=="rgba(0,0,0,0.1)"}var RS={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=t.config,{elements:i}=o,s=Yh(r)||zS(o)||i&&Yh(i)||HS();if(!n.forceOverride&&s)return;const a=FS(t);r.forEach(a)}};const qh=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},US=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Kh extends Tr{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n,r){this.maxWidth=e,this.maxHeight=n,this._margins=r,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(){const e=this.options.labels||{};let n=Te(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(r=>e.filter(r,this.chart.data))),e.sort&&(n=n.sort((r,o)=>e.sort(r,o,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const r=e.labels,o=et(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=qh(r,i);let c,u;n.font=o.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,i,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,o,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,r,o){const{ctx:i,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=o+a;let d=e;i.textAlign="left",i.textBaseline="middle";let A=-1,f=-u;return this.legendItems.forEach((h,g)=>{const p=r+n/2+i.measureText(h.text).width;(g===0||c[c.length-1]+p+2*a>s)&&(d+=u,c[c.length-(g>0?0:1)]=0,f+=u,A++),l[g]={left:0,top:f,row:A,width:p,height:o},c[c.length-1]+=p+a}),d}_fitCols(e,n,r,o){const{ctx:i,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-e;let d=a,A=0,f=0,h=0,g=0;return this.legendItems.forEach((p,v)=>{const{itemWidth:x,itemHeight:y}=jS(r,n,i,p,o);v>0&&f+y+2*a>u&&(d+=A+a,c.push({width:A,height:f}),h+=A+a,g++,A=f=0),l[v]={left:h,top:f,col:g,width:x,height:y},A=Math.max(A,x),f+=y+a}),d+=A,c.push({width:A,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Or(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=$e(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=$e(r,this.left+o,this.right-this.lineWidths[a])),c.top+=this.top+e+o,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+o}else{let a=0,l=$e(r,this.top+e+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=$e(r,this.top+e+o,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+o,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;pl(e,this),this._draw(),gl(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=e,a=ze.color,l=Or(e.rtl,this.left,this.width),c=et(s.font),{padding:u}=s,d=c.size,A=d/2;let f;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:h,boxHeight:g,itemHeight:p}=qh(s,d),v=function(k,P,D){if(isNaN(h)||h<=0||isNaN(g)||g<0)return;o.save();const M=ye(D.lineWidth,1);if(o.fillStyle=ye(D.fillStyle,a),o.lineCap=ye(D.lineCap,"butt"),o.lineDashOffset=ye(D.lineDashOffset,0),o.lineJoin=ye(D.lineJoin,"miter"),o.lineWidth=M,o.strokeStyle=ye(D.strokeStyle,a),o.setLineDash(ye(D.lineDash,[])),s.usePointStyle){const I={radius:g*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:M},_=l.xPlus(k,h/2),B=P+A;Uf(o,I,_,B,s.pointStyleWidth&&h)}else{const I=P+Math.max((d-g)/2,0),_=l.leftForLtr(k,h),B=Ir(D.borderRadius);o.beginPath(),Object.values(B).some(T=>T!==0)?Vi(o,{x:_,y:I,w:h,h:g,radius:B}):o.rect(_,I,h,g),o.fill(),M!==0&&o.stroke()}o.restore()},x=function(k,P,D){Io(o,D.text,k,P+p/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},y=this.isHorizontal(),b=this._computeTitleHeight();y?f={x:$e(i,this.left+u,this.right-r[0]),y:this.top+u+b,line:0}:f={x:this.left+u,y:$e(i,this.top+b+u,this.bottom-n[0].height),line:0},eh(this.ctx,e.textDirection);const E=p+u;this.legendItems.forEach((k,P)=>{o.strokeStyle=k.fontColor,o.fillStyle=k.fontColor;const D=o.measureText(k.text).width,M=l.textAlign(k.textAlign||(k.textAlign=s.textAlign)),I=h+A+D;let _=f.x,B=f.y;l.setWidth(this.width),y?P>0&&_+I+u>this.right&&(B=f.y+=E,f.line++,_=f.x=$e(i,this.left+u,this.right-r[f.line])):P>0&&B+E>this.bottom&&(_=f.x=_+n[f.line].width+u,f.line++,B=f.y=$e(i,this.top+b+u,this.bottom-n[f.line].height));const T=l.x(_);if(v(T,B,k),_=sk(M,_+h+A,y?_+I:this.right,e.rtl),x(l.x(_),B,k),y)f.x+=I+u;else if(typeof k.text!="string"){const z=c.lineHeight;f.y+=Gh(k,z)+u}else f.y+=E}),th(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,r=et(n.font),o=Ot(n.padding);if(!n.display)return;const i=Or(e.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=o.top+l;let u,d=this.left,A=this.width;if(this.isHorizontal())A=Math.max(...this.lineWidths),u=this.top+c,d=$e(e.align,d,this.right-A);else{const h=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);u=c+$e(e.align,this.top,this.bottom-h-e.labels.padding-this._computeTitleHeight())}const f=$e(a,d,d+A);s.textAlign=i.textAlign(dl(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Io(s,n.text,f,u,r)}_computeTitleHeight(){const e=this.options.title,n=et(e.font),r=Ot(e.padding);return e.display?n.lineHeight+r.height:0}_getLegendItemAt(e,n){let r,o,i;if(Br(e,this.left,this.right)&&Br(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Br(e,o.left,o.left+o.width)&&Br(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(e){const n=this.options;if(!YS(e.type,n))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const o=this._hoveredItem,i=US(o,r);o&&!i&&Te(n.onLeave,[e,o,this],this),this._hoveredItem=r,r&&!i&&Te(n.onHover,[e,r,this],this)}else r&&Te(n.onClick,[e,r,this],this)}}function jS(t,e,n,r,o){const i=VS(r,t,e,n),s=WS(o,r,e.lineHeight);return{itemWidth:i,itemHeight:s}}function VS(t,e,n,r){let o=t.text;return o&&typeof o!="string"&&(o=o.reduce((i,s)=>i.length>s.length?i:s)),e+n.size/2+r.measureText(o).width}function WS(t,e,n){let r=t;return typeof e.text!="string"&&(r=Gh(e,n)),r}function Gh(t,e){const n=t.text?t.text.length:0;return e*n}function YS(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var qS={id:"legend",_element:Kh,start(t,e,n){const r=t.legend=new Kh({ctx:t.ctx,options:n,chart:t});Tt.configure(t,r,n),Tt.addBox(t,r)},stop(t){Tt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;Tt.configure(t,r,n),r.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const r=e.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),e.hidden=!0):(o.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:s,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ot(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:o||c.textAlign,borderRadius:s&&(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)}}};class Xh extends Tr{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const o=We(r.text)?r.text.length:1;this._padding=Ot(r.padding);const i=o*et(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:r,bottom:o,right:i,options:s}=this,a=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=$e(a,r,i),d=n+e,c=i-r):(s.position==="left"?(u=r+e,d=$e(a,o,n),l=Ye*-.5):(u=i-e,d=$e(a,n,o),l=Ye*.5),c=o-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const r=et(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);Io(e,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:dl(n.align),textBaseline:"middle",translation:[s,a]})}}function KS(t,e){const n=new Xh({ctx:t.ctx,options:e,chart:t});Tt.configure(t,n,e),Tt.addBox(t,n),t.titleBlock=n}var GS={id:"title",_element:Xh,start(t,e,n){KS(t,n)},stop(t){const e=t.titleBlock;Tt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;Tt.configure(t,r,n),r.options=n},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}};const Fo={average(t){if(!t.length)return!1;let e,n,r=new Set,o=0,i=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),o+=l.y,++i}}return i===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:o/i}},nearest(t,e){if(!t.length)return!1;let n=e.x,r=e.y,o=Number.POSITIVE_INFINITY,i,s,a;for(i=0,s=t.length;i<s;++i){const l=t[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=ek(e,c);u<o&&(o=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function un(t,e){return e&&(We(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function En(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
312
312
|
`)>-1?t.split(`
|
|
313
|
-
`):t}function XS(t,e){const{element:n,datasetIndex:r,index:o}=e,i=t.getDatasetMeta(r).controller,{label:s,value:a}=i.getLabelAndValue(o);return{chart:t,label:s,parsed:i.getParsed(o),raw:t.data.datasets[r].data[o],formattedValue:a,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function Jh(t,e){const n=t.chart.ctx,{body:r,footer:o,title:i}=t,{boxWidth:s,boxHeight:a}=e,l=et(e.bodyFont),c=et(e.titleFont),u=et(e.footerFont),d=i.length,A=o.length,f=r.length,h=Ot(e.padding);let g=h.height,p=0,v=r.reduce((b,E)=>b+E.before.length+E.lines.length+E.after.length,0);if(v+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),v){const b=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*b+(v-f)*l.lineHeight+(v-1)*e.bodySpacing}A&&(g+=e.footerMarginTop+A*u.lineHeight+(A-1)*e.footerSpacing);let x=0;const y=function(b){p=Math.max(p,n.measureText(b).width+x)};return n.save(),n.font=c.string,Ee(t.title,y),n.font=l.string,Ee(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?s+2+e.boxPadding:0,Ee(r,b=>{Ee(b.before,y),Ee(b.lines,y),Ee(b.after,y)}),x=0,n.font=u.string,Ee(t.footer,y),n.restore(),p+=h.width,{width:p,height:g}}function JS(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function ZS(t,e,n,r){const{x:o,width:i}=r,s=n.caretSize+n.caretPadding;if(t==="left"&&o+i+s>e.width||t==="right"&&o-i-s<0)return!0}function $S(t,e,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=t;let c="center";return r==="center"?c=o<=(a+l)/2?"left":"right":o<=i/2?c="left":o>=s-i/2&&(c="right"),ZS(c,t,e,n)&&(c="center"),c}function Zh(t,e,n){const r=n.yAlign||e.yAlign||JS(t,n);return{xAlign:n.xAlign||e.xAlign||$S(t,e,n,r),yAlign:r}}function eC(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function tC(t,e,n){let{y:r,height:o}=t;return e==="top"?r+=n:e==="bottom"?r-=o+n:r-=o/2,r}function $h(t,e,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=t,{xAlign:a,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:A,bottomRight:f}=Ir(s);let h=eC(e,a);const g=tC(e,l,c);return l==="center"?a==="left"?h+=c:a==="right"&&(h-=c):a==="left"?h-=Math.max(u,A)+o:a==="right"&&(h+=Math.max(d,f)+o),{x:Ht(h,0,r.width-e.width),y:Ht(g,0,r.height-e.height)}}function os(t,e,n){const r=Ot(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function ep(t){return un([],En(t))}function nC(t,e,n){return Mr(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function tp(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const np={beforeTitle:xn,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:xn,beforeBody:xn,beforeLabel:xn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Pe(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:xn,afterBody:xn,beforeFooter:xn,footer:xn,afterFooter:xn};function ut(t,e,n,r){const o=t[e].call(n,r);return typeof o>"u"?np[e].call(n,r):o}class rp extends Tr{static positioners=Fo;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(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,r=this.options.setContext(this.getContext()),o=r.enabled&&n.options.animation&&r.animations,i=new rh(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=nC(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,o=ut(r,"beforeTitle",this,e),i=ut(r,"title",this,e),s=ut(r,"afterTitle",this,e);let a=[];return a=un(a,En(o)),a=un(a,En(i)),a=un(a,En(s)),a}getBeforeBody(e,n){return ep(ut(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,o=[];return Ee(e,i=>{const s={before:[],lines:[],after:[]},a=tp(r,i);un(s.before,En(ut(a,"beforeLabel",this,i))),un(s.lines,ut(a,"label",this,i)),un(s.after,En(ut(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(e,n){return ep(ut(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,o=ut(r,"beforeFooter",this,e),i=ut(r,"footer",this,e),s=ut(r,"afterFooter",this,e);let a=[];return a=un(a,En(o)),a=un(a,En(i)),a=un(a,En(s)),a}_createItems(e){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(XS(this.chart,n[l]));return e.filter&&(a=a.filter((u,d,A)=>e.filter(u,d,A,r))),e.itemSort&&(a=a.sort((u,d)=>e.itemSort(u,d,r))),Ee(a,u=>{const d=tp(e.callbacks,u);o.push(ut(d,"labelColor",this,u)),i.push(ut(d,"labelPointStyle",this,u)),s.push(ut(d,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=a,a}update(e,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,s=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const a=Fo[r.position].call(this,o,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=Jh(this,r),c=Object.assign({},a,l),u=Zh(this.chart,r,c),d=$h(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,o){const i=this.getCaretPosition(e,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Ir(a),{x:A,y:f}=e,{width:h,height:g}=n;let p,v,x,y,b,E;return i==="center"?(b=f+g/2,o==="left"?(p=A,v=p-s,y=b+s,E=b-s):(p=A+h,v=p+s,y=b-s,E=b+s),x=p):(o==="left"?v=A+Math.max(l,u)+s:o==="right"?v=A+h-Math.max(c,d)-s:v=this.caretX,i==="top"?(y=f,b=y-s,p=v-s,x=v+s):(y=f+g,b=y+s,p=v+s,x=v-s),E=y),{x1:p,x2:v,x3:x,y1:y,y2:b,y3:E}}drawTitle(e,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=Or(r.rtl,this.x,this.width);for(e.x=os(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=et(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],c.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+a,l+1===i&&(e.y+=r.titleMarginBottom-a)}}_drawColorBox(e,n,r,o,i){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,u=et(i.bodyFont),d=os(this,"left",i),A=o.x(d),f=l<u.lineHeight?(u.lineHeight-l)/2:0,h=n.y+f;if(i.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=o.leftForLtr(A,c)+c/2,v=h+l/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Rf(e,g,p,v),e.strokeStyle=s.borderColor,e.fillStyle=s.backgroundColor,Rf(e,g,p,v)}else{e.lineWidth=be(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,e.strokeStyle=s.borderColor,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset||0;const g=o.leftForLtr(A,c),p=o.leftForLtr(o.xPlus(A,1),c-2),v=Ir(s.borderRadius);Object.values(v).some(x=>x!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,Vi(e,{x:g,y:h,w:c,h:l,radius:v}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),Vi(e,{x:p,y:h+1,w:c-2,h:l-2,radius:v}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(g,h,c,l),e.strokeRect(g,h,c,l),e.fillStyle=s.backgroundColor,e.fillRect(p,h+1,c-2,l-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=et(r.bodyFont);let A=d.lineHeight,f=0;const h=Or(r.rtl,this.x,this.width),g=function(D){n.fillText(D,h.x(e.x+f),e.y+A/2),e.y+=A+i},p=h.textAlign(s);let v,x,y,b,E,k,P;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,e.x=os(this,p,r),n.fillStyle=r.bodyColor,Ee(this.beforeBody,g),f=a&&p!=="right"?s==="center"?c/2+u:c+2+u:0,b=0,k=o.length;b<k;++b){for(v=o[b],x=this.labelTextColors[b],n.fillStyle=x,Ee(v.before,g),y=v.lines,a&&y.length&&(this._drawColorBox(n,e,b,h,r),A=Math.max(d.lineHeight,l)),E=0,P=y.length;E<P;++E)g(y[E]),A=d.lineHeight;Ee(v.after,g)}f=0,A=d.lineHeight,Ee(this.afterBody,g),e.y-=i}drawFooter(e,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=Or(r.rtl,this.x,this.width);for(e.x=os(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=et(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<i;++a)n.fillText(o[a],l.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+r.footerSpacing}}drawBackground(e,n,r,o){const{xAlign:i,yAlign:s}=this,{x:a,y:l}=e,{width:c,height:u}=r,{topLeft:d,topRight:A,bottomLeft:f,bottomRight:h}=Ir(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+d,l),s==="top"&&this.drawCaret(e,n,r,o),n.lineTo(a+c-A,l),n.quadraticCurveTo(a+c,l,a+c,l+A),s==="center"&&i==="right"&&this.drawCaret(e,n,r,o),n.lineTo(a+c,l+u-h),n.quadraticCurveTo(a+c,l+u,a+c-h,l+u),s==="bottom"&&this.drawCaret(e,n,r,o),n.lineTo(a+f,l+u),n.quadraticCurveTo(a,l+u,a,l+u-f),s==="center"&&i==="left"&&this.drawCaret(e,n,r,o),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const s=Fo[e.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=Jh(this,e),l=Object.assign({},s,this._size),c=Zh(n,e,l),u=$h(e,l,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Ot(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=r,this.drawBackground(i,e,o,n),eh(e,n.textDirection),i.y+=s.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),th(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,o=e.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),i=!Qi(r,o),s=this._positionChanged(o,n);(i||s)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],s=this._getActiveElements(e,i,n,r),a=this._positionChanged(s,e),l=n||!Qi(s,i)||a;return l&&(this._active=s,(o.enabled||o.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,r,o){const i=this.options;if(e.type==="mouseout")return[];if(!o)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(e,i.mode,i,r);return i.reverse&&s.reverse(),s}_positionChanged(e,n){const{caretX:r,caretY:o,options:i}=this,s=Fo[i.position].call(this,e,n);return s!==!1&&(r!==s.x||o!==s.y)}}var rC={id:"tooltip",_element:rp,positioners:Fo,afterInit(t,e,n){n&&(t.tooltip=new rp({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:np},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"]};const oC=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function iC(t,e,n,r){const o=t.indexOf(e);if(o===-1)return oC(t,e,n,r);const i=t.lastIndexOf(e);return o!==i?n:o}const sC=(t,e)=>t===null?null:Ht(Math.round(t),0,e);function op(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class aC extends Lr{static id="category";static defaults={ticks:{callback:op}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:o,label:i}of n)r[o]===i&&r.splice(o,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Pe(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:iC(r,e,ye(n,e),this._addedLabels),sC(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,o=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=e;s<=n;s++)o.push({value:s});return o}getLabelForValue(e){return op.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){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function lC(t,e){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:A}=t,f=i||1,h=u-1,{min:g,max:p}=e,v=!Pe(s),x=!Pe(a),y=!Pe(c),b=(p-g)/(d+1);let E=Cf((p-g)/h/f)*f,k,P,D,M;if(E<1e-14&&!v&&!x)return[{value:g},{value:p}];M=Math.ceil(p/E)-Math.floor(g/E),M>h&&(E=Cf(M*E/h/f)*f),Pe(l)||(k=Math.pow(10,l),E=Math.ceil(E*k)/k),o==="ticks"?(P=Math.floor(g/E)*E,D=Math.ceil(p/E)*E):(P=g,D=p),v&&x&&i&&X2((a-s)/i,E/1e3)?(M=Math.round(Math.min((a-s)/E,u)),E=(a-s)/M,P=s,D=a):y?(P=v?s:P,D=x?a:D,M=c-1,E=(D-P)/M):(M=(D-P)/E,Hi(M,Math.round(M),E/1e3)?M=Math.round(M):M=Math.ceil(M));const I=Math.max(Pf(E),Pf(P));k=Math.pow(10,Pe(l)?I:l),P=Math.round(P*k)/k,D=Math.round(D*k)/k;let _=0;for(v&&(A&&P!==s?(n.push({value:s}),P<s&&_++,Hi(Math.round((P+_*E)*k)/k,s,ip(s,b,t))&&_++):P<s&&_++);_<M;++_){const B=Math.round((P+_*E)*k)/k;if(x&&B>a)break;n.push({value:B})}return x&&A&&D!==a?n.length&&Hi(n[n.length-1].value,a,ip(a,b,t))?n[n.length-1].value=a:n.push({value:a}):(!x||D===a)&&n.push({value:D}),n}function ip(t,e,{horizontal:n,minRotation:r}){const o=ln(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*e*(""+t).length;return Math.min(e/i,s)}class cC extends Lr{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Pe(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:o,max:i}=this;const s=l=>o=n?o:l,a=l=>i=r?i:l;if(e){const l=Rn(o),c=Rn(i);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);a(i+l),e||s(o-l)}this.min=o,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,s=lC(o,i);return e.bounds==="ticks"&&J2(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const e=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const o=(r-n)/Math.max(e.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return ji(e,this.chart.options.locale,this.options.ticks.format)}}class uC extends cC{static id="linear";static defaults={ticks:{callback:Ff.formatters.numeric}};determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=_t(e)?e:0,this.max=_t(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=ln(this.options.ticks.minRotation),o=(e?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const is={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}},dt=Object.keys(is);function sp(t,e){return t-e}function ap(t,e){if(Pe(e))return null;const n=t._adapter,{parser:r,round:o,isoWeekday:i}=t._parseOpts;let s=e;return typeof r=="function"&&(s=r(s)),_t(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(Ri(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function lp(t,e,n,r){const o=dt.length;for(let i=dt.indexOf(t);i<o-1;++i){const s=is[dt[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-e)/(a*s.size))<=r)return dt[i]}return dt[o-1]}function dC(t,e,n,r,o){for(let i=dt.length-1;i>=dt.indexOf(n);i--){const s=dt[i];if(is[s].common&&t._adapter.diff(o,r,s)>=e-1)return s}return dt[n?dt.indexOf(n):0]}function AC(t){for(let e=dt.indexOf(t)+1,n=dt.length;e<n;++e)if(is[dt[e]].common)return dt[e]}function cp(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:o}=cl(n,e),i=n[r]>=e?n[r]:n[o];t[i]=!0}}function fC(t,e,n,r){const o=t._adapter,i=+o.startOf(e[0].value,r),s=e[e.length-1].value;let a,l;for(a=i;a<=s;a=+o.add(a,1,r))l=n[a],l>=0&&(e[l].major=!0);return e}function up(t,e,n){const r=[],o={},i=e.length;let s,a;for(s=0;s<i;++s)a=e[s],o[a]=s,r.push({value:a,major:!1});return i===0||!n?r:fC(t,r,o,n)}class dp extends Lr{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,n={}){const r=e.time||(e.time={}),o=this._adapter=new vE._date(e.adapters.date);o.init(n),Co(r.displayFormats,o.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:ap(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:o,max:i,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=_t(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=_t(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,o=r.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]);const i=this.min,s=this.max,a=rk(o,i,s);return this._unit=n.unit||(r.autoSkip?lp(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):dC(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:AC(this._unit),this.initOffsets(o),e.reverse&&a.reverse(),up(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,o,i;this.options.offset&&e.length&&(o=this.getDecimalForValue(e[0]),e.length===1?n=1-o:n=(this.getDecimalForValue(e[1])-o)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?r=i:r=(i-this.getDecimalForValue(e[e.length-2]))/2);const s=e.length<3?.5:.25;n=Ht(n,0,s),r=Ht(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,s=i.unit||lp(i.minUnit,n,r,this._getLabelCapacity(n)),a=ye(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=Ri(l)||l===!0,u={};let d=n,A,f;if(c&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,c?"day":s),e.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const h=o.ticks.source==="data"&&this.getDataTimestamps();for(A=d,f=0;A<r;A=+e.add(A,a,s),f++)cp(u,A,h);return(A===r||o.bounds==="ticks"||f===1)&&cp(u,A,h),Object.keys(u).sort(sp).map(g=>+g)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const o=this.options.time.displayFormats,i=this._unit,s=n||o[i];return this._adapter.format(e,s)}_tickFormatFunction(e,n,r,o){const i=this.options,s=i.ticks.callback;if(s)return Te(s,[e,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],A=r[n],f=c&&d&&A&&A.major;return this._adapter.format(e,o||(f?d:u))}generateTickLabels(e){let n,r,o;for(n=0,r=e.length;n<r;++n)o=e[n],o.label=this._tickFormatFunction(o.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,o=ln(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),s=Math.sin(o),a=this._resolveTickFontOptions(0).size;return{w:r*i+a*s,h:r*s+a*i}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,o=r[n.unit]||r.millisecond,i=this._tickFormatFunction(e,0,up(this,[e],this._majorUnit),o),s=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n<r;++n)e=e.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const o=this.getLabels();for(n=0,r=o.length;n<r;++n)e.push(ap(this,o[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return If(e.sort(sp))}}function ss(t,e,n){let r=0,o=t.length-1,i,s,a,l;n?(e>=t[r].pos&&e<=t[o].pos&&({lo:r,hi:o}=ul(t,"pos",e)),{pos:i,time:a}=t[r],{pos:s,time:l}=t[o]):(e>=t[r].time&&e<=t[o].time&&({lo:r,hi:o}=ul(t,"time",e)),{time:i,pos:a}=t[r],{time:s,pos:l}=t[o]);const c=s-i;return c?a+(l-a)*(e-i)/c:a}class gP extends dp{static id="timeseries";static defaults=dp.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=ss(n,this.min),this._tableRange=ss(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,o=[],i=[];let s,a,l,c,u;for(s=0,a=e.length;s<a;++s)c=e[s],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=o.length;s<a;++s)u=o[s+1],l=o[s-1],c=o[s],Math.round((u+l)/2)!==c&&i.push({time:c,pos:s/(a-1)});return i}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((o,i)=>o-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(ss(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return ss(this._table,r*this._tableRange+this._minPos,!0)}}_l.register(RS,gE,TS,aC,uC,qS,GS,rC);function hC({type:t="bar",data:e,options:n}){const r=w.useRef(null),o=w.useRef(null);return w.useLayoutEffect(()=>{o.current&&(r.current?(r.current.options=n,r.current.data=e,r.current.update()):r.current=new _l(o.current,{type:t,data:e,options:n}))},[t,e,n]),m.jsx("div",{className:"chart",children:m.jsx("canvas",{ref:o})})}const Ap=["--teal-700","--yellow-400","--teal-400","--orange-400","--green-400","--red-400"],Nl=["0 - 1s","1 - 30s","30s - 30min","30 - 60min","1 - 5hr","5 - 10hr","10 - 18hr","18+hr"],Ql=(t,e,n=0)=>`${t.toFixed(n)} ${e}${t==1?"":"s"}`,fp=t=>{const e=t/3600;if(e>=1)return Ql(e,"hour",1);const n=t/60;return n>=1?Ql(n,"minute",0):Ql(t,"second",0)},as=t=>t.replace(/ \([^)]+\)/,"");function pC({infoGroupId:t}){const[e,n]=w.useState("overview"),r=Vp(t).filter(c=>c.cider_type=="Compute"),o=rt(r.length?r.map(c=>`https://rest-test.ccr.xdmod.org/rest/v0.1/custom_queries/wait_times/${c.info_resourceid}/`):null,{defaultValue:[]}),i=rt(e!=="overview"?`https://rest-test.ccr.xdmod.org/rest/v0.1/custom_queries/wait_times/${e}/queue/job_walltime`:null);if(!o.length||!r.length)return;const s=o.map((c,u)=>c.error?c:{...c.data[0],...r[u]}).filter(c=>!c.error);if(!s.length)return;const a=[m.jsxs("select",{value:e,onChange:c=>n(c.target.value),children:[m.jsx("option",{value:"overview",children:"Overview"},"overview"),s.map(c=>m.jsx("option",{value:c.info_resourceid,children:as(c.resource_descriptive_name)},c.info_resourceid))]},"select")];let l=null;if(e==="overview")l=m.jsx("div",{className:"cards",children:s.map(({info_resourceid:c,job_count:u,median_expansion_factor:d,median_wait_time:A,median_wall_time:f,resource_descriptive_name:h})=>m.jsxs("p",{className:"card metrics-overview",children:[m.jsxs("b",{children:[as(h),":"]})," Users ran"," ",m.jsxs("strong",{children:[m.jsx(me,{name:"file-earmark-code"}),parseInt(u).toLocaleString("en-us")," jobs"]})," ","during the last 30 days. Waiting in the queue caused an average"," ",m.jsxs("strong",{children:[m.jsx(me,{name:"calculator"}),((d-1)*100).toLocaleString("en-us",{maximumFractionDigits:0}),"% increase"]})," ","in the total completion time. The average job waited for"," ",m.jsxs("strong",{children:[m.jsx(me,{name:"hourglass-split"})," ",fp(A)]})," ","and ran for"," ",m.jsxs("strong",{children:[m.jsx(me,{name:"stopwatch"}),fp(f)]}),"."," ",m.jsx("a",{title:`Wait time chart for ${as(h)}`,href:"#",onClick:g=>{g.preventDefault(),n(c)},children:"View chart »"})]},c))});else if(i&&i.info_resource_id===e){const c={},u=Nl;for(let h of i.data)c[h.queue]=c[h.queue]||{label:h.queue,data:Array(Nl.length).fill(null)},c[h.queue].data[Nl.indexOf(h.job_walltime)]=h.median_wait_time/60;const d=Object.values(c);d.forEach((h,g)=>{let p=Ap[g%(Ap.length-1)];h.backgroundColor=getComputedStyle(document.body).getPropertyValue(p)});const A=s.find(h=>h.info_resourceid==i.info_resource_id),f={interaction:{intersect:!1,mode:"index"},plugins:{title:{display:!0,text:`Median Wait Time by Queue on ${as(A.resource_descriptive_name)}: Last 30 Days`}},scales:{x:{title:{display:!0,text:"Job Wall Time (Run Time)"}},y:{title:{display:!0,text:"Median Wait Time (Minutes)"}}}};l=m.jsxs(m.Fragment,{children:[m.jsx(hC,{type:"bar",data:{labels:u,datasets:d},options:f}),m.jsx("p",{children:m.jsx("a",{href:"#",onClick:h=>{h.preventDefault(),n("overview")},children:"« Back to overview"})})]})}return m.jsxs(nn,{title:"Wait Time",icon:"hourglass-split",headerComponents:a,children:[l,m.jsxs("p",{className:"metrics-disclaimer",children:[m.jsx(me,{name:"info-circle"}),"These metrics describe activity from ACCESS projects. Many resources have additional projects that are not part of ACCESS."]})]})}function Sn(t){return Array.isArray?Array.isArray(t):gp(t)==="[object Array]"}function gC(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function mC(t){return t==null?"":gC(t)}function dn(t){return typeof t=="string"}function hp(t){return typeof t=="number"}function bC(t){return t===!0||t===!1||yC(t)&&gp(t)=="[object Boolean]"}function pp(t){return typeof t=="object"}function yC(t){return pp(t)&&t!==null}function xt(t){return t!=null}function Fl(t){return!t.trim().length}function gp(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const vC="Incorrect 'index' type",wC=t=>`Invalid value for key ${t}`,xC=t=>`Pattern length exceeds max of ${t}.`,kC=t=>`Missing ${t} property in key`,EC=t=>`Property 'weight' in key '${t}' must be a positive integer`,mp=Object.prototype.hasOwnProperty;class SC{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{let o=bp(r);this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function bp(t){let e=null,n=null,r=null,o=1,i=null;if(dn(t)||Sn(t))r=t,e=yp(t),n=zl(t);else{if(!mp.call(t,"name"))throw new Error(kC("name"));const s=t.name;if(r=s,mp.call(t,"weight")&&(o=t.weight,o<=0))throw new Error(EC(s));e=yp(s),n=zl(s),i=t.getFn}return{path:e,id:n,weight:o,src:r,getFn:i}}function yp(t){return Sn(t)?t:t.split(".")}function zl(t){return Sn(t)?t.join("."):t}function CC(t,e){let n=[],r=!1;const o=(i,s,a)=>{if(xt(i))if(!s[a])n.push(i);else{let l=s[a];const c=i[l];if(!xt(c))return;if(a===s.length-1&&(dn(c)||hp(c)||bC(c)))n.push(mC(c));else if(Sn(c)){r=!0;for(let u=0,d=c.length;u<d;u+=1)o(c[u],s,a+1)}else s.length&&o(c,s,a+1)}};return o(t,dn(e)?e.split("."):e,0),r?n:n[0]}var se={...{isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:CC,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const PC=/[^ ]+/g;function DC(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(o){const i=o.match(PC).length;if(n.has(i))return n.get(i);const s=1/Math.pow(i,.5*t),a=parseFloat(Math.round(s*r)/r);return n.set(i,a),a},clear(){n.clear()}}}class Hl{constructor({getFn:e=se.getFn,fieldNormWeight:n=se.fieldNormWeight}={}){this.norm=DC(n,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,dn(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();dn(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!xt(e)||Fl(e))return;let r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){let r={i:n,$:{}};this.keys.forEach((o,i)=>{let s=o.getFn?o.getFn(e):this.getFn(e,o.path);if(xt(s)){if(Sn(s)){let a=[];const l=[{nestedArrIndex:-1,value:s}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(xt(u))if(dn(u)&&!Fl(u)){let d={v:u,i:c,n:this.norm.get(u)};a.push(d)}else Sn(u)&&u.forEach((d,A)=>{l.push({nestedArrIndex:A,value:d})})}r.$[i]=a}else if(dn(s)&&!Fl(s)){let a={v:s,n:this.norm.get(s)};r.$[i]=a}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function vp(t,e,{getFn:n=se.getFn,fieldNormWeight:r=se.fieldNormWeight}={}){const o=new Hl({getFn:n,fieldNormWeight:r});return o.setKeys(t.map(bp)),o.setSources(e),o.create(),o}function BC(t,{getFn:e=se.getFn,fieldNormWeight:n=se.fieldNormWeight}={}){const{keys:r,records:o}=t,i=new Hl({getFn:e,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(o),i}function ls(t,{errors:e=0,currentLocation:n=0,expectedLocation:r=0,distance:o=se.distance,ignoreLocation:i=se.ignoreLocation}={}){const s=e/t.length;if(i)return s;const a=Math.abs(r-n);return o?s+a/o:a?1:s}function IC(t=[],e=se.minMatchCharLength){let n=[],r=-1,o=-1,i=0;for(let s=t.length;i<s;i+=1){let a=t[i];a&&r===-1?r=i:!a&&r!==-1&&(o=i-1,o-r+1>=e&&n.push([r,o]),r=-1)}return t[i-1]&&i-r>=e&&n.push([r,i-1]),n}const cr=32;function MC(t,e,n,{location:r=se.location,distance:o=se.distance,threshold:i=se.threshold,findAllMatches:s=se.findAllMatches,minMatchCharLength:a=se.minMatchCharLength,includeMatches:l=se.includeMatches,ignoreLocation:c=se.ignoreLocation}={}){if(e.length>cr)throw new Error(xC(cr));const u=e.length,d=t.length,A=Math.max(0,Math.min(r,d));let f=i,h=A;const g=a>1||l,p=g?Array(d):[];let v;for(;(v=t.indexOf(e,h))>-1;){let P=ls(e,{currentLocation:v,expectedLocation:A,distance:o,ignoreLocation:c});if(f=Math.min(P,f),h=v+u,g){let D=0;for(;D<u;)p[v+D]=1,D+=1}}h=-1;let x=[],y=1,b=u+d;const E=1<<u-1;for(let P=0;P<u;P+=1){let D=0,M=b;for(;D<M;)ls(e,{errors:P,currentLocation:A+M,expectedLocation:A,distance:o,ignoreLocation:c})<=f?D=M:b=M,M=Math.floor((b-D)/2+D);b=M;let I=Math.max(1,A-M+1),_=s?d:Math.min(A+M,d)+u,B=Array(_+2);B[_+1]=(1<<P)-1;for(let z=_;z>=I;z-=1){let O=z-1,R=n[t.charAt(O)];if(g&&(p[O]=+!!R),B[z]=(B[z+1]<<1|1)&R,P&&(B[z]|=(x[z+1]|x[z])<<1|1|x[z+1]),B[z]&E&&(y=ls(e,{errors:P,currentLocation:O,expectedLocation:A,distance:o,ignoreLocation:c}),y<=f)){if(f=y,h=O,h<=A)break;I=Math.max(1,2*A-h)}}if(ls(e,{errors:P+1,currentLocation:A,expectedLocation:A,distance:o,ignoreLocation:c})>f)break;x=B}const k={isMatch:h>=0,score:Math.max(.001,y)};if(g){const P=IC(p,a);P.length?l&&(k.indices=P):k.isMatch=!1}return k}function _C(t){let e={};for(let n=0,r=t.length;n<r;n+=1){const o=t.charAt(n);e[o]=(e[o]||0)|1<<r-n-1}return e}const cs=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);class wp{constructor(e,{location:n=se.location,threshold:r=se.threshold,distance:o=se.distance,includeMatches:i=se.includeMatches,findAllMatches:s=se.findAllMatches,minMatchCharLength:a=se.minMatchCharLength,isCaseSensitive:l=se.isCaseSensitive,ignoreDiacritics:c=se.ignoreDiacritics,ignoreLocation:u=se.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:s,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},e=l?e:e.toLowerCase(),e=c?cs(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(f,h)=>{this.chunks.push({pattern:f,alphabet:_C(f),startIndex:h})},A=this.pattern.length;if(A>cr){let f=0;const h=A%cr,g=A-h;for(;f<g;)d(this.pattern.substr(f,cr),f),f+=cr;if(h){const p=A-cr;d(this.pattern.substr(p),p)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:o}=this.options;if(e=n?e:e.toLowerCase(),e=r?cs(e):e,this.pattern===e){let g={isMatch:!0,score:0};return o&&(g.indices=[[0,e.length-1]]),g}const{location:i,distance:s,threshold:a,findAllMatches:l,minMatchCharLength:c,ignoreLocation:u}=this.options;let d=[],A=0,f=!1;this.chunks.forEach(({pattern:g,alphabet:p,startIndex:v})=>{const{isMatch:x,score:y,indices:b}=MC(e,g,p,{location:i+v,distance:s,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:o,ignoreLocation:u});x&&(f=!0),A+=y,x&&b&&(d=[...d,...b])});let h={isMatch:f,score:f?A/this.chunks.length:1};return f&&o&&(h.indices=d),h}}class Vn{constructor(e){this.pattern=e}static isMultiMatch(e){return xp(e,this.multiRegex)}static isSingleMatch(e){return xp(e,this.singleRegex)}search(){}}function xp(t,e){const n=t.match(e);return n?n[1]:null}class OC extends Vn{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class TC extends Vn{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class LC extends Vn{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class NC extends Vn{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class QC extends Vn{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class FC extends Vn{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class kp extends Vn{constructor(e,{location:n=se.location,threshold:r=se.threshold,distance:o=se.distance,includeMatches:i=se.includeMatches,findAllMatches:s=se.findAllMatches,minMatchCharLength:a=se.minMatchCharLength,isCaseSensitive:l=se.isCaseSensitive,ignoreDiacritics:c=se.ignoreDiacritics,ignoreLocation:u=se.ignoreLocation}={}){super(e),this._bitapSearch=new wp(e,{location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:s,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Ep extends Vn{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const o=[],i=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+i,o.push([r,n-1]);const s=!!o.length;return{isMatch:s,score:s?0:1,indices:o}}}const Rl=[OC,Ep,LC,NC,FC,QC,TC,kp],Sp=Rl.length,zC=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,HC="|";function RC(t,e={}){return t.split(HC).map(n=>{let r=n.trim().split(zC).filter(i=>i&&!!i.trim()),o=[];for(let i=0,s=r.length;i<s;i+=1){const a=r[i];let l=!1,c=-1;for(;!l&&++c<Sp;){const u=Rl[c];let d=u.isMultiMatch(a);d&&(o.push(new u(d,e)),l=!0)}if(!l)for(c=-1;++c<Sp;){const u=Rl[c];let d=u.isSingleMatch(a);if(d){o.push(new u(d,e));break}}}return o})}const UC=new Set([kp.type,Ep.type]);class jC{constructor(e,{isCaseSensitive:n=se.isCaseSensitive,ignoreDiacritics:r=se.ignoreDiacritics,includeMatches:o=se.includeMatches,minMatchCharLength:i=se.minMatchCharLength,ignoreLocation:s=se.ignoreLocation,findAllMatches:a=se.findAllMatches,location:l=se.location,threshold:c=se.threshold,distance:u=se.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:o,minMatchCharLength:i,findAllMatches:a,ignoreLocation:s,location:l,threshold:c,distance:u},e=n?e:e.toLowerCase(),e=r?cs(e):e,this.pattern=e,this.query=RC(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:o,ignoreDiacritics:i}=this.options;e=o?e:e.toLowerCase(),e=i?cs(e):e;let s=0,a=[],l=0;for(let c=0,u=n.length;c<u;c+=1){const d=n[c];a.length=0,s=0;for(let A=0,f=d.length;A<f;A+=1){const h=d[A],{isMatch:g,indices:p,score:v}=h.search(e);if(g){if(s+=1,l+=v,r){const x=h.constructor.type;UC.has(x)?a=[...a,...p]:a.push(p)}}else{l=0,s=0,a.length=0;break}}if(s){let A={isMatch:!0,score:l/s};return r&&(A.indices=a),A}}return{isMatch:!1,score:1}}}const Ul=[];function VC(...t){Ul.push(...t)}function jl(t,e){for(let n=0,r=Ul.length;n<r;n+=1){let o=Ul[n];if(o.condition(t,e))return new o(t,e)}return new wp(t,e)}const us={AND:"$and",OR:"$or"},Vl={PATH:"$path",PATTERN:"$val"},Wl=t=>!!(t[us.AND]||t[us.OR]),WC=t=>!!t[Vl.PATH],YC=t=>!Sn(t)&&pp(t)&&!Wl(t),Cp=t=>({[us.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function Pp(t,e,{auto:n=!0}={}){const r=o=>{let i=Object.keys(o);const s=WC(o);if(!s&&i.length>1&&!Wl(o))return r(Cp(o));if(YC(o)){const l=s?o[Vl.PATH]:i[0],c=s?o[Vl.PATTERN]:o[l];if(!dn(c))throw new Error(wC(l));const u={keyId:zl(l),pattern:c};return n&&(u.searcher=jl(c,e)),u}let a={children:[],operator:i[0]};return i.forEach(l=>{const c=o[l];Sn(c)&&c.forEach(u=>{a.children.push(r(u))})}),a};return Wl(t)||(t=Cp(t)),r(t)}function qC(t,{ignoreFieldNorm:e=se.ignoreFieldNorm}){t.forEach(n=>{let r=1;n.matches.forEach(({key:o,norm:i,score:s})=>{const a=o?o.weight:null;r*=Math.pow(s===0&&a?Number.EPSILON:s,(a||1)*(e?1:i))}),n.score=r})}function KC(t,e){const n=t.matches;e.matches=[],xt(n)&&n.forEach(r=>{if(!xt(r.indices)||!r.indices.length)return;const{indices:o,value:i}=r;let s={indices:o,value:i};r.key&&(s.key=r.key.src),r.idx>-1&&(s.refIndex=r.idx),e.matches.push(s)})}function GC(t,e){e.score=t.score}function XC(t,e,{includeMatches:n=se.includeMatches,includeScore:r=se.includeScore}={}){const o=[];return n&&o.push(KC),r&&o.push(GC),t.map(i=>{const{idx:s}=i,a={item:e[s],refIndex:s};return o.length&&o.forEach(l=>{l(i,a)}),a})}class Nr{constructor(e,n={},r){this.options={...se,...n},this.options.useExtendedSearch,this._keyStore=new SC(this.options.keys),this.setCollection(e,r)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Hl))throw new Error(vC);this._myIndex=n||vp(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){xt(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let r=0,o=this._docs.length;r<o;r+=1){const i=this._docs[r];e(i,r)&&(this.removeAt(r),r-=1,o-=1,n.push(i))}return n}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:r,includeScore:o,shouldSort:i,sortFn:s,ignoreFieldNorm:a}=this.options;let l=dn(e)?dn(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return qC(l,{ignoreFieldNorm:a}),i&&l.sort(s),hp(n)&&n>-1&&(l=l.slice(0,n)),XC(l,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(e){const n=jl(e,this.options),{records:r}=this._myIndex,o=[];return r.forEach(({v:i,i:s,n:a})=>{if(!xt(i))return;const{isMatch:l,score:c,indices:u}=n.searchIn(i);l&&o.push({item:i,idx:s,matches:[{score:c,value:i,norm:a,indices:u}]})}),o}_searchLogical(e){const n=Pp(e,this.options),r=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:A}=a,f=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:A});return f&&f.length?[{idx:c,item:l,matches:f}]:[]}const u=[];for(let d=0,A=a.children.length;d<A;d+=1){const f=a.children[d],h=r(f,l,c);if(h.length)u.push(...h);else if(a.operator===us.AND)return[]}return u},o=this._myIndex.records,i={},s=[];return o.forEach(({$:a,i:l})=>{if(xt(a)){let c=r(n,a,l);c.length&&(i[l]||(i[l]={idx:l,item:a,matches:[]},s.push(i[l])),c.forEach(({matches:u})=>{i[l].matches.push(...u)}))}}),s}_searchObjectList(e){const n=jl(e,this.options),{keys:r,records:o}=this._myIndex,i=[];return o.forEach(({$:s,i:a})=>{if(!xt(s))return;let l=[];r.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:s[u],searcher:n}))}),l.length&&i.push({idx:a,item:s,matches:l})}),i}_findMatches({key:e,value:n,searcher:r}){if(!xt(n))return[];let o=[];if(Sn(n))n.forEach(({v:i,i:s,n:a})=>{if(!xt(i))return;const{isMatch:l,score:c,indices:u}=r.searchIn(i);l&&o.push({score:c,key:e,value:i,idx:s,norm:a,indices:u})});else{const{v:i,n:s}=n,{isMatch:a,score:l,indices:c}=r.searchIn(i);a&&o.push({score:l,key:e,value:i,norm:s,indices:c})}return o}}Nr.version="7.1.0",Nr.createIndex=vp,Nr.parseIndex=BC,Nr.config=se,Nr.parseQuery=Pp,VC(jC);function JC({highlight:t,text:e}){if(!t||!t.length)return e;const n=new RegExp(t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"gi"),r=[...e.matchAll(n)];if(!r.length)return e;const o=[];let i=0;for(let s of r)s.index>i&&o.push(e.substr(i,s.index)),o.push(m.jsx("span",{className:"highlight",children:s[0]})),i=s.index+s[0].length;return o.push(e.substr(i)),o}function ZC({delay:t=300,placeholder:e,setSearchText:n,width:r="calc(var(--width) / 4)"}){const o=w.useRef(null),i=w.useRef(null),[s,a]=w.useState(""),l=()=>{a(""),n(""),o.current.value="",o.current.focus()};return w.useLayoutEffect(()=>{o.current&&o.current.addEventListener("keyup",()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n(o.current.value),a(o.current.value)},t)})},[o.current]),m.jsx(m.Fragment,{children:m.jsxs("div",{className:"search",children:[m.jsx("input",{placeholder:e,style:{width:r},ref:o}),s.length?m.jsx("button",{className:"btn btn-clear",title:"Clear search",onClick:l,children:m.jsx(me,{name:"x-lg"})}):null]})})}const $C=["software_name","software_description","software_web_page","software_documentation","software_use_link","software_versions"];function eP({infoGroupId:t}){const e=rt("https://sds-ara-api.access-ci.org/api/v1",{body:JSON.stringify({rps:[t],columns:$C}),headers:{"Content-Type":"application/json","X-API-Key":"asSuQQ0IfIEUrSRTl44aqn2ZpMPpJ_G02BgemAY4WN0"},method:"POST"}),[n,r]=w.useState(""),o=w.useMemo(()=>e?.data&&e.data.length?new Nr(e.data,{keys:[{name:"software_name",weight:.6},{name:"software_description",weight:.4}]}):null,[e?.data]);if(!e?.data||!e.data.length)return;const i=A=>m.jsx(JC,{text:A,highlight:n}),c=[{key:"software_name",name:"Package",format:(A,f)=>{const h=i(A),g=f.software_web_page||f.software_documentation,p=f.software_use_link&&f.software_use_link.length?f.software_use_link[0]:"";return m.jsxs("span",{style:{lineHeight:1.3},children:[g?m.jsx("a",{href:g,children:h},"name"):h," ",f.software_documentation&&m.jsx("a",{href:f.software_documentation,title:`Documentation for ${A}`,children:m.jsx(me,{name:"book"})},"documentation")," ",p&&p!=f.software_documentation&&m.jsx("a",{href:p,title:`Usage example for ${A}`,children:m.jsx(me,{name:"terminal"})},"use")]})}},{key:"software_versions",name:"Versions",format:(A,f)=>f.rps[t].software_versions.join(", ")},{key:"software_description",name:"Description",format:(A,f)=>{const h=/Description Source:[ ]+(http[^ ]+)/,g=A.match(h);return m.jsxs(m.Fragment,{children:[i(A.replace(h,""))," ",g?m.jsx("a",{href:g[1],title:`Description source for ${f.software_name}`,children:m.jsx(me,{name:"info-circle"})}):null]})}}],u=n.length?o.search(n).map(A=>A.item):e.data,d=[m.jsx(ZC,{placeholder:"Search software packages...",setSearchText:r},"search")];return m.jsx(nn,{title:"Software",icon:"terminal",headerComponents:d,children:m.jsx(yi,{columns:c,rows:u,scrollResetOnUpdate:!0})})}function tP({prompt:t="Jump To:"}){const[e,n]=w.useState([]),r=w.useRef(null),o=()=>{const s=[];for(let a of r.current.querySelectorAll("[data-section-title]"))s.push({icon:a.dataset.sectionIcon,id:a.id,title:a.dataset.sectionTitle});n(s)},i=s=>{const a=r.current.querySelector(`#${s}`);a&&a.scrollIntoView()};return w.useEffect(()=>{r.current&&(o(),document.addEventListener("accessci-update-sections",o))},[r.current]),m.jsx("div",{ref:s=>r.current=s?.parentElement,children:e.length>=2?m.jsxs("nav",{className:"section-navigation",children:[t?m.jsx("h2",{children:t}):null,m.jsx("ul",{children:e.map(({icon:s,id:a,title:l})=>m.jsx("li",{children:m.jsxs("a",{href:`#${a}`,onClick:c=>{c.preventDefault(),i(a)},children:[s?m.jsxs(m.Fragment,{children:[m.jsx(me,{name:s})," "]}):null,l]})},a))})]}):null})}function nP({baseUri:t,showBreadcrumbs:e=!0}){const{infoGroupId:n}=Ng(),r=Ur(n),o=[{name:"Resources",href:t}];return r&&o.push({name:r.name}),m.jsxs(m.Fragment,{children:[e&&m.jsx(fs,{expandWidth:!0,items:o,topBorder:!0}),m.jsxs("div",{className:"resource-group-detail",children:[m.jsx(Nw,{infoGroupId:n}),m.jsx(tP,{}),m.jsx(P1,{infoGroupId:n}),m.jsx(v1,{infoGroupId:n}),m.jsx(E1,{infoGroupId:n}),m.jsx(Lw,{infoGroupId:n}),m.jsx(eP,{infoGroupId:n}),m.jsx(m2,{infoGroupId:n}),m.jsx(pC,{infoGroupId:n}),m.jsx(zw,{infoGroupId:n})]})]})}const rP=Object.freeze(Object.defineProperty({__proto__:null,default:nP},Symbol.toStringTag,{value:"Module"})),oP={"ACCESS Pegasus":"https://pegasus.isi.edu/wordpress/wp-content/uploads/2016/01/favicon.ico","ACCESS OnDemand":"https://openondemand.org/themes/fire/theme/assets/media/favicons/favicon.ico","Advance reservations":"calendar-check","Composable hardware fabric":"boxes","Compute Resources":"cpu-fill","CPU Compute":"cpu-fill","GPU Compute":"cpu","Innovative / Novel Compute":"lightbulb","Large Memory Nodes":"arrows-fullscreen",Preemption:"clock-history","Science Gateway support":"globe","Service / Other":"stars","Storage Resources":"hdd-fill","Virtual Machines":"pc-display-horizontal",Cloud:"cloud",Storage:"hdd-fill"};function Dp({active:t,tagCategory:e,tagId:n,iconUri:r,name:o,toggleTag:i}){const s=r||oP[o]||"tag";return m.jsx("li",{className:`tag tag-category-${e.name.toLowerCase().replace(/[^a-z]+/g,"-")}${t.tagIds.has(n)?" active":""}`,children:m.jsxs("button",{href:"#",disabled:t.disabledTagIds.has(n),onClick:a=>{a.preventDefault(),i(n)},children:[s.startsWith("http")?m.jsx(me,{alt:o,src:s}):m.jsx(me,{name:s}),o]})})}function Bp({children:t}){return m.jsx("ul",{className:"tags",children:t})}function iP({active:t,baseUri:e,description:n,imageType:r,imageUri:o,name:i,infoGroupId:s,parentInfoGroupId:a,tags:l,toggleTag:c}){const u=`${e}/${a||s}`;return m.jsxs("div",{className:"resource-group",children:[m.jsx("a",{className:`resource-group-image image-type-${r}`,href:u,children:o?m.jsx("img",{src:o}):m.jsx(me,{name:"motherboard"})}),m.jsxs("div",{className:"resource-group-text",children:[m.jsx("h3",{children:m.jsx("a",{href:u,children:i})}),m.jsx(Bp,{children:l.map(d=>m.jsx(Dp,{...d,active:t,toggleTag:c},d.tagId))}),m.jsxs("p",{children:[n&&n,m.jsx("br",{}),m.jsxs("a",{href:u,children:["Learn more about ",i," »"]})]})]})]})}function sP({active:t,baseUri:e,name:n,resourceGroups:r,toggleTag:o}){return m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:n}),r.filter(({infoGroupId:i})=>t.infoGroupIds.has(i)).map(i=>m.jsx(iP,{...i,baseUri:e,active:t,toggleTag:o},i.infoGroupId))]})}function aP({active:t,clearTags:e,tagCategories:n,toggleTag:r}){const[o,i]=w.useState(!1),s=w.useRef(null);return w.useEffect(()=>{const a=()=>i(!1);return document.body.addEventListener("click",a),()=>document.body.removeEventListener("click",a)},[]),m.jsxs("section",{className:"filters-outer",onClick:a=>{a.stopPropagation()},children:[m.jsxs("button",{ref:s,onClick:()=>i(!o),className:`btn-filters btn ${o?"active":""}`,children:[m.jsx(me,{name:"filter"})," Filters",t.tagIds.size>0?m.jsx("span",{className:"active-tag-count",children:t.tagIds.size}):null]}),o?m.jsxs("div",{className:"filters-inner",children:[n.map(a=>m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:a.name}),m.jsx(Bp,{children:a.tags.map(l=>m.jsx(Dp,{...l,active:t,toggleTag:r}))})]})),m.jsxs("button",{onClick:e,disabled:t.tagIds.size==0,className:"btn danger",children:[m.jsx(me,{name:"trash"})," Clear Filters"]})]}):null]})}function lP({setBotOpen:t}){const e=w.useRef(null),n=[{title:"Browse resources",icon:"filter-square",description:"Filter resources to find the best match for your research.",onClick:r=>{r.preventDefault(),e.current&&e.current.nextSibling.scrollIntoView({bahavior:"smooth"})}},{title:"Ask a question",icon:"question-circle",onClick:r=>{r.preventDefault(),t(!0)},description:"You have resource questions. Our Q&A bot has answers!",login:!0},{title:"Get suggestions",icon:"card-checklist",href:"https://ara.access-ci.org/",description:"Fill out a form to get resource recommendations."},{title:"Read news",icon:"newspaper",href:"https://access-ci.org/tag/resource-providers/",description:"See the latest news from resource providers."}];return m.jsxs("section",{id:"resource-pathways",ref:e,children:[m.jsxs("p",{className:"intro",children:["ACCESS provides advanced computing resources ",m.jsx("strong",{children:"at no cost"})," ","to researchers and educators."]}),m.jsx("ul",{className:"resource-pathways",children:n.map(({title:r,icon:o,href:i,description:s,login:a,onClick:l},c)=>m.jsx("li",{className:`resource-pathway-${c}`,children:m.jsxs("a",{href:i||"#",onClick:l,children:[o?m.jsx(me,{name:o}):null," ",m.jsxs("span",{className:"detail",children:[m.jsx("span",{className:"title",children:r}),m.jsx("span",{className:"description",children:s}),a?m.jsxs("span",{className:"login",children:[m.jsx(me,{name:"key"})," Requires ACCESS Login"]}):null]})]})},r))})]})}function cP({baseUri:t,title:e,setBotOpen:n,showBreadcrumbs:r=!0,showTitle:o=!0}){const[i,s]=w.useState([]),a=oc(),l=w.useMemo(()=>a?Yp(a,i):null,[a,i]),c=d=>s(i.includes(d)?i.filter(A=>A!=d):[...i,d]),u=()=>s([]);return m.jsxs(m.Fragment,{children:[r&&m.jsx(fs,{expandWidth:!0,items:[{name:"Resources"}],topBorder:!0}),e&&m.jsx("h1",{className:o?"":"visually-hidden",children:e}),m.jsx(lP,{setBotOpen:n}),m.jsxs("div",{id:"browse-resources",children:[l?m.jsx(aP,{tagCategories:a.tagCategories,active:l,clearTags:u,toggleTag:c}):null,a?a.resourceCategories.filter(({resourceCategoryId:d})=>l.resourceCategoryIds.has(d)).map(d=>m.jsx(sP,{...d,active:l,baseUri:t,clearTags:u,toggleTag:c},d.name)):null]})]})}const uP=Object.freeze(Object.defineProperty({__proto__:null,default:cP},Symbol.toStringTag,{value:"Module"}));ve.Breadcrumbs=Nc,ve.Footer=Qc,ve.FooterMenus=Fc,ve.Header=zc,ve.QABot=Hc,ve.ResourceCatalog=Rc,ve.SiteMenus=Uc,ve.TableOfContents=jc,ve.UniversalMenus=Vc,ve.breadcrumbs=Um,ve.footer=jm,ve.footerMenus=Vm,ve.header=Wm,ve.loginMenuItem=$l,ve.myAccessMenuItem=Zl,ve.qaBot=Ym,ve.resourceCatalog=qm,ve.siteMenus=Km,ve.tableOfContents=Gm,ve.universalMenuItems=Jl,ve.universalMenus=Xm,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})}));
|
|
313
|
+
`):t}function XS(t,e){const{element:n,datasetIndex:r,index:o}=e,i=t.getDatasetMeta(r).controller,{label:s,value:a}=i.getLabelAndValue(o);return{chart:t,label:s,parsed:i.getParsed(o),raw:t.data.datasets[r].data[o],formattedValue:a,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function Jh(t,e){const n=t.chart.ctx,{body:r,footer:o,title:i}=t,{boxWidth:s,boxHeight:a}=e,l=et(e.bodyFont),c=et(e.titleFont),u=et(e.footerFont),d=i.length,A=o.length,f=r.length,h=Ot(e.padding);let g=h.height,p=0,v=r.reduce((b,E)=>b+E.before.length+E.lines.length+E.after.length,0);if(v+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),v){const b=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*b+(v-f)*l.lineHeight+(v-1)*e.bodySpacing}A&&(g+=e.footerMarginTop+A*u.lineHeight+(A-1)*e.footerSpacing);let x=0;const y=function(b){p=Math.max(p,n.measureText(b).width+x)};return n.save(),n.font=c.string,Ee(t.title,y),n.font=l.string,Ee(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?s+2+e.boxPadding:0,Ee(r,b=>{Ee(b.before,y),Ee(b.lines,y),Ee(b.after,y)}),x=0,n.font=u.string,Ee(t.footer,y),n.restore(),p+=h.width,{width:p,height:g}}function JS(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function ZS(t,e,n,r){const{x:o,width:i}=r,s=n.caretSize+n.caretPadding;if(t==="left"&&o+i+s>e.width||t==="right"&&o-i-s<0)return!0}function $S(t,e,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=t;let c="center";return r==="center"?c=o<=(a+l)/2?"left":"right":o<=i/2?c="left":o>=s-i/2&&(c="right"),ZS(c,t,e,n)&&(c="center"),c}function Zh(t,e,n){const r=n.yAlign||e.yAlign||JS(t,n);return{xAlign:n.xAlign||e.xAlign||$S(t,e,n,r),yAlign:r}}function eC(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function tC(t,e,n){let{y:r,height:o}=t;return e==="top"?r+=n:e==="bottom"?r-=o+n:r-=o/2,r}function $h(t,e,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=t,{xAlign:a,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:A,bottomRight:f}=Ir(s);let h=eC(e,a);const g=tC(e,l,c);return l==="center"?a==="left"?h+=c:a==="right"&&(h-=c):a==="left"?h-=Math.max(u,A)+o:a==="right"&&(h+=Math.max(d,f)+o),{x:Ht(h,0,r.width-e.width),y:Ht(g,0,r.height-e.height)}}function os(t,e,n){const r=Ot(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function ep(t){return un([],En(t))}function nC(t,e,n){return Mr(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function tp(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const np={beforeTitle:xn,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:xn,beforeBody:xn,beforeLabel:xn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Pe(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:xn,afterBody:xn,beforeFooter:xn,footer:xn,afterFooter:xn};function ut(t,e,n,r){const o=t[e].call(n,r);return typeof o>"u"?np[e].call(n,r):o}class rp extends Tr{static positioners=Fo;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(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,r=this.options.setContext(this.getContext()),o=r.enabled&&n.options.animation&&r.animations,i=new rh(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=nC(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,o=ut(r,"beforeTitle",this,e),i=ut(r,"title",this,e),s=ut(r,"afterTitle",this,e);let a=[];return a=un(a,En(o)),a=un(a,En(i)),a=un(a,En(s)),a}getBeforeBody(e,n){return ep(ut(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,o=[];return Ee(e,i=>{const s={before:[],lines:[],after:[]},a=tp(r,i);un(s.before,En(ut(a,"beforeLabel",this,i))),un(s.lines,ut(a,"label",this,i)),un(s.after,En(ut(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(e,n){return ep(ut(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,o=ut(r,"beforeFooter",this,e),i=ut(r,"footer",this,e),s=ut(r,"afterFooter",this,e);let a=[];return a=un(a,En(o)),a=un(a,En(i)),a=un(a,En(s)),a}_createItems(e){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(XS(this.chart,n[l]));return e.filter&&(a=a.filter((u,d,A)=>e.filter(u,d,A,r))),e.itemSort&&(a=a.sort((u,d)=>e.itemSort(u,d,r))),Ee(a,u=>{const d=tp(e.callbacks,u);o.push(ut(d,"labelColor",this,u)),i.push(ut(d,"labelPointStyle",this,u)),s.push(ut(d,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=a,a}update(e,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,s=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const a=Fo[r.position].call(this,o,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=Jh(this,r),c=Object.assign({},a,l),u=Zh(this.chart,r,c),d=$h(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,o){const i=this.getCaretPosition(e,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Ir(a),{x:A,y:f}=e,{width:h,height:g}=n;let p,v,x,y,b,E;return i==="center"?(b=f+g/2,o==="left"?(p=A,v=p-s,y=b+s,E=b-s):(p=A+h,v=p+s,y=b-s,E=b+s),x=p):(o==="left"?v=A+Math.max(l,u)+s:o==="right"?v=A+h-Math.max(c,d)-s:v=this.caretX,i==="top"?(y=f,b=y-s,p=v-s,x=v+s):(y=f+g,b=y+s,p=v+s,x=v-s),E=y),{x1:p,x2:v,x3:x,y1:y,y2:b,y3:E}}drawTitle(e,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=Or(r.rtl,this.x,this.width);for(e.x=os(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=et(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],c.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+a,l+1===i&&(e.y+=r.titleMarginBottom-a)}}_drawColorBox(e,n,r,o,i){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,u=et(i.bodyFont),d=os(this,"left",i),A=o.x(d),f=l<u.lineHeight?(u.lineHeight-l)/2:0,h=n.y+f;if(i.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=o.leftForLtr(A,c)+c/2,v=h+l/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Rf(e,g,p,v),e.strokeStyle=s.borderColor,e.fillStyle=s.backgroundColor,Rf(e,g,p,v)}else{e.lineWidth=me(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,e.strokeStyle=s.borderColor,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset||0;const g=o.leftForLtr(A,c),p=o.leftForLtr(o.xPlus(A,1),c-2),v=Ir(s.borderRadius);Object.values(v).some(x=>x!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,Vi(e,{x:g,y:h,w:c,h:l,radius:v}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),Vi(e,{x:p,y:h+1,w:c-2,h:l-2,radius:v}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(g,h,c,l),e.strokeRect(g,h,c,l),e.fillStyle=s.backgroundColor,e.fillRect(p,h+1,c-2,l-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=et(r.bodyFont);let A=d.lineHeight,f=0;const h=Or(r.rtl,this.x,this.width),g=function(D){n.fillText(D,h.x(e.x+f),e.y+A/2),e.y+=A+i},p=h.textAlign(s);let v,x,y,b,E,k,P;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,e.x=os(this,p,r),n.fillStyle=r.bodyColor,Ee(this.beforeBody,g),f=a&&p!=="right"?s==="center"?c/2+u:c+2+u:0,b=0,k=o.length;b<k;++b){for(v=o[b],x=this.labelTextColors[b],n.fillStyle=x,Ee(v.before,g),y=v.lines,a&&y.length&&(this._drawColorBox(n,e,b,h,r),A=Math.max(d.lineHeight,l)),E=0,P=y.length;E<P;++E)g(y[E]),A=d.lineHeight;Ee(v.after,g)}f=0,A=d.lineHeight,Ee(this.afterBody,g),e.y-=i}drawFooter(e,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=Or(r.rtl,this.x,this.width);for(e.x=os(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=et(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<i;++a)n.fillText(o[a],l.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+r.footerSpacing}}drawBackground(e,n,r,o){const{xAlign:i,yAlign:s}=this,{x:a,y:l}=e,{width:c,height:u}=r,{topLeft:d,topRight:A,bottomLeft:f,bottomRight:h}=Ir(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+d,l),s==="top"&&this.drawCaret(e,n,r,o),n.lineTo(a+c-A,l),n.quadraticCurveTo(a+c,l,a+c,l+A),s==="center"&&i==="right"&&this.drawCaret(e,n,r,o),n.lineTo(a+c,l+u-h),n.quadraticCurveTo(a+c,l+u,a+c-h,l+u),s==="bottom"&&this.drawCaret(e,n,r,o),n.lineTo(a+f,l+u),n.quadraticCurveTo(a,l+u,a,l+u-f),s==="center"&&i==="left"&&this.drawCaret(e,n,r,o),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const s=Fo[e.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=Jh(this,e),l=Object.assign({},s,this._size),c=Zh(n,e,l),u=$h(e,l,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Ot(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=r,this.drawBackground(i,e,o,n),eh(e,n.textDirection),i.y+=s.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),th(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,o=e.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),i=!Qi(r,o),s=this._positionChanged(o,n);(i||s)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],s=this._getActiveElements(e,i,n,r),a=this._positionChanged(s,e),l=n||!Qi(s,i)||a;return l&&(this._active=s,(o.enabled||o.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,r,o){const i=this.options;if(e.type==="mouseout")return[];if(!o)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(e,i.mode,i,r);return i.reverse&&s.reverse(),s}_positionChanged(e,n){const{caretX:r,caretY:o,options:i}=this,s=Fo[i.position].call(this,e,n);return s!==!1&&(r!==s.x||o!==s.y)}}var rC={id:"tooltip",_element:rp,positioners:Fo,afterInit(t,e,n){n&&(t.tooltip=new rp({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:np},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"]};const oC=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function iC(t,e,n,r){const o=t.indexOf(e);if(o===-1)return oC(t,e,n,r);const i=t.lastIndexOf(e);return o!==i?n:o}const sC=(t,e)=>t===null?null:Ht(Math.round(t),0,e);function op(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class aC extends Lr{static id="category";static defaults={ticks:{callback:op}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:o,label:i}of n)r[o]===i&&r.splice(o,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Pe(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:iC(r,e,ye(n,e),this._addedLabels),sC(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,o=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=e;s<=n;s++)o.push({value:s});return o}getLabelForValue(e){return op.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){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function lC(t,e){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:A}=t,f=i||1,h=u-1,{min:g,max:p}=e,v=!Pe(s),x=!Pe(a),y=!Pe(c),b=(p-g)/(d+1);let E=Cf((p-g)/h/f)*f,k,P,D,M;if(E<1e-14&&!v&&!x)return[{value:g},{value:p}];M=Math.ceil(p/E)-Math.floor(g/E),M>h&&(E=Cf(M*E/h/f)*f),Pe(l)||(k=Math.pow(10,l),E=Math.ceil(E*k)/k),o==="ticks"?(P=Math.floor(g/E)*E,D=Math.ceil(p/E)*E):(P=g,D=p),v&&x&&i&&X2((a-s)/i,E/1e3)?(M=Math.round(Math.min((a-s)/E,u)),E=(a-s)/M,P=s,D=a):y?(P=v?s:P,D=x?a:D,M=c-1,E=(D-P)/M):(M=(D-P)/E,Hi(M,Math.round(M),E/1e3)?M=Math.round(M):M=Math.ceil(M));const I=Math.max(Pf(E),Pf(P));k=Math.pow(10,Pe(l)?I:l),P=Math.round(P*k)/k,D=Math.round(D*k)/k;let _=0;for(v&&(A&&P!==s?(n.push({value:s}),P<s&&_++,Hi(Math.round((P+_*E)*k)/k,s,ip(s,b,t))&&_++):P<s&&_++);_<M;++_){const B=Math.round((P+_*E)*k)/k;if(x&&B>a)break;n.push({value:B})}return x&&A&&D!==a?n.length&&Hi(n[n.length-1].value,a,ip(a,b,t))?n[n.length-1].value=a:n.push({value:a}):(!x||D===a)&&n.push({value:D}),n}function ip(t,e,{horizontal:n,minRotation:r}){const o=ln(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*e*(""+t).length;return Math.min(e/i,s)}class cC extends Lr{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Pe(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:o,max:i}=this;const s=l=>o=n?o:l,a=l=>i=r?i:l;if(e){const l=Rn(o),c=Rn(i);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);a(i+l),e||s(o-l)}this.min=o,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,s=lC(o,i);return e.bounds==="ticks"&&J2(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const e=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const o=(r-n)/Math.max(e.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return ji(e,this.chart.options.locale,this.options.ticks.format)}}class uC extends cC{static id="linear";static defaults={ticks:{callback:Ff.formatters.numeric}};determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=_t(e)?e:0,this.max=_t(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=ln(this.options.ticks.minRotation),o=(e?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const is={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}},dt=Object.keys(is);function sp(t,e){return t-e}function ap(t,e){if(Pe(e))return null;const n=t._adapter,{parser:r,round:o,isoWeekday:i}=t._parseOpts;let s=e;return typeof r=="function"&&(s=r(s)),_t(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(Ri(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function lp(t,e,n,r){const o=dt.length;for(let i=dt.indexOf(t);i<o-1;++i){const s=is[dt[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-e)/(a*s.size))<=r)return dt[i]}return dt[o-1]}function dC(t,e,n,r,o){for(let i=dt.length-1;i>=dt.indexOf(n);i--){const s=dt[i];if(is[s].common&&t._adapter.diff(o,r,s)>=e-1)return s}return dt[n?dt.indexOf(n):0]}function AC(t){for(let e=dt.indexOf(t)+1,n=dt.length;e<n;++e)if(is[dt[e]].common)return dt[e]}function cp(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:o}=cl(n,e),i=n[r]>=e?n[r]:n[o];t[i]=!0}}function fC(t,e,n,r){const o=t._adapter,i=+o.startOf(e[0].value,r),s=e[e.length-1].value;let a,l;for(a=i;a<=s;a=+o.add(a,1,r))l=n[a],l>=0&&(e[l].major=!0);return e}function up(t,e,n){const r=[],o={},i=e.length;let s,a;for(s=0;s<i;++s)a=e[s],o[a]=s,r.push({value:a,major:!1});return i===0||!n?r:fC(t,r,o,n)}class dp extends Lr{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,n={}){const r=e.time||(e.time={}),o=this._adapter=new vE._date(e.adapters.date);o.init(n),Co(r.displayFormats,o.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:ap(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:o,max:i,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=_t(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=_t(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,o=r.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]);const i=this.min,s=this.max,a=rk(o,i,s);return this._unit=n.unit||(r.autoSkip?lp(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):dC(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:AC(this._unit),this.initOffsets(o),e.reverse&&a.reverse(),up(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,o,i;this.options.offset&&e.length&&(o=this.getDecimalForValue(e[0]),e.length===1?n=1-o:n=(this.getDecimalForValue(e[1])-o)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?r=i:r=(i-this.getDecimalForValue(e[e.length-2]))/2);const s=e.length<3?.5:.25;n=Ht(n,0,s),r=Ht(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,s=i.unit||lp(i.minUnit,n,r,this._getLabelCapacity(n)),a=ye(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=Ri(l)||l===!0,u={};let d=n,A,f;if(c&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,c?"day":s),e.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const h=o.ticks.source==="data"&&this.getDataTimestamps();for(A=d,f=0;A<r;A=+e.add(A,a,s),f++)cp(u,A,h);return(A===r||o.bounds==="ticks"||f===1)&&cp(u,A,h),Object.keys(u).sort(sp).map(g=>+g)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const o=this.options.time.displayFormats,i=this._unit,s=n||o[i];return this._adapter.format(e,s)}_tickFormatFunction(e,n,r,o){const i=this.options,s=i.ticks.callback;if(s)return Te(s,[e,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],A=r[n],f=c&&d&&A&&A.major;return this._adapter.format(e,o||(f?d:u))}generateTickLabels(e){let n,r,o;for(n=0,r=e.length;n<r;++n)o=e[n],o.label=this._tickFormatFunction(o.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,o=ln(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),s=Math.sin(o),a=this._resolveTickFontOptions(0).size;return{w:r*i+a*s,h:r*s+a*i}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,o=r[n.unit]||r.millisecond,i=this._tickFormatFunction(e,0,up(this,[e],this._majorUnit),o),s=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n<r;++n)e=e.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const o=this.getLabels();for(n=0,r=o.length;n<r;++n)e.push(ap(this,o[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return If(e.sort(sp))}}function ss(t,e,n){let r=0,o=t.length-1,i,s,a,l;n?(e>=t[r].pos&&e<=t[o].pos&&({lo:r,hi:o}=ul(t,"pos",e)),{pos:i,time:a}=t[r],{pos:s,time:l}=t[o]):(e>=t[r].time&&e<=t[o].time&&({lo:r,hi:o}=ul(t,"time",e)),{time:i,pos:a}=t[r],{time:s,pos:l}=t[o]);const c=s-i;return c?a+(l-a)*(e-i)/c:a}class gP extends dp{static id="timeseries";static defaults=dp.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=ss(n,this.min),this._tableRange=ss(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,o=[],i=[];let s,a,l,c,u;for(s=0,a=e.length;s<a;++s)c=e[s],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=o.length;s<a;++s)u=o[s+1],l=o[s-1],c=o[s],Math.round((u+l)/2)!==c&&i.push({time:c,pos:s/(a-1)});return i}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((o,i)=>o-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(ss(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return ss(this._table,r*this._tableRange+this._minPos,!0)}}_l.register(RS,gE,TS,aC,uC,qS,GS,rC);function hC({type:t="bar",data:e,options:n}){const r=w.useRef(null),o=w.useRef(null);return w.useLayoutEffect(()=>{o.current&&(r.current?(r.current.options=n,r.current.data=e,r.current.update()):r.current=new _l(o.current,{type:t,data:e,options:n}))},[t,e,n]),m.jsx("div",{className:"chart",children:m.jsx("canvas",{ref:o})})}const Ap=["--teal-700","--yellow-400","--teal-400","--orange-400","--green-400","--red-400"],Nl=["0 - 1s","1 - 30s","30s - 30min","30 - 60min","1 - 5hr","5 - 10hr","10 - 18hr","18+hr"],Ql=(t,e,n=0)=>`${t.toFixed(n)} ${e}${t==1?"":"s"}`,fp=t=>{const e=t/3600;if(e>=1)return Ql(e,"hour",1);const n=t/60;return n>=1?Ql(n,"minute",0):Ql(t,"second",0)},as=t=>t.replace(/ \([^)]+\)/,"");function pC({infoGroupId:t}){const[e,n]=w.useState("overview"),r=Vp(t).filter(c=>c.cider_type=="Compute"),o=rt(r.length?r.map(c=>`https://rest-test.ccr.xdmod.org/rest/v0.1/custom_queries/wait_times/${c.info_resourceid}/`):null,{defaultValue:[]}),i=rt(e!=="overview"?`https://rest-test.ccr.xdmod.org/rest/v0.1/custom_queries/wait_times/${e}/queue/job_walltime`:null);if(!o.length||!r.length)return;const s=o.map((c,u)=>c.error?c:{...c.data[0],...r[u]}).filter(c=>!c.error);if(!s.length)return;const a=[m.jsxs("select",{value:e,onChange:c=>n(c.target.value),children:[m.jsx("option",{value:"overview",children:"Overview"},"overview"),s.map(c=>m.jsx("option",{value:c.info_resourceid,children:as(c.resource_descriptive_name)},c.info_resourceid))]},"select")];let l=null;if(e==="overview")l=m.jsx("div",{className:"cards",children:s.map(({info_resourceid:c,job_count:u,median_expansion_factor:d,median_wait_time:A,median_wall_time:f,resource_descriptive_name:h})=>m.jsxs("p",{className:"card metrics-overview",children:[m.jsxs("b",{children:[as(h),":"]})," Users ran"," ",m.jsxs("strong",{children:[m.jsx(be,{name:"file-earmark-code"}),parseInt(u).toLocaleString("en-us")," jobs"]})," ","during the last 30 days. Waiting in the queue caused an average"," ",m.jsxs("strong",{children:[m.jsx(be,{name:"calculator"}),((d-1)*100).toLocaleString("en-us",{maximumFractionDigits:0}),"% increase"]})," ","in the total completion time. The average job waited for"," ",m.jsxs("strong",{children:[m.jsx(be,{name:"hourglass-split"})," ",fp(A)]})," ","and ran for"," ",m.jsxs("strong",{children:[m.jsx(be,{name:"stopwatch"}),fp(f)]}),"."," ",m.jsx("a",{title:`Wait time chart for ${as(h)}`,href:"#",onClick:g=>{g.preventDefault(),n(c)},children:"View chart »"})]},c))});else if(i&&i.info_resource_id===e){const c={},u=Nl;for(let h of i.data)c[h.queue]=c[h.queue]||{label:h.queue,data:Array(Nl.length).fill(null)},c[h.queue].data[Nl.indexOf(h.job_walltime)]=h.median_wait_time/60;const d=Object.values(c);d.forEach((h,g)=>{let p=Ap[g%(Ap.length-1)];h.backgroundColor=getComputedStyle(document.body).getPropertyValue(p)});const A=s.find(h=>h.info_resourceid==i.info_resource_id),f={interaction:{intersect:!1,mode:"index"},plugins:{title:{display:!0,text:`Median Wait Time by Queue on ${as(A.resource_descriptive_name)}: Last 30 Days`}},scales:{x:{title:{display:!0,text:"Job Wall Time (Run Time)"}},y:{title:{display:!0,text:"Median Wait Time (Minutes)"}}}};l=m.jsxs(m.Fragment,{children:[m.jsx(hC,{type:"bar",data:{labels:u,datasets:d},options:f}),m.jsx("p",{children:m.jsx("a",{href:"#",onClick:h=>{h.preventDefault(),n("overview")},children:"« Back to overview"})})]})}return m.jsxs(nn,{title:"Wait Time",icon:"hourglass-split",headerComponents:a,children:[l,m.jsxs("p",{className:"metrics-disclaimer",children:[m.jsx(be,{name:"info-circle"}),"These metrics describe activity from ACCESS projects. Many resources have additional projects that are not part of ACCESS."]})]})}function Sn(t){return Array.isArray?Array.isArray(t):gp(t)==="[object Array]"}function gC(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function mC(t){return t==null?"":gC(t)}function dn(t){return typeof t=="string"}function hp(t){return typeof t=="number"}function bC(t){return t===!0||t===!1||yC(t)&&gp(t)=="[object Boolean]"}function pp(t){return typeof t=="object"}function yC(t){return pp(t)&&t!==null}function xt(t){return t!=null}function Fl(t){return!t.trim().length}function gp(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const vC="Incorrect 'index' type",wC=t=>`Invalid value for key ${t}`,xC=t=>`Pattern length exceeds max of ${t}.`,kC=t=>`Missing ${t} property in key`,EC=t=>`Property 'weight' in key '${t}' must be a positive integer`,mp=Object.prototype.hasOwnProperty;class SC{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{let o=bp(r);this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function bp(t){let e=null,n=null,r=null,o=1,i=null;if(dn(t)||Sn(t))r=t,e=yp(t),n=zl(t);else{if(!mp.call(t,"name"))throw new Error(kC("name"));const s=t.name;if(r=s,mp.call(t,"weight")&&(o=t.weight,o<=0))throw new Error(EC(s));e=yp(s),n=zl(s),i=t.getFn}return{path:e,id:n,weight:o,src:r,getFn:i}}function yp(t){return Sn(t)?t:t.split(".")}function zl(t){return Sn(t)?t.join("."):t}function CC(t,e){let n=[],r=!1;const o=(i,s,a)=>{if(xt(i))if(!s[a])n.push(i);else{let l=s[a];const c=i[l];if(!xt(c))return;if(a===s.length-1&&(dn(c)||hp(c)||bC(c)))n.push(mC(c));else if(Sn(c)){r=!0;for(let u=0,d=c.length;u<d;u+=1)o(c[u],s,a+1)}else s.length&&o(c,s,a+1)}};return o(t,dn(e)?e.split("."):e,0),r?n:n[0]}var se={...{isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:CC,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const PC=/[^ ]+/g;function DC(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(o){const i=o.match(PC).length;if(n.has(i))return n.get(i);const s=1/Math.pow(i,.5*t),a=parseFloat(Math.round(s*r)/r);return n.set(i,a),a},clear(){n.clear()}}}class Hl{constructor({getFn:e=se.getFn,fieldNormWeight:n=se.fieldNormWeight}={}){this.norm=DC(n,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,dn(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();dn(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!xt(e)||Fl(e))return;let r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){let r={i:n,$:{}};this.keys.forEach((o,i)=>{let s=o.getFn?o.getFn(e):this.getFn(e,o.path);if(xt(s)){if(Sn(s)){let a=[];const l=[{nestedArrIndex:-1,value:s}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(xt(u))if(dn(u)&&!Fl(u)){let d={v:u,i:c,n:this.norm.get(u)};a.push(d)}else Sn(u)&&u.forEach((d,A)=>{l.push({nestedArrIndex:A,value:d})})}r.$[i]=a}else if(dn(s)&&!Fl(s)){let a={v:s,n:this.norm.get(s)};r.$[i]=a}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function vp(t,e,{getFn:n=se.getFn,fieldNormWeight:r=se.fieldNormWeight}={}){const o=new Hl({getFn:n,fieldNormWeight:r});return o.setKeys(t.map(bp)),o.setSources(e),o.create(),o}function BC(t,{getFn:e=se.getFn,fieldNormWeight:n=se.fieldNormWeight}={}){const{keys:r,records:o}=t,i=new Hl({getFn:e,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(o),i}function ls(t,{errors:e=0,currentLocation:n=0,expectedLocation:r=0,distance:o=se.distance,ignoreLocation:i=se.ignoreLocation}={}){const s=e/t.length;if(i)return s;const a=Math.abs(r-n);return o?s+a/o:a?1:s}function IC(t=[],e=se.minMatchCharLength){let n=[],r=-1,o=-1,i=0;for(let s=t.length;i<s;i+=1){let a=t[i];a&&r===-1?r=i:!a&&r!==-1&&(o=i-1,o-r+1>=e&&n.push([r,o]),r=-1)}return t[i-1]&&i-r>=e&&n.push([r,i-1]),n}const cr=32;function MC(t,e,n,{location:r=se.location,distance:o=se.distance,threshold:i=se.threshold,findAllMatches:s=se.findAllMatches,minMatchCharLength:a=se.minMatchCharLength,includeMatches:l=se.includeMatches,ignoreLocation:c=se.ignoreLocation}={}){if(e.length>cr)throw new Error(xC(cr));const u=e.length,d=t.length,A=Math.max(0,Math.min(r,d));let f=i,h=A;const g=a>1||l,p=g?Array(d):[];let v;for(;(v=t.indexOf(e,h))>-1;){let P=ls(e,{currentLocation:v,expectedLocation:A,distance:o,ignoreLocation:c});if(f=Math.min(P,f),h=v+u,g){let D=0;for(;D<u;)p[v+D]=1,D+=1}}h=-1;let x=[],y=1,b=u+d;const E=1<<u-1;for(let P=0;P<u;P+=1){let D=0,M=b;for(;D<M;)ls(e,{errors:P,currentLocation:A+M,expectedLocation:A,distance:o,ignoreLocation:c})<=f?D=M:b=M,M=Math.floor((b-D)/2+D);b=M;let I=Math.max(1,A-M+1),_=s?d:Math.min(A+M,d)+u,B=Array(_+2);B[_+1]=(1<<P)-1;for(let z=_;z>=I;z-=1){let O=z-1,R=n[t.charAt(O)];if(g&&(p[O]=+!!R),B[z]=(B[z+1]<<1|1)&R,P&&(B[z]|=(x[z+1]|x[z])<<1|1|x[z+1]),B[z]&E&&(y=ls(e,{errors:P,currentLocation:O,expectedLocation:A,distance:o,ignoreLocation:c}),y<=f)){if(f=y,h=O,h<=A)break;I=Math.max(1,2*A-h)}}if(ls(e,{errors:P+1,currentLocation:A,expectedLocation:A,distance:o,ignoreLocation:c})>f)break;x=B}const k={isMatch:h>=0,score:Math.max(.001,y)};if(g){const P=IC(p,a);P.length?l&&(k.indices=P):k.isMatch=!1}return k}function _C(t){let e={};for(let n=0,r=t.length;n<r;n+=1){const o=t.charAt(n);e[o]=(e[o]||0)|1<<r-n-1}return e}const cs=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);class wp{constructor(e,{location:n=se.location,threshold:r=se.threshold,distance:o=se.distance,includeMatches:i=se.includeMatches,findAllMatches:s=se.findAllMatches,minMatchCharLength:a=se.minMatchCharLength,isCaseSensitive:l=se.isCaseSensitive,ignoreDiacritics:c=se.ignoreDiacritics,ignoreLocation:u=se.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:s,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},e=l?e:e.toLowerCase(),e=c?cs(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(f,h)=>{this.chunks.push({pattern:f,alphabet:_C(f),startIndex:h})},A=this.pattern.length;if(A>cr){let f=0;const h=A%cr,g=A-h;for(;f<g;)d(this.pattern.substr(f,cr),f),f+=cr;if(h){const p=A-cr;d(this.pattern.substr(p),p)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:o}=this.options;if(e=n?e:e.toLowerCase(),e=r?cs(e):e,this.pattern===e){let g={isMatch:!0,score:0};return o&&(g.indices=[[0,e.length-1]]),g}const{location:i,distance:s,threshold:a,findAllMatches:l,minMatchCharLength:c,ignoreLocation:u}=this.options;let d=[],A=0,f=!1;this.chunks.forEach(({pattern:g,alphabet:p,startIndex:v})=>{const{isMatch:x,score:y,indices:b}=MC(e,g,p,{location:i+v,distance:s,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:o,ignoreLocation:u});x&&(f=!0),A+=y,x&&b&&(d=[...d,...b])});let h={isMatch:f,score:f?A/this.chunks.length:1};return f&&o&&(h.indices=d),h}}class Vn{constructor(e){this.pattern=e}static isMultiMatch(e){return xp(e,this.multiRegex)}static isSingleMatch(e){return xp(e,this.singleRegex)}search(){}}function xp(t,e){const n=t.match(e);return n?n[1]:null}class OC extends Vn{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class TC extends Vn{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class LC extends Vn{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class NC extends Vn{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class QC extends Vn{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class FC extends Vn{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class kp extends Vn{constructor(e,{location:n=se.location,threshold:r=se.threshold,distance:o=se.distance,includeMatches:i=se.includeMatches,findAllMatches:s=se.findAllMatches,minMatchCharLength:a=se.minMatchCharLength,isCaseSensitive:l=se.isCaseSensitive,ignoreDiacritics:c=se.ignoreDiacritics,ignoreLocation:u=se.ignoreLocation}={}){super(e),this._bitapSearch=new wp(e,{location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:s,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Ep extends Vn{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const o=[],i=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+i,o.push([r,n-1]);const s=!!o.length;return{isMatch:s,score:s?0:1,indices:o}}}const Rl=[OC,Ep,LC,NC,FC,QC,TC,kp],Sp=Rl.length,zC=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,HC="|";function RC(t,e={}){return t.split(HC).map(n=>{let r=n.trim().split(zC).filter(i=>i&&!!i.trim()),o=[];for(let i=0,s=r.length;i<s;i+=1){const a=r[i];let l=!1,c=-1;for(;!l&&++c<Sp;){const u=Rl[c];let d=u.isMultiMatch(a);d&&(o.push(new u(d,e)),l=!0)}if(!l)for(c=-1;++c<Sp;){const u=Rl[c];let d=u.isSingleMatch(a);if(d){o.push(new u(d,e));break}}}return o})}const UC=new Set([kp.type,Ep.type]);class jC{constructor(e,{isCaseSensitive:n=se.isCaseSensitive,ignoreDiacritics:r=se.ignoreDiacritics,includeMatches:o=se.includeMatches,minMatchCharLength:i=se.minMatchCharLength,ignoreLocation:s=se.ignoreLocation,findAllMatches:a=se.findAllMatches,location:l=se.location,threshold:c=se.threshold,distance:u=se.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:o,minMatchCharLength:i,findAllMatches:a,ignoreLocation:s,location:l,threshold:c,distance:u},e=n?e:e.toLowerCase(),e=r?cs(e):e,this.pattern=e,this.query=RC(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:o,ignoreDiacritics:i}=this.options;e=o?e:e.toLowerCase(),e=i?cs(e):e;let s=0,a=[],l=0;for(let c=0,u=n.length;c<u;c+=1){const d=n[c];a.length=0,s=0;for(let A=0,f=d.length;A<f;A+=1){const h=d[A],{isMatch:g,indices:p,score:v}=h.search(e);if(g){if(s+=1,l+=v,r){const x=h.constructor.type;UC.has(x)?a=[...a,...p]:a.push(p)}}else{l=0,s=0,a.length=0;break}}if(s){let A={isMatch:!0,score:l/s};return r&&(A.indices=a),A}}return{isMatch:!1,score:1}}}const Ul=[];function VC(...t){Ul.push(...t)}function jl(t,e){for(let n=0,r=Ul.length;n<r;n+=1){let o=Ul[n];if(o.condition(t,e))return new o(t,e)}return new wp(t,e)}const us={AND:"$and",OR:"$or"},Vl={PATH:"$path",PATTERN:"$val"},Wl=t=>!!(t[us.AND]||t[us.OR]),WC=t=>!!t[Vl.PATH],YC=t=>!Sn(t)&&pp(t)&&!Wl(t),Cp=t=>({[us.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function Pp(t,e,{auto:n=!0}={}){const r=o=>{let i=Object.keys(o);const s=WC(o);if(!s&&i.length>1&&!Wl(o))return r(Cp(o));if(YC(o)){const l=s?o[Vl.PATH]:i[0],c=s?o[Vl.PATTERN]:o[l];if(!dn(c))throw new Error(wC(l));const u={keyId:zl(l),pattern:c};return n&&(u.searcher=jl(c,e)),u}let a={children:[],operator:i[0]};return i.forEach(l=>{const c=o[l];Sn(c)&&c.forEach(u=>{a.children.push(r(u))})}),a};return Wl(t)||(t=Cp(t)),r(t)}function qC(t,{ignoreFieldNorm:e=se.ignoreFieldNorm}){t.forEach(n=>{let r=1;n.matches.forEach(({key:o,norm:i,score:s})=>{const a=o?o.weight:null;r*=Math.pow(s===0&&a?Number.EPSILON:s,(a||1)*(e?1:i))}),n.score=r})}function KC(t,e){const n=t.matches;e.matches=[],xt(n)&&n.forEach(r=>{if(!xt(r.indices)||!r.indices.length)return;const{indices:o,value:i}=r;let s={indices:o,value:i};r.key&&(s.key=r.key.src),r.idx>-1&&(s.refIndex=r.idx),e.matches.push(s)})}function GC(t,e){e.score=t.score}function XC(t,e,{includeMatches:n=se.includeMatches,includeScore:r=se.includeScore}={}){const o=[];return n&&o.push(KC),r&&o.push(GC),t.map(i=>{const{idx:s}=i,a={item:e[s],refIndex:s};return o.length&&o.forEach(l=>{l(i,a)}),a})}class Nr{constructor(e,n={},r){this.options={...se,...n},this.options.useExtendedSearch,this._keyStore=new SC(this.options.keys),this.setCollection(e,r)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Hl))throw new Error(vC);this._myIndex=n||vp(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){xt(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let r=0,o=this._docs.length;r<o;r+=1){const i=this._docs[r];e(i,r)&&(this.removeAt(r),r-=1,o-=1,n.push(i))}return n}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:r,includeScore:o,shouldSort:i,sortFn:s,ignoreFieldNorm:a}=this.options;let l=dn(e)?dn(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return qC(l,{ignoreFieldNorm:a}),i&&l.sort(s),hp(n)&&n>-1&&(l=l.slice(0,n)),XC(l,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(e){const n=jl(e,this.options),{records:r}=this._myIndex,o=[];return r.forEach(({v:i,i:s,n:a})=>{if(!xt(i))return;const{isMatch:l,score:c,indices:u}=n.searchIn(i);l&&o.push({item:i,idx:s,matches:[{score:c,value:i,norm:a,indices:u}]})}),o}_searchLogical(e){const n=Pp(e,this.options),r=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:A}=a,f=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:A});return f&&f.length?[{idx:c,item:l,matches:f}]:[]}const u=[];for(let d=0,A=a.children.length;d<A;d+=1){const f=a.children[d],h=r(f,l,c);if(h.length)u.push(...h);else if(a.operator===us.AND)return[]}return u},o=this._myIndex.records,i={},s=[];return o.forEach(({$:a,i:l})=>{if(xt(a)){let c=r(n,a,l);c.length&&(i[l]||(i[l]={idx:l,item:a,matches:[]},s.push(i[l])),c.forEach(({matches:u})=>{i[l].matches.push(...u)}))}}),s}_searchObjectList(e){const n=jl(e,this.options),{keys:r,records:o}=this._myIndex,i=[];return o.forEach(({$:s,i:a})=>{if(!xt(s))return;let l=[];r.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:s[u],searcher:n}))}),l.length&&i.push({idx:a,item:s,matches:l})}),i}_findMatches({key:e,value:n,searcher:r}){if(!xt(n))return[];let o=[];if(Sn(n))n.forEach(({v:i,i:s,n:a})=>{if(!xt(i))return;const{isMatch:l,score:c,indices:u}=r.searchIn(i);l&&o.push({score:c,key:e,value:i,idx:s,norm:a,indices:u})});else{const{v:i,n:s}=n,{isMatch:a,score:l,indices:c}=r.searchIn(i);a&&o.push({score:l,key:e,value:i,norm:s,indices:c})}return o}}Nr.version="7.1.0",Nr.createIndex=vp,Nr.parseIndex=BC,Nr.config=se,Nr.parseQuery=Pp,VC(jC);function JC({highlight:t,text:e}){if(!t||!t.length)return e;const n=new RegExp(t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"gi"),r=[...e.matchAll(n)];if(!r.length)return e;const o=[];let i=0;for(let s of r)s.index>i&&o.push(e.substr(i,s.index)),o.push(m.jsx("span",{className:"highlight",children:s[0]})),i=s.index+s[0].length;return o.push(e.substr(i)),o}function ZC({delay:t=300,placeholder:e,setSearchText:n,width:r="calc(var(--width) / 4)"}){const o=w.useRef(null),i=w.useRef(null),[s,a]=w.useState(""),l=()=>{a(""),n(""),o.current.value="",o.current.focus()};return w.useLayoutEffect(()=>{o.current&&o.current.addEventListener("keyup",()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,n(o.current.value),a(o.current.value)},t)})},[o.current]),m.jsx(m.Fragment,{children:m.jsxs("div",{className:"search",children:[m.jsx("input",{placeholder:e,style:{width:r},ref:o}),s.length?m.jsx("button",{className:"btn btn-clear",title:"Clear search",onClick:l,children:m.jsx(be,{name:"x-lg"})}):null]})})}const $C=["software_name","software_description","software_web_page","software_documentation","software_use_link","software_versions"];function eP({infoGroupId:t}){const e=rt("https://sds-ara-api.access-ci.org/api/v1",{body:JSON.stringify({rps:[t],columns:$C}),headers:{"Content-Type":"application/json","X-API-Key":"asSuQQ0IfIEUrSRTl44aqn2ZpMPpJ_G02BgemAY4WN0"},method:"POST"}),[n,r]=w.useState(""),o=w.useMemo(()=>e?.data&&e.data.length?new Nr(e.data,{keys:[{name:"software_name",weight:.6},{name:"software_description",weight:.4}]}):null,[e?.data]);if(!e?.data||!e.data.length)return;const i=A=>m.jsx(JC,{text:A,highlight:n}),c=[{key:"software_name",name:"Package",format:(A,f)=>{const h=i(A),g=f.software_web_page||f.software_documentation,p=f.software_use_link&&f.software_use_link.length?f.software_use_link[0]:"";return m.jsxs("span",{style:{lineHeight:1.3},children:[g?m.jsx("a",{href:g,children:h},"name"):h," ",f.software_documentation&&m.jsx("a",{href:f.software_documentation,title:`Documentation for ${A}`,children:m.jsx(be,{name:"book"})},"documentation")," ",p&&p!=f.software_documentation&&m.jsx("a",{href:p,title:`Usage example for ${A}`,children:m.jsx(be,{name:"terminal"})},"use")]})}},{key:"software_versions",name:"Versions",format:(A,f)=>f.rps[t].software_versions.join(", ")},{key:"software_description",name:"Description",format:(A,f)=>{const h=/Description Source:[ ]+(http[^ ]+)/,g=A.match(h);return m.jsxs(m.Fragment,{children:[i(A.replace(h,""))," ",g?m.jsx("a",{href:g[1],title:`Description source for ${f.software_name}`,children:m.jsx(be,{name:"info-circle"})}):null]})}}],u=n.length?o.search(n).map(A=>A.item):e.data,d=[m.jsx(ZC,{placeholder:"Search software packages...",setSearchText:r},"search")];return m.jsx(nn,{title:"Software",icon:"terminal",headerComponents:d,children:m.jsx(yi,{columns:c,rows:u,scrollResetOnUpdate:!0})})}function tP({prompt:t="Jump To:"}){const[e,n]=w.useState([]),r=w.useRef(null),o=()=>{const s=[];for(let a of r.current.querySelectorAll("[data-section-title]"))s.push({icon:a.dataset.sectionIcon,id:a.id,title:a.dataset.sectionTitle});n(s)},i=s=>{const a=r.current.querySelector(`#${s}`);a&&a.scrollIntoView()};return w.useEffect(()=>{r.current&&(o(),document.addEventListener("accessci-update-sections",o))},[r.current]),m.jsx("div",{ref:s=>r.current=s?.parentElement,children:e.length>=2?m.jsxs("nav",{className:"section-navigation",children:[t?m.jsx("h2",{children:t}):null,m.jsx("ul",{children:e.map(({icon:s,id:a,title:l})=>m.jsx("li",{children:m.jsxs("a",{href:`#${a}`,onClick:c=>{c.preventDefault(),i(a)},children:[s?m.jsxs(m.Fragment,{children:[m.jsx(be,{name:s})," "]}):null,l]})},a))})]}):null})}function nP({baseUri:t,showBreadcrumbs:e=!0}){const{infoGroupId:n}=Ng(),r=Ur(n),o=[{name:"Resources",href:t}];return r&&o.push({name:r.name}),m.jsxs(m.Fragment,{children:[e&&m.jsx(fs,{expandWidth:!0,items:o,topBorder:!0}),m.jsxs("div",{className:"resource-group-detail",children:[m.jsx(Nw,{infoGroupId:n}),m.jsx(tP,{}),m.jsx(P1,{infoGroupId:n}),m.jsx(v1,{infoGroupId:n}),m.jsx(E1,{infoGroupId:n}),m.jsx(Lw,{infoGroupId:n}),m.jsx(eP,{infoGroupId:n}),m.jsx(m2,{infoGroupId:n}),m.jsx(pC,{infoGroupId:n}),m.jsx(zw,{infoGroupId:n})]})]})}const rP=Object.freeze(Object.defineProperty({__proto__:null,default:nP},Symbol.toStringTag,{value:"Module"})),oP={"ACCESS Pegasus":"https://pegasus.isi.edu/wordpress/wp-content/uploads/2016/01/favicon.ico","ACCESS OnDemand":"https://openondemand.org/themes/fire/theme/assets/media/favicons/favicon.ico","Advance reservations":"calendar-check","Composable hardware fabric":"boxes","Compute Resources":"cpu-fill","CPU Compute":"cpu-fill","GPU Compute":"cpu","Innovative / Novel Compute":"lightbulb","Large Memory Nodes":"arrows-fullscreen",Preemption:"clock-history","Science Gateway support":"globe","Service / Other":"stars","Storage Resources":"hdd-fill","Virtual Machines":"pc-display-horizontal",Cloud:"cloud",Storage:"hdd-fill"};function Dp({active:t,tagCategory:e,tagId:n,iconUri:r,name:o,toggleTag:i}){const s=r||oP[o]||"tag";return m.jsx("li",{className:`tag tag-category-${e.name.toLowerCase().replace(/[^a-z]+/g,"-")}${t.tagIds.has(n)?" active":""}`,children:m.jsxs("button",{href:"#",disabled:t.disabledTagIds.has(n),onClick:a=>{a.preventDefault(),i(n)},children:[s.startsWith("http")?m.jsx(be,{alt:o,src:s}):m.jsx(be,{name:s}),o]})})}function Bp({children:t}){return m.jsx("ul",{className:"tags",children:t})}function iP({active:t,baseUri:e,description:n,imageType:r,imageUri:o,name:i,infoGroupId:s,parentInfoGroupId:a,tags:l,toggleTag:c}){const u=`${e}/${a||s}`;return m.jsxs("div",{className:"resource-group",children:[m.jsx("a",{className:`resource-group-image image-type-${r}`,href:u,children:o?m.jsx("img",{src:o}):m.jsx(be,{name:"motherboard"})}),m.jsxs("div",{className:"resource-group-text",children:[m.jsx("h3",{children:m.jsx("a",{href:u,children:i})}),m.jsx(Bp,{children:l.map(d=>m.jsx(Dp,{...d,active:t,toggleTag:c},d.tagId))}),m.jsxs("p",{children:[n&&n,m.jsx("br",{}),m.jsxs("a",{href:u,children:["Learn more about ",i," »"]})]})]})]})}function sP({active:t,baseUri:e,name:n,resourceGroups:r,toggleTag:o}){return m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:n}),r.filter(({infoGroupId:i})=>t.infoGroupIds.has(i)).map(i=>m.jsx(iP,{...i,baseUri:e,active:t,toggleTag:o},i.infoGroupId))]})}function aP({active:t,clearTags:e,tagCategories:n,toggleTag:r}){const[o,i]=w.useState(!1),s=w.useRef(null);return w.useEffect(()=>{const a=()=>i(!1);return document.body.addEventListener("click",a),()=>document.body.removeEventListener("click",a)},[]),m.jsxs("section",{className:"filters-outer",onClick:a=>{a.stopPropagation()},children:[m.jsxs("button",{ref:s,onClick:()=>i(!o),className:`btn-filters btn ${o?"active":""}`,children:[m.jsx(be,{name:"filter"})," Filters",t.tagIds.size>0?m.jsx("span",{className:"active-tag-count",children:t.tagIds.size}):null]}),o?m.jsxs("div",{className:"filters-inner",children:[n.map(a=>m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:a.name}),m.jsx(Bp,{children:a.tags.map(l=>m.jsx(Dp,{...l,active:t,toggleTag:r}))})]})),m.jsxs("button",{onClick:e,disabled:t.tagIds.size==0,className:"btn danger",children:[m.jsx(be,{name:"trash"})," Clear Filters"]})]}):null]})}function lP({setBotOpen:t}){const e=w.useRef(null),n=[{title:"Browse resources",icon:"filter-square",description:"Filter resources to find the best match for your research.",onClick:r=>{r.preventDefault(),e.current&&e.current.nextSibling.scrollIntoView({bahavior:"smooth"})}},{title:"Ask a question",icon:"question-circle",onClick:r=>{r.preventDefault(),t(!0)},description:"You have resource questions. Our Q&A bot has answers!"},{title:"Get suggestions",icon:"card-checklist",href:"https://ara.access-ci.org/",description:"Fill out a form to get resource recommendations."},{title:"Read news",icon:"newspaper",href:"https://access-ci.org/tag/resource-providers/",description:"See the latest news from resource providers."}];return m.jsxs("section",{id:"resource-pathways",ref:e,children:[m.jsxs("p",{className:"intro",children:["ACCESS provides advanced computing resources ",m.jsx("strong",{children:"at no cost"})," ","to researchers and educators."]}),m.jsx("ul",{className:"resource-pathways",children:n.map(({title:r,icon:o,href:i,description:s,onClick:a},l)=>m.jsx("li",{className:`resource-pathway-${l}`,children:m.jsxs("a",{href:i||"#",onClick:a,children:[o?m.jsx(be,{name:o}):null," ",m.jsxs("span",{className:"detail",children:[m.jsx("span",{className:"title",children:r}),m.jsx("span",{className:"description",children:s})]})]})},r))})]})}function cP({baseUri:t,title:e,setBotOpen:n,showBreadcrumbs:r=!0,showTitle:o=!0}){const[i,s]=w.useState([]),a=oc(),l=w.useMemo(()=>a?Yp(a,i):null,[a,i]),c=d=>s(i.includes(d)?i.filter(A=>A!=d):[...i,d]),u=()=>s([]);return m.jsxs(m.Fragment,{children:[r&&m.jsx(fs,{expandWidth:!0,items:[{name:"Resources"}],topBorder:!0}),e&&m.jsx("h1",{className:o?"":"visually-hidden",children:e}),m.jsx(lP,{setBotOpen:n}),m.jsxs("div",{id:"browse-resources",children:[l?m.jsx(aP,{tagCategories:a.tagCategories,active:l,clearTags:u,toggleTag:c}):null,a?a.resourceCategories.filter(({resourceCategoryId:d})=>l.resourceCategoryIds.has(d)).map(d=>m.jsx(sP,{...d,active:l,baseUri:t,clearTags:u,toggleTag:c},d.name)):null]})]})}const uP=Object.freeze(Object.defineProperty({__proto__:null,default:cP},Symbol.toStringTag,{value:"Module"}));ve.Breadcrumbs=Nc,ve.Footer=Qc,ve.FooterMenus=Fc,ve.Header=zc,ve.QABot=Hc,ve.ResourceCatalog=Rc,ve.SiteMenus=Uc,ve.TableOfContents=jc,ve.UniversalMenus=Vc,ve.breadcrumbs=Um,ve.footer=jm,ve.footerMenus=Vm,ve.header=Wm,ve.loginMenuItem=$l,ve.myAccessMenuItem=Zl,ve.qaBot=Ym,ve.resourceCatalog=qm,ve.siteMenus=Km,ve.tableOfContents=Gm,ve.universalMenuItems=Jl,ve.universalMenus=Xm,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})}));
|