whoami7 - Manager
:
/
home
/
analuakl
/
somethingsmushy.com
/
wp-content
/
plugins
/
user-registration
/
chunks
/
Upload File:
files >> /home/analuakl/somethingsmushy.com/wp-content/plugins/user-registration/chunks/analytics.js
(()=>{"use strict";var t,e,n={5795(t){t.exports=window.ReactDOM},9576(t,e,n){var i=n(5795);e.createRoot=i.createRoot,e.hydrateRoot=i.hydrateRoot}},i={};function r(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={exports:{}};return n[t](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,r.t=function(n,i){if(1&i&&(n=this(n)),8&i)return n;if("object"==typeof n&&n){if(4&i&&n.__esModule)return n;if(16&i&&"function"==typeof n.then)return n}var o=Object.create(null);r.r(o);var s={};t=t||[null,e({}),e([]),e(e)];for(var a=2&i&&n;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(t=>s[t]=()=>n[t]);return s.default=()=>n,r.d(o,s),o},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nc=void 0;var o={};r.r(o),r.d(o,{Button:()=>go,CaptionLabel:()=>mo,Chevron:()=>yo,Day:()=>bo,DayButton:()=>vo,Dropdown:()=>xo,DropdownNav:()=>wo,Footer:()=>_o,Month:()=>Mo,MonthCaption:()=>So,MonthGrid:()=>ko,Months:()=>Co,MonthsDropdown:()=>Ro,Nav:()=>Po,NextMonthButton:()=>To,Option:()=>Eo,PreviousMonthButton:()=>Ao,Root:()=>No,Select:()=>Io,Week:()=>Lo,WeekNumber:()=>Wo,WeekNumberHeader:()=>Uo,Weekday:()=>jo,Weekdays:()=>Fo,Weeks:()=>Bo,YearsDropdown:()=>Ho});var s={};r.r(s),r.d(s,{formatCaption:()=>zo,formatDay:()=>$o,formatMonthCaption:()=>Yo,formatMonthDropdown:()=>qo,formatWeekNumber:()=>Qo,formatWeekNumberHeader:()=>Ko,formatWeekdayName:()=>Vo,formatYearCaption:()=>Go,formatYearDropdown:()=>Xo});var a={};r.r(a),r.d(a,{labelCaption:()=>es,labelDay:()=>Jo,labelDayButton:()=>Zo,labelGrid:()=>ts,labelGridcell:()=>ns,labelMonthDropdown:()=>is,labelNav:()=>rs,labelNext:()=>ss,labelPrevious:()=>as,labelWeekNumber:()=>cs,labelWeekNumberHeader:()=>us,labelWeekday:()=>ls,labelYearDropdown:()=>hs});const l=window.React;var c=r.t(l,2),u=r.n(l),h=r(9576);function d(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function f(...t){return e=>{let n=!1;const i=t.map(t=>{const i=d(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e<i.length;e++){const n=i[e];"function"==typeof n?n():d(t[e],null)}}}}function p(...t){return l.useCallback(f(...t),t)}const g=window.ReactJSXRuntime;var m=Symbol.for("react.lazy"),y=c[" use ".trim().toString()];function b(t){return null!=t&&"object"==typeof t&&"$$typeof"in t&&t.$$typeof===m&&"_payload"in t&&"object"==typeof(e=t._payload)&&null!==e&&"then"in e;var e}function v(t){const e=w(t),n=l.forwardRef((t,n)=>{let{children:i,...r}=t;b(i)&&"function"==typeof y&&(i=y(i._payload));const o=l.Children.toArray(i),s=o.find(M);if(s){const t=s.props.children,i=o.map(e=>e===s?l.Children.count(t)>1?l.Children.only(null):l.isValidElement(t)?t.props.children:null:e);return(0,g.jsx)(e,{...r,ref:n,children:l.isValidElement(t)?l.cloneElement(t,void 0,i):null})}return(0,g.jsx)(e,{...r,ref:n,children:i})});return n.displayName=`${t}.Slot`,n}var x=v("Slot");function w(t){const e=l.forwardRef((t,e)=>{let{children:n,...i}=t;if(b(n)&&"function"==typeof y&&(n=y(n._payload)),l.isValidElement(n)){const t=function(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}(n),r=function(t,e){const n={...e};for(const i in e){const r=t[i],o=e[i];/^on[A-Z]/.test(i)?r&&o?n[i]=(...t)=>{const e=o(...t);return r(...t),e}:r&&(n[i]=r):"style"===i?n[i]={...r,...o}:"className"===i&&(n[i]=[r,o].filter(Boolean).join(" "))}return{...t,...n}}(i,n.props);return n.type!==l.Fragment&&(r.ref=e?f(e,t):t),l.cloneElement(n,r)}return l.Children.count(n)>1?l.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var _=Symbol("radix.slottable");function M(t){return l.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===_}function S(t){var e,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=S(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function k(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=S(t))&&(i&&(i+=" "),i+=e);return i}const C=t=>"boolean"==typeof t?`${t}`:0===t?"0":t,D=k;function O(...t){return k(t)}const R=(P={variants:{variant:{default:"UR-UI-Button",destructive:"UR-UI-Button UR-UI-Button--destructive",outline:"UR-UI-Button UR-UI-Button--outline",secondary:"UR-UI-Button UR-UI-Button--secondary",ghost:"UR-UI-Button UR-UI-Button--ghost",link:"UR-UI-Button UR-UI-Button--link"},size:{default:"",sm:"UR-UI-Button--sm",lg:"UR-UI-Button--lg",icon:"UR-UI-Button--icon","icon-sm":"UR-UI-Button--icon-sm","icon-lg":"UR-UI-Button--icon-lg"}},defaultVariants:{variant:"default",size:"default"}},t=>{var e;if(null==(null==P?void 0:P.variants))return D("",null==t?void 0:t.class,null==t?void 0:t.className);const{variants:n,defaultVariants:i}=P,r=Object.keys(n).map(e=>{const r=null==t?void 0:t[e],o=null==i?void 0:i[e];if(null===r)return null;const s=C(r)||C(o);return n[e][s]}),o=t&&Object.entries(t).reduce((t,e)=>{let[n,i]=e;return void 0===i||(t[n]=i),t},{}),s=null==P||null===(e=P.compoundVariants)||void 0===e?void 0:e.reduce((t,e)=>{let{class:n,className:r,...s}=e;return Object.entries(s).every(t=>{let[e,n]=t;return Array.isArray(n)?n.includes({...i,...o}[e]):{...i,...o}[e]===n})?[...t,n,r]:t},[]);return D("",r,s,null==t?void 0:t.class,null==t?void 0:t.className)});var P;function T({className:t,variant:e,size:n,asChild:i=!1,...r}){const o=i?x:"button";return(0,g.jsx)(o,{"data-slot":"button",className:O(R({variant:e,size:n,className:t})),...r})}function E(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),!1===n||!i.defaultPrevented)return e?.(i)}}function A(t,e=[]){let n=[];const i=()=>{const e=n.map(t=>l.createContext(t));return function(n){const i=n?.[t]||e;return l.useMemo(()=>({[`__scope${t}`]:{...n,[t]:i}}),[n,i])}};return i.scopeName=t,[function(e,i){const r=l.createContext(i),o=n.length;n=[...n,i];const s=e=>{const{scope:n,children:i,...s}=e,a=n?.[t]?.[o]||r,c=l.useMemo(()=>s,Object.values(s));return(0,g.jsx)(a.Provider,{value:c,children:i})};return s.displayName=e+"Provider",[s,function(n,s){const a=s?.[t]?.[o]||r,c=l.useContext(a);if(c)return c;if(void 0!==i)return i;throw new Error(`\`${n}\` must be used within \`${e}\``)}]},N(i,...e)]}function N(...t){const e=t[0];if(1===t.length)return e;const n=()=>{const n=t.map(t=>({useScope:t(),scopeName:t.scopeName}));return function(t){const i=n.reduce((e,{useScope:n,scopeName:i})=>({...e,...n(t)[`__scope${i}`]}),{});return l.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return n.scopeName=e.scopeName,n}"undefined"==typeof window||!window.document||window.document.createElement;var I=r(5795);function L(t){const e=j(t),n=l.forwardRef((t,n)=>{const{children:i,...r}=t,o=l.Children.toArray(i),s=o.find(W);if(s){const t=s.props.children,i=o.map(e=>e===s?l.Children.count(t)>1?l.Children.only(null):l.isValidElement(t)?t.props.children:null:e);return(0,g.jsx)(e,{...r,ref:n,children:l.isValidElement(t)?l.cloneElement(t,void 0,i):null})}return(0,g.jsx)(e,{...r,ref:n,children:i})});return n.displayName=`${t}.Slot`,n}function j(t){const e=l.forwardRef((t,e)=>{const{children:n,...i}=t;if(l.isValidElement(n)){const t=function(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}(n),r=function(t,e){const n={...e};for(const i in e){const r=t[i],o=e[i];/^on[A-Z]/.test(i)?r&&o?n[i]=(...t)=>{const e=o(...t);return r(...t),e}:r&&(n[i]=r):"style"===i?n[i]={...r,...o}:"className"===i&&(n[i]=[r,o].filter(Boolean).join(" "))}return{...t,...n}}(i,n.props);return n.type!==l.Fragment&&(r.ref=e?f(e,t):t),l.cloneElement(n,r)}return l.Children.count(n)>1?l.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var F=Symbol("radix.slottable");function W(t){return l.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===F}var U=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,e)=>{const n=L(`Primitive.${e}`),i=l.forwardRef((t,i)=>{const{asChild:r,...o}=t,s=r?n:e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(s,{...o,ref:i})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function B(t){const e=l.useRef(t);return l.useEffect(()=>{e.current=t}),l.useMemo(()=>(...t)=>e.current?.(...t),[])}var H,z="dismissableLayer.update",Y=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$=l.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:r,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...c}=t,u=l.useContext(Y),[h,d]=l.useState(null),f=h?.ownerDocument??globalThis?.document,[,m]=l.useState({}),y=p(e,t=>d(t)),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(v),w=h?b.indexOf(h):-1,_=u.layersWithOutsidePointerEventsDisabled.size>0,M=w>=x,S=function(t,e=globalThis?.document){const n=B(t),i=l.useRef(!1),r=l.useRef(()=>{});return l.useEffect(()=>{const t=t=>{if(t.target&&!i.current){let i=function(){V("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})};const o={originalEvent:t};"touch"===t.pointerType?(e.removeEventListener("click",r.current),r.current=i,e.addEventListener("click",r.current,{once:!0})):i()}else e.removeEventListener("click",r.current);i.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",t)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",t),e.removeEventListener("click",r.current)}},[e,n]),{onPointerDownCapture:()=>i.current=!0}}(t=>{const e=t.target,n=[...u.branches].some(t=>t.contains(e));M&&!n&&(r?.(t),s?.(t),t.defaultPrevented||a?.())},f),k=function(t,e=globalThis?.document){const n=B(t),i=l.useRef(!1);return l.useEffect(()=>{const t=t=>{t.target&&!i.current&&V("dismissableLayer.focusOutside",n,{originalEvent:t},{discrete:!1})};return e.addEventListener("focusin",t),()=>e.removeEventListener("focusin",t)},[e,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}(t=>{const e=t.target;[...u.branches].some(t=>t.contains(e))||(o?.(t),s?.(t),t.defaultPrevented||a?.())},f);return function(t,e=globalThis?.document){const n=B(t);l.useEffect(()=>{const t=t=>{"Escape"===t.key&&n(t)};return e.addEventListener("keydown",t,{capture:!0}),()=>e.removeEventListener("keydown",t,{capture:!0})},[n,e])}(t=>{w===u.layers.size-1&&(i?.(t),!t.defaultPrevented&&a&&(t.preventDefault(),a()))},f),l.useEffect(()=>{if(h)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(H=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),q(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=H)}},[h,f,n,u]),l.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),q())},[h,u]),l.useEffect(()=>{const t=()=>m({});return document.addEventListener(z,t),()=>document.removeEventListener(z,t)},[]),(0,g.jsx)(U.div,{...c,ref:y,style:{pointerEvents:_?M?"auto":"none":void 0,...t.style},onFocusCapture:E(t.onFocusCapture,k.onFocusCapture),onBlurCapture:E(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:E(t.onPointerDownCapture,S.onPointerDownCapture)})});function q(){const t=new CustomEvent(z);document.dispatchEvent(t)}function V(t,e,n,{discrete:i}){const r=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),i?function(t,e){t&&I.flushSync(()=>t.dispatchEvent(e))}(r,o):r.dispatchEvent(o)}$.displayName="DismissableLayer",l.forwardRef((t,e)=>{const n=l.useContext(Y),i=l.useRef(null),r=p(e,i);return l.useEffect(()=>{const t=i.current;if(t)return n.branches.add(t),()=>{n.branches.delete(t)}},[n.branches]),(0,g.jsx)(U.div,{...t,ref:r})}).displayName="DismissableLayerBranch";var Q=0;function K(){l.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??X()),document.body.insertAdjacentElement("beforeend",t[1]??X()),Q++,()=>{1===Q&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Q--}},[])}function X(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var G="focusScope.autoFocusOnMount",Z="focusScope.autoFocusOnUnmount",J={bubbles:!1,cancelable:!0},tt=l.forwardRef((t,e)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:r,onUnmountAutoFocus:o,...s}=t,[a,c]=l.useState(null),u=B(r),h=B(o),d=l.useRef(null),f=p(e,t=>c(t)),m=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(i){let t=function(t){if(m.paused||!a)return;const e=t.target;a.contains(e)?d.current=e:rt(d.current,{select:!0})},e=function(t){if(m.paused||!a)return;const e=t.relatedTarget;null!==e&&(a.contains(e)||rt(d.current,{select:!0}))},n=function(t){if(document.activeElement===document.body)for(const e of t)e.removedNodes.length>0&&rt(a)};document.addEventListener("focusin",t),document.addEventListener("focusout",e);const i=new MutationObserver(n);return a&&i.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",t),document.removeEventListener("focusout",e),i.disconnect()}}},[i,a,m.paused]),l.useEffect(()=>{if(a){ot.add(m);const t=document.activeElement;if(!a.contains(t)){const e=new CustomEvent(G,J);a.addEventListener(G,u),a.dispatchEvent(e),e.defaultPrevented||(function(t,{select:e=!1}={}){const n=document.activeElement;for(const i of t)if(rt(i,{select:e}),document.activeElement!==n)return}(et(a).filter(t=>"A"!==t.tagName),{select:!0}),document.activeElement===t&&rt(a))}return()=>{a.removeEventListener(G,u),setTimeout(()=>{const e=new CustomEvent(Z,J);a.addEventListener(Z,h),a.dispatchEvent(e),e.defaultPrevented||rt(t??document.body,{select:!0}),a.removeEventListener(Z,h),ot.remove(m)},0)}}},[a,u,h,m]);const y=l.useCallback(t=>{if(!n&&!i)return;if(m.paused)return;const e="Tab"===t.key&&!t.altKey&&!t.ctrlKey&&!t.metaKey,r=document.activeElement;if(e&&r){const e=t.currentTarget,[i,o]=function(t){const e=et(t);return[nt(e,t),nt(e.reverse(),t)]}(e);i&&o?t.shiftKey||r!==o?t.shiftKey&&r===i&&(t.preventDefault(),n&&rt(o,{select:!0})):(t.preventDefault(),n&&rt(i,{select:!0})):r===e&&t.preventDefault()}},[n,i,m.paused]);return(0,g.jsx)(U.div,{tabIndex:-1,...s,ref:f,onKeyDown:y})});function et(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>{const e="INPUT"===t.tagName&&"hidden"===t.type;return t.disabled||t.hidden||e?NodeFilter.FILTER_SKIP:t.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function nt(t,e){for(const n of t)if(!it(n,{upTo:e}))return n}function it(t,{upTo:e}){if("hidden"===getComputedStyle(t).visibility)return!0;for(;t;){if(void 0!==e&&t===e)return!1;if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1}function rt(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&function(t){return t instanceof HTMLInputElement&&"select"in t}(t)&&e&&t.select()}}tt.displayName="FocusScope";var ot=function(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=st(t,e),t.unshift(e)},remove(e){t=st(t,e),t[0]?.resume()}}}();function st(t,e){const n=[...t],i=n.indexOf(e);return-1!==i&&n.splice(i,1),n}var at=globalThis?.document?l.useLayoutEffect:()=>{},lt=c[" useId ".trim().toString()]||(()=>{}),ct=0;function ut(t){const[e,n]=l.useState(lt());return at(()=>{t||n(t=>t??String(ct++))},[t]),t||(e?`radix-${e}`:"")}const ht=["top","right","bottom","left"],dt=Math.min,ft=Math.max,pt=Math.round,gt=Math.floor,mt=t=>({x:t,y:t}),yt={left:"right",right:"left",bottom:"top",top:"bottom"},bt={start:"end",end:"start"};function vt(t,e,n){return ft(t,dt(e,n))}function xt(t,e){return"function"==typeof t?t(e):t}function wt(t){return t.split("-")[0]}function _t(t){return t.split("-")[1]}function Mt(t){return"x"===t?"y":"x"}function St(t){return"y"===t?"height":"width"}const kt=new Set(["top","bottom"]);function Ct(t){return kt.has(wt(t))?"y":"x"}function Dt(t){return Mt(Ct(t))}function Ot(t){return t.replace(/start|end/g,t=>bt[t])}const Rt=["left","right"],Pt=["right","left"],Tt=["top","bottom"],Et=["bottom","top"];function At(t){return t.replace(/left|right|bottom|top/g,t=>yt[t])}function Nt(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function It(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function Lt(t,e,n){let{reference:i,floating:r}=t;const o=Ct(e),s=Dt(e),a=St(s),l=wt(e),c="y"===o,u=i.x+i.width/2-r.width/2,h=i.y+i.height/2-r.height/2,d=i[a]/2-r[a]/2;let f;switch(l){case"top":f={x:u,y:i.y-r.height};break;case"bottom":f={x:u,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:h};break;case"left":f={x:i.x-r.width,y:h};break;default:f={x:i.x,y:i.y}}switch(_t(e)){case"start":f[s]-=d*(n&&c?-1:1);break;case"end":f[s]+=d*(n&&c?-1:1)}return f}async function jt(t,e){var n;void 0===e&&(e={});const{x:i,y:r,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:f=0}=xt(e,t),p=Nt(f),g=a[d?"floating"===h?"reference":"floating":h],m=It(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(g)))||n?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===h?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),v=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},x=It(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:b,strategy:l}):y);return{top:(m.top-x.top+p.top)/v.y,bottom:(x.bottom-m.bottom+p.bottom)/v.y,left:(m.left-x.left+p.left)/v.x,right:(x.right-m.right+p.right)/v.x}}function Ft(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Wt(t){return ht.some(e=>t[e]>=0)}const Ut=new Set(["left","top"]);function Bt(){return"undefined"!=typeof window}function Ht(t){return $t(t)?(t.nodeName||"").toLowerCase():"#document"}function zt(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Yt(t){var e;return null==(e=($t(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function $t(t){return!!Bt()&&(t instanceof Node||t instanceof zt(t).Node)}function qt(t){return!!Bt()&&(t instanceof Element||t instanceof zt(t).Element)}function Vt(t){return!!Bt()&&(t instanceof HTMLElement||t instanceof zt(t).HTMLElement)}function Qt(t){return!(!Bt()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof zt(t).ShadowRoot)}const Kt=new Set(["inline","contents"]);function Xt(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=le(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!Kt.has(r)}const Gt=new Set(["table","td","th"]);function Zt(t){return Gt.has(Ht(t))}const Jt=[":popover-open",":modal"];function te(t){return Jt.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const ee=["transform","translate","scale","rotate","perspective"],ne=["transform","translate","scale","rotate","perspective","filter"],ie=["paint","layout","strict","content"];function re(t){const e=oe(),n=qt(t)?le(t):t;return ee.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||ne.some(t=>(n.willChange||"").includes(t))||ie.some(t=>(n.contain||"").includes(t))}function oe(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const se=new Set(["html","body","#document"]);function ae(t){return se.has(Ht(t))}function le(t){return zt(t).getComputedStyle(t)}function ce(t){return qt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ue(t){if("html"===Ht(t))return t;const e=t.assignedSlot||t.parentNode||Qt(t)&&t.host||Yt(t);return Qt(e)?e.host:e}function he(t){const e=ue(t);return ae(e)?t.ownerDocument?t.ownerDocument.body:t.body:Vt(e)&&Xt(e)?e:he(e)}function de(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=he(t),o=r===(null==(i=t.ownerDocument)?void 0:i.body),s=zt(r);if(o){const t=fe(s);return e.concat(s,s.visualViewport||[],Xt(r)?r:[],t&&n?de(t):[])}return e.concat(r,de(r,[],n))}function fe(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function pe(t){const e=le(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Vt(t),o=r?t.offsetWidth:n,s=r?t.offsetHeight:i,a=pt(n)!==o||pt(i)!==s;return a&&(n=o,i=s),{width:n,height:i,$:a}}function ge(t){return qt(t)?t:t.contextElement}function me(t){const e=ge(t);if(!Vt(e))return mt(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:o}=pe(e);let s=(o?pt(n.width):n.width)/i,a=(o?pt(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const ye=mt(0);function be(t){const e=zt(t);return oe()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ye}function ve(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),o=ge(t);let s=mt(1);e&&(i?qt(i)&&(s=me(i)):s=me(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==zt(t))&&e}(o,n,i)?be(o):mt(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,h=r.height/s.y;if(o){const t=zt(o),e=i&&qt(i)?zt(i):i;let n=t,r=fe(n);for(;r&&i&&e!==n;){const t=me(r),e=r.getBoundingClientRect(),i=le(r),o=e.left+(r.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,u*=t.x,h*=t.y,l+=o,c+=s,n=zt(r),r=fe(n)}}return It({width:u,height:h,x:l,y:c})}function xe(t,e){const n=ce(t).scrollLeft;return e?e.left+n:ve(Yt(t)).left+n}function we(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-xe(t,n),y:n.top+e.scrollTop}}const _e=new Set(["absolute","fixed"]);function Me(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=zt(t),i=Yt(t),r=n.visualViewport;let o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;const t=oe();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}const c=xe(i);if(c<=0){const t=i.ownerDocument,e=t.body,n=getComputedStyle(e),r="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(i.clientWidth-e.clientWidth-r);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:a,y:l}}(t,n);else if("document"===e)i=function(t){const e=Yt(t),n=ce(t),i=t.ownerDocument.body,r=ft(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=ft(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+xe(t);const a=-n.scrollTop;return"rtl"===le(i).direction&&(s+=ft(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:s,y:a}}(Yt(t));else if(qt(e))i=function(t,e){const n=ve(t,!0,"fixed"===e),i=n.top+t.clientTop,r=n.left+t.clientLeft,o=Vt(t)?me(t):mt(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:r*o.x,y:i*o.y}}(e,n);else{const n=be(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return It(i)}function Se(t,e){const n=ue(t);return!(n===e||!qt(n)||ae(n))&&("fixed"===le(n).position||Se(n,e))}function ke(t,e,n){const i=Vt(e),r=Yt(e),o="fixed"===n,s=ve(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=mt(0);function c(){l.x=xe(r)}if(i||!i&&!o)if(("body"!==Ht(e)||Xt(r))&&(a=ce(e)),i){const t=ve(e,!0,o,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&c();o&&!i&&r&&c();const u=!r||i||o?mt(0):we(r,a);return{x:s.left+a.scrollLeft-l.x-u.x,y:s.top+a.scrollTop-l.y-u.y,width:s.width,height:s.height}}function Ce(t){return"static"===le(t).position}function De(t,e){if(!Vt(t)||"fixed"===le(t).position)return null;if(e)return e(t);let n=t.offsetParent;return Yt(t)===n&&(n=n.ownerDocument.body),n}function Oe(t,e){const n=zt(t);if(te(t))return n;if(!Vt(t)){let e=ue(t);for(;e&&!ae(e);){if(qt(e)&&!Ce(e))return e;e=ue(e)}return n}let i=De(t,e);for(;i&&Zt(i)&&Ce(i);)i=De(i,e);return i&&ae(i)&&Ce(i)&&!re(i)?n:i||function(t){let e=ue(t);for(;Vt(e)&&!ae(e);){if(re(e))return e;if(te(e))return null;e=ue(e)}return null}(t)||n}const Re={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const o="fixed"===r,s=Yt(i),a=!!e&&te(e.floating);if(i===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=mt(1);const u=mt(0),h=Vt(i);if((h||!h&&!o)&&(("body"!==Ht(i)||Xt(s))&&(l=ce(i)),Vt(i))){const t=ve(i);c=me(i),u.x=t.x+i.clientLeft,u.y=t.y+i.clientTop}const d=!s||h||o?mt(0):we(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}},getDocumentElement:Yt,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const o=[..."clippingAncestors"===n?te(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let i=de(t,[],!1).filter(t=>qt(t)&&"body"!==Ht(t)),r=null;const o="fixed"===le(t).position;let s=o?ue(t):t;for(;qt(s)&&!ae(s);){const e=le(s),n=re(s);n||"fixed"!==e.position||(r=null),(o?!n&&!r:!n&&"static"===e.position&&r&&_e.has(r.position)||Xt(s)&&!n&&Se(t,s))?i=i.filter(t=>t!==s):r=e,s=ue(s)}return e.set(t,i),i}(e,this._c):[].concat(n),i],s=o[0],a=o.reduce((t,n)=>{const i=Me(e,n,r);return t.top=ft(i.top,t.top),t.right=dt(i.right,t.right),t.bottom=dt(i.bottom,t.bottom),t.left=ft(i.left,t.left),t},Me(e,s,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Oe,getElementRects:async function(t){const e=this.getOffsetParent||Oe,n=this.getDimensions,i=await n(t.floating);return{reference:ke(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=pe(t);return{width:e,height:n}},getScale:me,isElement:qt,isRTL:function(t){return"rtl"===le(t).direction}};function Pe(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}const Te=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:o,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:n,platform:i,elements:r}=t,o=await(null==i.isRTL?void 0:i.isRTL(r.floating)),s=wt(n),a=_t(n),l="y"===Ct(n),c=Ut.has(s)?-1:1,u=o&&l?-1:1,h=xt(e,t);let{mainAxis:d,crossAxis:f,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:d*c}:{x:d*c,y:f*u}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:s}}}}},Ee=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=xt(t,e),c={x:n,y:i},u=await jt(e,l),h=Ct(wt(r)),d=Mt(h);let f=c[d],p=c[h];if(o){const t="y"===d?"bottom":"right";f=vt(f+u["y"===d?"top":"left"],f,f-u[t])}if(s){const t="y"===h?"bottom":"right";p=vt(p+u["y"===h?"top":"left"],p,p-u[t])}const g=a.fn({...e,[d]:f,[h]:p});return{...g,data:{x:g.x-n,y:g.y-i,enabled:{[d]:o,[h]:s}}}}}},Ae=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=xt(t,e);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const y=wt(r),b=Ct(a),v=wt(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=d||(v||!g?[At(a)]:function(t){const e=At(t);return[Ot(t),e,Ot(e)]}(a)),_="none"!==p;!d&&_&&w.push(...function(t,e,n,i){const r=_t(t);let o=function(t,e,n){switch(t){case"top":case"bottom":return n?e?Pt:Rt:e?Rt:Pt;case"left":case"right":return e?Tt:Et;default:return[]}}(wt(t),"start"===n,i);return r&&(o=o.map(t=>t+"-"+r),e&&(o=o.concat(o.map(Ot)))),o}(a,g,p,x));const M=[a,...w],S=await jt(e,m),k=[];let C=(null==(i=o.flip)?void 0:i.overflows)||[];if(u&&k.push(S[y]),h){const t=function(t,e,n){void 0===n&&(n=!1);const i=_t(t),r=Dt(t),o=St(r);let s="x"===r?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=At(s)),[s,At(s)]}(r,s,x);k.push(S[t[0]],S[t[1]])}if(C=[...C,{placement:r,overflows:k}],!k.every(t=>t<=0)){var D,O;const t=((null==(D=o.flip)?void 0:D.index)||0)+1,e=M[t];if(e&&("alignment"!==h||b===Ct(e)||C.every(t=>Ct(t.placement)!==b||t.overflows[0]>0)))return{data:{index:t,overflows:C},reset:{placement:e}};let n=null==(O=C.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:O.placement;if(!n)switch(f){case"bestFit":{var R;const t=null==(R=C.filter(t=>{if(_){const e=Ct(t.placement);return e===b||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:R[0];t&&(n=t);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},Ne=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:r,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...c}=xt(t,e),u=await jt(e,c),h=wt(r),d=_t(r),f="y"===Ct(r),{width:p,height:g}=o.floating;let m,y;"top"===h||"bottom"===h?(m=h,y=d===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=h,m="end"===d?"top":"bottom");const b=g-u.top-u.bottom,v=p-u.left-u.right,x=dt(g-u[m],b),w=dt(p-u[y],v),_=!e.middlewareData.shift;let M=x,S=w;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(S=v),null!=(i=e.middlewareData.shift)&&i.enabled.y&&(M=b),_&&!d){const t=ft(u.left,0),e=ft(u.right,0),n=ft(u.top,0),i=ft(u.bottom,0);f?S=p-2*(0!==t||0!==e?t+e:ft(u.left,u.right)):M=g-2*(0!==n||0!==i?n+i:ft(u.top,u.bottom))}await l({...e,availableWidth:S,availableHeight:M});const k=await s.getDimensions(a.floating);return p!==k.width||g!==k.height?{reset:{rects:!0}}:{}}}},Ie=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...r}=xt(t,e);switch(i){case"referenceHidden":{const t=Ft(await jt(e,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:Wt(t)}}}case"escaped":{const t=Ft(await jt(e,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:Wt(t)}}}default:return{}}}}},Le=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=xt(t,e)||{};if(null==c)return{};const h=Nt(u),d={x:n,y:i},f=Dt(r),p=St(f),g=await s.getDimensions(c),m="y"===f,y=m?"top":"left",b=m?"bottom":"right",v=m?"clientHeight":"clientWidth",x=o.reference[p]+o.reference[f]-d[f]-o.floating[p],w=d[f]-o.reference[f],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let M=_?_[v]:0;M&&await(null==s.isElement?void 0:s.isElement(_))||(M=a.floating[v]||o.floating[p]);const S=x/2-w/2,k=M/2-g[p]/2-1,C=dt(h[y],k),D=dt(h[b],k),O=C,R=M-g[p]-D,P=M/2-g[p]/2+S,T=vt(O,P,R),E=!l.arrow&&null!=_t(r)&&P!==T&&o.reference[p]/2-(P<O?C:D)-g[p]/2<0,A=E?P<O?P-O:P-R:0;return{[f]:d[f]+A,data:{[f]:T,centerOffset:P-T-A,...E&&{alignmentOffset:A}},reset:E}}}),je=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:o,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=xt(t,e),u={x:n,y:i},h=Ct(r),d=Mt(h);let f=u[d],p=u[h];const g=xt(a,e),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const t="y"===d?"height":"width",e=o.reference[d]-o.floating[t]+m.mainAxis,n=o.reference[d]+o.reference[t]-m.mainAxis;f<e?f=e:f>n&&(f=n)}if(c){var y,b;const t="y"===d?"width":"height",e=Ut.has(wt(r)),n=o.reference[h]-o.floating[t]+(e&&(null==(y=s.offset)?void 0:y[h])||0)+(e?0:m.crossAxis),i=o.reference[h]+o.reference[t]+(e?0:(null==(b=s.offset)?void 0:b[h])||0)-(e?m.crossAxis:0);p<n?p=n:p>i&&(p=i)}return{[d]:f,[h]:p}}}},Fe=(t,e,n)=>{const i=new Map,r={platform:Re,...n},o={...r.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:h}=Lt(c,i,l),d=i,f={},p=0;for(let n=0;n<a.length;n++){const{name:o,fn:g}=a[n],{x:m,y,data:b,reset:v}=await g({x:u,y:h,initialPlacement:i,placement:d,strategy:r,middlewareData:f,rects:c,platform:s,elements:{reference:t,floating:e}});u=null!=m?m:u,h=null!=y?y:h,f={...f,[o]:{...f[o],...b}},v&&p<=50&&(p++,"object"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(c=!0===v.rects?await s.getElementRects({reference:t,floating:e,strategy:r}):v.rects),({x:u,y:h}=Lt(c,d,l))),n=-1)}return{x:u,y:h,placement:d,strategy:r,middlewareData:f}})(t,e,{...r,platform:o})},We=t=>({name:"arrow",options:t,fn(e){const{element:n,padding:i}="function"==typeof t?t(e):t;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?Le({element:n.current,padding:i}).fn(e):{}:n?Le({element:n,padding:i}).fn(e):{};var r}});var Ue="undefined"!=typeof document?l.useLayoutEffect:l.useEffect;function Be(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let n,i,r;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;0!==i--;)if(!Be(t[i],e[i]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(i=n;0!==i--;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=n;0!==i--;){const n=r[i];if(!("_owner"===n&&t.$$typeof||Be(t[n],e[n])))return!1}return!0}return t!=t&&e!=e}function He(t){return"undefined"==typeof window?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ze(t,e){const n=He(t);return Math.round(e*n)/n}function Ye(t){const e=l.useRef(t);return Ue(()=>{e.current=t}),e}var $e=l.forwardRef((t,e)=>{const{children:n,width:i=10,height:r=5,...o}=t;return(0,g.jsx)(U.svg,{...o,ref:e,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:(0,g.jsx)("polygon",{points:"0,0 30,0 15,10"})})});$e.displayName="Arrow";var qe=$e,Ve="Popper",[Qe,Ke]=A(Ve),[Xe,Ge]=Qe(Ve),Ze=t=>{const{__scopePopper:e,children:n}=t,[i,r]=l.useState(null);return(0,g.jsx)(Xe,{scope:e,anchor:i,onAnchorChange:r,children:n})};Ze.displayName=Ve;var Je="PopperAnchor",tn=l.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:i,...r}=t,o=Ge(Je,n),s=l.useRef(null),a=p(e,s),c=l.useRef(null);return l.useEffect(()=>{const t=c.current;c.current=i?.current||s.current,t!==c.current&&o.onAnchorChange(c.current)}),i?null:(0,g.jsx)(U.div,{...r,ref:a})});tn.displayName=Je;var en="PopperContent",[nn,rn]=Qe(en),on=l.forwardRef((t,e)=>{const{__scopePopper:n,side:i="bottom",sideOffset:r=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:y,...b}=t,v=Ge(en,n),[x,w]=l.useState(null),_=p(e,t=>w(t)),[M,S]=l.useState(null),k=function(t){const[e,n]=l.useState(void 0);return at(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const i=e[0];let r,o;if("borderBoxSize"in i){const t=i.borderBoxSize,e=Array.isArray(t)?t[0]:t;r=e.inlineSize,o=e.blockSize}else r=t.offsetWidth,o=t.offsetHeight;n({width:r,height:o})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}n(void 0)},[t]),e}(M),C=k?.width??0,D=k?.height??0,O=i+("center"!==o?"-"+o:""),R="number"==typeof h?h:{top:0,right:0,bottom:0,left:0,...h},P=Array.isArray(u)?u:[u],T=P.length>0,E={padding:R,boundary:P.filter(cn),altBoundary:T},{refs:A,floatingStyles:N,placement:L,isPositioned:j,middlewareData:F}=function(t){void 0===t&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:c,open:u}=t,[h,d]=l.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=l.useState(i);Be(f,i)||p(i);const[g,m]=l.useState(null),[y,b]=l.useState(null),v=l.useCallback(t=>{t!==M.current&&(M.current=t,m(t))},[]),x=l.useCallback(t=>{t!==S.current&&(S.current=t,b(t))},[]),w=o||g,_=s||y,M=l.useRef(null),S=l.useRef(null),k=l.useRef(h),C=null!=c,D=Ye(c),O=Ye(r),R=l.useCallback(()=>{if(!M.current||!S.current)return;const t={placement:e,strategy:n,middleware:f};O.current&&(t.platform=O.current),Fe(M.current,S.current,t).then(t=>{const e={...t,isPositioned:!0};P.current&&!Be(k.current,e)&&(k.current=e,I.flushSync(()=>{d(e)}))})},[f,e,n,O]);Ue(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,d(t=>({...t,isPositioned:!1})))},[u]);const P=l.useRef(!1);Ue(()=>(P.current=!0,()=>{P.current=!1}),[]),Ue(()=>{if(w&&(M.current=w),_&&(S.current=_),w&&_){if(D.current)return D.current(w,_,R);R()}},[w,_,R,D,C]);const T=l.useMemo(()=>({reference:M,floating:S,setReference:v,setFloating:x}),[v,x]),E=l.useMemo(()=>({reference:w,floating:_}),[w,_]),A=l.useMemo(()=>{const t={position:n,left:0,top:0};if(!E.floating)return t;const e=ze(E.floating,h.x),i=ze(E.floating,h.y);return a?{...t,transform:"translate("+e+"px, "+i+"px)",...He(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:e,top:i}},[n,a,E.floating,h.x,h.y]);return l.useMemo(()=>({...h,update:R,refs:T,elements:E,floatingStyles:A}),[h,R,T,E,A])}({strategy:"fixed",placement:O,whileElementsMounted:(...t)=>function(t,e,n,i){void 0===i&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=ge(t),u=r||o?[...c?de(c):[],...de(e)]:[];u.forEach(t=>{r&&t.addEventListener("scroll",n,{passive:!0}),o&&t.addEventListener("resize",n)});const h=c&&a?function(t,e){let n,i=null;const r=Yt(t);function o(){var t;clearTimeout(n),null==(t=i)||t.disconnect(),i=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const c=t.getBoundingClientRect(),{left:u,top:h,width:d,height:f}=c;if(a||e(),!d||!f)return;const p={rootMargin:-gt(h)+"px "+-gt(r.clientWidth-(u+d))+"px "+-gt(r.clientHeight-(h+f))+"px "+-gt(u)+"px",threshold:ft(0,dt(1,l))||1};let g=!0;function m(e){const i=e[0].intersectionRatio;if(i!==l){if(!g)return s();i?s(!1,i):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==i||Pe(c,t.getBoundingClientRect())||s(),g=!1}try{i=new IntersectionObserver(m,{...p,root:r.ownerDocument})}catch(t){i=new IntersectionObserver(m,p)}i.observe(t)}(!0),o}(c,n):null;let d,f=-1,p=null;s&&(p=new ResizeObserver(t=>{let[i]=t;i&&i.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let g=l?ve(t):null;return l&&function e(){const i=ve(t);g&&!Pe(g,i)&&n(),g=i,d=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach(t=>{r&&t.removeEventListener("scroll",n),o&&t.removeEventListener("resize",n)}),null==h||h(),null==(t=p)||t.disconnect(),p=null,l&&cancelAnimationFrame(d)}}(...t,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[Te({mainAxis:r+D,alignmentAxis:s}),c&&Ee({mainAxis:!0,crossAxis:!1,limiter:"partial"===d?je():void 0,...E}),c&&Ae({...E}),Ne({...E,apply:({elements:t,rects:e,availableWidth:n,availableHeight:i})=>{const{width:r,height:o}=e.reference,s=t.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${i}px`),s.setProperty("--radix-popper-anchor-width",`${r}px`),s.setProperty("--radix-popper-anchor-height",`${o}px`)}}),M&&We({element:M,padding:a}),un({arrowWidth:C,arrowHeight:D}),f&&Ie({strategy:"referenceHidden",...E})]}),[W,H]=hn(L),z=B(y);at(()=>{j&&z?.()},[j,z]);const Y=F.arrow?.x,$=F.arrow?.y,q=0!==F.arrow?.centerOffset,[V,Q]=l.useState();return at(()=>{x&&Q(window.getComputedStyle(x).zIndex)},[x]),(0,g.jsx)("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:j?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:(0,g.jsx)(nn,{scope:n,placedSide:W,onArrowChange:S,arrowX:Y,arrowY:$,shouldHideArrow:q,children:(0,g.jsx)(U.div,{"data-side":W,"data-align":H,...b,ref:_,style:{...b.style,animation:j?void 0:"none"}})})})});on.displayName=en;var sn="PopperArrow",an={top:"bottom",right:"left",bottom:"top",left:"right"},ln=l.forwardRef(function(t,e){const{__scopePopper:n,...i}=t,r=rn(sn,n),o=an[r.placedSide];return(0,g.jsx)("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:(0,g.jsx)(qe,{...i,ref:e,style:{...i.style,display:"block"}})})});function cn(t){return null!==t}ln.displayName=sn;var un=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:i,middlewareData:r}=e,o=0!==r.arrow?.centerOffset,s=o?0:t.arrowWidth,a=o?0:t.arrowHeight,[l,c]=hn(n),u={start:"0%",center:"50%",end:"100%"}[c],h=(r.arrow?.x??0)+s/2,d=(r.arrow?.y??0)+a/2;let f="",p="";return"bottom"===l?(f=o?u:`${h}px`,p=-a+"px"):"top"===l?(f=o?u:`${h}px`,p=`${i.floating.height+a}px`):"right"===l?(f=-a+"px",p=o?u:`${d}px`):"left"===l&&(f=`${i.floating.width+a}px`,p=o?u:`${d}px`),{data:{x:f,y:p}}}});function hn(t){const[e,n="center"]=t.split("-");return[e,n]}var dn=Ze,fn=tn,pn=on,gn=ln,mn=l.forwardRef((t,e)=>{const{container:n,...i}=t,[r,o]=l.useState(!1);at(()=>o(!0),[]);const s=n||r&&globalThis?.document?.body;return s?I.createPortal((0,g.jsx)(U.div,{...i,ref:e}),s):null});mn.displayName="Portal";var yn=t=>{const{present:e,children:n}=t,i=function(t){const[e,n]=l.useState(),i=l.useRef(null),r=l.useRef(t),o=l.useRef("none"),s=t?"mounted":"unmounted",[a,c]=function(t,e){return l.useReducer((t,n)=>e[t][n]??t,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const t=bn(i.current);o.current="mounted"===a?t:"none"},[a]),at(()=>{const e=i.current,n=r.current;if(n!==t){const i=o.current,s=bn(e);c(t?"MOUNT":"none"===s||"none"===e?.display?"UNMOUNT":n&&i!==s?"ANIMATION_OUT":"UNMOUNT"),r.current=t}},[t,c]),at(()=>{if(e){let t;const n=e.ownerDocument.defaultView??window,s=o=>{const s=bn(i.current).includes(CSS.escape(o.animationName));if(o.target===e&&s&&(c("ANIMATION_END"),!r.current)){const i=e.style.animationFillMode;e.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===e.style.animationFillMode&&(e.style.animationFillMode=i)})}},a=t=>{t.target===e&&(o.current=bn(i.current))};return e.addEventListener("animationstart",a),e.addEventListener("animationcancel",s),e.addEventListener("animationend",s),()=>{n.clearTimeout(t),e.removeEventListener("animationstart",a),e.removeEventListener("animationcancel",s),e.removeEventListener("animationend",s)}}c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:l.useCallback(t=>{i.current=t?getComputedStyle(t):null,n(t)},[])}}(e),r="function"==typeof n?n({present:i.isPresent}):l.Children.only(n),o=p(i.ref,function(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}(r));return"function"==typeof n||i.isPresent?l.cloneElement(r,{ref:o}):null};function bn(t){return t?.animationName||"none"}yn.displayName="Presence";var vn=c[" useInsertionEffect ".trim().toString()]||at;function xn({prop:t,defaultProp:e,onChange:n=()=>{},caller:i}){const[r,o,s]=function({defaultProp:t,onChange:e}){const[n,i]=l.useState(t),r=l.useRef(n),o=l.useRef(e);return vn(()=>{o.current=e},[e]),l.useEffect(()=>{r.current!==n&&(o.current?.(n),r.current=n)},[n,r]),[n,i,o]}({defaultProp:e,onChange:n}),a=void 0!==t,c=a?t:r;{const e=l.useRef(void 0!==t);l.useEffect(()=>{const t=e.current;if(t!==a){const e=t?"controlled":"uncontrolled",n=a?"controlled":"uncontrolled";console.warn(`${i} is changing from ${e} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}e.current=a},[a,i])}const u=l.useCallback(e=>{if(a){const n=function(t){return"function"==typeof t}(e)?e(t):e;n!==t&&s.current?.(n)}else o(e)},[a,t,o,s]);return[c,u]}Symbol("RADIX:SYNC_STATE");var wn=new WeakMap,Mn=new WeakMap,Sn={},kn=0,Cn=function(t){return t&&(t.host||Cn(t.parentNode))},Dn=function(t,e,n){void 0===n&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=e||function(t){return"undefined"==typeof document?null:(Array.isArray(t)?t[0]:t).ownerDocument.body}(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),function(t,e,n,i){var r=function(t,e){return e.map(function(e){if(t.contains(e))return e;var n=Cn(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(t){return Boolean(t)})}(e,Array.isArray(t)?t:[t]);Sn[n]||(Sn[n]=new WeakMap);var o=Sn[n],s=[],a=new Set,l=new Set(r),c=function(t){t&&!a.has(t)&&(a.add(t),c(t.parentNode))};r.forEach(c);var u=function(t){t&&!l.has(t)&&Array.prototype.forEach.call(t.children,function(t){if(a.has(t))u(t);else try{var e=t.getAttribute(i),r=null!==e&&"false"!==e,l=(wn.get(t)||0)+1,c=(o.get(t)||0)+1;wn.set(t,l),o.set(t,c),s.push(t),1===l&&r&&Mn.set(t,!0),1===c&&t.setAttribute(n,"true"),r||t.setAttribute(i,"true")}catch(e){console.error("aria-hidden: cannot operate on ",t,e)}})};return u(e),a.clear(),kn++,function(){s.forEach(function(t){var e=wn.get(t)-1,r=o.get(t)-1;wn.set(t,e),o.set(t,r),e||(Mn.has(t)||t.removeAttribute(i),Mn.delete(t)),r||t.removeAttribute(n)}),--kn||(wn=new WeakMap,wn=new WeakMap,Mn=new WeakMap,Sn={})}}(i,r,n,"aria-hidden")):function(){return null}},On=function(){return On=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},On.apply(this,arguments)};function Rn(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var Pn="right-scroll-bar-position",Tn="width-before-scroll-bar";function En(t,e){return"function"==typeof t?t(e):t&&(t.current=e),t}var An="undefined"!=typeof window?l.useLayoutEffect:l.useEffect,Nn=new WeakMap;function In(t){return t}var Ln=function(t){void 0===t&&(t={});var e=function(t,e){void 0===e&&(e=In);var n=[],i=!1;return{read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(t){var r=e(t,i);return n.push(r),function(){n=n.filter(function(t){return t!==r})}},assignSyncMedium:function(t){for(i=!0;n.length;){var e=n;n=[],e.forEach(t)}n={push:function(e){return t(e)},filter:function(){return n}}},assignMedium:function(t){i=!0;var e=[];if(n.length){var r=n;n=[],r.forEach(t),e=n}var o=function(){var n=e;e=[],n.forEach(t)},s=function(){return Promise.resolve().then(o)};s(),n={push:function(t){e.push(t),s()},filter:function(t){return e=e.filter(t),n}}}}}(null);return e.options=On({async:!0,ssr:!1},t),e}(),jn=function(){},Fn=l.forwardRef(function(t,e){var n,i,r,o=l.useRef(null),s=l.useState({onScrollCapture:jn,onWheelCapture:jn,onTouchMoveCapture:jn}),a=s[0],c=s[1],u=t.forwardProps,h=t.children,d=t.className,f=t.removeScrollBar,p=t.enabled,g=t.shards,m=t.sideCar,y=t.noRelative,b=t.noIsolation,v=t.inert,x=t.allowPinchZoom,w=t.as,_=void 0===w?"div":w,M=t.gapMode,S=Rn(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=m,C=(n=[o,e],r=function(t,e){var n=(0,l.useState)(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(t){var e=n.value;e!==t&&(n.value=t,n.callback(t,e))}}}})[0];return n.callback=e,n.facade}(i||null,function(t){return n.forEach(function(e){return En(e,t)})}),An(function(){var t=Nn.get(r);if(t){var e=new Set(t),i=new Set(n),o=r.current;e.forEach(function(t){i.has(t)||En(t,null)}),i.forEach(function(t){e.has(t)||En(t,o)})}Nn.set(r,n)},[n]),r),D=On(On({},S),a);return l.createElement(l.Fragment,null,p&&l.createElement(k,{sideCar:Ln,removeScrollBar:f,shards:g,noRelative:y,noIsolation:b,inert:v,setCallbacks:c,allowPinchZoom:!!x,lockRef:o,gapMode:M}),u?l.cloneElement(l.Children.only(h),On(On({},D),{ref:C})):l.createElement(_,On({},D,{className:d,ref:C}),h))});Fn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Fn.classNames={fullWidth:Tn,zeroRight:Pn};var Wn=function(t){var e=t.sideCar,n=Rn(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return l.createElement(i,On({},n))};Wn.isSideCarExport=!0;var Un=function(){var t=0,e=null;return{add:function(n){var i,o;0==t&&(e=function(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=r.nc;return e&&t.setAttribute("nonce",e),t}())&&(o=n,(i=e).styleSheet?i.styleSheet.cssText=o:i.appendChild(document.createTextNode(o)),function(t){(document.head||document.getElementsByTagName("head")[0]).appendChild(t)}(e)),t++},remove:function(){! --t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Bn=function(){var t,e=(t=Un(),function(e,n){l.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])});return function(t){var n=t.styles,i=t.dynamic;return e(n,i),null}},Hn={left:0,top:0,right:0,gap:0},zn=function(t){return parseInt(t||"",10)||0},Yn=Bn(),$n="data-scroll-locked",qn=function(t,e,n,i){var r=t.left,o=t.top,s=t.right,a=t.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(i,";\n padding-right: ").concat(a,"px ").concat(i,";\n }\n body[").concat($n,"] {\n overflow: hidden ").concat(i,";\n overscroll-behavior: contain;\n ").concat([e&&"position: relative ".concat(i,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(i,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(i,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Pn," {\n right: ").concat(a,"px ").concat(i,";\n }\n \n .").concat(Tn," {\n margin-right: ").concat(a,"px ").concat(i,";\n }\n \n .").concat(Pn," .").concat(Pn," {\n right: 0 ").concat(i,";\n }\n \n .").concat(Tn," .").concat(Tn," {\n margin-right: 0 ").concat(i,";\n }\n \n body[").concat($n,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},Vn=function(){var t=parseInt(document.body.getAttribute($n)||"0",10);return isFinite(t)?t:0},Qn=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,r=void 0===i?"margin":i;l.useEffect(function(){return document.body.setAttribute($n,(Vn()+1).toString()),function(){var t=Vn()-1;t<=0?document.body.removeAttribute($n):document.body.setAttribute($n,t.toString())}},[]);var o=l.useMemo(function(){return function(t){if(void 0===t&&(t="margin"),"undefined"==typeof window)return Hn;var e=function(t){var e=window.getComputedStyle(document.body),n=e["padding"===t?"paddingLeft":"marginLeft"],i=e["padding"===t?"paddingTop":"marginTop"],r=e["padding"===t?"paddingRight":"marginRight"];return[zn(n),zn(i),zn(r)]}(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}}(r)},[r]);return l.createElement(Yn,{styles:qn(o,!e,r,n?"":"!important")})},Kn=!1;if("undefined"!=typeof window)try{var Xn=Object.defineProperty({},"passive",{get:function(){return Kn=!0,!0}});window.addEventListener("test",Xn,Xn),window.removeEventListener("test",Xn,Xn)}catch(t){Kn=!1}var Gn=!!Kn&&{passive:!1},Zn=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return"hidden"!==n[e]&&!(n.overflowY===n.overflowX&&!function(t){return"TEXTAREA"===t.tagName}(t)&&"visible"===n[e])},Jn=function(t,e){var n=e.ownerDocument,i=e;do{if("undefined"!=typeof ShadowRoot&&i instanceof ShadowRoot&&(i=i.host),ti(t,i)){var r=ei(t,i);if(r[1]>r[2])return!0}i=i.parentNode}while(i&&i!==n.body);return!1},ti=function(t,e){return"v"===t?function(t){return Zn(t,"overflowY")}(e):function(t){return Zn(t,"overflowX")}(e)},ei=function(t,e){return"v"===t?[(n=e).scrollTop,n.scrollHeight,n.clientHeight]:function(t){return[t.scrollLeft,t.scrollWidth,t.clientWidth]}(e);var n},ni=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},ii=function(t){return[t.deltaX,t.deltaY]},ri=function(t){return t&&"current"in t?t.current:t},oi=function(t){return"\n .block-interactivity-".concat(t," {pointer-events: none;}\n .allow-interactivity-").concat(t," {pointer-events: all;}\n")},si=0,ai=[];function li(t){for(var e=null;null!==t;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const ci=(ui=function(t){var e=l.useRef([]),n=l.useRef([0,0]),i=l.useRef(),r=l.useState(si++)[0],o=l.useState(Bn)[0],s=l.useRef(t);l.useEffect(function(){s.current=t},[t]),l.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var e=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}([t.lockRef.current],(t.shards||[]).map(ri),!0).filter(Boolean);return e.forEach(function(t){return t.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),e.forEach(function(t){return t.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var a=l.useCallback(function(t,e){if("touches"in t&&2===t.touches.length||"wheel"===t.type&&t.ctrlKey)return!s.current.allowPinchZoom;var r,o=ni(t),a=n.current,l="deltaX"in t?t.deltaX:a[0]-o[0],c="deltaY"in t?t.deltaY:a[1]-o[1],u=t.target,h=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in t&&"h"===h&&"range"===u.type)return!1;var d=window.getSelection(),f=d&&d.anchorNode;if(f&&(f===u||f.contains(u)))return!1;var p=Jn(h,u);if(!p)return!0;if(p?r=h:(r="v"===h?"h":"v",p=Jn(h,u)),!p)return!1;if(!i.current&&"changedTouches"in t&&(l||c)&&(i.current=r),!r)return!0;var g=i.current||r;return function(t,e,n,i){var r=function(t,e){return"h"===t&&"rtl"===e?-1:1}(t,window.getComputedStyle(e).direction),o=r*i,s=n.target,a=e.contains(s),l=!1,c=o>0,u=0,h=0;do{if(!s)break;var d=ei(t,s),f=d[0],p=d[1]-d[2]-r*f;(f||p)&&ti(t,s)&&(u+=p,h+=f);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!a&&s!==document.body||a&&(e.contains(s)||e===s));return(c&&(Math.abs(u)<1||!1)||!c&&(Math.abs(h)<1||!1))&&(l=!0),l}(g,e,t,"h"===g?l:c)},[]),c=l.useCallback(function(t){var n=t;if(ai.length&&ai[ai.length-1]===o){var i="deltaY"in n?ii(n):ni(n),r=e.current.filter(function(t){return t.name===n.type&&(t.target===n.target||n.target===t.shadowParent)&&(e=t.delta,r=i,e[0]===r[0]&&e[1]===r[1]);var e,r})[0];if(r&&r.should)n.cancelable&&n.preventDefault();else if(!r){var l=(s.current.shards||[]).map(ri).filter(Boolean).filter(function(t){return t.contains(n.target)});(l.length>0?a(n,l[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=l.useCallback(function(t,n,i,r){var o={name:t,delta:n,target:i,should:r,shadowParent:li(i)};e.current.push(o),setTimeout(function(){e.current=e.current.filter(function(t){return t!==o})},1)},[]),h=l.useCallback(function(t){n.current=ni(t),i.current=void 0},[]),d=l.useCallback(function(e){u(e.type,ii(e),e.target,a(e,t.lockRef.current))},[]),f=l.useCallback(function(e){u(e.type,ni(e),e.target,a(e,t.lockRef.current))},[]);l.useEffect(function(){return ai.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Gn),document.addEventListener("touchmove",c,Gn),document.addEventListener("touchstart",h,Gn),function(){ai=ai.filter(function(t){return t!==o}),document.removeEventListener("wheel",c,Gn),document.removeEventListener("touchmove",c,Gn),document.removeEventListener("touchstart",h,Gn)}},[]);var p=t.removeScrollBar,g=t.inert;return l.createElement(l.Fragment,null,g?l.createElement(o,{styles:oi(r)}):null,p?l.createElement(Qn,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},Ln.useMedium(ui),Wn);var ui,hi=l.forwardRef(function(t,e){return l.createElement(Fn,On({},t,{ref:e,sideCar:ci}))});hi.classNames=Fn.classNames;const di=hi;var fi="Popover",[pi,gi]=A(fi,[Ke]),mi=Ke(),[yi,bi]=pi(fi),vi=t=>{const{__scopePopover:e,children:n,open:i,defaultOpen:r,onOpenChange:o,modal:s=!1}=t,a=mi(e),c=l.useRef(null),[u,h]=l.useState(!1),[d,f]=xn({prop:i,defaultProp:r??!1,onChange:o,caller:fi});return(0,g.jsx)(dn,{...a,children:(0,g.jsx)(yi,{scope:e,contentId:ut(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(t=>!t),[f]),hasCustomAnchor:u,onCustomAnchorAdd:l.useCallback(()=>h(!0),[]),onCustomAnchorRemove:l.useCallback(()=>h(!1),[]),modal:s,children:n})})};vi.displayName=fi;var xi="PopoverAnchor";l.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,r=bi(xi,n),o=mi(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=r;return l.useEffect(()=>(s(),()=>a()),[s,a]),(0,g.jsx)(fn,{...o,...i,ref:e})}).displayName=xi;var wi="PopoverTrigger",_i=l.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,r=bi(wi,n),o=mi(n),s=p(e,r.triggerRef),a=(0,g.jsx)(U.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Ni(r.open),...i,ref:s,onClick:E(t.onClick,r.onOpenToggle)});return r.hasCustomAnchor?a:(0,g.jsx)(fn,{asChild:!0,...o,children:a})});_i.displayName=wi;var Mi="PopoverPortal",[Si,ki]=pi(Mi,{forceMount:void 0}),Ci=t=>{const{__scopePopover:e,forceMount:n,children:i,container:r}=t,o=bi(Mi,e);return(0,g.jsx)(Si,{scope:e,forceMount:n,children:(0,g.jsx)(yn,{present:n||o.open,children:(0,g.jsx)(mn,{asChild:!0,container:r,children:i})})})};Ci.displayName=Mi;var Di="PopoverContent",Oi=l.forwardRef((t,e)=>{const n=ki(Di,t.__scopePopover),{forceMount:i=n.forceMount,...r}=t,o=bi(Di,t.__scopePopover);return(0,g.jsx)(yn,{present:i||o.open,children:o.modal?(0,g.jsx)(Pi,{...r,ref:e}):(0,g.jsx)(Ti,{...r,ref:e})})});Oi.displayName=Di;var Ri=L("PopoverContent.RemoveScroll"),Pi=l.forwardRef((t,e)=>{const n=bi(Di,t.__scopePopover),i=l.useRef(null),r=p(e,i),o=l.useRef(!1);return l.useEffect(()=>{const t=i.current;if(t)return Dn(t)},[]),(0,g.jsx)(di,{as:Ri,allowPinchZoom:!0,children:(0,g.jsx)(Ei,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(t.onCloseAutoFocus,t=>{t.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:E(t.onPointerDownOutside,t=>{const e=t.detail.originalEvent,n=0===e.button&&!0===e.ctrlKey,i=2===e.button||n;o.current=i},{checkForDefaultPrevented:!1}),onFocusOutside:E(t.onFocusOutside,t=>t.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ti=l.forwardRef((t,e)=>{const n=bi(Di,t.__scopePopover),i=l.useRef(!1),r=l.useRef(!1);return(0,g.jsx)(Ei,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(i.current||n.triggerRef.current?.focus(),e.preventDefault()),i.current=!1,r.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(i.current=!0,"pointerdown"===e.detail.originalEvent.type&&(r.current=!0));const o=e.target,s=n.triggerRef.current?.contains(o);s&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&r.current&&e.preventDefault()}})}),Ei=l.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:r,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...h}=t,d=bi(Di,n),f=mi(n);return K(),(0,g.jsx)(tt,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:r,onUnmountAutoFocus:o,children:(0,g.jsx)($,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>d.onOpenChange(!1),children:(0,g.jsx)(pn,{"data-state":Ni(d.open),role:"dialog",id:d.contentId,...f,...h,ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ai="PopoverClose";function Ni(t){return t?"open":"closed"}l.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,r=bi(Ai,n);return(0,g.jsx)(U.button,{type:"button",...i,ref:e,onClick:E(t.onClick,()=>r.onOpenChange(!1))})}).displayName=Ai,l.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,r=mi(n);return(0,g.jsx)(gn,{...r,...i,ref:e})}).displayName="PopoverArrow";var Ii,Li,ji,Fi,Wi=vi,Ui=_i,Bi=Ci,Hi=Oi;function zi({...t}){return(0,g.jsx)(Wi,{"data-slot":"popover",...t})}function Yi({className:t,...e}){return(0,g.jsx)(Ui,{"data-slot":"popover-trigger",className:O("UR-UI-Popover-Trigger",t),...e})}function $i({className:t,align:e="center",sideOffset:n=4,...i}){return(0,g.jsx)(Bi,{children:(0,g.jsx)(Hi,{"data-slot":"popover-content",align:e,sideOffset:n,className:O("UR-UI-Popover",t),...i})})}function qi(){const t={};for(const e in Ii)t[Ii[e]]=`rdp-${Ii[e]}`;for(const e in Li)t[Li[e]]=`rdp-${Li[e]}`;for(const e in ji)t[ji[e]]=`rdp-${ji[e]}`;for(const e in Fi)t[Fi[e]]=`rdp-${Fi[e]}`;return t}!function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"}(Ii||(Ii={})),function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"}(Li||(Li={})),function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"}(ji||(ji={})),function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"}(Fi||(Fi={}));const Vi={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Qi(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Ki={date:Qi({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Qi({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Qi({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Xi={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Gi(t){return(e,n)=>{let i;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,r=n?.width?String(n.width):e;i=t.formattingValues[r]||t.formattingValues[e]}else{const e=t.defaultWidth,r=n?.width?String(n.width):t.defaultWidth;i=t.values[r]||t.values[e]}return i[t.argumentCallback?t.argumentCallback(e):e]}}const Zi={ordinalNumber:(t,e)=>{const n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Gi({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Gi({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:Gi({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Gi({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Gi({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function Ji(t){return(e,n={})=>{const i=n.width,r=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;const s=o[0],a=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}(a,t=>t.test(s)):function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}(a,t=>t.test(s));let c;return c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:e.slice(s.length)}}}const tr={ordinalNumber:(er={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(er.matchPattern);if(!n)return null;const i=n[0],r=t.match(er.parsePattern);if(!r)return null;let o=er.valueCallback?er.valueCallback(r[0]):r[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(i.length)}}),era:Ji({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Ji({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ji({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Ji({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Ji({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var er;const nr={code:"en-US",formatDistance:(t,e,n)=>{let i;const r=Vi[t];return i="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:Ki,formatRelative:(t,e,n,i)=>Xi[t],localize:Zi,match:tr,options:{weekStartsOn:0,firstWeekContainsDate:1}};let ir={};function rr(){return ir}Math.pow(10,8);const or=6048e5,sr=Symbol.for("constructDateFrom");function ar(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&sr in t?t[sr](e):t instanceof Date?new t.constructor(e):new Date(e)}function lr(t,e){return ar(e||t,t)}function cr(t){const e=lr(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function ur(t,...e){const n=ar.bind(null,t||e.find(t=>"object"==typeof t));return e.map(n)}function hr(t,e){const n=lr(t,e?.in);return n.setHours(0,0,0,0),n}function dr(t,e,n){const[i,r]=ur(n?.in,t,e),o=hr(i),s=hr(r),a=+o-cr(o),l=+s-cr(s);return Math.round((a-l)/864e5)}function fr(t,e){const n=lr(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function pr(t,e){const n=rr(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=lr(t,e?.in),o=r.getDay(),s=(o<i?7:0)+o-i;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function gr(t,e){return pr(t,{...e,weekStartsOn:1})}function mr(t,e){const n=lr(t,e?.in),i=n.getFullYear(),r=ar(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const o=gr(r),s=ar(n,0);s.setFullYear(i,0,4),s.setHours(0,0,0,0);const a=gr(s);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function yr(t,e){const n=lr(t,e?.in),i=+gr(n)-+function(t,e){const n=mr(t,e),i=ar(e?.in||t,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),gr(i)}(n);return Math.round(i/or)+1}function br(t,e){const n=lr(t,e?.in),i=n.getFullYear(),r=rr(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=ar(e?.in||t,0);s.setFullYear(i+1,0,o),s.setHours(0,0,0,0);const a=pr(s,e),l=ar(e?.in||t,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=pr(l,e);return+n>=+a?i+1:+n>=+c?i:i-1}function vr(t,e){const n=lr(t,e?.in),i=+pr(n,e)-+function(t,e){const n=rr(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=br(t,e),o=ar(e?.in||t,0);return o.setFullYear(r,0,i),o.setHours(0,0,0,0),pr(o,e)}(n,e);return Math.round(i/or)+1}function xr(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const wr={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return xr("yy"===e?i%100:i,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):xr(n+1,2)},d:(t,e)=>xr(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>xr(t.getHours()%12||12,e.length),H:(t,e)=>xr(t.getHours(),e.length),m:(t,e)=>xr(t.getMinutes(),e.length),s:(t,e)=>xr(t.getSeconds(),e.length),S(t,e){const n=e.length,i=t.getMilliseconds();return xr(Math.trunc(i*Math.pow(10,n-3)),e.length)}},_r={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),i=e>0?e:1-e;return n.ordinalNumber(i,{unit:"year"})}return wr.y(t,e)},Y:function(t,e,n,i){const r=br(t,i),o=r>0?r:1-r;return"YY"===e?xr(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):xr(o,e.length)},R:function(t,e){return xr(mr(t),e.length)},u:function(t,e){return xr(t.getFullYear(),e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return xr(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return xr(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return wr.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return xr(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){const r=vr(t,i);return"wo"===e?n.ordinalNumber(r,{unit:"week"}):xr(r,e.length)},I:function(t,e,n){const i=yr(t);return"Io"===e?n.ordinalNumber(i,{unit:"week"}):xr(i,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):wr.d(t,e)},D:function(t,e,n){const i=function(t,e){const n=lr(t,e?.in);return dr(n,fr(n))+1}(t);return"Do"===e?n.ordinalNumber(i,{unit:"dayOfYear"}):xr(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){const r=t.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return xr(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){const r=t.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return xr(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const i=t.getDay(),r=0===i?7:i;switch(e){case"i":return String(r);case"ii":return xr(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const i=t.getHours();let r;switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const i=t.getHours();let r;switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return wr.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):wr.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return"Ko"===e?n.ordinalNumber(i,{unit:"hour"}):xr(i,e.length)},k:function(t,e,n){let i=t.getHours();return 0===i&&(i=24),"ko"===e?n.ordinalNumber(i,{unit:"hour"}):xr(i,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):wr.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):wr.s(t,e)},S:function(t,e){return wr.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return Sr(i);case"XXXX":case"XX":return kr(i);default:return kr(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return Sr(i);case"xxxx":case"xx":return kr(i);default:return kr(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Mr(i,":");default:return"GMT"+kr(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Mr(i,":");default:return"GMT"+kr(i,":")}},t:function(t,e,n){return xr(Math.trunc(+t/1e3),e.length)},T:function(t,e,n){return xr(+t,e.length)}};function Mr(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),r=Math.trunc(i/60),o=i%60;return 0===o?n+String(r):n+String(r)+e+xr(o,2)}function Sr(t,e){return t%60==0?(t>0?"-":"+")+xr(Math.abs(t)/60,2):kr(t,e)}function kr(t,e=""){const n=t>0?"-":"+",i=Math.abs(t);return n+xr(Math.trunc(i/60),2)+e+xr(i%60,2)}const Cr=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Dr=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Or={p:Dr,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Cr(t,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"})}return o.replace("{{date}}",Cr(i,e)).replace("{{time}}",Dr(r,e))}},Rr=/^D+$/,Pr=/^Y+$/,Tr=["D","DD","YY","YYYY"];function Er(t){return t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}const Ar=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Nr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ir=/^'([^]*?)'?$/,Lr=/''/g,jr=/[a-zA-Z]/;function Fr(t,e,n){const i=rr(),r=n?.locale??i.locale??nr,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=lr(t,n?.in);if(!function(t){return!(!Er(t)&&"number"!=typeof t||isNaN(+lr(t)))}(a))throw new RangeError("Invalid time value");let l=e.match(Nr).map(t=>{const e=t[0];return"p"===e||"P"===e?(0,Or[e])(t,r.formatLong):t}).join("").match(Ar).map(t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:Wr(t)};if(_r[e])return{isToken:!0,value:t};if(e.match(jr))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}});r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:r};return l.map(i=>{if(!i.isToken)return i.value;const o=i.value;return(!n?.useAdditionalWeekYearTokens&&function(t){return Pr.test(t)}(o)||!n?.useAdditionalDayOfYearTokens&&function(t){return Rr.test(t)}(o))&&function(t,e,n){const i=function(t,e,n){const i="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,n);if(console.warn(i),Tr.includes(t))throw new RangeError(i)}(o,e,String(t)),(0,_r[o[0]])(a,o,r.localize,c)}).join("")}function Wr(t){const e=t.match(Ir);return e?e[1].replace(Lr,"'"):t}const Ur={...nr,labels:{labelDayButton:(t,e,n,i)=>{let r;r=i&&"function"==typeof i.format?i.format.bind(i):(t,e)=>Fr(t,e,{locale:nr,...n});let o=r(t,"PPPP");return e.today&&(o=`Today, ${o}`),e.selected&&(o=`${o}, selected`),o},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:t=>`Week ${t}`,labelYearDropdown:"Choose the Year",labelGrid:(t,e,n)=>{let i;return i=n&&"function"==typeof n.format?n.format.bind(n):(t,n)=>Fr(t,n,{locale:nr,...e}),i(t,"LLLL yyyy")},labelGridcell:(t,e,n,i)=>{let r;r=i&&"function"==typeof i.format?i.format.bind(i):(t,e)=>Fr(t,e,{locale:nr,...n});let o=r(t,"PPPP");return e?.today&&(o=`Today, ${o}`),o},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(t,e,n)=>{let i;return i=n&&"function"==typeof n.format?n.format.bind(n):(t,n)=>Fr(t,n,{locale:nr,...e}),i(t,"cccc")}}};Symbol.for("constructDateFrom");const Br={},Hr={};function zr(t,e){try{const n=(Br[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return n in Hr?Hr[n]:$r(n,n.split(":"))}catch{if(t in Hr)return Hr[t];const e=t?.match(Yr);return e?$r(t,e.slice(1)):NaN}}const Yr=/([+-]\d\d):?(\d\d)?/;function $r(t,e){const n=+(e[0]||0),i=+(e[1]||0),r=+(e[2]||0)/60;return Hr[t]=60*n+i>0?60*n+i+r:60*n-i-r}class qr extends Date{constructor(...t){super(),t.length>1&&"string"==typeof t[t.length-1]&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(zr(this.timeZone,this))?this.setTime(NaN):t.length?"number"==typeof t[0]&&(1===t.length||2===t.length&&"number"!=typeof t[1])?this.setTime(t[0]):"string"==typeof t[0]?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Kr(this),Qr(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new qr(...e,t):new qr(Date.now(),t)}withTimeZone(t){return new qr(+this,t)}getTimezoneOffset(){const t=-zr(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Qr(this),+this}[Symbol.for("constructDateFrom")](t){return new qr(+new Date(t),this.timeZone)}}const Vr=/^(get|set)(?!UTC)/;function Qr(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(60*-zr(t.timeZone,t)))}function Kr(t){const e=zr(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),i=new Date(+t);i.setUTCHours(i.getUTCHours()-1);const r=-new Date(+t).getTimezoneOffset(),o=r- -new Date(+i).getTimezoneOffset(),s=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();o&&s&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+o);const a=r-n;a&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+a);const l=new Date(+t);l.setUTCSeconds(0);const c=r>0?l.getSeconds():(l.getSeconds()-60)%60,u=Math.round(-60*zr(t.timeZone,t))%60;(u||c)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+u+c));const h=zr(t.timeZone,t),d=h>0?Math.floor(h):Math.ceil(h),f=-new Date(+t).getTimezoneOffset()-d-a;if(d!==n&&f){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+f);const e=zr(t.timeZone,t),n=d-(e>0?Math.floor(e):Math.ceil(e));n&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+n))}}Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!Vr.test(t))return;const e=t.replace(Vr,"$1UTC");qr.prototype[e]&&(t.startsWith("get")?qr.prototype[t]=function(){return this.internal[e]()}:(qr.prototype[t]=function(){var t;return Date.prototype[e].apply(this.internal,arguments),t=this,Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),Kr(t),+this},qr.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Qr(this),+this}))});class Xr extends qr{static tz(t,...e){return e.length?new Xr(...e,t):new Xr(Date.now(),t)}toISOString(){const[t,e,n]=this.tzComponents(),i=`${t}${e}:${n}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,n,i]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${n} ${e} ${i}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,n,i]=this.tzComponents();return`${t} GMT${e}${n}${i} (${function(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:e?.timeZone||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:e?.timeZone||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:e?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset();return[t>0?"-":"+",String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),String(Math.abs(t)%60).padStart(2,"0")]}withTimeZone(t){return new Xr(+this,t)}[Symbol.for("constructDateFrom")](t){return new Xr(+new Date(t),this.timeZone)}}function Gr(t,e,n){const i=lr(t,n?.in);return isNaN(e)?ar(n?.in||t,NaN):e?(i.setDate(i.getDate()+e),i):i}function Zr(t,e,n){const i=lr(t,n?.in);if(isNaN(e))return ar(n?.in||t,NaN);if(!e)return i;const r=i.getDate(),o=ar(n?.in||t,i.getTime());return o.setMonth(i.getMonth()+e+1,0),r>=o.getDate()?o:(i.setFullYear(o.getFullYear(),o.getMonth(),r),i)}function Jr(t,e,n){const[i,r]=ur(n?.in,t,e);return 12*(i.getFullYear()-r.getFullYear())+(i.getMonth()-r.getMonth())}function to(t,e){const[n,i]=ur(t,e.start,e.end);return{start:n,end:i}}function eo(t,e){const n=rr(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=lr(t,e?.in),o=r.getDay(),s=6+(o<i?-7:0)-(o-i);return r.setDate(r.getDate()+s),r.setHours(23,59,59,999),r}function no(t,e,n){const i=lr(t,n?.in),r=i.getFullYear(),o=i.getDate(),s=ar(n?.in||t,0);s.setFullYear(r,e,15),s.setHours(0,0,0,0);const a=function(t,e){const n=lr(t,e?.in),i=n.getFullYear(),r=n.getMonth(),o=ar(n,0);return o.setFullYear(i,r+1,0),o.setHours(0,0,0,0),o.getDate()}(s);return i.setMonth(e,Math.min(o,a)),i}function io(t,e){const n=e.startOfMonth(t),i=n.getDay();return 1===i?n:0===i?e.addDays(n,-6):e.addDays(n,-1*(i-1))}class ro{constructor(t,e){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Xr.tz(this.options.timeZone):new this.Date,this.newDate=(t,e,n)=>this.overrides?.newDate?this.overrides.newDate(t,e,n):this.options.timeZone?new Xr(t,e,n,this.options.timeZone):new Date(t,e,n),this.addDays=(t,e)=>this.overrides?.addDays?this.overrides.addDays(t,e):Gr(t,e),this.addMonths=(t,e)=>this.overrides?.addMonths?this.overrides.addMonths(t,e):Zr(t,e),this.addWeeks=(t,e)=>this.overrides?.addWeeks?this.overrides.addWeeks(t,e):function(t,e,n){return Gr(t,7*e,n)}(t,e),this.addYears=(t,e)=>this.overrides?.addYears?this.overrides.addYears(t,e):function(t,e,n){return Zr(t,12*e,n)}(t,e),this.differenceInCalendarDays=(t,e)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(t,e):dr(t,e),this.differenceInCalendarMonths=(t,e)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(t,e):Jr(t,e),this.eachMonthOfInterval=t=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(t):function(t,e){const{start:n,end:i}=to(e?.in,t);let r=+n>+i;const o=r?+n:+i,s=r?i:n;s.setHours(0,0,0,0),s.setDate(1);let a=e?.step??1;if(!a)return[];a<0&&(a=-a,r=!r);const l=[];for(;+s<=o;)l.push(ar(n,s)),s.setMonth(s.getMonth()+a);return r?l.reverse():l}(t),this.eachYearOfInterval=t=>{const e=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(t):function(t,e){const{start:n,end:i}=to(e?.in,t);let r=+n>+i;const o=r?+n:+i,s=r?i:n;s.setHours(0,0,0,0),s.setMonth(0,1);let a=e?.step??1;if(!a)return[];a<0&&(a=-a,r=!r);const l=[];for(;+s<=o;)l.push(ar(n,s)),s.setFullYear(s.getFullYear()+a);return r?l.reverse():l}(t),n=new Set(e.map(t=>this.getYear(t)));if(n.size===e.length)return e;const i=[];return n.forEach(t=>{i.push(new Date(t,0,1))}),i},this.endOfBroadcastWeek=t=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(t):function(t,e){const n=io(t,e),i=function(t,e){const n=e.startOfMonth(t),i=n.getDay()>0?n.getDay():7,r=e.addDays(t,1-i),o=e.addDays(r,34);return e.getMonth(t)===e.getMonth(o)?5:4}(t,e);return e.addDays(n,7*i-1)}(t,this),this.endOfISOWeek=t=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(t):function(t,e){return eo(t,{...e,weekStartsOn:1})}(t),this.endOfMonth=t=>this.overrides?.endOfMonth?this.overrides.endOfMonth(t):function(t,e){const n=lr(t,e?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}(t),this.endOfWeek=(t,e)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(t,e):eo(t,this.options),this.endOfYear=t=>this.overrides?.endOfYear?this.overrides.endOfYear(t):function(t,e){const n=lr(t,e?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}(t),this.format=(t,e,n)=>{const i=this.overrides?.format?this.overrides.format(t,e,this.options):Fr(t,e,this.options);return this.options.numerals&&"latn"!==this.options.numerals?this.replaceDigits(i):i},this.getISOWeek=t=>this.overrides?.getISOWeek?this.overrides.getISOWeek(t):yr(t),this.getMonth=(t,e)=>this.overrides?.getMonth?this.overrides.getMonth(t,this.options):function(t,e){return lr(t,e?.in).getMonth()}(t,this.options),this.getYear=(t,e)=>this.overrides?.getYear?this.overrides.getYear(t,this.options):function(t,e){return lr(t,e?.in).getFullYear()}(t,this.options),this.getWeek=(t,e)=>this.overrides?.getWeek?this.overrides.getWeek(t,this.options):vr(t,this.options),this.isAfter=(t,e)=>this.overrides?.isAfter?this.overrides.isAfter(t,e):function(t,e){return+lr(t)>+lr(e)}(t,e),this.isBefore=(t,e)=>this.overrides?.isBefore?this.overrides.isBefore(t,e):function(t,e){return+lr(t)<+lr(e)}(t,e),this.isDate=t=>this.overrides?.isDate?this.overrides.isDate(t):Er(t),this.isSameDay=(t,e)=>this.overrides?.isSameDay?this.overrides.isSameDay(t,e):function(t,e,n){const[i,r]=ur(n?.in,t,e);return+hr(i)===+hr(r)}(t,e),this.isSameMonth=(t,e)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(t,e):function(t,e,n){const[i,r]=ur(n?.in,t,e);return i.getFullYear()===r.getFullYear()&&i.getMonth()===r.getMonth()}(t,e),this.isSameYear=(t,e)=>this.overrides?.isSameYear?this.overrides.isSameYear(t,e):function(t,e,n){const[i,r]=ur(n?.in,t,e);return i.getFullYear()===r.getFullYear()}(t,e),this.max=t=>this.overrides?.max?this.overrides.max(t):function(t,e){let n,i=e?.in;return t.forEach(t=>{i||"object"!=typeof t||(i=ar.bind(null,t));const e=lr(t,i);(!n||n<e||isNaN(+e))&&(n=e)}),ar(i,n||NaN)}(t),this.min=t=>this.overrides?.min?this.overrides.min(t):function(t,e){let n,i=e?.in;return t.forEach(t=>{i||"object"!=typeof t||(i=ar.bind(null,t));const e=lr(t,i);(!n||n>e||isNaN(+e))&&(n=e)}),ar(i,n||NaN)}(t),this.setMonth=(t,e)=>this.overrides?.setMonth?this.overrides.setMonth(t,e):no(t,e),this.setYear=(t,e)=>this.overrides?.setYear?this.overrides.setYear(t,e):function(t,e,n){const i=lr(t,n?.in);return isNaN(+i)?ar(n?.in||t,NaN):(i.setFullYear(e),i)}(t,e),this.startOfBroadcastWeek=(t,e)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(t,this):io(t,this),this.startOfDay=t=>this.overrides?.startOfDay?this.overrides.startOfDay(t):hr(t),this.startOfISOWeek=t=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(t):gr(t),this.startOfMonth=t=>this.overrides?.startOfMonth?this.overrides.startOfMonth(t):function(t,e){const n=lr(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}(t),this.startOfWeek=(t,e)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(t,this.options):pr(t,this.options),this.startOfYear=t=>this.overrides?.startOfYear?this.overrides.startOfYear(t):fr(t),this.options={locale:Ur,...t},this.overrides=e}getDigitMap(){const{numerals:t="latn"}=this.options,e=new Intl.NumberFormat("en-US",{numberingSystem:t}),n={};for(let t=0;t<10;t++)n[t.toString()]=e.format(t);return n}replaceDigits(t){const e=this.getDigitMap();return t.replace(/\d/g,t=>e[t]||t)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&ro.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:e,timeZone:n,numerals:i}=this.options,r=e?.code;if(r&&ro.yearFirstLocales.has(r))try{return new Intl.DateTimeFormat(r,{month:"long",year:"numeric",timeZone:n,numberingSystem:i}).format(t)}catch{}const o="year-first"===this.getMonthYearOrder()?"y LLLL":"LLLL y";return this.format(t,o)}}ro.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const oo=new ro;function so(t,e,n=!1,i=oo){let{from:r,to:o}=t;const{differenceInCalendarDays:s,isSameDay:a}=i;return r&&o?(s(o,r)<0&&([r,o]=[o,r]),s(e,r)>=(n?1:0)&&s(o,e)>=(n?1:0)):!n&&o?a(o,e):!(n||!r)&&a(r,e)}function ao(t){return Boolean(t&&"object"==typeof t&&"before"in t&&"after"in t)}function lo(t){return Boolean(t&&"object"==typeof t&&"from"in t)}function co(t){return Boolean(t&&"object"==typeof t&&"after"in t)}function uo(t){return Boolean(t&&"object"==typeof t&&"before"in t)}function ho(t){return Boolean(t&&"object"==typeof t&&"dayOfWeek"in t)}function fo(t,e){return Array.isArray(t)&&t.every(e.isDate)}function po(t,e,n=oo){const i=Array.isArray(e)?e:[e],{isSameDay:r,differenceInCalendarDays:o,isAfter:s}=n;return i.some(e=>{if("boolean"==typeof e)return e;if(n.isDate(e))return r(t,e);if(fo(e,n))return e.some(e=>r(t,e));if(lo(e))return so(e,t,!1,n);if(ho(e))return Array.isArray(e.dayOfWeek)?e.dayOfWeek.includes(t.getDay()):e.dayOfWeek===t.getDay();if(ao(e)){const n=o(e.before,t)>0,i=o(e.after,t)<0;return s(e.before,e.after)?i&&n:n||i}return co(e)?o(t,e.after)>0:uo(e)?o(e.before,t)>0:"function"==typeof e&&e(t)})}function go(t){return l.createElement("button",{...t})}function mo(t){return l.createElement("span",{...t})}function yo(t){const{size:e=24,orientation:n="left",className:i}=t;return l.createElement("svg",{className:i,width:e,height:e,viewBox:"0 0 24 24"},"up"===n&&l.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===n&&l.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===n&&l.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===n&&l.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function bo(t){const{day:e,modifiers:n,...i}=t;return l.createElement("td",{...i})}function vo(t){const{day:e,modifiers:n,...i}=t,r=l.useRef(null);return l.useEffect(()=>{n.focused&&r.current?.focus()},[n.focused]),l.createElement("button",{ref:r,...i})}function xo(t){const{options:e,className:n,components:i,classNames:r,...o}=t,s=[r[Ii.Dropdown],n].join(" "),a=e?.find(({value:t})=>t===o.value);return l.createElement("span",{"data-disabled":o.disabled,className:r[Ii.DropdownRoot]},l.createElement(i.Select,{className:s,...o},e?.map(({value:t,label:e,disabled:n})=>l.createElement(i.Option,{key:t,value:t,disabled:n},e))),l.createElement("span",{className:r[Ii.CaptionLabel],"aria-hidden":!0},a?.label,l.createElement(i.Chevron,{orientation:"down",size:18,className:r[Ii.Chevron]})))}function wo(t){return l.createElement("div",{...t})}function _o(t){return l.createElement("div",{...t})}function Mo(t){const{calendarMonth:e,displayIndex:n,...i}=t;return l.createElement("div",{...i},t.children)}function So(t){const{calendarMonth:e,displayIndex:n,...i}=t;return l.createElement("div",{...i})}function ko(t){return l.createElement("table",{...t})}function Co(t){return l.createElement("div",{...t})}const Do=(0,l.createContext)(void 0);function Oo(){const t=(0,l.useContext)(Do);if(void 0===t)throw new Error("useDayPicker() must be used within a custom component.");return t}function Ro(t){const{components:e}=Oo();return l.createElement(e.Dropdown,{...t})}function Po(t){const{onPreviousClick:e,onNextClick:n,previousMonth:i,nextMonth:r,...o}=t,{components:s,classNames:a,labels:{labelPrevious:c,labelNext:u}}=Oo(),h=(0,l.useCallback)(t=>{r&&n?.(t)},[r,n]),d=(0,l.useCallback)(t=>{i&&e?.(t)},[i,e]);return l.createElement("nav",{...o},l.createElement(s.PreviousMonthButton,{type:"button",className:a[Ii.PreviousMonthButton],tabIndex:i?void 0:-1,"aria-disabled":!i||void 0,"aria-label":c(i),onClick:d},l.createElement(s.Chevron,{disabled:!i||void 0,className:a[Ii.Chevron],orientation:"left"})),l.createElement(s.NextMonthButton,{type:"button",className:a[Ii.NextMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":u(r),onClick:h},l.createElement(s.Chevron,{disabled:!r||void 0,orientation:"right",className:a[Ii.Chevron]})))}function To(t){const{components:e}=Oo();return l.createElement(e.Button,{...t})}function Eo(t){return l.createElement("option",{...t})}function Ao(t){const{components:e}=Oo();return l.createElement(e.Button,{...t})}function No(t){const{rootRef:e,...n}=t;return l.createElement("div",{...n,ref:e})}function Io(t){return l.createElement("select",{...t})}function Lo(t){const{week:e,...n}=t;return l.createElement("tr",{...n})}function jo(t){return l.createElement("th",{...t})}function Fo(t){return l.createElement("thead",{"aria-hidden":!0},l.createElement("tr",{...t}))}function Wo(t){const{week:e,...n}=t;return l.createElement("th",{...n})}function Uo(t){return l.createElement("th",{...t})}function Bo(t){return l.createElement("tbody",{...t})}function Ho(t){const{components:e}=Oo();return l.createElement(e.Dropdown,{...t})}function zo(t,e,n){return(n??new ro(e)).formatMonthYear(t)}const Yo=zo;function $o(t,e,n){return(n??new ro(e)).format(t,"d")}function qo(t,e=oo){return e.format(t,"LLLL")}function Vo(t,e,n){return(n??new ro(e)).format(t,"cccccc")}function Qo(t,e=oo){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function Ko(){return""}function Xo(t,e=oo){return e.format(t,"yyyy")}const Go=Xo;function Zo(t,e,n,i){let r=(i??new ro(n)).format(t,"PPPP");return e.today&&(r=`Today, ${r}`),e.selected&&(r=`${r}, selected`),r}const Jo=Zo;function ts(t,e,n){return(n??new ro(e)).formatMonthYear(t)}const es=ts;function ns(t,e,n,i){let r=(i??new ro(n)).format(t,"PPPP");return e?.today&&(r=`Today, ${r}`),r}function is(t){return"Choose the Month"}function rs(){return""}const os="Go to the Next Month";function ss(t,e){return os}function as(t){return"Go to the Previous Month"}function ls(t,e,n){return(n??new ro(e)).format(t,"cccc")}function cs(t,e){return`Week ${t}`}function us(t){return"Week Number"}function hs(t){return"Choose the Year"}const ds=(t,e,n)=>e||(n?"function"==typeof n?n:(...t)=>n:t);function fs(t,e){const n=e.locale?.labels??{};return{...a,...t??{},labelDayButton:ds(Zo,t?.labelDayButton,n.labelDayButton),labelMonthDropdown:ds(is,t?.labelMonthDropdown,n.labelMonthDropdown),labelNext:ds(ss,t?.labelNext,n.labelNext),labelPrevious:ds(as,t?.labelPrevious,n.labelPrevious),labelWeekNumber:ds(cs,t?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:ds(hs,t?.labelYearDropdown,n.labelYearDropdown),labelGrid:ds(ts,t?.labelGrid,n.labelGrid),labelGridcell:ds(ns,t?.labelGridcell,n.labelGridcell),labelNav:ds(rs,t?.labelNav,n.labelNav),labelWeekNumberHeader:ds(us,t?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:ds(ls,t?.labelWeekday,n.labelWeekday)}}function ps(t,e,n,i,r){const{startOfMonth:o,startOfYear:s,endOfYear:a,eachMonthOfInterval:l,getMonth:c}=r;return l({start:s(t),end:a(t)}).map(t=>{const s=i.formatMonthDropdown(t,r);return{value:c(t),label:s,disabled:e&&t<o(e)||n&&t>o(n)||!1}})}function gs(t,e,n,i,r=!1){if(!t)return;if(!e)return;const{startOfYear:o,endOfYear:s,eachYearOfInterval:a,getYear:l}=i,c=a({start:o(t),end:s(e)});return r&&c.reverse(),c.map(t=>{const e=n.formatYearDropdown(t,i);return{value:l(t),label:e,disabled:!1}})}const ms=t=>t instanceof HTMLElement?t:null,ys=t=>[...t.querySelectorAll("[data-animated-month]")??[]],bs=t=>ms(t.querySelector("[data-animated-caption]")),vs=t=>ms(t.querySelector("[data-animated-weeks]"));function xs(t,e,n,i){const{month:r,defaultMonth:o,today:s=i.today(),numberOfMonths:a=1}=t;let l=r||o||s;const{differenceInCalendarMonths:c,addMonths:u,startOfMonth:h}=i;return n&&c(n,l)<a-1&&(l=u(n,-1*(a-1))),e&&c(l,e)<0&&(l=e),h(l)}class ws{constructor(t,e,n=oo){this.date=t,this.displayMonth=e,this.outside=Boolean(e&&!n.isSameMonth(t,e)),this.dateLib=n,this.isoDate=n.format(t,"yyyy-MM-dd"),this.displayMonthId=n.format(e,"yyyy-MM"),this.dateMonthId=n.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class _s{constructor(t,e){this.days=e,this.weekNumber=t}}class Ms{constructor(t,e){this.date=t,this.weeks=e}}function Ss(t,e){const[n,i]=(0,l.useState)(t);return[void 0===e?n:e,i]}var ks;function Cs(t){return!t[Li.disabled]&&!t[Li.hidden]&&!t[Li.outside]}function Ds(t,e,n,i,r,o,s,a=0){if(a>365)return;const l=function(t,e,n,i,r,o,s){const{ISOWeek:a,broadcastCalendar:l}=o,{addDays:c,addMonths:u,addWeeks:h,addYears:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfWeek:g,max:m,min:y,startOfBroadcastWeek:b,startOfISOWeek:v,startOfWeek:x}=s;let w={day:c,week:h,month:u,year:d,startOfWeek:t=>l?b(t,s):a?v(t):x(t),endOfWeek:t=>l?f(t):a?p(t):g(t)}[t](n,"after"===e?1:-1);return"before"===e&&i?w=m([i,w]):"after"===e&&r&&(w=y([r,w])),w}(t,e,n.date,i,r,o,s),c=Boolean(o.disabled&&po(l,o.disabled,s)),u=Boolean(o.hidden&&po(l,o.hidden,s)),h=new ws(l,l,s);return c||u?Ds(t,e,h,i,r,o,s,a+1):h}function Os(t,e,n,i,r){const{autoFocus:o}=t,[s,a]=(0,l.useState)(),c=function(t,e,n,i){let r,o=-1;for(const s of t){const t=e(s);Cs(t)&&(t[Li.focused]&&o<ks.FocusedModifier?(r=s,o=ks.FocusedModifier):i?.isEqualTo(s)&&o<ks.LastFocused?(r=s,o=ks.LastFocused):n(s.date)&&o<ks.Selected?(r=s,o=ks.Selected):t[Li.today]&&o<ks.Today&&(r=s,o=ks.Today))}return r||(r=t.find(t=>Cs(e(t)))),r}(e.days,n,i||(()=>!1),s),[u,h]=(0,l.useState)(o?c:void 0);return{isFocusTarget:t=>Boolean(c?.isEqualTo(t)),setFocused:h,focused:u,blur:()=>{a(u),h(void 0)},moveFocus:(n,i)=>{if(!u)return;const o=Ds(n,i,u,e.navStart,e.navEnd,t,r);if(o){if(t.disableNavigation&&!e.days.some(t=>t.isEqualTo(o)))return;e.goToDay(o),h(o)}}}}function Rs(t,e,n=oo){return so(t,e.from,!1,n)||so(t,e.to,!1,n)||so(e,t.from,!1,n)||so(e,t.to,!1,n)}function Ps(t,e){const{disabled:n,excludeDisabled:i,selected:r,required:o,onSelect:s}=t,[a,l]=Ss(r,s?r:void 0),c=s?r:a;return{selected:c,select:(r,a,u)=>{const{min:h,max:d}=t,f=r?function(t,e,n=0,i=0,r=!1,o=oo){const{from:s,to:a}=e||{},{isSameDay:l,isAfter:c,isBefore:u}=o;let h;if(s||a){if(s&&!a)h=l(s,t)?0===n?{from:s,to:t}:r?{from:s,to:void 0}:void 0:u(t,s)?{from:t,to:s}:{from:s,to:t};else if(s&&a)if(l(s,t)&&l(a,t))h=r?{from:s,to:a}:void 0;else if(l(s,t))h={from:s,to:n>0?void 0:t};else if(l(a,t))h={from:t,to:n>0?void 0:t};else if(u(t,s))h={from:t,to:a};else if(c(t,s))h={from:s,to:t};else{if(!c(t,a))throw new Error("Invalid range");h={from:s,to:t}}}else h={from:t,to:n>0?void 0:t};if(h?.from&&h?.to){const e=o.differenceInCalendarDays(h.to,h.from);(i>0&&e>i||n>1&&e<n)&&(h={from:t,to:void 0})}return h}(r,c,h,d,o,e):void 0;return i&&n&&f?.from&&f.to&&function(t,e,n=oo){const i=Array.isArray(e)?e:[e];if(i.filter(t=>"function"!=typeof t).some(e=>"boolean"==typeof e?e:n.isDate(e)?so(t,e,!1,n):fo(e,n)?e.some(e=>so(t,e,!1,n)):lo(e)?!(!e.from||!e.to)&&Rs(t,{from:e.from,to:e.to},n):ho(e)?function(t,e,n=oo){const i=Array.isArray(e)?e:[e];let r=t.from;const o=n.differenceInCalendarDays(t.to,t.from),s=Math.min(o,6);for(let t=0;t<=s;t++){if(i.includes(r.getDay()))return!0;r=n.addDays(r,1)}return!1}(t,e.dayOfWeek,n):ao(e)?n.isAfter(e.before,e.after)?Rs(t,{from:n.addDays(e.after,1),to:n.addDays(e.before,-1)},n):po(t.from,e,n)||po(t.to,e,n):!(!co(e)&&!uo(e))&&(po(t.from,e,n)||po(t.to,e,n))))return!0;const r=i.filter(t=>"function"==typeof t);if(r.length){let e=t.from;const i=n.differenceInCalendarDays(t.to,t.from);for(let t=0;t<=i;t++){if(r.some(t=>t(e)))return!0;e=n.addDays(e,1)}}return!1}({from:f.from,to:f.to},n,e)&&(f.from=r,f.to=void 0),s||l(f),s?.(f,r,a,u),f},isSelected:t=>c&&so(c,t,!1,e)}}function Ts(t,e){return t instanceof Xr&&t.timeZone===e?t:new Xr(t,e)}function Es(t,e,n){if(!n)return Ts(t,e);const i=Ts(t,e),r=new Xr(i.getFullYear(),i.getMonth(),i.getDate(),12,0,0,e);return new Date(r.getTime())}function As(t,e,n){return"boolean"==typeof t||"function"==typeof t?t:t instanceof Date?Es(t,e,n):Array.isArray(t)?t.map(t=>t instanceof Date?Es(t,e,n):t):lo(t)?{...t,from:t.from?Ts(t.from,e):t.from,to:t.to?Ts(t.to,e):t.to}:ao(t)?{before:Es(t.before,e,n),after:Es(t.after,e,n)}:co(t)?{after:Es(t.after,e,n)}:uo(t)?{before:Es(t.before,e,n)}:t}function Ns(t,e,n){return t?Array.isArray(t)?t.map(t=>As(t,e,n)):As(t,e,n):t}function Is(t){let e=t;const n=e.timeZone;if(n&&(e={...t,timeZone:n},e.today&&(e.today=Ts(e.today,n)),e.month&&(e.month=Ts(e.month,n)),e.defaultMonth&&(e.defaultMonth=Ts(e.defaultMonth,n)),e.startMonth&&(e.startMonth=Ts(e.startMonth,n)),e.endMonth&&(e.endMonth=Ts(e.endMonth,n)),"single"===e.mode&&e.selected?e.selected=Ts(e.selected,n):"multiple"===e.mode&&e.selected?e.selected=e.selected?.map(t=>Ts(t,n)):"range"===e.mode&&e.selected&&(e.selected={from:e.selected.from?Ts(e.selected.from,n):e.selected.from,to:e.selected.to?Ts(e.selected.to,n):e.selected.to}),void 0!==e.disabled&&(e.disabled=Ns(e.disabled,n)),void 0!==e.hidden&&(e.hidden=Ns(e.hidden,n)),e.modifiers)){const t={};Object.keys(e.modifiers).forEach(i=>{t[i]=Ns(e.modifiers?.[i],n)}),e.modifiers=t}const{components:i,formatters:r,labels:a,dateLib:c,locale:u,classNames:h}=(0,l.useMemo)(()=>{const t={...Ur,...e.locale},n=e.broadcastCalendar?1:e.weekStartsOn,i=e.noonSafe&&e.timeZone?function(t,e={}){const{weekStartsOn:n,locale:i}=e,r=n??i?.options?.weekStartsOn??0,o=e=>{const n="number"==typeof e||"string"==typeof e?new Date(e):e;return new Xr(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,t)},s=t=>{const e=o(t);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)};return{today:()=>o(Xr.tz(t)),newDate:(e,n,i)=>new Xr(e,n,i,12,0,0,t),startOfDay:t=>o(t),startOfWeek:(t,e)=>{const n=o(t),i=e?.weekStartsOn??r,s=(n.getDay()-i+7)%7;return n.setDate(n.getDate()-s),n},startOfISOWeek:t=>{const e=o(t),n=(e.getDay()-1+7)%7;return e.setDate(e.getDate()-n),e},startOfMonth:t=>{const e=o(t);return e.setDate(1),e},startOfYear:t=>{const e=o(t);return e.setMonth(0,1),e},endOfWeek:(t,e)=>{const n=o(t),i=(((e?.weekStartsOn??r)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+i),n},endOfISOWeek:t=>{const e=o(t),n=(7-e.getDay())%7;return e.setDate(e.getDate()+n),e},endOfMonth:t=>{const e=o(t);return e.setMonth(e.getMonth()+1,0),e},endOfYear:t=>{const e=o(t);return e.setMonth(11,31),e},eachMonthOfInterval:e=>{const n=o(e.start),i=o(e.end),r=[],s=new Xr(n.getFullYear(),n.getMonth(),1,12,0,0,t),a=12*i.getFullYear()+i.getMonth();for(;12*s.getFullYear()+s.getMonth()<=a;)r.push(new Xr(s,t)),s.setMonth(s.getMonth()+1,1);return r},addDays:(t,e)=>{const n=o(t);return n.setDate(n.getDate()+e),n},addWeeks:(t,e)=>{const n=o(t);return n.setDate(n.getDate()+7*e),n},addMonths:(t,e)=>{const n=o(t);return n.setMonth(n.getMonth()+e),n},addYears:(t,e)=>{const n=o(t);return n.setFullYear(n.getFullYear()+e),n},eachYearOfInterval:e=>{const n=o(e.start),i=o(e.end),r=[],s=new Xr(n.getFullYear(),0,1,12,0,0,t);for(;s.getFullYear()<=i.getFullYear();)r.push(new Xr(s,t)),s.setFullYear(s.getFullYear()+1,0,1);return r},getWeek:(t,e)=>vr(s(t),{weekStartsOn:e?.weekStartsOn??r,firstWeekContainsDate:e?.firstWeekContainsDate??i?.options?.firstWeekContainsDate??1}),getISOWeek:t=>yr(s(t)),differenceInCalendarDays:(t,e)=>dr(s(t),s(e)),differenceInCalendarMonths:(t,e)=>Jr(s(t),s(e))}}(e.timeZone,{weekStartsOn:n,locale:t}):void 0,r=e.dateLib&&i?{...i,...e.dateLib}:e.dateLib??i,a=new ro({locale:t,weekStartsOn:n,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},r);return{dateLib:a,components:(c=e.components,{...o,...c}),formatters:(l=e.formatters,l?.formatMonthCaption&&!l.formatCaption&&(l.formatCaption=l.formatMonthCaption),l?.formatYearCaption&&!l.formatYearDropdown&&(l.formatYearDropdown=l.formatYearCaption),{...s,...l}),labels:fs(e.labels,a.options),locale:t,classNames:{...qi(),...e.classNames}};var l,c},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.noonSafe,e.components,e.formatters,e.labels,e.classNames]);e.today||(e={...e,today:c.today()});const{captionLayout:d,mode:f,navLayout:p,numberOfMonths:g=1,onDayBlur:m,onDayClick:y,onDayFocus:b,onDayKeyDown:v,onDayMouseEnter:x,onDayMouseLeave:w,onNextClick:_,onPrevClick:M,showWeekNumber:S,styles:k}=e,{formatCaption:C,formatDay:D,formatMonthDropdown:O,formatWeekNumber:R,formatWeekNumberHeader:P,formatWeekdayName:T,formatYearDropdown:E}=r,A=function(t,e){const[n,i]=function(t,e){let{startMonth:n,endMonth:i}=t;const{startOfYear:r,startOfDay:o,startOfMonth:s,endOfMonth:a,addYears:l,endOfYear:c,newDate:u,today:h}=e,{fromYear:d,toYear:f,fromMonth:p,toMonth:g}=t;!n&&p&&(n=p),!n&&d&&(n=e.newDate(d,0,1)),!i&&g&&(i=g),!i&&f&&(i=u(f,11,31));const m="dropdown"===t.captionLayout||"dropdown-years"===t.captionLayout;return n?n=s(n):d?n=u(d,0,1):!n&&m&&(n=r(l(t.today??h(),-100))),i?i=a(i):f?i=u(f,11,31):!i&&m&&(i=c(t.today??h())),[n?o(n):n,i?o(i):i]}(t,e),{startOfMonth:r,endOfMonth:o}=e,s=xs(t,n,i,e),[a,c]=Ss(s,t.month?s:void 0);(0,l.useEffect)(()=>{const r=xs(t,n,i,e);c(r)},[t.timeZone]);const{months:u,weeks:h,days:d,previousMonth:f,nextMonth:p}=(0,l.useMemo)(()=>{const r=function(t,e,n,i){const{numberOfMonths:r=1}=n,o=[];for(let n=0;n<r;n++){const r=i.addMonths(t,n);if(e&&r>e)break;o.push(r)}return o}(a,i,{numberOfMonths:t.numberOfMonths},e),s=function(t,e,n,i){const r=t[0],o=t[t.length-1],{ISOWeek:s,fixedWeeks:a,broadcastCalendar:l}=n??{},{addDays:c,differenceInCalendarDays:u,differenceInCalendarMonths:h,endOfBroadcastWeek:d,endOfISOWeek:f,endOfMonth:p,endOfWeek:g,isAfter:m,startOfBroadcastWeek:y,startOfISOWeek:b,startOfWeek:v}=i,x=l?y(r,i):s?b(r):v(r),w=l?d(o):s?f(p(o)):g(p(o)),_=e&&(l?d(e):s?f(e):g(e)),M=u(_&&m(w,_)?_:w,x),S=h(o,r)+1,k=[];for(let t=0;t<=M;t++){const e=c(x,t);k.push(e)}const C=(l?35:42)*S;if(a&&k.length<C){const t=C-k.length;for(let e=0;e<t;e++){const t=c(k[k.length-1],1);k.push(t)}}return k}(r,t.endMonth?o(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},e),l=function(t,e,n,i){const{addDays:r,endOfBroadcastWeek:o,endOfISOWeek:s,endOfMonth:a,endOfWeek:l,getISOWeek:c,getWeek:u,startOfBroadcastWeek:h,startOfISOWeek:d,startOfWeek:f}=i,p=t.reduce((t,p)=>{const g=n.broadcastCalendar?h(p,i):n.ISOWeek?d(p):f(p),m=n.broadcastCalendar?o(p):n.ISOWeek?s(a(p)):l(a(p)),y=e.filter(t=>t>=g&&t<=m),b=n.broadcastCalendar?35:42;if(n.fixedWeeks&&y.length<b){const t=e.filter(t=>{const e=b-y.length;return t>m&&t<=r(m,e)});y.push(...t)}const v=y.reduce((t,e)=>{const r=n.ISOWeek?c(e):u(e),o=t.find(t=>t.weekNumber===r),s=new ws(e,p,i);return o?o.days.push(s):t.push(new _s(r,[s])),t},[]),x=new Ms(p,v);return t.push(x),t},[]);return n.reverseMonths?p.reverse():p}(r,s,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},e),c=function(t){return t.reduce((t,e)=>t.concat(e.weeks.slice()),[].slice())}(l),u=function(t){const e=[];return t.reduce((t,n)=>{const i=n.weeks.reduce((t,e)=>t.concat(e.days.slice()),e.slice());return t.concat(i.slice())},e.slice())}(l),h=function(t,e,n,i){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:o}=n,{startOfMonth:s,addMonths:a,differenceInCalendarMonths:l}=i,c=r?o??1:1,u=s(t);return e&&l(u,e)<=0?void 0:a(u,-c)}(a,n,t,e),d=function(t,e,n,i){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:o=1}=n,{startOfMonth:s,addMonths:a,differenceInCalendarMonths:l}=i,c=r?o:1,u=s(t);return e&&l(e,t)<o?void 0:a(u,c)}(a,i,t,e);return{months:l,weeks:c,days:u,previousMonth:h,nextMonth:d}},[e,a.getTime(),i?.getTime(),n?.getTime(),t.disableNavigation,t.broadcastCalendar,t.endMonth?.getTime(),t.fixedWeeks,t.ISOWeek,t.numberOfMonths,t.pagedNavigation,t.reverseMonths]),{disableNavigation:g,onMonthChange:m}=t,y=t=>{if(g)return;let e=r(t);n&&e<r(n)&&(e=r(n)),i&&e>r(i)&&(e=r(i)),c(e),m?.(e)};return{months:u,weeks:h,days:d,navStart:n,navEnd:i,previousMonth:f,nextMonth:p,goToMonth:y,goToDay:t=>{(t=>h.some(e=>e.days.some(e=>e.isEqualTo(t))))(t)||y(t.date)}}}(e,c),{days:N,months:I,navStart:L,navEnd:j,previousMonth:F,nextMonth:W,goToMonth:U}=A,B=function(t,e,n,i,r){const{disabled:o,hidden:s,modifiers:a,showOutsideDays:l,broadcastCalendar:c,today:u=r.today()}=e,{isSameDay:h,isSameMonth:d,startOfMonth:f,isBefore:p,endOfMonth:g,isAfter:m}=r,y=n&&f(n),b=i&&g(i),v={[Li.focused]:[],[Li.outside]:[],[Li.disabled]:[],[Li.hidden]:[],[Li.today]:[]},x={};for(const e of t){const{date:t,displayMonth:n}=e,i=Boolean(n&&!d(t,n)),f=Boolean(y&&p(t,y)),g=Boolean(b&&m(t,b)),w=Boolean(o&&po(t,o,r)),_=Boolean(s&&po(t,s,r))||f||g||!c&&!l&&i||c&&!1===l&&i,M=h(t,u);i&&v.outside.push(e),w&&v.disabled.push(e),_&&v.hidden.push(e),M&&v.today.push(e),a&&Object.keys(a).forEach(n=>{const i=a?.[n];i&&po(t,i,r)&&(x[n]?x[n].push(e):x[n]=[e])})}return t=>{const e={[Li.focused]:!1,[Li.disabled]:!1,[Li.hidden]:!1,[Li.outside]:!1,[Li.today]:!1},n={};for(const n in v){const i=v[n];e[n]=i.some(e=>e===t)}for(const e in x)n[e]=x[e].some(e=>e===t);return{...e,...n}}}(N,e,L,j,c),{isSelected:H,select:z,selected:Y}=function(t,e){const n=function(t,e){const{selected:n,required:i,onSelect:r}=t,[o,s]=Ss(n,r?n:void 0),a=r?n:o,{isSameDay:l}=e;return{selected:a,select:(t,e,n)=>{let o=t;return!i&&a&&a&&l(t,a)&&(o=void 0),r||s(o),r?.(o,t,e,n),o},isSelected:t=>!!a&&l(a,t)}}(t,e),i=function(t,e){const{selected:n,required:i,onSelect:r}=t,[o,s]=Ss(n,r?n:void 0),a=r?n:o,{isSameDay:l}=e,c=t=>a?.some(e=>l(e,t))??!1,{min:u,max:h}=t;return{selected:a,select:(t,e,n)=>{let o=[...a??[]];if(c(t)){if(a?.length===u)return;if(i&&1===a?.length)return;o=a?.filter(e=>!l(e,t))}else o=a?.length===h?[t]:[...o,t];return r||s(o),r?.(o,t,e,n),o},isSelected:c}}(t,e),r=Ps(t,e);switch(t.mode){case"single":return n;case"multiple":return i;case"range":return r;default:return}}(e,c)??{},{blur:$,focused:q,isFocusTarget:V,moveFocus:Q,setFocused:K}=Os(e,A,B,H??(()=>!1),c),{labelDayButton:X,labelGridcell:G,labelGrid:Z,labelMonthDropdown:J,labelNav:tt,labelPrevious:et,labelNext:nt,labelWeekday:it,labelWeekNumber:rt,labelWeekNumberHeader:ot,labelYearDropdown:st}=a,at=(0,l.useMemo)(()=>function(t,e,n,i){const r=i??t.today(),o=n?t.startOfBroadcastWeek(r,t):e?t.startOfISOWeek(r):t.startOfWeek(r),s=[];for(let e=0;e<7;e++){const n=t.addDays(o,e);s.push(n)}return s}(c,e.ISOWeek,e.broadcastCalendar,e.today),[c,e.ISOWeek,e.broadcastCalendar,e.today]),lt=void 0!==f||void 0!==y,ct=(0,l.useCallback)(()=>{F&&(U(F),M?.(F))},[F,U,M]),ut=(0,l.useCallback)(()=>{W&&(U(W),_?.(W))},[U,W,_]),ht=(0,l.useCallback)((t,e)=>n=>{n.preventDefault(),n.stopPropagation(),K(t),e.disabled||(z?.(t.date,e,n),y?.(t.date,e,n))},[z,y,K]),dt=(0,l.useCallback)((t,e)=>n=>{K(t),b?.(t.date,e,n)},[b,K]),ft=(0,l.useCallback)((t,e)=>n=>{$(),m?.(t.date,e,n)},[$,m]),pt=(0,l.useCallback)((t,n)=>i=>{const r={ArrowLeft:[i.shiftKey?"month":"day","rtl"===e.dir?"after":"before"],ArrowRight:[i.shiftKey?"month":"day","rtl"===e.dir?"before":"after"],ArrowDown:[i.shiftKey?"year":"week","after"],ArrowUp:[i.shiftKey?"year":"week","before"],PageUp:[i.shiftKey?"year":"month","before"],PageDown:[i.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(r[i.key]){i.preventDefault(),i.stopPropagation();const[t,e]=r[i.key];Q(t,e)}v?.(t.date,n,i)},[Q,v,e.dir]),gt=(0,l.useCallback)((t,e)=>n=>{x?.(t.date,e,n)},[x]),mt=(0,l.useCallback)((t,e)=>n=>{w?.(t.date,e,n)},[w]),yt=(0,l.useCallback)(t=>e=>{const n=Number(e.target.value),i=c.setMonth(c.startOfMonth(t),n);U(i)},[c,U]),bt=(0,l.useCallback)(t=>e=>{const n=Number(e.target.value),i=c.setYear(c.startOfMonth(t),n);U(i)},[c,U]),{className:vt,style:xt}=(0,l.useMemo)(()=>({className:[h[Ii.Root],e.className].filter(Boolean).join(" "),style:{...k?.[Ii.Root],...e.style}}),[h,e.className,e.style,k]),wt=function(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([t,n])=>{t.startsWith("data-")&&(e[t]=n)}),e}(e),_t=(0,l.useRef)(null);!function(t,e,{classNames:n,months:i,focused:r,dateLib:o}){const s=(0,l.useRef)(null),a=(0,l.useRef)(i),c=(0,l.useRef)(!1);(0,l.useLayoutEffect)(()=>{const l=a.current;if(a.current=i,!(e&&t.current&&t.current instanceof HTMLElement&&0!==i.length&&0!==l.length&&i.length===l.length))return;const u=o.isSameMonth(i[0].date,l[0].date),h=o.isAfter(i[0].date,l[0].date),d=h?n[Fi.caption_after_enter]:n[Fi.caption_before_enter],f=h?n[Fi.weeks_after_enter]:n[Fi.weeks_before_enter],p=s.current,g=t.current.cloneNode(!0);if(g instanceof HTMLElement?(ys(g).forEach(t=>{if(!(t instanceof HTMLElement))return;const e=ms(t.querySelector("[data-animated-month]"));e&&t.contains(e)&&t.removeChild(e);const n=bs(t);n&&n.classList.remove(d);const i=vs(t);i&&i.classList.remove(f)}),s.current=g):s.current=null,c.current||u||r)return;const m=p instanceof HTMLElement?ys(p):[],y=ys(t.current);if(y?.every(t=>t instanceof HTMLElement)&&m&&m.every(t=>t instanceof HTMLElement)){c.current=!0;const e=[];t.current.style.isolation="isolate";const i=(b=t.current,ms(b.querySelector("[data-animated-nav]")));i&&(i.style.zIndex="1"),y.forEach((r,o)=>{const s=m[o];if(!s)return;r.style.position="relative",r.style.overflow="hidden";const a=bs(r);a&&a.classList.add(d);const l=vs(r);l&&l.classList.add(f);const u=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),i&&(i.style.zIndex=""),a&&a.classList.remove(d),l&&l.classList.remove(f),r.style.position="",r.style.overflow="",r.contains(s)&&r.removeChild(s)};e.push(u),s.style.pointerEvents="none",s.style.position="absolute",s.style.overflow="hidden",s.setAttribute("aria-hidden","true");const p=(t=>ms(t.querySelector("[data-animated-weekdays]")))(s);p&&(p.style.opacity="0");const g=bs(s);g&&(g.classList.add(h?n[Fi.caption_before_exit]:n[Fi.caption_after_exit]),g.addEventListener("animationend",u));const y=vs(s);y&&y.classList.add(h?n[Fi.weeks_before_exit]:n[Fi.weeks_after_exit]),r.insertBefore(s,r.firstChild)})}var b})}(_t,Boolean(e.animate),{classNames:h,months:I,focused:q,dateLib:c});const Mt={dayPickerProps:e,selected:Y,select:z,isSelected:H,months:I,nextMonth:W,previousMonth:F,goToMonth:U,getModifiers:B,components:i,classNames:h,styles:k,labels:a,formatters:r};return l.createElement(Do.Provider,{value:Mt},l.createElement(i.Root,{rootRef:e.animate?_t:void 0,className:vt,style:xt,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...wt},l.createElement(i.Months,{className:h[Ii.Months],style:k?.[Ii.Months]},!e.hideNavigation&&!p&&l.createElement(i.Nav,{"data-animated-nav":e.animate?"true":void 0,className:h[Ii.Nav],style:k?.[Ii.Nav],"aria-label":tt(),onPreviousClick:ct,onNextClick:ut,previousMonth:F,nextMonth:W}),I.map((t,n)=>l.createElement(i.Month,{"data-animated-month":e.animate?"true":void 0,className:h[Ii.Month],style:k?.[Ii.Month],key:n,displayIndex:n,calendarMonth:t},"around"===p&&!e.hideNavigation&&0===n&&l.createElement(i.PreviousMonthButton,{type:"button",className:h[Ii.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":!F||void 0,"aria-label":et(F),onClick:ct,"data-animated-button":e.animate?"true":void 0},l.createElement(i.Chevron,{disabled:!F||void 0,className:h[Ii.Chevron],orientation:"rtl"===e.dir?"right":"left"})),l.createElement(i.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:h[Ii.MonthCaption],style:k?.[Ii.MonthCaption],calendarMonth:t,displayIndex:n},d?.startsWith("dropdown")?l.createElement(i.DropdownNav,{className:h[Ii.Dropdowns],style:k?.[Ii.Dropdowns]},(()=>{const n="dropdown"===d||"dropdown-months"===d?l.createElement(i.MonthsDropdown,{key:"month",className:h[Ii.MonthsDropdown],"aria-label":J(),classNames:h,components:i,disabled:Boolean(e.disableNavigation),onChange:yt(t.date),options:ps(t.date,L,j,r,c),style:k?.[Ii.Dropdown],value:c.getMonth(t.date)}):l.createElement("span",{key:"month"},O(t.date,c)),o="dropdown"===d||"dropdown-years"===d?l.createElement(i.YearsDropdown,{key:"year",className:h[Ii.YearsDropdown],"aria-label":st(c.options),classNames:h,components:i,disabled:Boolean(e.disableNavigation),onChange:bt(t.date),options:gs(L,j,r,c,Boolean(e.reverseYears)),style:k?.[Ii.Dropdown],value:c.getYear(t.date)}):l.createElement("span",{key:"year"},E(t.date,c));return"year-first"===c.getMonthYearOrder()?[o,n]:[n,o]})(),l.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},C(t.date,c.options,c))):l.createElement(i.CaptionLabel,{className:h[Ii.CaptionLabel],role:"status","aria-live":"polite"},C(t.date,c.options,c))),"around"===p&&!e.hideNavigation&&n===g-1&&l.createElement(i.NextMonthButton,{type:"button",className:h[Ii.NextMonthButton],tabIndex:W?void 0:-1,"aria-disabled":!W||void 0,"aria-label":nt(W),onClick:ut,"data-animated-button":e.animate?"true":void 0},l.createElement(i.Chevron,{disabled:!W||void 0,className:h[Ii.Chevron],orientation:"rtl"===e.dir?"left":"right"})),n===g-1&&"after"===p&&!e.hideNavigation&&l.createElement(i.Nav,{"data-animated-nav":e.animate?"true":void 0,className:h[Ii.Nav],style:k?.[Ii.Nav],"aria-label":tt(),onPreviousClick:ct,onNextClick:ut,previousMonth:F,nextMonth:W}),l.createElement(i.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===f||"range"===f,"aria-label":Z(t.date,c.options,c)||void 0,className:h[Ii.MonthGrid],style:k?.[Ii.MonthGrid]},!e.hideWeekdays&&l.createElement(i.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:h[Ii.Weekdays],style:k?.[Ii.Weekdays]},S&&l.createElement(i.WeekNumberHeader,{"aria-label":ot(c.options),className:h[Ii.WeekNumberHeader],style:k?.[Ii.WeekNumberHeader],scope:"col"},P()),at.map(t=>l.createElement(i.Weekday,{"aria-label":it(t,c.options,c),className:h[Ii.Weekday],key:String(t),style:k?.[Ii.Weekday],scope:"col"},T(t,c.options,c)))),l.createElement(i.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:h[Ii.Weeks],style:k?.[Ii.Weeks]},t.weeks.map(t=>l.createElement(i.Week,{className:h[Ii.Week],key:t.weekNumber,style:k?.[Ii.Week],week:t},S&&l.createElement(i.WeekNumber,{week:t,style:k?.[Ii.WeekNumber],"aria-label":rt(t.weekNumber,{locale:u}),className:h[Ii.WeekNumber],scope:"row",role:"rowheader"},R(t.weekNumber,c)),t.days.map(t=>{const{date:n}=t,r=B(t);if(r[Li.focused]=!r.hidden&&Boolean(q?.isEqualTo(t)),r[ji.selected]=H?.(n)||r.selected,lo(Y)){const{from:t,to:e}=Y;r[ji.range_start]=Boolean(t&&e&&c.isSameDay(n,t)),r[ji.range_end]=Boolean(t&&e&&c.isSameDay(n,e)),r[ji.range_middle]=so(Y,n,!0,c)}const o=function(t,e={},n={}){let i={...e?.[Ii.Day]};return Object.entries(t).filter(([,t])=>!0===t).forEach(([t])=>{i={...i,...n?.[t]}}),i}(r,k,e.modifiersStyles),s=function(t,e,n={}){return Object.entries(t).filter(([,t])=>!0===t).reduce((t,[i])=>(n[i]?t.push(n[i]):e[Li[i]]?t.push(e[Li[i]]):e[ji[i]]&&t.push(e[ji[i]]),t),[e[Ii.Day]])}(r,h,e.modifiersClassNames),a=lt||r.hidden?void 0:G(n,r,c.options,c);return l.createElement(i.Day,{key:`${t.isoDate}_${t.displayMonthId}`,day:t,modifiers:r,className:s.join(" "),style:o,role:"gridcell","aria-selected":r.selected||void 0,"aria-label":a,"data-day":t.isoDate,"data-month":t.outside?t.dateMonthId:void 0,"data-selected":r.selected||void 0,"data-disabled":r.disabled||void 0,"data-hidden":r.hidden||void 0,"data-outside":t.outside||void 0,"data-focused":r.focused||void 0,"data-today":r.today||void 0},!r.hidden&<?l.createElement(i.DayButton,{className:h[Ii.DayButton],style:k?.[Ii.DayButton],type:"button",day:t,modifiers:r,disabled:!r.focused&&r.disabled||void 0,"aria-disabled":r.focused&&r.disabled||void 0,tabIndex:V(t)?0:-1,"aria-label":X(n,r,c.options,c),onClick:ht(t,r),onBlur:ft(t,r),onFocus:dt(t,r),onKeyDown:pt(t,r),onMouseEnter:gt(t,r),onMouseLeave:mt(t,r)},D(n,c.options,c)):!r.hidden&&D(t.date,c.options,c))})))))))),e.footer&&l.createElement(i.Footer,{className:h[Ii.Footer],style:k?.[Ii.Footer],role:"status","aria-live":"polite"},e.footer)))}!function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"}(ks||(ks={}));const Ls=(t,e)=>{const n=l.forwardRef(({className:t,size:n=24,strokeWidth:i=2,color:r="currentColor",circle:o,...s},a)=>(0,g.jsxs)("svg",{ref:a,xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",className:O("UR-UI-Icon",t),...s,children:[o&&(0,g.jsx)("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:r,strokeWidth:i}),e.map(([t,e],n)=>l.createElement(t,{key:n,...e}))]}));return n.displayName=t,n},js=Ls("Check",[["path",{d:"M20 6 9 17l-5-5"}]]),Fs=Ls("ChevronUp",[["path",{d:"m18 15-6-6-6 6"}]]),Ws=Ls("ChevronDown",[["path",{d:"m6 9 6 6 6-6"}]]),Us=Ls("ChevronLeft",[["path",{d:"m15 18-6-6 6-6"}]]),Bs=Ls("ChevronRight",[["path",{d:"m9 18 6-6-6-6"}]]);function Hs({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:i="label",buttonVariant:r="ghost",formatters:o,components:s,...a}){const l=qi();return(0,g.jsx)(Is,{showOutsideDays:n,className:O("UR-UI-Calendar",t),captionLayout:i,formatters:{formatMonthDropdown:t=>t.toLocaleString("default",{month:"short"}),...o},classNames:{root:O("UR-UI-Calendar-Root",l.root),months:O("UR-UI-Calendar-Months",l.months),month:O("UR-UI-Calendar-Month",l.month),nav:O("UR-UI-Calendar-Nav",l.nav),button_previous:O(R({variant:r}),"UR-UI-Calendar-NavButton","UR-UI-Calendar-NavButtonPrevious",l.button_previous),button_next:O(R({variant:r}),"UR-UI-Calendar-NavButton","UR-UI-Calendar-NavButtonNext",l.button_next),month_caption:O("UR-UI-Calendar-MonthCaption",l.month_caption),dropdowns:O("UR-UI-Calendar-Dropdowns",l.dropdowns),dropdown_root:O("UR-UI-Calendar-DropdownRoot",l.dropdown_root),dropdown:O("UR-UI-Calendar-Dropdown",l.dropdown),caption_label:O("UR-UI-Calendar-CaptionLabel",l.caption_label),weekdays:O("UR-UI-Calendar-Weekdays",l.weekdays),weekday:O("UR-UI-Calendar-Weekday",l.weekday),week:O("UR-UI-Calendar-Week",l.week),week_number_header:O("UR-UI-Calendar-WeekNumberHeader",l.week_number_header),week_number:O("UR-UI-Calendar-WeekNumber",l.week_number),day:O("UR-UI-Calendar-Day",l.day),range_start:O("UR-UI-Calendar-RangeStart",l.range_start),range_middle:O("UR-UI-Calendar-RangeMiddle",l.range_middle),range_end:O("UR-UI-Calendar-RangeEnd",l.range_end),today:O("UR-UI-Calendar-Today",l.today),outside:O("UR-UI-Calendar-Outside",l.outside),disabled:O("UR-UI-Calendar-Disabled",l.disabled),hidden:O("UR-UI-Calendar-Hidden",l.hidden),...e},components:{Root:({className:t,rootRef:e,...n})=>(0,g.jsx)("div",{"data-slot":"calendar",ref:e,className:O(t),...n}),Chevron:({className:t,orientation:e,...n})=>"left"===e?(0,g.jsx)(Us,{className:O("UR-UI-Calendar-Chevron",t),size:16,...n}):"right"===e?(0,g.jsx)(Bs,{className:O("UR-UI-Calendar-Chevron",t),size:16,...n}):(0,g.jsx)(Ws,{className:O("UR-UI-Calendar-Chevron",t),size:16,...n}),DayButton:zs,WeekNumber:({children:t,...e})=>(0,g.jsx)("td",{...e,children:(0,g.jsx)("div",{className:"UR-UI-Calendar-WeekNumberCell",children:t})}),...s},...a})}function zs({className:t,day:e,modifiers:n,...i}){const r=qi(),o=l.useRef(null);return l.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),(0,g.jsx)(T,{ref:o,variant:"ghost",size:"icon","data-day":e.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,"data-day-same":n.range_start&&n.range_end,className:O("UR-UI-Calendar-DayButton",n.selected&&"UR-UI-Calendar-DayButton--selected-single",n.range_start&&"UR-UI-Calendar-DayButton--range-start",n.range_end&&"UR-UI-Calendar-DayButton--range-end",n.range_middle&&"UR-UI-Calendar-DayButton--range-middle",n.range_start&&n.range_end&&"UR-UI-Calendar-DayButton--same",r.day,t),...i})}Hs.displayName="Calendar";const Ys=[{name:"today",label:"Today"},{name:"last7",label:"Last 7 days"},{name:"last14",label:"Last 14 days"},{name:"last30",label:"Last 30 days"},{name:"last3Months",label:"Last 3 Months"},{name:"last12Months",label:"Last 12 Months"},{name:"monthToDate",label:"Month to Date"},{name:"quarterToDate",label:"Quarter to Date"},{name:"yearToDate",label:"Year to Date"},{name:"allTime",label:"All Time"}],$s=(t,e="en-us")=>t.toLocaleDateString(e,{month:"short",day:"numeric",year:"numeric"}),qs=t=>{if("string"==typeof t){const e=t.split("-").map(t=>parseInt(t,10));return new Date(e[0],e[1]-1,e[2])}return t},Vs=({initialDateFrom:t,initialDateTo:e,onUpdate:n,align:i="end",locale:r="en-US"})=>{const[o,s]=(0,l.useState)(!1),[a,c]=(0,l.useState)(t?{from:qs(t),to:qs(e||t)}:(()=>{const t=new Date;t.setHours(23,59,59,999);const e=new Date(t);return e.setDate(t.getDate()-30),e.setHours(0,0,0,0),{from:e,to:t}})()),[u,h]=(0,l.useState)(),d=(0,l.useRef)(),[f,p]=(0,l.useState)("undefined"!=typeof window&&window.innerWidth<960);(0,l.useEffect)(()=>{const t=()=>{p(window.innerWidth<960)};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]);const m=({preset:t,label:e})=>(0,g.jsx)(T,{variant:"ghost",onClick:()=>{(t=>{const e=(t=>{const e=new Date;switch(e.setHours(23,59,59,999),t){case"today":{const t=new Date;return t.setHours(0,0,0,0),{from:t,to:e}}case"last7":{const t=new Date(e);return t.setDate(e.getDate()-6),t.setHours(0,0,0,0),{from:t,to:e}}case"last14":{const t=new Date(e);return t.setDate(e.getDate()-13),t.setHours(0,0,0,0),{from:t,to:e}}case"last30":{const t=new Date(e);return t.setDate(e.getDate()-29),t.setHours(0,0,0,0),{from:t,to:e}}case"last3Months":{const t=new Date(e);return t.setMonth(e.getMonth()-3),t.setHours(0,0,0,0),{from:t,to:e}}case"last12Months":{const t=new Date(e);return t.setFullYear(e.getFullYear()-1),t.setHours(0,0,0,0),{from:t,to:e}}case"monthToDate":{const t=new Date(e.getFullYear(),e.getMonth(),1);return t.setHours(0,0,0,0),{from:t,to:e}}case"quarterToDate":{const t=Math.floor(e.getMonth()/3),n=new Date(e.getFullYear(),3*t,1);return n.setHours(0,0,0,0),{from:n,to:e}}case"yearToDate":{const t=new Date(e.getFullYear(),0,1);return t.setHours(0,0,0,0),{from:t,to:e}}case"allTime":{const t=new Date(window.__UR_ANALYTICS__.install_date);return t.setHours(0,0,0,0),{from:t,to:e}}default:return{from:e,to:e}}})(t);h(void 0),c(e),n?.({range:e}),s(!1)})(t)},className:"justify-start",children:e});return(0,l.useEffect)(()=>{o&&(d.current=a,h(void 0))},[o,a]),(0,g.jsxs)(zi,{modal:!1,open:o,onOpenChange:t=>{t||h(void 0),s(t)},children:[(0,g.jsx)(T,{asChild:!0,variant:"outline",children:(0,g.jsxs)(Yi,{children:[(0,g.jsx)("div",{className:"UR-DateRangePicker-TriggerContent",children:(0,g.jsx)("div",{className:"UR-DateRangePicker-DateText",children:(0,g.jsx)("div",{children:`${$s(a?.from,r)}${null!=a?.to?" - "+$s(a.to,r):""}`})})}),(0,g.jsx)("div",{className:"UR-DateRangePicker-Icon",children:(0,g.jsx)(Ws,{size:24})})]})}),(0,g.jsx)($i,{className:"UR-DateRangePicker-Content",align:i,sideOffset:4,children:(0,g.jsxs)("div",{className:"UR-DateRangePicker-Layout",children:[(0,g.jsx)("div",{className:"UR-DateRangePicker-Presets",children:Ys.map(t=>(0,g.jsx)(m,{preset:t.name,label:t.label},t.name))}),(0,g.jsx)("div",{className:"UR-DateRangePicker-Calendar",children:(0,g.jsx)(Hs,{mode:"range",onSelect:t=>{t&&t?.from&&t?.to&&a?.from&&a?.to&&(u?(c(t),n?.({range:t}),h(void 0),s(!1)):a.from.getTime()!==t.from.getTime()?h(t.from):a.to.getTime()!==t.to.getTime()?h(t.to):h(t.from))},selected:u?{from:u,to:u}:a,numberOfMonths:f?1:2,defaultMonth:new Date((new Date).setMonth((new Date).getMonth()-(f?0:1)))})})]})})]})},Qs=l.forwardRef(({children:t,className:e,...n},i)=>(0,g.jsx)("div",{ref:i,className:O("UR-Analytics-Layout",e),...n,children:t}));Qs.displayName="Layout";const Ks=l.forwardRef(({children:t,className:e,...n},i)=>(0,g.jsx)("header",{ref:i,className:O("UR-Analytics-Layout-Header",e),...n,children:t}));Ks.displayName="LayoutHeader";const Xs=l.forwardRef(({children:t,className:e,...n},i)=>(0,g.jsx)("main",{ref:i,className:O("UR-Analytics-Layout-Body",e),...n,children:t}));function Gs(t,[e,n]){return Math.min(n,Math.max(e,t))}Xs.displayName="LayoutBody";Map;var Zs=l.createContext(void 0),Js=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});l.forwardRef((t,e)=>(0,g.jsx)(U.span,{...t,ref:e,style:{...Js,...t.style}})).displayName="VisuallyHidden";var ta=[" ","Enter","ArrowUp","ArrowDown"],ea=[" ","Enter"],na="Select",[ia,ra,oa]=function(t){const e=t+"CollectionProvider",[n,i]=A(e),[r,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=t=>{const{scope:e,children:n}=t,i=l.useRef(null),o=l.useRef(new Map).current;return(0,g.jsx)(r,{scope:e,itemMap:o,collectionRef:i,children:n})};s.displayName=e;const a=t+"CollectionSlot",c=L(a),u=l.forwardRef((t,e)=>{const{scope:n,children:i}=t,r=p(e,o(a,n).collectionRef);return(0,g.jsx)(c,{ref:r,children:i})});u.displayName=a;const h=t+"CollectionItemSlot",d="data-radix-collection-item",f=L(h),m=l.forwardRef((t,e)=>{const{scope:n,children:i,...r}=t,s=l.useRef(null),a=p(e,s),c=o(h,n);return l.useEffect(()=>(c.itemMap.set(s,{ref:s,...r}),()=>{c.itemMap.delete(s)})),(0,g.jsx)(f,{[d]:"",ref:a,children:i})});return m.displayName=h,[{Provider:s,Slot:u,ItemSlot:m},function(e){const n=o(t+"CollectionConsumer",e);return l.useCallback(()=>{const t=n.collectionRef.current;if(!t)return[];const e=Array.from(t.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((t,n)=>e.indexOf(t.ref.current)-e.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},i]}(na),[sa,aa]=A(na,[oa,Ke]),la=Ke(),[ca,ua]=sa(na),[ha,da]=sa(na),fa=t=>{const{__scopeSelect:e,children:n,open:i,defaultOpen:r,onOpenChange:o,value:s,defaultValue:a,onValueChange:c,dir:u,name:h,autoComplete:d,disabled:f,required:p,form:m}=t,y=la(e),[b,v]=l.useState(null),[x,w]=l.useState(null),[_,M]=l.useState(!1),S=function(t){const e=l.useContext(Zs);return t||e||"ltr"}(u),[k,C]=xn({prop:i,defaultProp:r??!1,onChange:o,caller:na}),[D,O]=xn({prop:s,defaultProp:a,onChange:c,caller:na}),R=l.useRef(null),P=!b||m||!!b.closest("form"),[T,E]=l.useState(new Set),A=Array.from(T).map(t=>t.props.value).join(";");return(0,g.jsx)(dn,{...y,children:(0,g.jsxs)(ca,{required:p,scope:e,trigger:b,onTriggerChange:v,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:_,onValueNodeHasChildrenChange:M,contentId:ut(),value:D,onValueChange:O,open:k,onOpenChange:C,dir:S,triggerPointerDownPosRef:R,disabled:f,children:[(0,g.jsx)(ia.Provider,{scope:e,children:(0,g.jsx)(ha,{scope:t.__scopeSelect,onNativeOptionAdd:l.useCallback(t=>{E(e=>new Set(e).add(t))},[]),onNativeOptionRemove:l.useCallback(t=>{E(e=>{const n=new Set(e);return n.delete(t),n})},[]),children:n})}),P?(0,g.jsxs)(Ja,{"aria-hidden":!0,required:p,tabIndex:-1,name:h,autoComplete:d,value:D,onChange:t=>O(t.target.value),disabled:f,form:m,children:[void 0===D?(0,g.jsx)("option",{value:""}):null,Array.from(T)]},A):null]})})};fa.displayName=na;var pa="SelectTrigger",ga=l.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:i=!1,...r}=t,o=la(n),s=ua(pa,n),a=s.disabled||i,c=p(e,s.onTriggerChange),u=ra(n),h=l.useRef("touch"),[d,f,m]=el(t=>{const e=u().filter(t=>!t.disabled),n=e.find(t=>t.value===s.value),i=nl(e,t,n);void 0!==i&&s.onValueChange(i.value)}),y=t=>{a||(s.onOpenChange(!0),m()),t&&(s.triggerPointerDownPosRef.current={x:Math.round(t.pageX),y:Math.round(t.pageY)})};return(0,g.jsx)(fn,{asChild:!0,...o,children:(0,g.jsx)(U.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tl(s.value)?"":void 0,...r,ref:c,onClick:E(r.onClick,t=>{t.currentTarget.focus(),"mouse"!==h.current&&y(t)}),onPointerDown:E(r.onPointerDown,t=>{h.current=t.pointerType;const e=t.target;e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId),0===t.button&&!1===t.ctrlKey&&"mouse"===t.pointerType&&(y(t),t.preventDefault())}),onKeyDown:E(r.onKeyDown,t=>{const e=""!==d.current;t.ctrlKey||t.altKey||t.metaKey||1!==t.key.length||f(t.key),e&&" "===t.key||ta.includes(t.key)&&(y(),t.preventDefault())})})})});ga.displayName=pa;var ma="SelectValue",ya=l.forwardRef((t,e)=>{const{__scopeSelect:n,className:i,style:r,children:o,placeholder:s="",...a}=t,l=ua(ma,n),{onValueNodeHasChildrenChange:c}=l,u=void 0!==o,h=p(e,l.onValueNodeChange);return at(()=>{c(u)},[c,u]),(0,g.jsx)(U.span,{...a,ref:h,style:{pointerEvents:"none"},children:tl(l.value)?(0,g.jsx)(g.Fragment,{children:s}):o})});ya.displayName=ma;var ba=l.forwardRef((t,e)=>{const{__scopeSelect:n,children:i,...r}=t;return(0,g.jsx)(U.span,{"aria-hidden":!0,...r,ref:e,children:i||"▼"})});ba.displayName="SelectIcon";var va=t=>(0,g.jsx)(mn,{asChild:!0,...t});va.displayName="SelectPortal";var xa="SelectContent",wa=l.forwardRef((t,e)=>{const n=ua(xa,t.__scopeSelect),[i,r]=l.useState();if(at(()=>{r(new DocumentFragment)},[]),!n.open){const e=i;return e?I.createPortal((0,g.jsx)(Ma,{scope:t.__scopeSelect,children:(0,g.jsx)(ia.Slot,{scope:t.__scopeSelect,children:(0,g.jsx)("div",{children:t.children})})}),e):null}return(0,g.jsx)(Ca,{...t,ref:e})});wa.displayName=xa;var _a=10,[Ma,Sa]=sa(xa),ka=L("SelectContent.RemoveScroll"),Ca=l.forwardRef((t,e)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:c,align:u,alignOffset:h,arrowPadding:d,collisionBoundary:f,collisionPadding:m,sticky:y,hideWhenDetached:b,avoidCollisions:v,...x}=t,w=ua(xa,n),[_,M]=l.useState(null),[S,k]=l.useState(null),C=p(e,t=>M(t)),[D,O]=l.useState(null),[R,P]=l.useState(null),T=ra(n),[A,N]=l.useState(!1),I=l.useRef(!1);l.useEffect(()=>{if(_)return Dn(_)},[_]),K();const L=l.useCallback(t=>{const[e,...n]=T().map(t=>t.ref.current),[i]=n.slice(-1),r=document.activeElement;for(const n of t){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===e&&S&&(S.scrollTop=0),n===i&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==r)return}},[T,S]),j=l.useCallback(()=>L([D,_]),[L,D,_]);l.useEffect(()=>{A&&j()},[A,j]);const{onOpenChange:F,triggerPointerDownPosRef:W}=w;l.useEffect(()=>{if(_){let t={x:0,y:0};const e=e=>{t={x:Math.abs(Math.round(e.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(e.pageY)-(W.current?.y??0))}},n=n=>{t.x<=10&&t.y<=10?n.preventDefault():_.contains(n.target)||F(!1),document.removeEventListener("pointermove",e),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",e),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",e),document.removeEventListener("pointerup",n,{capture:!0})}}},[_,F,W]),l.useEffect(()=>{const t=()=>F(!1);return window.addEventListener("blur",t),window.addEventListener("resize",t),()=>{window.removeEventListener("blur",t),window.removeEventListener("resize",t)}},[F]);const[U,B]=el(t=>{const e=T().filter(t=>!t.disabled),n=e.find(t=>t.ref.current===document.activeElement),i=nl(e,t,n);i&&setTimeout(()=>i.ref.current.focus())}),H=l.useCallback((t,e,n)=>{const i=!I.current&&!n;(void 0!==w.value&&w.value===e||i)&&(O(t),i&&(I.current=!0))},[w.value]),z=l.useCallback(()=>_?.focus(),[_]),Y=l.useCallback((t,e,n)=>{const i=!I.current&&!n;(void 0!==w.value&&w.value===e||i)&&P(t)},[w.value]),q="popper"===i?Oa:Da,V=q===Oa?{side:a,sideOffset:c,align:u,alignOffset:h,arrowPadding:d,collisionBoundary:f,collisionPadding:m,sticky:y,hideWhenDetached:b,avoidCollisions:v}:{};return(0,g.jsx)(Ma,{scope:n,content:_,viewport:S,onViewportChange:k,itemRefCallback:H,selectedItem:D,onItemLeave:z,itemTextRefCallback:Y,focusSelectedItem:j,selectedItemText:R,position:i,isPositioned:A,searchRef:U,children:(0,g.jsx)(di,{as:ka,allowPinchZoom:!0,children:(0,g.jsx)(tt,{asChild:!0,trapped:w.open,onMountAutoFocus:t=>{t.preventDefault()},onUnmountAutoFocus:E(r,t=>{w.trigger?.focus({preventScroll:!0}),t.preventDefault()}),children:(0,g.jsx)($,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:t=>t.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:(0,g.jsx)(q,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:t=>t.preventDefault(),...x,...V,onPlaced:()=>N(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:E(x.onKeyDown,t=>{const e=t.ctrlKey||t.altKey||t.metaKey;if("Tab"===t.key&&t.preventDefault(),e||1!==t.key.length||B(t.key),["ArrowUp","ArrowDown","Home","End"].includes(t.key)){let e=T().filter(t=>!t.disabled).map(t=>t.ref.current);if(["ArrowUp","End"].includes(t.key)&&(e=e.slice().reverse()),["ArrowUp","ArrowDown"].includes(t.key)){const n=t.target,i=e.indexOf(n);e=e.slice(i+1)}setTimeout(()=>L(e)),t.preventDefault()}})})})})})})});Ca.displayName="SelectContentImpl";var Da=l.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:i,...r}=t,o=ua(xa,n),s=Sa(xa,n),[a,c]=l.useState(null),[u,h]=l.useState(null),d=p(e,t=>h(t)),f=ra(n),m=l.useRef(!1),y=l.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:x,focusSelectedItem:w}=s,_=l.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&u&&b&&v&&x){const t=o.trigger.getBoundingClientRect(),e=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),r=x.getBoundingClientRect();if("rtl"!==o.dir){const i=r.left-e.left,o=n.left-i,s=t.left-o,l=t.width+s,c=Math.max(l,e.width),u=window.innerWidth-_a,h=Gs(o,[_a,Math.max(_a,u-c)]);a.style.minWidth=l+"px",a.style.left=h+"px"}else{const i=e.right-r.right,o=window.innerWidth-n.right-i,s=window.innerWidth-t.right-o,l=t.width+s,c=Math.max(l,e.width),u=window.innerWidth-_a,h=Gs(o,[_a,Math.max(_a,u-c)]);a.style.minWidth=l+"px",a.style.right=h+"px"}const s=f(),l=window.innerHeight-2*_a,c=b.scrollHeight,h=window.getComputedStyle(u),d=parseInt(h.borderTopWidth,10),p=parseInt(h.paddingTop,10),g=parseInt(h.borderBottomWidth,10),y=d+p+c+parseInt(h.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,y),_=window.getComputedStyle(b),M=parseInt(_.paddingTop,10),S=parseInt(_.paddingBottom,10),k=t.top+t.height/2-_a,C=l-k,D=v.offsetHeight/2,O=d+p+(v.offsetTop+D),R=y-O;if(O<=k){const t=s.length>0&&v===s[s.length-1].ref.current;a.style.bottom="0px";const e=u.clientHeight-b.offsetTop-b.offsetHeight,n=O+Math.max(C,D+(t?S:0)+e+g);a.style.height=n+"px"}else{const t=s.length>0&&v===s[0].ref.current;a.style.top="0px";const e=Math.max(k,d+b.offsetTop+(t?M:0)+D)+R;a.style.height=e+"px",b.scrollTop=O-k+b.offsetTop}a.style.margin=`${_a}px 0`,a.style.minHeight=w+"px",a.style.maxHeight=l+"px",i?.(),requestAnimationFrame(()=>m.current=!0)}},[f,o.trigger,o.valueNode,a,u,b,v,x,o.dir,i]);at(()=>_(),[_]);const[M,S]=l.useState();at(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const k=l.useCallback(t=>{t&&!0===y.current&&(_(),w?.(),y.current=!1)},[_,w]);return(0,g.jsx)(Ra,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:(0,g.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:(0,g.jsx)(U.div,{...r,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Da.displayName="SelectItemAlignedPosition";var Oa=l.forwardRef((t,e)=>{const{__scopeSelect:n,align:i="start",collisionPadding:r=_a,...o}=t,s=la(n);return(0,g.jsx)(pn,{...s,...o,ref:e,align:i,collisionPadding:r,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Oa.displayName="SelectPopperPosition";var[Ra,Pa]=sa(xa,{}),Ta="SelectViewport",Ea=l.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:i,...r}=t,o=Sa(Ta,n),s=Pa(Ta,n),a=p(e,o.onViewportChange),c=l.useRef(0);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),(0,g.jsx)(ia.Slot,{scope:n,children:(0,g.jsx)(U.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E(r.onScroll,t=>{const e=t.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:i}=s;if(i?.current&&n){const t=Math.abs(c.current-e.scrollTop);if(t>0){const i=window.innerHeight-2*_a,r=parseFloat(n.style.minHeight),o=parseFloat(n.style.height),s=Math.max(r,o);if(s<i){const r=s+t,o=Math.min(i,r),a=r-o;n.style.height=o+"px","0px"===n.style.bottom&&(e.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}c.current=e.scrollTop})})})]})});Ea.displayName=Ta;var Aa="SelectGroup",[Na,Ia]=sa(Aa),La=l.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,r=ut();return(0,g.jsx)(Na,{scope:n,id:r,children:(0,g.jsx)(U.div,{role:"group","aria-labelledby":r,...i,ref:e})})});La.displayName=Aa;var ja="SelectLabel";l.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,r=Ia(ja,n);return(0,g.jsx)(U.div,{id:r.id,...i,ref:e})}).displayName=ja;var Fa="SelectItem",[Wa,Ua]=sa(Fa),Ba=l.forwardRef((t,e)=>{const{__scopeSelect:n,value:i,disabled:r=!1,textValue:o,...s}=t,a=ua(Fa,n),c=Sa(Fa,n),u=a.value===i,[h,d]=l.useState(o??""),[f,m]=l.useState(!1),y=p(e,t=>c.itemRefCallback?.(t,i,r)),b=ut(),v=l.useRef("touch"),x=()=>{r||(a.onValueChange(i),a.onOpenChange(!1))};if(""===i)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,g.jsx)(Wa,{scope:n,value:i,disabled:r,textId:b,isSelected:u,onItemTextChange:l.useCallback(t=>{d(e=>e||(t?.textContent??"").trim())},[]),children:(0,g.jsx)(ia.ItemSlot,{scope:n,value:i,disabled:r,textValue:h,children:(0,g.jsx)(U.div,{role:"option","aria-labelledby":b,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:y,onFocus:E(s.onFocus,()=>m(!0)),onBlur:E(s.onBlur,()=>m(!1)),onClick:E(s.onClick,()=>{"mouse"!==v.current&&x()}),onPointerUp:E(s.onPointerUp,()=>{"mouse"===v.current&&x()}),onPointerDown:E(s.onPointerDown,t=>{v.current=t.pointerType}),onPointerMove:E(s.onPointerMove,t=>{v.current=t.pointerType,r?c.onItemLeave?.():"mouse"===v.current&&t.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(s.onPointerLeave,t=>{t.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:E(s.onKeyDown,t=>{""!==c.searchRef?.current&&" "===t.key||(ea.includes(t.key)&&x()," "===t.key&&t.preventDefault())})})})})});Ba.displayName=Fa;var Ha="SelectItemText",za=l.forwardRef((t,e)=>{const{__scopeSelect:n,className:i,style:r,...o}=t,s=ua(Ha,n),a=Sa(Ha,n),c=Ua(Ha,n),u=da(Ha,n),[h,d]=l.useState(null),f=p(e,t=>d(t),c.onItemTextChange,t=>a.itemTextRefCallback?.(t,c.value,c.disabled)),m=h?.textContent,y=l.useMemo(()=>(0,g.jsx)("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:b,onNativeOptionRemove:v}=u;return at(()=>(b(y),()=>v(y)),[b,v,y]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(U.span,{id:c.textId,...o,ref:f}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?I.createPortal(o.children,s.valueNode):null]})});za.displayName=Ha;var Ya="SelectItemIndicator",$a=l.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t;return Ua(Ya,n).isSelected?(0,g.jsx)(U.span,{"aria-hidden":!0,...i,ref:e}):null});$a.displayName=Ya;var qa="SelectScrollUpButton",Va=l.forwardRef((t,e)=>{const n=Sa(qa,t.__scopeSelect),i=Pa(qa,t.__scopeSelect),[r,o]=l.useState(!1),s=p(e,i.onScrollButtonChange);return at(()=>{if(n.viewport&&n.isPositioned){let t=function(){const t=e.scrollTop>0;o(t)};const e=n.viewport;return t(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[n.viewport,n.isPositioned]),r?(0,g.jsx)(Xa,{...t,ref:s,onAutoScroll:()=>{const{viewport:t,selectedItem:e}=n;t&&e&&(t.scrollTop=t.scrollTop-e.offsetHeight)}}):null});Va.displayName=qa;var Qa="SelectScrollDownButton",Ka=l.forwardRef((t,e)=>{const n=Sa(Qa,t.__scopeSelect),i=Pa(Qa,t.__scopeSelect),[r,o]=l.useState(!1),s=p(e,i.onScrollButtonChange);return at(()=>{if(n.viewport&&n.isPositioned){let t=function(){const t=e.scrollHeight-e.clientHeight,n=Math.ceil(e.scrollTop)<t;o(n)};const e=n.viewport;return t(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[n.viewport,n.isPositioned]),r?(0,g.jsx)(Xa,{...t,ref:s,onAutoScroll:()=>{const{viewport:t,selectedItem:e}=n;t&&e&&(t.scrollTop=t.scrollTop+e.offsetHeight)}}):null});Ka.displayName=Qa;var Xa=l.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:i,...r}=t,o=Sa("SelectScrollButton",n),s=l.useRef(null),a=ra(n),c=l.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return l.useEffect(()=>()=>c(),[c]),at(()=>{const t=a().find(t=>t.ref.current===document.activeElement);t?.ref.current?.scrollIntoView({block:"nearest"})},[a]),(0,g.jsx)(U.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:E(r.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(i,50))}),onPointerMove:E(r.onPointerMove,()=>{o.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(i,50))}),onPointerLeave:E(r.onPointerLeave,()=>{c()})})}),Ga=l.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t;return(0,g.jsx)(U.div,{"aria-hidden":!0,...i,ref:e})});Ga.displayName="SelectSeparator";var Za="SelectArrow";l.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,r=la(n),o=ua(Za,n),s=Sa(Za,n);return o.open&&"popper"===s.position?(0,g.jsx)(gn,{...r,...i,ref:e}):null}).displayName=Za;var Ja=l.forwardRef(({__scopeSelect:t,value:e,...n},i)=>{const r=l.useRef(null),o=p(i,r),s=function(t){const e=l.useRef({value:t,previous:t});return l.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}(e);return l.useEffect(()=>{const t=r.current;if(!t)return;const n=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(n,"value").set;if(s!==e&&i){const n=new Event("change",{bubbles:!0});i.call(t,e),t.dispatchEvent(n)}},[s,e]),(0,g.jsx)(U.select,{...n,style:{...Js,...n.style},ref:o,defaultValue:e})});function tl(t){return""===t||void 0===t}function el(t){const e=B(t),n=l.useRef(""),i=l.useRef(0),r=l.useCallback(t=>{const r=n.current+t;e(r),function t(e){n.current=e,window.clearTimeout(i.current),""!==e&&(i.current=window.setTimeout(()=>t(""),1e3))}(r)},[e]),o=l.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,r,o]}function nl(t,e,n){const i=e.length>1&&Array.from(e).every(t=>t===e[0])?e[0]:e,r=n?t.indexOf(n):-1;let o=(s=t,a=Math.max(r,0),s.map((t,e)=>s[(a+e)%s.length]));var s,a;1===i.length&&(o=o.filter(t=>t!==n));const l=o.find(t=>t.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}Ja.displayName="SelectBubbleInput";var il=fa,rl=ga,ol=ya,sl=ba,al=va,ll=wa,cl=Ea,ul=La,hl=Ba,dl=za,fl=$a,pl=Va,gl=Ka,ml=Ga;function yl({...t}){return(0,g.jsx)(il,{"data-slot":"select",...t})}function bl({...t}){return(0,g.jsx)(ul,{"data-slot":"select-group",...t})}function vl({...t}){return(0,g.jsx)(ol,{"data-slot":"select-value",...t})}function xl({className:t,size:e="default",children:n,...i}){return(0,g.jsxs)(rl,{"data-slot":"select-trigger","data-size":e,className:O("UR-UI-Select-Trigger",t),...i,children:[n,(0,g.jsx)(sl,{asChild:!0,children:(0,g.jsx)(Ws,{className:"UR-UI-Select-ChevronDownIcon",size:16})})]})}function wl({className:t,children:e,position:n="popper",align:i="center",...r}){return(0,g.jsx)(al,{children:(0,g.jsxs)(ll,{"data-slot":"select-content",className:O("UR-UI-Select-Content","popper"===n&&"UR-UI-Select-Content--popper",t),position:n,align:i,...r,children:[(0,g.jsx)(Sl,{}),(0,g.jsx)(cl,{className:O("UR-UI-Select-Viewport","popper"===n&&"UR-UI-Select-Viewport--popper"),children:e}),(0,g.jsx)(kl,{})]})})}function _l({className:t,children:e,...n}){return(0,g.jsxs)(hl,{"data-slot":"select-item",className:O("UR-UI-Select-Item",t),...n,children:[(0,g.jsx)("span",{className:"UR-UI-Select-ItemIndicator",children:(0,g.jsx)(fl,{children:(0,g.jsx)(js,{className:"UR-UI-Select-CheckIcon",size:16})})}),(0,g.jsx)(dl,{children:e})]})}function Ml({className:t,...e}){return(0,g.jsx)(ml,{"data-slot":"select-separator",className:O("UR-UI-Select-Separator",t),...e})}function Sl({className:t,...e}){return(0,g.jsx)(pl,{"data-slot":"select-scroll-up-button",className:O("UR-UI-Select-ScrollUpButton",t),...e,children:(0,g.jsx)(Fs,{className:"UR-UI-Select-ChevronUpIcon",size:16})})}function kl({className:t,...e}){return(0,g.jsx)(gl,{"data-slot":"select-scroll-down-button",className:O("UR-UI-Select-ScrollDownButton",t),...e,children:(0,g.jsx)(Ws,{className:"UR-UI-Select-ChevronDownIcon",size:16})})}const Cl=window.wp.i18n,Dl=(t,e)=>{const n=Math.abs(e.getTime()-t.getTime());return Math.ceil(n/864e5)},Ol=t=>t<=1?["hour"]:t<=7?["day","hour"]:t<=14||t<=30?["day","week"]:t<=90?["week","month"]:t<=365?["month"]:["year"],Rl=[{label:(0,Cl.__)("Hour"),value:"hour"},{label:(0,Cl.__)("Day"),value:"day"},{label:(0,Cl.__)("Week"),value:"week"},{label:(0,Cl.__)("Month"),value:"month"},{label:(0,Cl.__)("Year"),value:"year"}],Pl=t=>null==t?null:"boolean"==typeof t?t?"true":"false":String(t),Tl=(t,e)=>{if(null===t)return null;switch(e){case"number":const e=Number(t);return isNaN(e)?null:e;case"boolean":return"true"===t;default:return t}},El=t=>{if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;const e=new Date(t);return!isNaN(e.getTime())&&e.toISOString().startsWith(t)},Al=t=>t&&El(t)?t:null,Nl=t=>"hour"===t||"day"===t||"week"===t||"month"===t||"year"===t?t:null;function Il(){const[t,e]=function(t){const e=(0,l.useRef)(t),n=(0,l.useMemo)(()=>(JSON.stringify(e.current)===JSON.stringify(t)||(e.current=t),e.current),[t]),i=(0,l.useCallback)(()=>{const t=new URLSearchParams(window.location.search),e={};for(const[r,o]of Object.entries(n)){var i;const n=t.get(r),s=Tl(n,o.type);e[r]=null!==(i=null!=s?s:o.default)&&void 0!==i?i:null}return e},[n]),[r,o]=(0,l.useState)(i);(0,l.useEffect)(()=>{const t=()=>{o(i())};return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)},[i]),(0,l.useEffect)(()=>{window.location.search;const t=i();JSON.stringify(r)!==JSON.stringify(t)&&o(t)},[window.location.search]);const s=(0,l.useCallback)(t=>{o(e=>{const n="function"==typeof t?{...e,...t(e)}:{...e,...t},i=new URLSearchParams;for(const[t,e]of Object.entries(n)){const n=Pl(e);null!==n&&i.set(t,n)}const r=`${window.location.pathname}?${i.toString()}`;return window.history.pushState({},"",r),n})},[]);return[r,s]}({"date-from":{type:"string"},"date-to":{type:"string"},unit:{type:"string"},scope:{type:"string",default:"all"},membership:{type:"number"},page:{type:"string"}}),n={dateFrom:Al(t["date-from"])||void 0,dateTo:Al(t["date-to"])||void 0,unit:Nl(t.unit)||void 0,scope:t.scope||void 0,membership:t.membership||void 0},i=(0,l.useCallback)(()=>{if(!n.dateFrom||!n.dateTo)return["day","week"];const t=new Date(n.dateFrom),e=new Date(n.dateTo),i=Dl(t,e),r=Ol(i),o=["hour","day","week","month","year"],s=r.filter(t=>o.includes(t));return s.length>0?s:["day"]},[n.dateFrom,n.dateTo]),r=i();(0,l.useEffect)(()=>{if(!n.unit||!r.includes(n.unit)){const t=r[0];t&&t!==n.unit&&e(e=>({...e,unit:t}))}},[n.unit,r,e]);const o=(0,l.useCallback)(t=>!t.dateFrom||!t.dateTo||new Date(t.dateFrom)<=new Date(t.dateTo),[]),s=(0,l.useCallback)(n=>{const i={dateFrom:Al(t["date-from"])||void 0,dateTo:Al(t["date-to"])||void 0,unit:Nl(t.unit)||void 0,scope:t.scope||void 0,membership:t.membership||void 0},r={...i,..."function"==typeof n?n(i):n};if(r.dateFrom&&!El(r.dateFrom))return void console.warn(`Invalid dateFrom: ${r.dateFrom}`);if(r.dateTo&&!El(r.dateTo))return void console.warn(`Invalid dateTo: ${r.dateTo}`);if(!o(r))return void console.warn("Invalid date range: dateFrom must be before or equal to dateTo");if(r.unit&&!["hour","day","week","month","year"].includes(r.unit))return void console.warn(`Invalid unit: ${r.unit}`);if(r.scope&&!["all","others","membership"].includes(r.scope))return void console.warn(`Invalid scope: ${r.scope}`);let s=r.unit;if(r.dateFrom&&r.dateTo&&r.unit){const t=new Date(r.dateFrom),e=new Date(r.dateTo),n=Dl(t,e),i=Ol(n),o=["hour","day","week","month","year"],a=i.filter(t=>o.includes(t));a.includes(r.unit)||(s=a.length>0?a[0]:"day")}e({"date-from":r.dateFrom||null,"date-to":r.dateTo||null,unit:s||null,scope:r.scope||"all",membership:r.membership||null})},[t,e,o]),a=(0,l.useCallback)(t=>{if(t){const n={},i={dateFrom:"date-from",dateTo:"date-to",unit:"unit",scope:"scope",membership:"membership"};for(const e of t)n[i[e]]=null;e(n)}else e({"date-from":null,"date-to":null,unit:null,scope:"all",membership:null})},[e]),c=(0,l.useCallback)(t=>{if(t.dateFrom&&!El(t.dateFrom))return void console.warn(`Invalid dateFrom: ${t.dateFrom}`);if(t.dateTo&&!El(t.dateTo))return void console.warn(`Invalid dateTo: ${t.dateTo}`);if(!o(t))return void console.warn("Invalid date range: dateFrom must be before or equal to dateTo");if(t.unit&&!["hour","day","week","month","year"].includes(t.unit))return void console.warn(`Invalid unit: ${t.unit}`);let n=t.unit;if(t.dateFrom&&t.dateTo&&t.unit){const e=new Date(t.dateFrom),i=new Date(t.dateTo),r=Dl(e,i),o=Ol(r),s=["hour","day","week","month","year"],a=o.filter(t=>s.includes(t));a.includes(t.unit)||(n=a.length>0?a[0]:"day")}e({"date-from":t.dateFrom||null,"date-to":t.dateTo||null,unit:n||null,scope:t.scope||"all",membership:t.membership||null})},[e,o]),u={...n,unit:n.unit&&r.includes(n.unit)?n.unit:r.length>0?r[0]:void 0};return{dateFrom:u.dateFrom,dateTo:u.dateTo,unit:u.unit,scope:u.scope,membership:u.membership,filters:u,validUnits:r,isValidDateRange:o(u),setFilters:s,clearFilters:a,replaceFilters:c}}var Ll={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},jl=new class{#t=Ll;#e=!1;setTimeoutProvider(t){this.#t=t}setTimeout(t,e){return this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},Fl=function(t){setTimeout(t,0)},Wl=function(){let t=[],e=0,n=t=>{t()},i=t=>{t()},r=Fl;const o=i=>{e?t.push(i):r(()=>{n(i)})};return{batch:o=>{let s;e++;try{s=o()}finally{e--,e||(()=>{const e=t;t=[],e.length&&r(()=>{i(()=>{e.forEach(t=>{n(t)})})})})()}return s},batchCalls:t=>(...e)=>{o(()=>{t(...e)})},schedule:o,setNotifyFunction:t=>{n=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{r=t}}}(),Ul=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Bl="undefined"==typeof window||"Deno"in globalThis;function Hl(){}function zl(t){return"number"==typeof t&&t>=0&&t!==1/0}function Yl(t,e){return Math.max(t+(e||0)-Date.now(),0)}function $l(t,e){return"function"==typeof t?t(e):t}function ql(t,e){return"function"==typeof t?t(e):t}function Vl(t,e){const{type:n="all",exact:i,fetchStatus:r,predicate:o,queryKey:s,stale:a}=t;if(s)if(i){if(e.queryHash!==Kl(s,e.options))return!1}else if(!Gl(e.queryKey,s))return!1;if("all"!==n){const t=e.isActive();if("active"===n&&!t)return!1;if("inactive"===n&&t)return!1}return!("boolean"==typeof a&&e.isStale()!==a||r&&r!==e.state.fetchStatus||o&&!o(e))}function Ql(t,e){const{exact:n,status:i,predicate:r,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Xl(e.options.mutationKey)!==Xl(o))return!1}else if(!Gl(e.options.mutationKey,o))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function Kl(t,e){return(e?.queryKeyHashFn||Xl)(t)}function Xl(t){return JSON.stringify(t,(t,e)=>nc(e)?Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}):e)}function Gl(t,e){return t===e||typeof t==typeof e&&!(!t||!e||"object"!=typeof t||"object"!=typeof e)&&Object.keys(e).every(n=>Gl(t[n],e[n]))}var Zl=Object.prototype.hasOwnProperty;function Jl(t,e){if(t===e)return t;const n=ec(t)&&ec(e);if(!(n||nc(t)&&nc(e)))return e;const i=(n?t:Object.keys(t)).length,r=n?e:Object.keys(e),o=r.length,s=n?new Array(o):{};let a=0;for(let l=0;l<o;l++){const o=n?l:r[l],c=t[o],u=e[o];if(c===u){s[o]=c,(n?l<i:Zl.call(t,o))&&a++;continue}if(null===c||null===u||"object"!=typeof c||"object"!=typeof u){s[o]=u;continue}const h=Jl(c,u);s[o]=h,h===c&&a++}return i===o&&a===i?t:s}function tc(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function ec(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function nc(t){if(!ic(t))return!1;const e=t.constructor;if(void 0===e)return!0;const n=e.prototype;return!!ic(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function ic(t){return"[object Object]"===Object.prototype.toString.call(t)}function rc(t,e,n){return"function"==typeof n.structuralSharing?n.structuralSharing(t,e):!1!==n.structuralSharing?Jl(t,e):e}function oc(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function sc(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var ac=Symbol();function lc(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==ac?t.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`))}function cc(t,e){return"function"==typeof t?t(...e):!!t}var uc=new class extends Ul{#n;#i;#r;constructor(){super(),this.#r=t=>{if(!Bl&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#i||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(t){this.#r=t,this.#i?.(),this.#i=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#n!==t&&(this.#n=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#n?this.#n:"hidden"!==globalThis.document?.visibilityState}},hc=new class extends Ul{#o=!0;#i;#r;constructor(){super(),this.#r=t=>{if(!Bl&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#i||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(t){this.#r=t,this.#i?.(),this.#i=t(this.setOnline.bind(this))}setOnline(t){this.#o!==t&&(this.#o=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#o}};function dc(){let t,e;const n=new Promise((n,i)=>{t=n,e=i});function i(t){Object.assign(n,t),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},n.reject=t=>{i({status:"rejected",reason:t}),e(t)},n}function fc(t){return Math.min(1e3*2**t,3e4)}function pc(t){return"online"!==(t??"online")||hc.isOnline()}var gc=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function mc(t){let e,n=!1,i=0;const r=dc(),o=()=>"pending"!==r.status,s=()=>uc.isFocused()&&("always"===t.networkMode||hc.isOnline())&&t.canRun(),a=()=>pc(t.networkMode)&&t.canRun(),l=t=>{o()||(e?.(),r.resolve(t))},c=t=>{o()||(e?.(),r.reject(t))},u=()=>new Promise(n=>{e=t=>{(o()||s())&&n(t)},t.onPause?.()}).then(()=>{e=void 0,o()||t.onContinue?.()}),h=()=>{if(o())return;let e;const r=0===i?t.initialPromise:void 0;try{e=r??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(l).catch(e=>{if(o())return;const r=t.retry??(Bl?0:3),a=t.retryDelay??fc,l="function"==typeof a?a(i,e):a,d=!0===r||"number"==typeof r&&i<r||"function"==typeof r&&r(i,e);var f;!n&&d?(i++,t.onFail?.(i,e),(f=l,new Promise(t=>{jl.setTimeout(t,f)})).then(()=>s()?void 0:u()).then(()=>{n?c(e):h()})):c(e)})};return{promise:r,status:()=>r.status,cancel:e=>{if(!o()){const n=new gc(e);c(n),t.onCancel?.(n)}},continue:()=>(e?.(),r),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:a,start:()=>(a()?h():u().then(h),r)}}var yc=class{#s;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zl(this.gcTime)&&(this.#s=jl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Bl?1/0:3e5))}clearGcTimeout(){this.#s&&(jl.clearTimeout(this.#s),this.#s=void 0)}},bc=class extends yc{#a;#l;#c;#u;#h;#d;#f;constructor(t){super(),this.#f=!1,this.#d=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#u=t.client,this.#c=this.#u.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#a=wc(this.options),this.state=t.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(t){if(this.options={...this.#d,...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const t=wc(this.options);void 0!==t.data&&(this.setState(xc(t.data,t.dataUpdatedAt)),this.#a=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(t,e){const n=rc(this.state.data,t,this.options);return this.#p({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#p({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#h?.promise;return this.#h?.cancel(t),e?e.then(Hl).catch(Hl):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(t=>!1!==ql(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ac||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===$l(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!Yl(this.state.dataUpdatedAt,t))}onFocus(){const t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){const t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#h&&(this.#f?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(t,e){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#h?.status())if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise;if(t&&this.setOptions(t),!this.options.queryFn){const t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}const n=new AbortController,i=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#f=!0,n.signal)})},r=()=>{const t=lc(this.options,e),n=(()=>{const t={client:this.#u,queryKey:this.queryKey,meta:this.meta};return i(t),t})();return this.#f=!1,this.options.persister?this.options.persister(t,n,this):t(n)},o=(()=>{const t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:r};return i(t),t})();this.options.behavior?.onFetch(o,this),this.#l=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#p({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=mc({initialPromise:e?.initialPromise,fn:o.fetchFn,onCancel:t=>{t instanceof gc&&t.revert&&this.setState({...this.#l,fetchStatus:"idle"}),n.abort()},onFail:(t,e)=>{this.#p({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const t=await this.#h.start();if(void 0===t)throw new Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#c.config.onSuccess?.(t,this),this.#c.config.onSettled?.(t,this.state.error,this),t}catch(t){if(t instanceof gc){if(t.silent)return this.#h.promise;if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw this.#p({type:"error",error:t}),this.#c.config.onError?.(t,this),this.#c.config.onSettled?.(this.state.data,t,this),t}finally{this.scheduleGc()}}#p(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...vc(e.data,this.options),fetchMeta:t.meta??null};case"success":const n={...e,...xc(t.data,t.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=t.manual?n:void 0,n;case"error":const i=t.error;return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),Wl.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:t})})}};function vc(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pc(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function xc(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function wc(t){const e="function"==typeof t.initialData?t.initialData():t.initialData,n=void 0!==e,i=n?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var _c=class extends Ul{constructor(t,e){super(),this.options=e,this.#u=t,this.#g=null,this.#m=dc(),this.bindMethods(),this.setOptions(e)}#u;#y=void 0;#b=void 0;#v=void 0;#x;#w;#m;#g;#_;#M;#S;#k;#C;#D;#O=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#y.addObserver(this),Mc(this.#y,this.options)?this.#R():this.updateResult(),this.#P())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sc(this.#y,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sc(this.#y,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#T(),this.#E(),this.#y.removeObserver(this)}setOptions(t){const e=this.options,n=this.#y;if(this.options=this.#u.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof ql(this.options.enabled,this.#y))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#A(),this.#y.setOptions(this.options),e._defaulted&&!tc(this.options,e)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#y,observer:this});const i=this.hasListeners();i&&kc(this.#y,n,this.options,e)&&this.#R(),this.updateResult(),!i||this.#y===n&&ql(this.options.enabled,this.#y)===ql(e.enabled,this.#y)&&$l(this.options.staleTime,this.#y)===$l(e.staleTime,this.#y)||this.#N();const r=this.#I();!i||this.#y===n&&ql(this.options.enabled,this.#y)===ql(e.enabled,this.#y)&&r===this.#D||this.#L(r)}getOptimisticResult(t){const e=this.#u.getQueryCache().build(this.#u,t),n=this.createResult(e,t);return i=n,!tc(this.getCurrentResult(),i)&&(this.#v=n,this.#w=this.options,this.#x=this.#y.state),n;var i}getCurrentResult(){return this.#v}trackResult(t,e){return new Proxy(t,{get:(t,n)=>(this.trackProp(n),e?.(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#m.status||this.#m.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,n))})}trackProp(t){this.#O.add(t)}getCurrentQuery(){return this.#y}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#u.defaultQueryOptions(t),n=this.#u.getQueryCache().build(this.#u,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#R({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#v))}#R(t){this.#A();let e=this.#y.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Hl)),e}#N(){this.#T();const t=$l(this.options.staleTime,this.#y);if(Bl||this.#v.isStale||!zl(t))return;const e=Yl(this.#v.dataUpdatedAt,t)+1;this.#k=jl.setTimeout(()=>{this.#v.isStale||this.updateResult()},e)}#I(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#y):this.options.refetchInterval)??!1}#L(t){this.#E(),this.#D=t,!Bl&&!1!==ql(this.options.enabled,this.#y)&&zl(this.#D)&&0!==this.#D&&(this.#C=jl.setInterval(()=>{(this.options.refetchIntervalInBackground||uc.isFocused())&&this.#R()},this.#D))}#P(){this.#N(),this.#L(this.#I())}#T(){this.#k&&(jl.clearTimeout(this.#k),this.#k=void 0)}#E(){this.#C&&(jl.clearInterval(this.#C),this.#C=void 0)}createResult(t,e){const n=this.#y,i=this.options,r=this.#v,o=this.#x,s=this.#w,a=t!==n?t.state:this.#b,{state:l}=t;let c,u={...l},h=!1;if(e._optimisticResults){const r=this.hasListeners(),o=!r&&Mc(t,e),s=r&&kc(t,n,e,i);(o||s)&&(u={...u,...vc(l.data,t.options)}),"isRestoring"===e._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=u;c=u.data;let g=!1;if(void 0!==e.placeholderData&&void 0===c&&"pending"===p){let t;r?.isPlaceholderData&&e.placeholderData===s?.placeholderData?(t=r.data,g=!0):t="function"==typeof e.placeholderData?e.placeholderData(this.#S?.state.data,this.#S):e.placeholderData,void 0!==t&&(p="success",c=rc(r?.data,t,e),h=!0)}if(e.select&&void 0!==c&&!g)if(r&&c===o?.data&&e.select===this.#_)c=this.#M;else try{this.#_=e.select,c=e.select(c),c=rc(r?.data,c,e),this.#M=c,this.#g=null}catch(t){this.#g=t}this.#g&&(d=this.#g,c=this.#M,f=Date.now(),p="error");const m="fetching"===u.fetchStatus,y="pending"===p,b="error"===p,v=y&&m,x=void 0!==c,w={status:p,fetchStatus:u.fetchStatus,isPending:y,isSuccess:"success"===p,isError:b,isInitialLoading:v,isLoading:v,data:c,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!y,isLoadingError:b&&!x,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:b&&x,isStale:Cc(t,e),refetch:this.refetch,promise:this.#m,isEnabled:!1!==ql(e.enabled,t)};if(this.options.experimental_prefetchInRender){const e=t=>{"error"===w.status?t.reject(w.error):void 0!==w.data&&t.resolve(w.data)},i=()=>{const t=this.#m=w.promise=dc();e(t)},r=this.#m;switch(r.status){case"pending":t.queryHash===n.queryHash&&e(r);break;case"fulfilled":"error"!==w.status&&w.data===r.value||i();break;case"rejected":"error"===w.status&&w.error===r.reason||i()}}return w}updateResult(){const t=this.#v,e=this.createResult(this.#y,this.options);this.#x=this.#y.state,this.#w=this.options,void 0!==this.#x.data&&(this.#S=this.#y),tc(e,t)||(this.#v=e,this.#j({listeners:(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,n="function"==typeof e?e():e;if("all"===n||!n&&!this.#O.size)return!0;const i=new Set(n??this.#O);return this.options.throwOnError&&i.add("error"),Object.keys(this.#v).some(e=>{const n=e;return this.#v[n]!==t[n]&&i.has(n)})})()}))}#A(){const t=this.#u.getQueryCache().build(this.#u,this.options);if(t===this.#y)return;const e=this.#y;this.#y=t,this.#b=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#P()}#j(t){Wl.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#v)}),this.#u.getQueryCache().notify({query:this.#y,type:"observerResultsUpdated"})})}};function Mc(t,e){return function(t,e){return!1!==ql(e.enabled,t)&&void 0===t.state.data&&!("error"===t.state.status&&!1===e.retryOnMount)}(t,e)||void 0!==t.state.data&&Sc(t,e,e.refetchOnMount)}function Sc(t,e,n){if(!1!==ql(e.enabled,t)&&"static"!==$l(e.staleTime,t)){const i="function"==typeof n?n(t):n;return"always"===i||!1!==i&&Cc(t,e)}return!1}function kc(t,e,n,i){return(t!==e||!1===ql(i.enabled,t))&&(!n.suspense||"error"!==t.state.status)&&Cc(t,n)}function Cc(t,e){return!1!==ql(e.enabled,t)&&t.isStaleByTime($l(e.staleTime,t))}function Dc(t,e){const n=new Set(e);return t.filter(t=>!n.has(t))}var Oc=class extends Ul{#u;#F;#W;#U;#B;#H;#z;#Y;#$=[];constructor(t,e,n){super(),this.#u=t,this.#U=n,this.#W=[],this.#B=[],this.#F=[],this.setQueries(e)}onSubscribe(){1===this.listeners.size&&this.#B.forEach(t=>{t.subscribe(e=>{this.#q(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#B.forEach(t=>{t.destroy()})}setQueries(t,e){this.#W=t,this.#U=e,Wl.batch(()=>{const t=this.#B,e=this.#V(this.#W);e.forEach(t=>t.observer.setOptions(t.defaultedQueryOptions));const n=e.map(t=>t.observer),i=n.map(t=>t.getCurrentResult()),r=t.length!==n.length,o=n.some((e,n)=>e!==t[n]),s=r||o,a=!!s||i.some((t,e)=>{const n=this.#F[e];return!n||!tc(t,n)});(s||a)&&(s&&(this.#$=e,this.#B=n),this.#F=i,this.hasListeners()&&(s&&(Dc(t,n).forEach(t=>{t.destroy()}),Dc(n,t).forEach(t=>{t.subscribe(e=>{this.#q(t,e)})})),this.#j()))})}getCurrentResult(){return this.#F}getQueries(){return this.#B.map(t=>t.getCurrentQuery())}getObservers(){return this.#B}getOptimisticResult(t,e){const n=this.#V(t),i=n.map(t=>t.observer.getOptimisticResult(t.defaultedQueryOptions));return[i,t=>this.#Q(t??i,e),()=>this.#K(i,n)]}#K(t,e){return e.map((n,i)=>{const r=t[i];return n.defaultedQueryOptions.notifyOnChangeProps?r:n.observer.trackResult(r,t=>{e.forEach(e=>{e.observer.trackProp(t)})})})}#Q(t,e){return e?(this.#H&&this.#F===this.#Y&&e===this.#z||(this.#z=e,this.#Y=this.#F,this.#H=Jl(this.#H,e(t))),this.#H):t}#V(t){const e=new Map;this.#B.forEach(t=>{const n=t.options.queryHash;if(!n)return;const i=e.get(n);i?i.push(t):e.set(n,[t])});const n=[];return t.forEach(t=>{const i=this.#u.defaultQueryOptions(t),r=e.get(i.queryHash)?.shift(),o=r??new _c(this.#u,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#q(t,e){const n=this.#B.indexOf(t);-1!==n&&(this.#F=function(t,e,n){const i=t.slice(0);return i[e]=n,i}(this.#F,n,e),this.#j())}#j(){if(this.hasListeners()){const t=this.#H,e=this.#K(this.#F,this.#$);t!==this.#Q(e,this.#U?.combine)&&Wl.batch(()=>{this.listeners.forEach(t=>{t(this.#F)})})}}},Rc=l.createContext(void 0),Pc=t=>{const e=l.useContext(Rc);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Tc=({client:t,children:e})=>(l.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,g.jsx)(Rc.Provider,{value:t,children:e})),Ec=l.createContext(!1);Ec.Provider;var Ac=l.createContext(function(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}()),Nc=(t,e)=>t?.suspense&&e.isPending,Ic=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});const Lc=window.wp.apiFetch;var jc=r.n(Lc);const Fc=Ls("MoveUp",[["path",{d:"M8 6L12 2L16 6"}],["path",{d:"M12 2V22"}]]),Wc=Ls("MoveDown",[["path",{d:"M8 18L12 22L16 18"}],["path",{d:"M12 2V22"}]]);function Uc(t){return t+.5|0}const Bc=(t,e,n)=>Math.max(Math.min(t,n),e);function Hc(t){return Bc(Uc(2.55*t),0,255)}function zc(t){return Bc(Uc(255*t),0,255)}function Yc(t){return Bc(Uc(t/2.55)/100,0,1)}function $c(t){return Bc(Uc(100*t),0,100)}const qc={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},Vc=[..."0123456789ABCDEF"],Qc=t=>Vc[15&t],Kc=t=>Vc[(240&t)>>4]+Vc[15&t],Xc=t=>(240&t)>>4==(15&t);const Gc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Zc(t,e,n){const i=e*Math.min(n,1-n),r=(e,r=(e+t/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function Jc(t,e,n){const i=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function tu(t,e,n){const i=Zc(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function eu(t){const e=t.r/255,n=t.g/255,i=t.b/255,r=Math.max(e,n,i),o=Math.min(e,n,i),s=(r+o)/2;let a,l,c;return r!==o&&(c=r-o,l=s>.5?c/(2-r-o):c/(r+o),a=function(t,e,n,i,r){return t===r?(e-n)/i+(e<n?6:0):e===r?(n-t)/i+2:(t-e)/i+4}(e,n,i,c,r),a=60*a+.5),[0|a,l||0,s]}function nu(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(zc)}function iu(t,e,n){return nu(Zc,t,e,n)}function ru(t){return(t%360+360)%360}const ou={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"},su={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"};let au;const lu=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,cu=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,uu=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function hu(t,e,n){if(t){let i=eu(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,0===e?360:1)),i=iu(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function du(t,e){return t?Object.assign(e||{},t):t}function fu(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=zc(t[3]))):(e=du(t,{r:0,g:0,b:0,a:1})).a=zc(e.a),e}function pu(t){return"r"===t.charAt(0)?function(t){const e=lu.exec(t);let n,i,r,o=255;if(e){if(e[7]!==n){const t=+e[7];o=e[8]?Hc(t):Bc(255*t,0,255)}return n=+e[1],i=+e[3],r=+e[5],n=255&(e[2]?Hc(n):Bc(n,0,255)),i=255&(e[4]?Hc(i):Bc(i,0,255)),r=255&(e[6]?Hc(r):Bc(r,0,255)),{r:n,g:i,b:r,a:o}}}(t):function(t){const e=Gc.exec(t);let n,i=255;if(!e)return;e[5]!==n&&(i=e[6]?Hc(+e[5]):zc(+e[5]));const r=ru(+e[2]),o=+e[3]/100,s=+e[4]/100;return n="hwb"===e[1]?function(t,e,n){return nu(tu,t,e,n)}(r,o,s):"hsv"===e[1]?function(t,e,n){return nu(Jc,t,e,n)}(r,o,s):iu(r,o,s),{r:n[0],g:n[1],b:n[2],a:i}}(t)}class gu{constructor(t){if(t instanceof gu)return t;const e=typeof t;let n;var i,r,o;"object"===e?n=fu(t):"string"===e&&(o=(i=t).length,"#"===i[0]&&(4===o||5===o?r={r:255&17*qc[i[1]],g:255&17*qc[i[2]],b:255&17*qc[i[3]],a:5===o?17*qc[i[4]]:255}:7!==o&&9!==o||(r={r:qc[i[1]]<<4|qc[i[2]],g:qc[i[3]]<<4|qc[i[4]],b:qc[i[5]]<<4|qc[i[6]],a:9===o?qc[i[7]]<<4|qc[i[8]]:255})),n=r||function(t){au||(au=function(){const t={},e=Object.keys(su),n=Object.keys(ou);let i,r,o,s,a;for(i=0;i<e.length;i++){for(s=a=e[i],r=0;r<n.length;r++)o=n[r],a=a.replace(o,ou[o]);o=parseInt(su[s],16),t[a]=[o>>16&255,o>>8&255,255&o]}return t}(),au.transparent=[0,0,0,0]);const e=au[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||pu(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=du(this._rgb);return t&&(t.a=Yc(t.a)),t}set rgb(t){this._rgb=fu(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Yc(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>Xc(t.r)&&Xc(t.g)&&Xc(t.b)&&Xc(t.a))(t)?Qc:Kc,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=eu(t),n=e[0],i=$c(e[1]),r=$c(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${r}%, ${Yc(t.a)})`:`hsl(${n}, ${i}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,i=t.rgb;let r;const o=e===r?.5:e,s=2*o-1,a=n.a-i.a,l=((s*a===-1?s:(s+a)/(1+s*a))+1)/2;r=1-l,n.r=255&l*n.r+r*i.r+.5,n.g=255&l*n.g+r*i.g+.5,n.b=255&l*n.b+r*i.b+.5,n.a=o*n.a+(1-o)*i.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,n){const i=uu(Yc(t.r)),r=uu(Yc(t.g)),o=uu(Yc(t.b));return{r:zc(cu(i+n*(uu(Yc(e.r))-i))),g:zc(cu(r+n*(uu(Yc(e.g))-r))),b:zc(cu(o+n*(uu(Yc(e.b))-o))),a:t.a+n*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new gu(this.rgb)}alpha(t){return this._rgb.a=zc(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=Uc(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return hu(this._rgb,2,t),this}darken(t){return hu(this._rgb,2,-t),this}saturate(t){return hu(this._rgb,1,t),this}desaturate(t){return hu(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=eu(t);n[0]=ru(n[0]+e),n=iu(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function mu(){}const yu=(()=>{let t=0;return()=>t++})();function bu(t){return null==t}function vu(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function xu(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function wu(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function _u(t,e){return wu(t)?t:e}function Mu(t,e){return void 0===t?e:t}const Su=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ku(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function Cu(t,e,n,i){let r,o,s;if(vu(t))if(o=t.length,i)for(r=o-1;r>=0;r--)e.call(n,t[r],r);else for(r=0;r<o;r++)e.call(n,t[r],r);else if(xu(t))for(s=Object.keys(t),o=s.length,r=0;r<o;r++)e.call(n,t[s[r]],s[r])}function Du(t,e){let n,i,r,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(r=t[n],o=e[n],r.datasetIndex!==o.datasetIndex||r.index!==o.index)return!1;return!0}function Ou(t){if(vu(t))return t.map(Ou);if(xu(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let r=0;for(;r<i;++r)e[n[r]]=Ou(t[n[r]]);return e}return t}function Ru(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function Pu(t,e,n,i){if(!Ru(t))return;const r=e[t],o=n[t];xu(r)&&xu(o)?Tu(r,o,i):e[t]=Ou(o)}function Tu(t,e,n){const i=vu(e)?e:[e],r=i.length;if(!xu(t))return t;const o=(n=n||{}).merger||Pu;let s;for(let e=0;e<r;++e){if(s=i[e],!xu(s))continue;const r=Object.keys(s);for(let e=0,i=r.length;e<i;++e)o(r[e],t,s,n)}return t}function Eu(t,e){return Tu(t,e,{merger:Au})}function Au(t,e,n){if(!Ru(t))return;const i=e[t],r=n[t];xu(i)&&xu(r)?Eu(i,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ou(r))}const Nu={"":t=>t,x:t=>t.x,y:t=>t.y};function Iu(t,e){const n=Nu[e]||(Nu[e]=function(t){const e=function(t){const e=t.split("."),n=[];let i="";for(const t of e)i+=t,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}(t);return t=>{for(const n of e){if(""===n)break;t=t&&t[n]}return t}}(e));return n(t)}function Lu(t){return t.charAt(0).toUpperCase()+t.slice(1)}const ju=t=>void 0!==t,Fu=t=>"function"==typeof t,Wu=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0},Uu=Math.PI,Bu=2*Uu,Hu=Bu+Uu,zu=Number.POSITIVE_INFINITY,Yu=Uu/180,$u=Uu/2,qu=Uu/4,Vu=2*Uu/3,Qu=Math.log10,Ku=Math.sign;function Xu(t,e,n){return Math.abs(t-e)<n}function Gu(t){const e=Math.round(t);t=Xu(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Qu(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Zu(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Ju(t){return t*(Uu/180)}function th(t){if(!wu(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function eh(t,e){const n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*Uu&&(o+=Bu),{angle:o,distance:r}}function nh(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ih(t,e){return(t-e+Hu)%Bu-Uu}function rh(t){return(t%Bu+Bu)%Bu}function oh(t,e,n,i){const r=rh(t),o=rh(e),s=rh(n),a=rh(o-r),l=rh(s-r),c=rh(r-o),u=rh(r-s);return r===o||r===s||i&&o===s||a>l&&c<u}function sh(t,e,n){return Math.max(e,Math.min(n,t))}function ah(t,e,n,i=1e-6){return t>=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function lh(t,e,n){n=n||(n=>t[n]<e);let i,r=t.length-1,o=0;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const ch=(t,e,n,i)=>lh(t,n,i?i=>{const r=t[i][e];return r<n||r===n&&t[i+1][e]===n}:i=>t[i][e]<n),uh=(t,e,n)=>lh(t,n,i=>t[i][e]>=n),hh=["push","pop","shift","splice","unshift"];function dh(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(hh.forEach(e=>{delete t[e]}),delete t._chartjs)}const fh="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function ph(t,e){let n=[],i=!1;return function(...r){n=r,i||(i=!0,fh.call(window,()=>{i=!1,t.apply(e,n)}))}}const gh=t=>"start"===t?"left":"end"===t?"right":"center",mh=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;const yh=t=>0===t||1===t,bh=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Bu/n),vh=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Bu/n)+1,xh={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=>1-Math.cos(t*$u),easeOutSine:t=>Math.sin(t*$u),easeInOutSine:t=>-.5*(Math.cos(Uu*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>yh(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),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=>yh(t)?t:bh(t,.075,.3),easeOutElastic:t=>yh(t)?t:vh(t,.075,.3),easeInOutElastic(t){const e=.1125;return yh(t)?t:t<.5?.5*bh(2*t,e,.45):.5+.5*vh(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-xh.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*xh.easeInBounce(2*t):.5*xh.easeOutBounce(2*t-1)+.5};function wh(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function _h(t){return wh(t)?t:new gu(t)}function Mh(t){return wh(t)?t:new gu(t).saturate(.5).darken(.1).hexString()}const Sh=["x","y","borderWidth","radius","tension"],kh=["color","borderColor","backgroundColor"],Ch=new Map;function Dh(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let i=Ch.get(n);return i||(i=new Intl.NumberFormat(t,e),Ch.set(n,i)),i}(e,n).format(t)}const Oh={values:t=>vu(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let r,o=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),o=function(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}(t,n)}const s=Qu(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Dh(t,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=n[e].significand||t/Math.pow(10,Math.floor(Qu(t)));return[1,2,3,5,10,15].includes(i)||e>.8*n.length?Oh.numeric.call(this,t,e,n):""}};var Rh={formatters:Oh};const Ph=Object.create(null),Th=Object.create(null);function Eh(t,e){if(!e)return t;const n=e.split(".");for(let e=0,i=n.length;e<i;++e){const i=n[e];t=t[i]||(t[i]=Object.create(null))}return t}function Ah(t,e,n){return"string"==typeof e?Tu(Eh(t,e),n):Tu(Eh(t,""),e)}class Nh{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.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=(t,e)=>Mh(e.backgroundColor),this.hoverBorderColor=(t,e)=>Mh(e.borderColor),this.hoverColor=(t,e)=>Mh(e.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(t),this.apply(e)}set(t,e){return Ah(this,t,e)}get(t){return Eh(this,t)}describe(t,e){return Ah(Th,t,e)}override(t,e){return Ah(Ph,t,e)}route(t,e,n,i){const r=Eh(this,t),o=Eh(this,n),s="_"+e;Object.defineProperties(r,{[s]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[s],e=o[i];return xu(t)?Object.assign({},e,t):Mu(t,e)},set(t){this[s]=t}}})}apply(t){t.forEach(t=>t(this))}}var Ih=new Nh({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(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:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:kh},numbers:{type:"number",properties:Sh}}),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:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(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:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Rh.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:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Lh(t,e,n,i,r){let o=e[r];return o||(o=e[r]=t.measureText(r).width,n.push(r)),o>i&&(i=o),i}function jh(t,e,n){const i=t.currentDevicePixelRatio,r=0!==n?Math.max(n/2,.5):0;return Math.round((e-r)*i)/i+r}function Fh(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Wh(t,e,n,i){Uh(t,e,n,i,null)}function Uh(t,e,n,i,r){let o,s,a,l,c,u,h,d;const f=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*Yu;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(n,i),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:r?t.ellipse(n,i,r/2,g,0,0,Bu):t.arc(n,i,g,0,Bu),t.closePath();break;case"triangle":u=r?r/2:g,t.moveTo(n+Math.sin(m)*u,i-Math.cos(m)*g),m+=Vu,t.lineTo(n+Math.sin(m)*u,i-Math.cos(m)*g),m+=Vu,t.lineTo(n+Math.sin(m)*u,i-Math.cos(m)*g),t.closePath();break;case"rectRounded":c=.516*g,l=g-c,s=Math.cos(m+qu)*l,h=Math.cos(m+qu)*(r?r/2-c:l),a=Math.sin(m+qu)*l,d=Math.sin(m+qu)*(r?r/2-c:l),t.arc(n-h,i-a,c,m-Uu,m-$u),t.arc(n+d,i-s,c,m-$u,m),t.arc(n+h,i+a,c,m,m+$u),t.arc(n-d,i+s,c,m+$u,m+Uu),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,u=r?r/2:l,t.rect(n-u,i-l,2*u,2*l);break}m+=qu;case"rectRot":h=Math.cos(m)*(r?r/2:g),s=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(n-h,i-a),t.lineTo(n+d,i-s),t.lineTo(n+h,i+a),t.lineTo(n-d,i+s),t.closePath();break;case"crossRot":m+=qu;case"cross":h=Math.cos(m)*(r?r/2:g),s=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(n-h,i-a),t.lineTo(n+h,i+a),t.moveTo(n+d,i-s),t.lineTo(n-d,i+s);break;case"star":h=Math.cos(m)*(r?r/2:g),s=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(n-h,i-a),t.lineTo(n+h,i+a),t.moveTo(n+d,i-s),t.lineTo(n-d,i+s),m+=qu,h=Math.cos(m)*(r?r/2:g),s=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(n-h,i-a),t.lineTo(n+h,i+a),t.moveTo(n+d,i-s),t.lineTo(n-d,i+s);break;case"line":s=r?r/2:Math.cos(m)*g,a=Math.sin(m)*g,t.moveTo(n-s,i-a),t.lineTo(n+s,i+a);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(m)*(r?r/2:g),i+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Bh(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 Hh(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function zh(t){t.restore()}function Yh(t,e,n,i,r){if(!e)return t.lineTo(n.x,n.y);if("middle"===r){const i=(e.x+n.x)/2;t.lineTo(i,e.y),t.lineTo(i,n.y)}else"after"===r!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function $h(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function qh(t,e,n,i,r){if(r.strikethrough||r.underline){const o=t.measureText(i),s=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(s,u),t.lineTo(a,u),t.stroke()}}function Vh(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function Qh(t,e,n,i,r,o={}){const s=vu(e)?e:[e],a=o.strokeWidth>0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),bu(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&Vh(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),bu(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(c,n,i,o.maxWidth)),t.fillText(c,n,i,o.maxWidth),qh(t,n,i,c,o),i+=Number(r.lineHeight);t.restore()}function Kh(t,e){const{x:n,y:i,w:r,h:o,radius:s}=e;t.arc(n+s.topLeft,i+s.topLeft,s.topLeft,1.5*Uu,Uu,!0),t.lineTo(n,i+o-s.bottomLeft),t.arc(n+s.bottomLeft,i+o-s.bottomLeft,s.bottomLeft,Uu,$u,!0),t.lineTo(n+r-s.bottomRight,i+o),t.arc(n+r-s.bottomRight,i+o-s.bottomRight,s.bottomRight,$u,0,!0),t.lineTo(n+r,i+s.topRight),t.arc(n+r-s.topRight,i+s.topRight,s.topRight,0,-$u,!0),t.lineTo(n+s.topLeft,i)}const Xh=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Gh=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Zh(t,e){const n=(""+t).match(Xh);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}const Jh=t=>+t||0;function td(t,e){const n={},i=xu(e),r=i?Object.keys(e):e,o=xu(t)?i?n=>Mu(t[n],t[e[n]]):e=>t[e]:()=>t;for(const t of r)n[t]=Jh(o(t));return n}function ed(t){return td(t,{top:"y",right:"x",bottom:"y",left:"x"})}function nd(t){return td(t,["topLeft","topRight","bottomLeft","bottomRight"])}function id(t){const e=ed(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function rd(t,e){t=t||{},e=e||Ih.font;let n=Mu(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let i=Mu(t.style,e.style);i&&!(""+i).match(Gh)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Mu(t.family,e.family),lineHeight:Zh(Mu(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:Mu(t.weight,e.weight),string:""};return r.string=function(t){return!t||bu(t.size)||bu(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function od(t,e,n,i){let r,o,s,a=!0;for(r=0,o=t.length;r<o;++r)if(s=t[r],void 0!==s&&(void 0!==e&&"function"==typeof s&&(s=s(e),a=!1),void 0!==n&&vu(s)&&(s=s[n%s.length],a=!1),void 0!==s))return i&&!a&&(i.cacheable=!1),s}function sd(t,e){return Object.assign(Object.create(t),e)}function ad(t,e=[""],n,i,r=()=>t[0]){const o=n||t;void 0===i&&(i=bd("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:i,_getTarget:r,override:n=>ad([n,...t],e,o,i)};return new Proxy(s,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,i)=>dd(n,i,()=>function(t,e,n,i){let r;for(const o of e)if(r=bd(ud(o,t),n),void 0!==r)return hd(t,r)?md(n,i,t,r):r}(i,e,t,n)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>vd(t).includes(e),ownKeys:t=>vd(t),set(t,e,n){const i=t._storage||(t._storage=r());return t[e]=i[e]=n,delete t._keys,!0}})}function ld(t,e,n,i){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:cd(t,i),setContext:e=>ld(t,e,n,i),override:r=>ld(t.override(r),e,n,i)};return new Proxy(r,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>dd(t,e,()=>function(t,e,n){const{_proxy:i,_context:r,_subProxy:o,_descriptors:s}=t;let a=i[e];return Fu(a)&&s.isScriptable(e)&&(a=function(t,e,n,i){const{_proxy:r,_context:o,_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(o,s||i);return a.delete(t),hd(t,l)&&(l=md(r._scopes,r,t,l)),l}(e,a,t,n)),vu(a)&&a.length&&(a=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:s,_descriptors:a}=n;if(void 0!==o.index&&i(t))return e[o.index%e.length];if(xu(e[0])){const n=e,i=r._scopes.filter(t=>t!==n);e=[];for(const l of n){const n=md(i,r,t,l);e.push(ld(n,o,s&&s[t],a))}}return e}(e,a,t,s.isIndexable)),hd(e,a)&&(a=ld(a,r,o&&o[e],s)),a}(t,e,n)),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,i)=>(t[n]=i,delete e[n],!0)})}function cd(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:i,isScriptable:Fu(n)?n:()=>n,isIndexable:Fu(i)?i:()=>i}}const ud=(t,e)=>t?t+Lu(e):e,hd=(t,e)=>xu(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function dd(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const i=n();return t[e]=i,i}function fd(t,e,n){return Fu(t)?t(e,n):t}const pd=(t,e)=>!0===t?e:"string"==typeof t?Iu(e,t):void 0;function gd(t,e,n,i,r){for(const o of e){const e=pd(n,o);if(e){t.add(e);const o=fd(e._fallback,n,r);if(void 0!==o&&o!==n&&o!==i)return o}else if(!1===e&&void 0!==i&&n!==i)return null}return!1}function md(t,e,n,i){const r=e._rootScopes,o=fd(e._fallback,n,i),s=[...t,...r],a=new Set;a.add(i);let l=yd(a,s,n,o||n,i);return null!==l&&(void 0===o||o===n||(l=yd(a,s,o,l,i),null!==l))&&ad(Array.from(a),[""],r,o,()=>function(t,e,n){const i=t._getTarget();e in i||(i[e]={});const r=i[e];return vu(r)&&xu(n)?n:r||{}}(e,n,i))}function yd(t,e,n,i,r){for(;n;)n=gd(t,e,n,i,r);return n}function bd(t,e){for(const n of e){if(!n)continue;const e=n[t];if(void 0!==e)return e}}function vd(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const xd=Number.EPSILON||1e-14,wd=(t,e)=>e<t.length&&!t[e].skip&&t[e],_d=t=>"x"===t?"y":"x";function Md(t,e,n,i){const r=t.skip?e:t,o=e,s=n.skip?e:n,a=nh(o,r),l=nh(s,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,d=i*u;return{previous:{x:o.x-h*(s.x-r.x),y:o.y-h*(s.y-r.y)},next:{x:o.x+d*(s.x-r.x),y:o.y+d*(s.y-r.y)}}}function Sd(t,e,n){return Math.max(Math.min(t,n),e)}function kd(t,e,n,i,r){let o,s,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const n=_d(e),i=t.length,r=Array(i).fill(0),o=Array(i);let s,a,l,c=wd(t,0);for(s=0;s<i;++s)if(a=l,l=c,c=wd(t,s+1),l){if(c){const t=c[e]-l[e];r[s]=0!==t?(c[n]-l[n])/t:0}o[s]=a?c?Ku(r[s-1])!==Ku(r[s])?0:(r[s-1]+r[s])/2:r[s-1]:r[s]}!function(t,e,n){const i=t.length;let r,o,s,a,l,c=wd(t,0);for(let u=0;u<i-1;++u)l=c,c=wd(t,u+1),l&&c&&(Xu(e[u],0,xd)?n[u]=n[u+1]=0:(r=n[u]/e[u],o=n[u+1]/e[u],a=Math.pow(r,2)+Math.pow(o,2),a<=9||(s=3/Math.sqrt(a),n[u]=r*s*e[u],n[u+1]=o*s*e[u])))}(t,r,o),function(t,e,n="x"){const i=_d(n),r=t.length;let o,s,a,l=wd(t,0);for(let c=0;c<r;++c){if(s=a,a=l,l=wd(t,c+1),!a)continue;const r=a[n],u=a[i];s&&(o=(r-s[n])/3,a[`cp1${n}`]=r-o,a[`cp1${i}`]=u-o*e[c]),l&&(o=(l[n]-r)/3,a[`cp2${n}`]=r+o,a[`cp2${i}`]=u+o*e[c])}}(t,o,e)}(t,r);else{let n=i?t[t.length-1]:t[0];for(o=0,s=t.length;o<s;++o)a=t[o],l=Md(n,a,t[Math.min(o+1,s-(i?0:1))%s],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,n=a}e.capBezierPoints&&function(t,e){let n,i,r,o,s,a=Bh(t[0],e);for(n=0,i=t.length;n<i;++n)s=o,o=a,a=n<i-1&&Bh(t[n+1],e),o&&(r=t[n],s&&(r.cp1x=Sd(r.cp1x,e.left,e.right),r.cp1y=Sd(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=Sd(r.cp2x,e.left,e.right),r.cp2y=Sd(r.cp2y,e.top,e.bottom)))}(t,n)}function Cd(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Dd(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Od(t,e,n){let i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}const Rd=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),Pd=["top","right","bottom","left"];function Td(t,e,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const o=Pd[r];i[o]=parseFloat(t[e+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function Ed(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,r=Rd(n),o="border-box"===r.boxSizing,s=Td(r,"padding"),a=Td(r,"border","width"),{x:l,y:c,box:u}=function(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:r,offsetY:o}=i;let s,a,l=!1;if(((t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot))(r,o,t.target))s=r,a=o;else{const t=e.getBoundingClientRect();s=i.clientX-t.left,a=i.clientY-t.top,l=!0}return{x:s,y:a,box:l}}(t,n),h=s.left+(u&&a.left),d=s.top+(u&&a.top);let{width:f,height:p}=e;return o&&(f-=s.width+a.width,p-=s.height+a.height),{x:Math.round((l-h)/f*n.width/i),y:Math.round((c-d)/p*n.height/i)}}const Ad=t=>Math.round(10*t)/10;function Nd(t,e,n){const i=e||1,r=Ad(t.height*i),o=Ad(t.width*i);t.height=Ad(t.height),t.width=Ad(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!==i||s.height!==r||s.width!==o)&&(t.currentDevicePixelRatio=i,s.height=r,s.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0)}const Id=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Cd()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Ld(t,e){const n=function(t,e){return Rd(t).getPropertyValue(e)}(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function jd(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function Fd(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:"middle"===i?n<.5?t.y:e.y:"after"===i?n<1?t.y:e.y:n>0?e.y:t.y}}function Wd(t,e,n,i){const r={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},s=jd(t,r,n),a=jd(r,o,n),l=jd(o,e,n),c=jd(s,a,n),u=jd(a,l,n);return jd(c,u,n)}function Ud(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Bd(t,e){let n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function Hd(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function zd(t){return"angle"===t?{between:oh,compare:ih,normalize:rh}:{between:ah,compare:(t,e)=>t-e,normalize:t=>t}}function Yd({start:t,end:e,count:n,loop:i,style:r}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n==0,style:r}}function $d(t,e,n){if(!n)return[t];const{property:i,start:r,end:o}=n,s=e.length,{compare:a,between:l,normalize:c}=zd(i),{start:u,end:h,loop:d,style:f}=function(t,e,n){const{property:i,start:r,end:o}=n,{between:s,normalize:a}=zd(i),l=e.length;let c,u,{start:h,end:d,loop:f}=t;if(f){for(h+=l,d+=l,c=0,u=l;c<u&&s(a(e[h%l][i]),r,o);++c)h--,d--;h%=l,d%=l}return d<h&&(d+=l),{start:h,end:d,loop:f,style:t.style}}(t,e,n),p=[];let g,m,y,b=!1,v=null;const x=()=>b||l(r,y,g)&&0!==a(r,y),w=()=>!b||0===a(o,g)||l(o,y,g);for(let t=u,n=u;t<=h;++t)m=e[t%s],m.skip||(g=c(m[i]),g!==y&&(b=l(g,r,o),null===v&&x()&&(v=0===a(g,r)?t:n),null!==v&&w()&&(p.push(Yd({start:v,end:t,loop:d,count:s,style:f})),v=null),n=t,y=g));return null!==v&&p.push(Yd({start:v,end:h,loop:d,count:s,style:f})),p}function qd(t,e){const n=[],i=t.segments;for(let r=0;r<i.length;r++){const o=$d(i[r],t.points,e);o.length&&n.push(...o)}return n}function Vd(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Qd(t,e){if(!e)return!1;const n=[],i=function(t,e){return wh(e)?(n.includes(e)||n.push(e),n.indexOf(e)):e};return JSON.stringify(t,i)!==JSON.stringify(e,i)}function Kd(t,e,n){return t.options.clip?t[n]:e[n]}function Xd(t,e){const n=e._clip;if(n.disabled)return!1;const i=function(t,e){const{xScale:n,yScale:i}=t;return n&&i?{left:Kd(n,e,"left"),right:Kd(n,e,"right"),top:Kd(i,e,"top"),bottom:Kd(i,e,"bottom")}:e}(e,t.chartArea);return{left:!1===n.left?0:i.left-(!0===n.left?0:n.left),right:!1===n.right?t.width:i.right+(!0===n.right?0:n.right),top:!1===n.top?0:i.top-(!0===n.top?0:n.top),bottom:!1===n.bottom?t.height:i.bottom+(!0===n.bottom?0:n.bottom)}}class Gd{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const r=e.listeners[i],o=e.duration;r.forEach(i=>i({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=fh.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const r=n.items;let o,s=r.length-1,a=!1;for(;s>=0;--s)o=r[s],o._active?(o._total>n.duration&&(n.duration=o._total),o.tick(t),a=!0):(r[s]=r[r.length-1],r.pop());a&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),e+=r.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Zd=new Gd;const Jd="transparent",tf={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=_h(t||Jd),r=i.valid&&_h(e||Jd);return r&&r.valid?r.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class ef{constructor(t,e,n,i){const r=e[n];i=od([t.to,i,r,t.from]);const o=od([t.from,r,i]);this._active=!0,this._fn=t.fn||tf[t.type||typeof o],this._easing=xh[t.easing]||xh.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const i=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=od([t.to,e,i,t.from]),this._from=od([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,i=this._prop,r=this._from,o=this._loop,s=this._to;let a;if(this._active=r!==s&&(o||e<n),!this._active)return this._target[i]=s,void this._notify(!0);e<0?this._target[i]=r:(a=e/n%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[i]=this._fn(r,s,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}class nf{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!xu(t))return;const e=Object.keys(Ih.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const r=t[i];if(!xu(r))return;const o={};for(const t of e)o[t]=r[t];(vu(r.properties)&&r.properties||[i]).forEach(t=>{t!==i&&n.has(t)||n.set(t,o)})})}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(n)return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;t.options=e}(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e<i.length;e++){const r=t[i[e]];r&&r.active()&&n.push(r.wait())}return Promise.all(n)}(t.options.$animations,n).then(()=>{t.options=n},()=>{}),r}_createAnimations(t,e){const n=this._properties,i=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),s=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(t,e));continue}const c=e[l];let u=r[l];const h=n.get(l);if(u){if(h&&u.active()){u.update(h,c,s);continue}u.cancel()}h&&h.duration?(r[l]=u=new ef(h,t,l,c),i.push(u)):t[l]=c}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(Zd.add(this._chart,n),!0):void 0}}function rf(t,e){const n=t&&t.options||{},i=n.reverse,r=void 0===n.min?e:0,o=void 0===n.max?e:0;return{start:i?o:r,end:i?r:o}}function of(t,e){const n=[],i=t._getSortedDatasetMetas(e);let r,o;for(r=0,o=i.length;r<o;++r)n.push(i[r].index);return n}function sf(t,e,n,i={}){const r=t.keys,o="single"===i.mode;let s,a,l,c;if(null===e)return;let u=!1;for(s=0,a=r.length;s<a;++s){if(l=+r[s],l===n){if(u=!0,i.all)continue;break}c=t.values[l],wu(c)&&(o||0===e||Ku(e)===Ku(c))&&(e+=c)}return u||i.all?e:0}function af(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function lf(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function cf(t,e,n,i){for(const r of e.getMatchingVisibleMetas(i).reverse()){const e=t[r.index];if(n&&e>0||!n&&e<0)return r.index}return null}function uf(t,e){const{chart:n,_cachedMeta:i}=t,r=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=i,l=o.axis,c=s.axis,u=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(o,s,i),h=e.length;let d;for(let t=0;t<h;++t){const n=e[t],{[l]:o,[c]:h}=n;d=(n._stacks||(n._stacks={}))[c]=lf(r,u,o),d[a]=h,d._top=cf(d,s,!0,i.type),d._bottom=cf(d,s,!1,i.type),(d._visualValues||(d._visualValues={}))[a]=h}}function hf(t,e){const n=t.scales;return Object.keys(n).filter(t=>n[t].axis===e).shift()}function df(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n],void 0!==e[i]._visualValues&&void 0!==e[i]._visualValues[n]&&delete e[i]._visualValues[n]}}}const ff=t=>"reset"===t||"none"===t,pf=(t,e)=>e?t:Object.assign({},t);class gf{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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 t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=af(t.vScale,t),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(t){this.index!==t&&df(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),i=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,r=e.xAxisID=Mu(n.xAxisID,hf(t,"x")),o=e.yAxisID=Mu(n.yAxisID,hf(t,"y")),s=e.rAxisID=Mu(n.rAxisID,hf(t,"r")),a=e.indexAxis,l=e.iAxisID=i(a,r,o,s),c=e.vAxisID=i(a,o,r,s);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(s),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&dh(this._data,this),t._stacked&&df(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(xu(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:n,vScale:i}=e,r="x"===n.axis?"x":"y",o="x"===i.axis?"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]={[r]:u,[o]:t[u]};return a}(e,t)}else if(n!==e){if(n){dh(n,this);const t=this._cachedMeta;df(t),t._parsed=[]}e&&Object.isExtensible(e)&&((i=e)._chartjs?i._chartjs.listeners.push(this):(Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),hh.forEach(t=>{const e="_onData"+Lu(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...t){const r=n.apply(this,t);return i._chartjs.listeners.forEach(n=>{"function"==typeof n[e]&&n[e](...t)}),r}})}))),this._syncList=[],this._data=e}var i}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const r=e._stacked;e._stacked=af(e.vScale,e),e.stack!==n.stack&&(i=!0,df(e),e.stack=n.stack),this._resyncElements(t),(i||r!==e._stacked)&&(uf(this,e._parsed),e._stacked=af(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:o}=n,s=r.axis;let a,l,c,u=0===t&&e===i.length||n._sorted,h=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=i,n._sorted=!0,c=i;else{c=vu(i[t])?this.parseArrayData(n,i,t,e):xu(i[t])?this.parseObjectData(n,i,t,e):this.parsePrimitiveData(n,i,t,e);const r=()=>null===l[s]||h&&l[s]<h[s];for(a=0;a<e;++a)n._parsed[a+t]=l=c[a],u&&(r()&&(u=!1),h=l);n._sorted=u}o&&uf(this,c)}parsePrimitiveData(t,e,n,i){const{iScale:r,vScale:o}=t,s=r.axis,a=o.axis,l=r.getLabels(),c=r===o,u=new Array(i);let h,d,f;for(h=0,d=i;h<d;++h)f=h+n,u[h]={[s]:c||r.parse(l[f],f),[a]:o.parse(e[f],f)};return u}parseArrayData(t,e,n,i){const{xScale:r,yScale:o}=t,s=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+n,u=e[c],s[a]={x:r.parse(u[0],c),y:o.parse(u[1],c)};return s}parseObjectData(t,e,n,i){const{xScale:r,yScale:o}=t,{xAxisKey:s="x",yAxisKey:a="y"}=this._parsing,l=new Array(i);let c,u,h,d;for(c=0,u=i;c<u;++c)h=c+n,d=e[h],l[c]={x:r.parse(Iu(d,s),h),y:o.parse(Iu(d,a),h)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const i=this.chart,r=this._cachedMeta,o=e[t.axis];return sf({keys:of(i,!0),values:e._stacks[t.axis]._visualValues},o,r.index,{mode:n})}updateRangeFromParsed(t,e,n,i){const r=n[e.axis];let o=null===r?NaN:r;const s=i&&n._stacks[e.axis];i&&s&&(i.values=s,o=sf(i,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this._cachedMeta,i=n._parsed,r=n._sorted&&t===n.iScale,o=i.length,s=this._getOtherScale(t),a=((t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:of(n,!0),values:null})(e,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:n,minDefined:i,maxDefined:r}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}(s);let h,d;function f(){d=i[h];const e=d[s.axis];return!wu(d[t.axis])||c>e||u<e}for(h=0;h<o&&(f()||(this.updateRangeFromParsed(l,t,d,a),!r));++h);if(r)for(h=o-1;h>=0;--h)if(!f()){this.updateRangeFromParsed(l,t,d,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i][t.axis],wu(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,i=e.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,n,i,r;return xu(t)?(e=t.top,n=t.right,i=t.bottom,r=t.left):e=n=i=r=t,{top:e,right:n,bottom:i,left:r,disabled:!1===t}}(Mu(this.options.clip,function(t,e,n){if(!1===n)return!1;const i=rf(t,n),r=rf(e,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,i=n.data||[],r=e.chartArea,o=[],s=this._drawStart||0,a=this._drawCount||i.length-s,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(t,r,s,a),c=s;c<s+a;++c){const e=i[c];e.hidden||(e.active&&l?o.push(e):e.draw(t,r))}for(c=0;c<o.length;++c)o[c].draw(t,r)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const i=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];r=e.$context||(e.$context=function(t,e,n){return sd(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),r.parsed=this.getParsed(t),r.raw=i.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=function(t,e){return sd(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=i,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const i="active"===e,r=this._cachedDataOpts,o=t+"-"+e,s=r[o],a=this.enableOptionSharing&&ju(n);if(s)return pf(s,a);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),u=i?[`${t}Hover`,"hover",t,""]:[t,""],h=l.getOptionScopes(this.getDataset(),c),d=Object.keys(Ih.elements[t]),f=l.resolveNamedOptions(h,d,()=>this.getContext(n,i,e),u);return f.$shared&&(f.$shared=a,r[o]=Object.freeze(pf(f,a))),f}_resolveAnimations(t,e,n){const i=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,s=r[o];if(s)return s;let a;if(!1!==i.options.animation){const i=this.chart.config,r=i.datasetAnimationScopeKeys(this._type,e),o=i.getOptionScopes(this.getDataset(),r);a=i.createResolver(o,this.getContext(t,n,e))}const l=new nf(i,a&&a.animations);return a&&a._cacheable&&(r[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ff(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),i=this._sharedOptions,r=this.getSharedOptions(n),o=this.includeOptions(e,r)||r!==i;return this.updateSharedOptions(r,e,n),{sharedOptions:r,includeOptions:o}}updateElement(t,e,n,i){ff(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!ff(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const r=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[t,e,n]of this._syncList)this[t](e,n);this._syncList=[];const i=n.length,r=e.length,o=Math.min(r,i);o&&this.parse(0,o),r>i?this._insertElements(i,r-i,t):r<i&&this._removeElements(r,i-r)}_insertElements(t,e,n=!0){const i=this._cachedMeta,r=i.data,o=t+e;let s;const a=t=>{for(t.length+=e,s=t.length-1;s>=o;s--)t[s]=t[s-e]};for(a(r),s=t;s<o;++s)r[s]=new this.dataElementType;this._parsing&&a(i._parsed),this.parse(t,e),n&&this.updateElements(r,t,e,"reset")}updateElements(t,e,n,i){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,e);n._stacked&&df(n,i)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,i]=t;this[e](n,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class mf extends gf{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:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:n,textAlign:i,color:r,useBorderRadius:o,borderRadius:s}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:l.backgroundColor,fontColor:r,hidden:!t.getDataVisibility(a),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:i,pointStyle:n,borderRadius:o&&(s||l.borderRadius),index:a}}):[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;if(!1===this._parsing)i._parsed=n;else{let r,o,s=t=>+n[t];if(xu(n[t])){const{key:t="value"}=this._parsing;s=e=>+Iu(n[e],t)}for(r=t,o=t+e;r<o;++r)i._parsed[r]=s(r)}}_getRotation(){return Ju(this.options.rotation-90)}_getCircumference(){return Ju(this.options.circumference)}_getRotationExtents(){let t=Bu,e=-Bu;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const i=this.chart.getDatasetMeta(n).controller,r=i._getRotation(),o=i._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,i=this._cachedMeta,r=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,s=Math.max((Math.min(n.width,n.height)-o)/2,0),a=Math.min((c=s,"string"==typeof(l=this.options.cutout)&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const u=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=function(t,e,n){let i=1,r=1,o=0,s=0;if(e<Bu){const a=t,l=a+e,c=Math.cos(a),u=Math.sin(a),h=Math.cos(l),d=Math.sin(l),f=(t,e,i)=>oh(t,a,l,!0)?1:Math.max(e,e*n,i,i*n),p=(t,e,i)=>oh(t,a,l,!0)?-1:Math.min(e,e*n,i,i*n),g=f(0,c,h),m=f($u,u,d),y=p(Uu,c,h),b=p(Uu+$u,u,d);i=(g-y)/2,r=(m-b)/2,o=-(g+y)/2,s=-(m+b)/2}return{ratioX:i,ratioY:r,offsetX:o,offsetY:s}}(d,h,a),y=(n.width-o)/f,b=(n.height-o)/p,v=Math.max(Math.min(y,b)/2,0),x=Su(this.options.radius,v),w=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,i.total=this.calculateTotal(),this.outerRadius=x-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*u,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const n=this.options,i=this._cachedMeta,r=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===i._parsed[t]||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/Bu)}updateElements(t,e,n,i){const r="reset"===i,o=this.chart,s=o.chartArea,a=o.options.animation,l=(s.left+s.right)/2,c=(s.top+s.bottom)/2,u=r&&a.animateScale,h=u?0:this.innerRadius,d=u?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,i);let g,m=this._getRotation();for(g=0;g<e;++g)m+=this._circumference(g,r);for(g=e;g<e+n;++g){const e=this._circumference(g,r),n=t[g],o={x:l+this.offsetX,y:c+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:d,innerRadius:h};p&&(o.options=f||this.resolveDataElementOptions(g,n.active?"active":i)),m+=e,this.updateElement(n,g,o,i)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,i=0;for(n=0;n<e.length;n++){const r=t._parsed[n];null===r||isNaN(r)||!this.chart.getDataVisibility(n)||e[n].hidden||(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Bu*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=Dh(e._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let i,r,o,s,a;if(!t)for(i=0,r=n.data.datasets.length;i<r;++i)if(n.isDatasetVisible(i)){o=n.getDatasetMeta(i),t=o.data,s=o.controller;break}if(!t)return 0;for(i=0,r=t.length;i<r;++i)a=s.resolveDataElementOptions(i),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,i=t.length;n<i;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(Mu(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class yf extends gf{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:s,count:a}=function(t,e,n){const i=e.length;let r=0,o=i;if(t._sorted){const{iScale:s,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=s.axis,{min:h,max:d,minDefined:f,maxDefined:p}=s.getUserBounds();if(f){if(r=Math.min(ch(l,u,h).lo,n?i:ch(e,u,s.getPixelForValue(h)).lo),c){const t=l.slice(0,r+1).reverse().findIndex(t=>!bu(t[a.axis]));r-=Math.max(0,t)}r=sh(r,0,i-1)}if(p){let t=Math.max(ch(l,s.axis,d,!0).hi+1,n?0:ch(e,u,s.getPixelForValue(d),!0).hi+1);if(c){const e=l.slice(t-1).findIndex(t=>!bu(t[a.axis]));t+=Math.max(0,e)}o=sh(t,r,i)-r}else o=i-r}return{start:r,count:o}}(e,i,o);this._drawStart=s,this._drawCount=a,function(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=r,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),o}(e)&&(s=0,a=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:l},t),this.updateElements(i,s,a,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:o,vScale:s,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,i),h=o.axis,d=s.axis,{spanGaps:f,segment:p}=this.options,g=Zu(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||r||"none"===i,y=e+n,b=t.length;let v=e>0&&this.getParsed(e-1);for(let n=0;n<b;++n){const f=t[n],b=m?f:{};if(n<e||n>=y){b.skip=!0;continue}const x=this.getParsed(n),w=bu(x[d]),_=b[h]=o.getPixelForValue(x[h],n),M=b[d]=r||w?s.getBasePixel():s.getPixelForValue(a?this.applyStack(s,x,a):x[d],n);b.skip=isNaN(_)||isNaN(M)||w,b.stop=n>0&&Math.abs(x[h]-v[h])>g,p&&(b.parsed=x,b.raw=l.data[n]),u&&(b.options=c||this.resolveDataElementOptions(n,f.active?"active":i)),m||this.updateElement(f,n,b,i),v=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const r=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class bf extends mf{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}function vf(t,e,n,i){const{controller:r,data:o,_sorted:s}=t,a=r._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&s&&o.length){const s=a._reversePixels?uh:ch;if(!i){const i=s(o,e,n);if(l){const{vScale:e}=r._cachedMeta,{_parsed:n}=t,o=n.slice(0,i.lo+1).reverse().findIndex(t=>!bu(t[e.axis]));i.lo-=Math.max(0,o);const s=n.slice(i.hi).findIndex(t=>!bu(t[e.axis]));i.hi+=Math.max(0,s)}return i}if(r._sharedOptions){const t=o[0],i="function"==typeof t.getRange&&t.getRange(e);if(i){const t=s(o,e,n-i),r=s(o,e,n+i);return{lo:t.lo,hi:r.hi}}}}return{lo:0,hi:o.length-1}}function xf(t,e,n,i,r){const o=t.getSortedVisibleDatasetMetas(),s=n[e];for(let t=0,n=o.length;t<n;++t){const{index:n,data:a}=o[t],{lo:l,hi:c}=vf(o[t],e,s,r);for(let t=l;t<=c;++t){const e=a[t];e.skip||i(e,n,t)}}}function wf(t,e,n,i,r){const o=[];return r||t.isPointInArea(e)?(xf(t,n,e,function(n,s,a){(r||Bh(n,t.chartArea,0))&&n.inRange(e.x,e.y,i)&&o.push({element:n,datasetIndex:s,index:a})},!0),o):o}function _f(t,e,n,i,r,o){return o||t.isPointInArea(e)?"r"!==n||i?function(t,e,n,i,r,o){let s=[];const a=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){const r=e?Math.abs(t.x-i.x):0,o=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}(n);let l=Number.POSITIVE_INFINITY;return xf(t,n,e,function(n,c,u){const h=n.inRange(e.x,e.y,r);if(i&&!h)return;const d=n.getCenterPoint(r);if(!o&&!t.isPointInArea(d)&&!h)return;const f=a(e,d);f<l?(s=[{element:n,datasetIndex:c,index:u}],l=f):f===l&&s.push({element:n,datasetIndex:c,index:u})}),s}(t,e,n,i,r,o):function(t,e,n,i){let r=[];return xf(t,n,e,function(t,n,o){const{startAngle:s,endAngle:a}=t.getProps(["startAngle","endAngle"],i),{angle:l}=eh(t,{x:e.x,y:e.y});oh(l,s,a)&&r.push({element:t,datasetIndex:n,index:o})}),r}(t,e,n,r):[]}function Mf(t,e,n,i,r){const o=[],s="x"===n?"inXRange":"inYRange";let a=!1;return xf(t,n,e,(t,i,l)=>{t[s]&&t[s](e[n],r)&&(o.push({element:t,datasetIndex:i,index:l}),a=a||t.inRange(e.x,e.y,r))}),i&&!a?[]:o}var Sf={evaluateInteractionItems:xf,modes:{index(t,e,n,i){const r=Ed(e,t),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?wf(t,r,o,i,s):_f(t,r,o,!1,i,s),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,n=t.data[e];n&&!n.skip&&l.push({element:n,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,n,i){const r=Ed(e,t),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?wf(t,r,o,i,s):_f(t,r,o,!1,i,s);if(a.length>0){const e=a[0].datasetIndex,n=t.getDatasetMeta(e).data;a=[];for(let t=0;t<n.length;++t)a.push({element:n[t],datasetIndex:e,index:t})}return a},point:(t,e,n,i)=>wf(t,Ed(e,t),n.axis||"xy",i,n.includeInvisible||!1),nearest(t,e,n,i){const r=Ed(e,t),o=n.axis||"xy",s=n.includeInvisible||!1;return _f(t,r,o,n.intersect,i,s)},x:(t,e,n,i)=>Mf(t,Ed(e,t),"x",n.intersect,i),y:(t,e,n,i)=>Mf(t,Ed(e,t),"y",n.intersect,i)}};const kf=["left","top","right","bottom"];function Cf(t,e){return t.filter(t=>t.pos===e)}function Df(t,e){return t.filter(t=>-1===kf.indexOf(t.pos)&&t.box.axis===e)}function Of(t,e){return t.sort((t,n)=>{const i=e?n:t,r=e?t:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight})}function Rf(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Pf(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 Tf(t,e,n,i){const{pos:r,box:o}=n,s=t.maxPadding;if(!xu(r)){n.size&&(t[r]-=n.size);const e=i[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?o.height:o.width),n.size=e.size/e.count,t[r]+=n.size}o.getPadding&&Pf(s,o.getPadding());const a=Math.max(0,e.outerWidth-Rf(s,t,"left","right")),l=Math.max(0,e.outerHeight-Rf(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 Ef(t,e){const n=e.maxPadding;return function(t){const i={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{i[t]=Math.max(e[t],n[t])}),i}(t?["left","right"]:["top","bottom"])}function Af(t,e,n,i){const r=[];let o,s,a,l,c,u;for(o=0,s=t.length,c=0;o<s;++o){a=t[o],l=a.box,l.update(a.width||e.w,a.height||e.h,Ef(a.horizontal,e));const{same:s,other:h}=Tf(e,n,a,i);c|=s&&r.length,u=u||h,l.fullSize||r.push(a)}return c&&Af(r,e,n,i)||u}function Nf(t,e,n,i,r){t.top=n,t.left=e,t.right=e+i,t.bottom=n+r,t.width=i,t.height=r}function If(t,e,n,i){const r=n.padding;let{x:o,y:s}=e;for(const a of t){const t=a.box,l=i[a.stack]||{count:1,placed:0,weight:1},c=a.stackWeight/l.weight||1;if(a.horizontal){const i=e.w*c,o=l.size||t.height;ju(l.start)&&(s=l.start),t.fullSize?Nf(t,r.left,s,n.outerWidth-r.right-r.left,o):Nf(t,e.left+l.placed,s,i,o),l.start=s,l.placed+=i,s=t.bottom}else{const i=e.h*c,s=l.size||t.width;ju(l.start)&&(o=l.start),t.fullSize?Nf(t,o,r.top,s,n.outerHeight-r.bottom-r.top):Nf(t,o,e.top+l.placed,s,i),l.start=o,l.placed+=i,o=t.right}}e.x=o,e.y=s}var Lf={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(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&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,i){if(!t)return;const r=id(t.options.layout.padding),o=Math.max(e-r.width,0),s=Math.max(n-r.height,0),a=function(t){const e=function(t){const e=[];let n,i,r,o,s,a;for(n=0,i=(t||[]).length;n<i;++n)r=t[n],({position:o,options:{stack:s,stackWeight:a=1}}=r),e.push({index:n,box:r,pos:o,horizontal:r.isHorizontal(),weight:r.weight,stack:s&&o+s,stackWeight:a});return e}(t),n=Of(e.filter(t=>t.box.fullSize),!0),i=Of(Cf(e,"left"),!0),r=Of(Cf(e,"right")),o=Of(Cf(e,"top"),!0),s=Of(Cf(e,"bottom")),a=Df(e,"x"),l=Df(e,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:r.concat(l).concat(s).concat(a),chartArea:Cf(e,"chartArea"),vertical:i.concat(r).concat(l),horizontal:o.concat(s).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;Cu(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const u=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),d=Object.assign({},r);Pf(d,id(i));const f=Object.assign({maxPadding:d,w:o,h:s,x:r.left,y:r.top},r),p=function(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:i,stackWeight:r}=n;if(!t||!kf.includes(i))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}(t),{vBoxMaxWidth:i,hBoxMaxHeight:r}=e;let o,s,a;for(o=0,s=t.length;o<s;++o){a=t[o];const{fullSize:s}=a.box,l=n[a.stack],c=l&&a.stackWeight/l.weight;a.horizontal?(a.width=c?c*i:s&&e.availableWidth,a.height=r):(a.width=i,a.height=c?c*r:s&&e.availableHeight)}return n}(l.concat(c),h);Af(a.fullSize,f,h,p),Af(l,f,h,p),Af(c,f,h,p)&&Af(l,f,h,p),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(f),If(a.leftAndTop,f,h,p),f.x+=f.w,f.y+=f.h,If(a.rightAndBottom,f,h,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Cu(a.chartArea,e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class jf{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}updateConfig(t){}}class Ff extends jf{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Wf="$chartjs",Uf={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Bf=t=>null===t||""===t,Hf=!!Id&&{passive:!0};function zf(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,Hf)}function Yf(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function $f(t,e,n){const i=t.canvas,r=new MutationObserver(t=>{let e=!1;for(const n of t)e=e||Yf(n.addedNodes,i),e=e&&!Yf(n.removedNodes,i);e&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function qf(t,e,n){const i=t.canvas,r=new MutationObserver(t=>{let e=!1;for(const n of t)e=e||Yf(n.removedNodes,i),e=e&&!Yf(n.addedNodes,i);e&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const Vf=new Map;let Qf=0;function Kf(){const t=window.devicePixelRatio;t!==Qf&&(Qf=t,Vf.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Xf(t,e,n){const i=t.canvas,r=i&&Dd(i);if(!r)return;const o=ph((t,e)=>{const i=r.clientWidth;n(t,e),i<r.clientWidth&&n()},window),s=new ResizeObserver(t=>{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||o(n,i)});return s.observe(r),function(t,e){Vf.size||window.addEventListener("resize",Kf),Vf.set(t,e)}(t,o),s}function Gf(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){Vf.delete(t),Vf.size||window.removeEventListener("resize",Kf)}(t)}function Zf(t,e,n){const i=t.canvas,r=ph(e=>{null!==t.ctx&&n(function(t,e){const n=Uf[t.type]||t.type,{x:i,y:r}=Ed(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==r?r:null}}(e,t))},t);return function(t,e,n){t&&t.addEventListener(e,n,Hf)}(i,e,r),r}class Jf extends jf{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t[Wf]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Bf(r)){const e=Ld(t,"width");void 0!==e&&(t.width=e)}if(Bf(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ld(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Wf])return!1;const n=e[Wf].initial;["height","width"].forEach(t=>{const i=n[t];bu(i)?e.removeAttribute(t):e.setAttribute(t,i)});const i=n.style||{};return Object.keys(i).forEach(t=>{e.style[t]=i[t]}),e.width=e.width,delete e[Wf],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),r={attach:$f,detach:qf,resize:Xf}[e]||Zf;i[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];i&&(({attach:Gf,detach:Gf,resize:Gf}[e]||zf)(t,e,i),n[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return function(t,e,n,i){const r=Rd(t),o=Td(r,"margin"),s=Od(r.maxWidth,t,"clientWidth")||zu,a=Od(r.maxHeight,t,"clientHeight")||zu,l=function(t,e,n){let i,r;if(void 0===e||void 0===n){const o=t&&Dd(t);if(o){const t=o.getBoundingClientRect(),s=Rd(o),a=Td(s,"border","width"),l=Td(s,"padding");e=t.width-l.width-a.width,n=t.height-l.height-a.height,i=Od(s.maxWidth,o,"clientWidth"),r=Od(s.maxHeight,o,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:i||zu,maxHeight:r||zu}}(t,e,n);let{width:c,height:u}=l;if("content-box"===r.boxSizing){const t=Td(r,"border","width"),e=Td(r,"padding");c-=e.width+t.width,u-=e.height+t.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=Ad(Math.min(c,s,l.maxWidth)),u=Ad(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Ad(c/2)),(void 0!==e||void 0!==n)&&i&&l.height&&u>l.height&&(u=l.height,c=Ad(Math.floor(u*i))),{width:c,height:u}}(t,e,n,i)}isAttached(t){const e=t&&Dd(t);return!(!e||!e.isConnected)}}class tp{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Zu(this.x)&&Zu(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const i={};return t.forEach(t=>{i[t]=n[t]&&n[t].active()?n[t]._to:this[t]}),i}}function ep(t,e,n,i,r){const o=Mu(i,0),s=Math.min(Mu(r,t.length),t.length);let a,l,c,u=0;for(n=Math.ceil(n),r&&(a=r-i,n=a/Math.floor(a/n)),c=o;c<0;)u++,c=Math.round(o+u*n);for(l=Math.max(o,0);l<s;l++)l===c&&(e.push(t[l]),u++,c=Math.round(o+u*n))}const np=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n,ip=(t,e)=>Math.min(e||t,t);function rp(t,e){const n=[],i=t.length/e,r=t.length;let o=0;for(;o<r;o+=i)n.push(t[Math.floor(o)]);return n}function op(t,e,n){const i=t.ticks.length,r=Math.min(e,i-1),o=t._startPixel,s=t._endPixel,a=1e-6;let l,c=t.getPixelForTick(r);if(!(n&&(l=1===i?Math.max(c-o,s-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(r-1))/2,c+=r<e?l:-l,c<o-a||c>s+a)))return c}function sp(t){return t.drawTicks?t.tickLength:0}function ap(t,e){if(!t.display)return 0;const n=rd(t.font,e),i=id(t.padding);return(vu(t.text)?t.text.length:1)*n.lineHeight+i.height}function lp(t,e,n){let i=gh(t);return(n&&"right"!==e||!n&&"right"===e)&&(i=(t=>"left"===t?"right":"right"===t?"left":t)(i)),i}class cp extends tp{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.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(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=_u(t,Number.POSITIVE_INFINITY),e=_u(e,Number.NEGATIVE_INFINITY),n=_u(n,Number.POSITIVE_INFINITY),i=_u(i,Number.NEGATIVE_INFINITY),{min:_u(t,n),max:_u(e,i),minDefined:wu(t),maxDefined:wu(e)}}getMinMax(t){let e,{min:n,max:i,minDefined:r,maxDefined:o}=this.getUserBounds();if(r&&o)return{min:n,max:i};const s=this.getMatchingVisibleMetas();for(let a=0,l=s.length;a<l;++a)e=s[a].controller.getMinMax(this,t),r||(n=Math.min(n,e.min)),o||(i=Math.max(i,e.max));return n=o&&n>i?i:n,i=r&&n>i?n:i,{min:_u(n,_u(i,n)),max:_u(i,_u(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ku(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:i,grace:r,ticks:o}=this.options,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,n){const{min:i,max:r}=t,o=Su(e,(r-i)/2),s=(t,e)=>n&&0===t?0:t+e;return{min:s(i,-Math.abs(o)),max:s(r,o)}}(this,r,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=s<this.ticks.length;this._convertTicksToLabels(a?rp(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(t,e){const n=t.options.ticks,i=function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(i,r))}(t),r=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}(e):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>r)return function(t,e,n,i){let r,o=0,s=n[0];for(i=Math.ceil(i),r=0;r<t.length;r++)r===s&&(e.push(t[r]),o++,s=n[o*i])}(e,c,o,s/r),c;const u=function(t,e,n){const i=function(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}(t),r=e.length/n;if(!i)return Math.max(r,1);const o=function(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i===0&&(e.push(i),e.push(t/i));return n===(0|n)&&e.push(n),e.sort((t,e)=>t-e).pop(),e}(i);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>r)return e}return Math.max(r,1)}(o,e,r);if(s>0){let t,n;const i=s>1?Math.round((l-a)/(s-1)):null;for(ep(e,c,u,bu(i)?0:a-i,a),t=0,n=s-1;t<n;t++)ep(e,c,u,o[t],o[t+1]);return ep(e,c,u,l,bu(i)?e.length:l+i),c}return ep(e,c,u),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,n=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,n=!n),this._startPixel=t,this._endPixel=e,this._reversePixels=n,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ku(this.options.afterUpdate,[this])}beforeSetDimensions(){ku(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(){ku(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ku(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ku(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,i,r;for(n=0,i=t.length;n<i;n++)r=t[n],r.label=ku(e.callback,[r.value,n,t],this)}afterTickToLabelConversion(){ku(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ku(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=ip(this.ticks.length,t.ticks.maxTicksLimit),i=e.minRotation||0,r=e.maxRotation;let o,s,a,l=i;if(!this._isVisible()||!e.display||i>=r||n<=1||!this.isHorizontal())return void(this.labelRotation=i);const c=this._getLabelSizes(),u=c.widest.width,h=c.highest.height,d=sh(this.chart.width-u,0,this.maxWidth);o=t.offset?this.maxWidth/n:d/(n-1),u+6>o&&(o=d/(n-(t.offset?.5:1)),s=this.maxHeight-sp(t.grid)-e.padding-ap(t.title,this.chart.options.font),a=Math.sqrt(u*u+h*h),l=Math.min(Math.asin(sh((c.highest.height+6)/o,-1,1)),Math.asin(sh(s/a,-1,1))-Math.asin(sh(h/a,-1,1)))*(180/Uu),l=Math.max(i,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){ku(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ku(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:i,grid:r}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){const o=ap(i,e.options.font);if(s?(t.width=this.maxWidth,t.height=sp(r)+o):(t.height=this.maxHeight,t.width=sp(r)+o),n.display&&this.ticks.length){const{first:e,last:i,widest:r,highest:o}=this._getLabelSizes(),a=2*n.padding,l=Ju(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(s){const e=n.mirror?0:u*r.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=n.mirror?0:c*r.width+u*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,i,u,c)}}this._handleMargins(),s?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,i){const{ticks:{align:r,padding:o},position:s}=this.options,a=0!==this.labelRotation,l="top"!==s&&"x"===this.axis;if(this.isHorizontal()){const s=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,h=0;a?l?(u=i*t.width,h=n*e.height):(u=n*t.height,h=i*e.width):"start"===r?h=e.width:"end"===r?u=t.width:"inner"!==r&&(u=t.width/2,h=e.width/2),this.paddingLeft=Math.max((u-s+o)*this.width/(this.width-s),0),this.paddingRight=Math.max((h-c+o)*this.width/(this.width-c),0)}else{let n=e.height/2,i=t.height/2;"start"===r?(n=0,i=t.height):"end"===r&&(n=e.height,i=0),this.paddingTop=n+o,this.paddingBottom=i+o}}_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(){ku(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,n=t.length;e<n;e++)bu(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=rp(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:i,_longestTextCache:r}=this,o=[],s=[],a=Math.floor(e/ip(e,n));let l,c,u,h,d,f,p,g,m,y,b,v=0,x=0;for(l=0;l<e;l+=a){if(h=t[l].label,d=this._resolveTickFontOptions(l),i.font=f=d.string,p=r[f]=r[f]||{data:{},gc:[]},g=d.lineHeight,m=y=0,bu(h)||vu(h)){if(vu(h))for(c=0,u=h.length;c<u;++c)b=h[c],bu(b)||vu(b)||(m=Lh(i,p.data,p.gc,m,b),y+=g)}else m=Lh(i,p.data,p.gc,m,h),y=g;o.push(m),s.push(y),v=Math.max(m,v),x=Math.max(y,x)}!function(t,e){Cu(t,t=>{const n=t.gc,i=n.length/2;let r;if(i>e){for(r=0;r<i;++r)delete t.data[n[r]];n.splice(0,i)}})}(r,e);const w=o.indexOf(v),_=s.indexOf(x),M=t=>({width:o[t]||0,height:s[t]||0});return{first:M(0),last:M(e-1),widest:M(w),highest:M(_),widths:o,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return sh(this._alignToPixels?jh(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=function(t,e,n){return sd(t,{tick:n,index:e,type:"tick"})}(this.getContext(),t,n))}return this.$context||(this.$context=sd(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=Ju(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,s=r?r.widest.width+o:0,a=r?r.highest.height+o:0;return this.isHorizontal()?a*n>s*i?s/n:a/i:a*i<s*n?a/n:s/i}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,i=this.options,{grid:r,position:o,border:s}=i,a=r.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),u=sp(r),h=[],d=s.setContext(this.getContext()),f=d.display?d.width:0,p=f/2,g=function(t){return jh(n,t,f)};let m,y,b,v,x,w,_,M,S,k,C,D;if("top"===o)m=g(this.bottom),w=this.bottom-u,M=m-p,k=g(t.top)+p,D=t.bottom;else if("bottom"===o)m=g(this.top),k=t.top,D=g(t.bottom)-p,w=m+p,M=this.top+u;else if("left"===o)m=g(this.right),x=this.right-u,_=m-p,S=g(t.left)+p,C=t.right;else if("right"===o)m=g(this.left),S=t.left,C=g(t.right)-p,x=m+p,_=this.left+u;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(xu(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}k=t.top,D=t.bottom,w=m+p,M=w+u}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(xu(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}x=m-p,_=x-u,S=t.left,C=t.right}const O=Mu(i.ticks.maxTicksLimit,c),R=Math.max(1,Math.ceil(c/O));for(y=0;y<c;y+=R){const t=this.getContext(y),e=r.setContext(t),i=s.setContext(t),o=e.lineWidth,c=e.color,u=i.dash||[],d=i.dashOffset,f=e.tickWidth,p=e.tickColor,g=e.tickBorderDash||[],m=e.tickBorderDashOffset;b=op(this,y,a),void 0!==b&&(v=jh(n,b,o),l?x=_=S=C=v:w=M=k=D=v,h.push({tx1:x,ty1:w,tx2:_,ty2:M,x1:S,y1:k,x2:C,y2:D,width:o,color:c,borderDash:u,borderDashOffset:d,tickWidth:f,tickColor:p,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=c,this._borderValue=m,h}_computeLabelItems(t){const e=this.axis,n=this.options,{position:i,ticks:r}=n,o=this.isHorizontal(),s=this.ticks,{align:a,crossAlign:l,padding:c,mirror:u}=r,h=sp(n.grid),d=h+c,f=u?-c:d,p=-Ju(this.labelRotation),g=[];let m,y,b,v,x,w,_,M,S,k,C,D,O="middle";if("top"===i)w=this.bottom-f,_=this._getXAxisLabelAlignment();else if("bottom"===i)w=this.top+f,_=this._getXAxisLabelAlignment();else if("left"===i){const t=this._getYAxisLabelAlignment(h);_=t.textAlign,x=t.x}else if("right"===i){const t=this._getYAxisLabelAlignment(h);_=t.textAlign,x=t.x}else if("x"===e){if("center"===i)w=(t.top+t.bottom)/2+d;else if(xu(i)){const t=Object.keys(i)[0],e=i[t];w=this.chart.scales[t].getPixelForValue(e)+d}_=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===i)x=(t.left+t.right)/2-d;else if(xu(i)){const t=Object.keys(i)[0],e=i[t];x=this.chart.scales[t].getPixelForValue(e)}_=this._getYAxisLabelAlignment(h).textAlign}"y"===e&&("start"===a?O="top":"end"===a&&(O="bottom"));const R=this._getLabelSizes();for(m=0,y=s.length;m<y;++m){b=s[m],v=b.label;const t=r.setContext(this.getContext(m));M=this.getPixelForTick(m)+r.labelOffset,S=this._resolveTickFontOptions(m),k=S.lineHeight,C=vu(v)?v.length:1;const e=C/2,n=t.color,a=t.textStrokeColor,c=t.textStrokeWidth;let h,d=_;if(o?(x=M,"inner"===_&&(d=m===y-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),D="top"===i?"near"===l||0!==p?-C*k+k/2:"center"===l?-R.highest.height/2-e*k+k:-R.highest.height+k/2:"near"===l||0!==p?k/2:"center"===l?R.highest.height/2-e*k:R.highest.height-C*k,u&&(D*=-1),0===p||t.showLabelBackdrop||(x+=k/2*Math.sin(p))):(w=M,D=(1-C)*k/2),t.showLabelBackdrop){const e=id(t.backdropPadding),n=R.heights[m],i=R.widths[m];let r=D-e.top,o=0-e.left;switch(O){case"middle":r-=n/2;break;case"bottom":r-=n}switch(_){case"center":o-=i/2;break;case"right":o-=i;break;case"inner":m===y-1?o-=i:m>0&&(o-=i/2)}h={left:o,top:r,width:i+e.width,height:n+e.height,color:t.backdropColor}}g.push({label:v,font:S,textOffset:D,options:{rotation:p,color:n,strokeColor:a,strokeWidth:c,textAlign:d,textBaseline:O,translation:[x,w],backdrop:h}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ju(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align?n="right":"inner"===e.align&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:i,padding:r}}=this.options,o=t+r,s=this._getLabelSizes().widest.width;let a,l;return"left"===e?i?(l=this.right+r,"near"===n?a="left":"center"===n?(a="center",l+=s/2):(a="right",l+=s)):(l=this.right-o,"near"===n?a="right":"center"===n?(a="center",l-=s/2):(a="left",l=this.left)):"right"===e?i?(l=this.left+r,"near"===n?a="right":"center"===n?(a="center",l-=s/2):(a="left",l-=s)):(l=this.left+o,"near"===n?a="left":"center"===n?(a="center",l+=s/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:i,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,i,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(e=>e.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const s=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(e.display)for(r=0,o=i.length;r<o;++r){const t=i[r];e.drawOnChartArea&&s({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&s({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:n,grid:i}}=this,r=n.setContext(this.getContext()),o=n.display?r.width:0;if(!o)return;const s=i.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,c,u,h;this.isHorizontal()?(l=jh(t,this.left,o)-o/2,c=jh(t,this.right,s)+s/2,u=h=a):(u=jh(t,this.top,o)-o/2,h=jh(t,this.bottom,s)+s/2,l=c=a),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(l,u),e.lineTo(c,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,n=this._computeLabelArea();n&&Hh(e,n);const i=this.getLabelItems(t);for(const t of i){const n=t.options,i=t.font;Qh(e,t.label,0,t.textOffset,i,n)}n&&zh(e)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:i}}=this;if(!n.display)return;const r=rd(n.font),o=id(n.padding),s=n.align;let a=r.lineHeight/2;"bottom"===e||"center"===e||xu(e)?(a+=o.bottom,vu(n.text)&&(a+=r.lineHeight*(n.text.length-1))):a+=o.top;const{titleX:l,titleY:c,maxWidth:u,rotation:h}=function(t,e,n,i){const{top:r,left:o,bottom:s,right:a,chart:l}=t,{chartArea:c,scales:u}=l;let h,d,f,p=0;const g=s-r,m=a-o;if(t.isHorizontal()){if(d=mh(i,o,a),xu(n)){const t=Object.keys(n)[0],i=n[t];f=u[t].getPixelForValue(i)+g-e}else f="center"===n?(c.bottom+c.top)/2+g-e:np(t,n,e);h=a-o}else{if(xu(n)){const t=Object.keys(n)[0],i=n[t];d=u[t].getPixelForValue(i)-m+e}else d="center"===n?(c.left+c.right)/2-m+e:np(t,n,e);f=mh(i,s,r),p="left"===n?-$u:$u}return{titleX:d,titleY:f,maxWidth:h,rotation:p}}(this,a,e,s);Qh(t,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:h,textAlign:lp(s,e,i),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=Mu(t.grid&&t.grid.z,-1),i=Mu(t.border&&t.border.z,0);return this._isVisible()&&this.draw===cp.prototype.draw?[{z:n,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let r,o;for(r=0,o=e.length;r<o;++r){const o=e[r];o[n]!==this.id||t&&o.type!==t||i.push(o)}return i}_resolveTickFontOptions(t){return rd(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class up{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;(function(t){return"id"in t&&"defaults"in t})(e)&&(n=this.register(e));const i=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in i||(i[r]=t,function(t,e,n){const i=Tu(Object.create(null),[n?Ih.get(n):{},Ih.get(e),t.defaults]);Ih.set(e,i),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(n=>{const i=n.split("."),r=i.pop(),o=[t].concat(i).join("."),s=e[n].split("."),a=s.pop(),l=s.join(".");Ih.route(o,r,l,a)})}(e,t.defaultRoutes),t.descriptors&&Ih.describe(e,t.descriptors)}(t,o,n),this.override&&Ih.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in Ih[i]&&(delete Ih[i][n],this.override&&delete Ph[n])}}class hp{constructor(){this.controllers=new up(gf,"datasets",!0),this.elements=new up(tp,"elements"),this.plugins=new up(Object,"plugins"),this.scales=new up(cp,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(e=>{const i=n||this._getRegistryForType(e);n||i.isForType(e)||i===this.plugins&&e.id?this._exec(t,i,e):Cu(e,e=>{const i=n||this._getRegistryForType(e);this._exec(t,i,e)})})}_exec(t,e,n){const i=Lu(t);ku(n["before"+i],[],n),e[t](n),ku(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const i=e.get(t);if(void 0===i)throw new Error('"'+t+'" is not a registered '+n+".");return i}}var dp=new hp;class fp{constructor(){this._init=void 0}notify(t,e,n,i){if("beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),void 0===this._init)return;const r=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(r,t,e,n);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,e,n,i){i=i||{};for(const r of t){const t=r.plugin;if(!1===ku(t[n],[e,i,r.options],t)&&i.cancelable)return!1}return!0}invalidate(){bu(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=Mu(n.options&&n.options.plugins,{}),r=function(t){const e={},n=[],i=Object.keys(dp.plugins.items);for(let t=0;t<i.length;t++)n.push(dp.getPlugin(i[t]));const r=t.plugins||[];for(let t=0;t<r.length;t++){const i=r[t];-1===n.indexOf(i)&&(n.push(i),e[i.id]=!0)}return{plugins:n,localIds:e}}(n);return!1!==i||e?function(t,{plugins:e,localIds:n},i,r){const o=[],s=t.getContext();for(const a of e){const e=a.id,l=pp(i[e],r);null!==l&&o.push({plugin:a,options:gp(t.config,{plugin:a,local:n[e]},l,s)})}return o}(t,r,i,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,i=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function pp(t,e){return e||!1!==t?!0===t?{}:t:null}function gp(t,{plugin:e,local:n},i,r){const o=t.pluginScopeKeys(e),s=t.getOptionScopes(i,o);return n&&e.defaults&&s.push(e.defaults),t.createResolver(s,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function mp(t,e){const n=Ih.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function yp(t){if("x"===t||"y"===t||"r"===t)return t}function bp(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function vp(t,...e){if(yp(t))return t;for(const n of e){const e=n.axis||bp(n.position)||t.length>1&&yp(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function xp(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function wp(t){const e=t.options||(t.options={});e.plugins=Mu(e.plugins,{}),e.scales=function(t,e){const n=Ph[t.type]||{scales:{}},i=e.scales||{},r=mp(t.type,e),o=Object.create(null);return Object.keys(i).forEach(e=>{const s=i[e];if(!xu(s))return console.error(`Invalid scale configuration for scale: ${e}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=vp(e,s,function(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(n.length)return xp(t,"x",n[0])||xp(t,"y",n[0])}return{}}(e,t),Ih.scales[s.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,r),c=n.scales||{};o[e]=Eu(Object.create(null),[{axis:a},s,c[a],c[l]])}),t.data.datasets.forEach(n=>{const r=n.type||t.type,s=n.indexAxis||mp(r,e),a=(Ph[r]||{}).scales||{};Object.keys(a).forEach(t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,s),r=n[e+"AxisID"]||e;o[r]=o[r]||Object.create(null),Eu(o[r],[{axis:e},i[r],a[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];Eu(e,[Ih.scales[e.type],Ih.scale])}),o}(t,e)}function _p(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Mp=new Map,Sp=new Set;function kp(t,e){let n=Mp.get(t);return n||(n=e(),Mp.set(t,n),Sp.add(n)),n}const Cp=(t,e,n)=>{const i=Iu(e,n);void 0!==i&&t.add(i)};class Dp{constructor(t){this._config=function(t){return(t=t||{}).data=_p(t.data),wp(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=_p(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),wp(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return kp(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return kp(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return kp(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return kp(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:r}=this,o=this._cachedScopes(t,n),s=o.get(e);if(s)return s;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>Cp(a,t,e))),e.forEach(t=>Cp(a,i,t)),e.forEach(t=>Cp(a,Ph[r]||{},t)),e.forEach(t=>Cp(a,Ih,t)),e.forEach(t=>Cp(a,Th,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Sp.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ph[e]||{},Ih.datasets[e]||{},{type:e},Ih,Th]}resolveNamedOptions(t,e,n,i=[""]){const r={$shared:!0},{resolver:o,subPrefixes:s}=Op(this._resolverCache,t,i);let a=o;(function(t,e){const{isScriptable:n,isIndexable:i}=cd(t);for(const r of e){const e=n(r),o=i(r),s=(o||e)&&t[r];if(e&&(Fu(s)||Rp(s))||o&&vu(s))return!0}return!1})(o,e)&&(r.$shared=!1,a=ld(o,n=Fu(n)?n():n,this.createResolver(t,n,s)));for(const t of e)r[t]=a[t];return r}createResolver(t,e,n=[""],i){const{resolver:r}=Op(this._resolverCache,t,n);return xu(e)?ld(r,e,void 0,i):r}}function Op(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const r=n.join();let o=i.get(r);return o||(o={resolver:ad(e,n),subPrefixes:n.filter(t=>!t.toLowerCase().includes("hover"))},i.set(r,o)),o}const Rp=t=>xu(t)&&Object.getOwnPropertyNames(t).some(e=>Fu(t[e])),Pp=["top","bottom","left","right","chartArea"];function Tp(t,e){return"top"===t||"bottom"===t||-1===Pp.indexOf(t)&&"x"===e}function Ep(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function Ap(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),ku(n&&n.onComplete,[t],e)}function Np(t){const e=t.chart,n=e.options.animation;ku(n&&n.onProgress,[t],e)}function Ip(t){return Cd()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Lp={},jp=t=>{const e=Ip(t);return Object.values(Lp).filter(t=>t.canvas===e).pop()};function Fp(t,e,n){const i=Object.keys(t);for(const r of i){const i=+r;if(i>=e){const o=t[r];delete t[r],(n>0||i>e)&&(t[i+n]=o)}}}class Wp{static defaults=Ih;static instances=Lp;static overrides=Ph;static registry=dp;static version="4.5.1";static getChart=jp;static register(...t){dp.add(...t),Up()}static unregister(...t){dp.remove(...t),Up()}constructor(t,e){const n=this.config=new Dp(e),i=Ip(t),r=jp(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(t){return!Cd()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Ff:Jf}(i)),this.platform.updateConfig(n);const s=this.platform.acquireContext(i,o.aspectRatio),a=s&&s.canvas,l=a&&a.height,c=a&&a.width;this.id=yu(),this.ctx=s,this.canvas=a,this.width=c,this.height=l,this._options=o,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 fp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],Lp[this.id]=this,s&&a?(Zd.listen(this,"complete",Ap),Zd.listen(this,"progress",Np),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:r}=this;return bu(t)?e&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return dp}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Nd(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Fh(this.canvas,this.ctx),this}stop(){return Zd.stop(this),this}resize(t,e){Zd.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,e,r),s=n.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Nd(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),ku(n.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){Cu(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,i=Object.keys(n).reduce((t,e)=>(t[e]=!1,t),{});let r=[];e&&(r=r.concat(Object.keys(e).map(t=>{const n=e[t],i=vp(t,n),r="r"===i,o="x"===i;return{options:n,dposition:r?"chartArea":o?"bottom":"left",dtype:r?"radialLinear":o?"category":"linear"}}))),Cu(r,e=>{const r=e.options,o=r.id,s=vp(o,r),a=Mu(r.type,e.dtype);void 0!==r.position&&Tp(r.position,s)===Tp(e.dposition)||(r.position=e.dposition),i[o]=!0;let l=null;o in n&&n[o].type===a?l=n[o]:(l=new(dp.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),n[l.id]=l),l.init(r,t)}),Cu(i,(t,e)=>{t||delete n[e]}),Cu(n,t=>{Lf.configure(this,t,t.options),Lf.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((t,e)=>t.index-e.index),n>e){for(let t=e;t<n;++t)this._destroyDatasetMeta(t);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(Ep("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,n)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=e.length;n<i;n++){const i=e[n];let r=this.getDatasetMeta(n);const o=i.type||this.config.type;if(r.type&&r.type!==o&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=o,r.indexAxis=i.indexAxis||mp(o,this.options),r.order=i.order||0,r.index=n,r.label=""+i.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{const e=dp.getController(o),{datasetElementType:i,dataElementType:s}=Ih.datasets[o];Object.assign(e,{dataElementType:dp.getElement(s),datasetElementType:i&&dp.getElement(i)}),r.controller=new e(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){Cu(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),n=!i&&-1===r.indexOf(e);e.buildOrUpdateElements(n),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),i||Cu(r,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ep("z","_idx"));const{_active:s,_lastEvent:a}=this;a?this._eventHandler(a,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){Cu(this.scales,t=>{Lf.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);Wu(e,n)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:r}of e)Fp(t,i,"_removeElements"===n?-r:r)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),i=n(0);for(let t=1;t<e;t++)if(!Wu(i,n(t)))return;return Array.from(i).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Lf.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],Cu(this.boxes,t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Fu(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),i={meta:n,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",i)&&(n.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Zd.has(this)?this.attached&&!Zd.running(this)&&Zd.start(this):(this.draw(),Ap({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let i,r;for(i=0,r=e.length;i<r;++i){const r=e[i];t&&!r.visible||n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n={meta:t,index:t.index,cancelable:!0},i=Xd(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",n)&&(i&&Hh(e,i),t.controller.draw(),i&&zh(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return Bh(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,i){const r=Sf.modes[e];return"function"==typeof r?r(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter(t=>t&&t._dataset===e).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=sd(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const i=n?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,i);ju(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(r,{visible:n}),this.update(e=>e.datasetIndex===t?i:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Zd.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Fh(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Lp[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(t,e,n)=>{t.offsetX=e,t.offsetY=n,this._eventHandler(t)};Cu(this.options.events,t=>n(t,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(n,i)=>{t[n]&&(e.removeEventListener(this,n,i),delete t[n])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const s=()=>{i("attach",s),this.attached=!0,this.resize(),n("resize",r),n("detach",o)};o=()=>{this.attached=!1,i("resize",r),this._stop(),this._resize(0,0),n("attach",s)},e.isAttached(this.canvas)?s():o()}unbindEvents(){Cu(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Cu(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let r,o,s,a;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),s=0,a=t.length;s<a;++s){o=t[s];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:t,index:e})=>{const n=this.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[e],index:e}});!Du(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,n){const i=this.options.hover,r=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=r(e,t),s=n?t:r(t,e);o.length&&this.updateHoverStyle(o,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",n,i))return;const r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:i=[],options:r}=this,o=e,s=this._getActiveElements(t,i,n,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,n,i){return n&&"mouseout"!==t.type?i?e:t:null}(t,this._lastEvent,n,a);n&&(this._lastEvent=null,ku(r.onHover,[t,s,this],this),a&&ku(r.onClick,[t,s,this],this));const c=!Du(s,i);return(c||e)&&(this._active=s,this._updateHoverStyles(s,i,e)),this._lastEvent=l,c}_getActiveElements(t,e,n,i){if("mouseout"===t.type)return[];if(!n)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,i)}}function Up(){return Cu(Wp.instances,t=>t._plugins.invalidate())}function Bp(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function Hp(t,e,n,i,r,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=e,h=Math.max(e.outerRadius+i+n-c,0),d=u>0?u+i+n+c:0;let f=0;const p=r-l;if(i){const t=((u>0?u-i:0)+(h>0?h-i:0))/2;f=(p-(0!==t?p*t/(t+i):p))/2}const g=(p-Math.max(.001,p*h-n/Uu)/h)/2,m=l+g+f,y=r-g-f,{outerStart:b,outerEnd:v,innerStart:x,innerEnd:w}=function(t,e,n,i){const r=td(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(n-e)/2,s=Math.min(o,i*e/2),a=t=>{const e=(n-Math.min(o,t))*i/2;return sh(t,0,Math.min(o,e))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:sh(r.innerStart,0,s),innerEnd:sh(r.innerEnd,0,s)}}(e,d,h,y-m),_=h-b,M=h-v,S=m+b/_,k=y-v/M,C=d+x,D=d+w,O=m+x/C,R=y-w/D;if(t.beginPath(),o){const e=(S+k)/2;if(t.arc(s,a,h,S,e),t.arc(s,a,h,e,k),v>0){const e=Bp(M,k,s,a);t.arc(e.x,e.y,v,k,y+$u)}const n=Bp(D,y,s,a);if(t.lineTo(n.x,n.y),w>0){const e=Bp(D,R,s,a);t.arc(e.x,e.y,w,y+$u,R+Math.PI)}const i=(y-w/d+(m+x/d))/2;if(t.arc(s,a,d,y-w/d,i,!0),t.arc(s,a,d,i,m+x/d,!0),x>0){const e=Bp(C,O,s,a);t.arc(e.x,e.y,x,O+Math.PI,m-$u)}const r=Bp(_,m,s,a);if(t.lineTo(r.x,r.y),b>0){const e=Bp(_,S,s,a);t.arc(e.x,e.y,b,m-$u,S)}}else{t.moveTo(s,a);const e=Math.cos(S)*h+s,n=Math.sin(S)*h+a;t.lineTo(e,n);const i=Math.cos(k)*h+s,r=Math.sin(k)*h+a;t.lineTo(i,r)}t.closePath()}function zp(t,e,n=e){t.lineCap=Mu(n.borderCapStyle,e.borderCapStyle),t.setLineDash(Mu(n.borderDash,e.borderDash)),t.lineDashOffset=Mu(n.borderDashOffset,e.borderDashOffset),t.lineJoin=Mu(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Mu(n.borderWidth,e.borderWidth),t.strokeStyle=Mu(n.borderColor,e.borderColor)}function Yp(t,e,n){t.lineTo(n.x,n.y)}function $p(t,e,n={}){const i=t.length,{start:r=0,end:o=i-1}=n,{start:s,end:a}=e,l=Math.max(r,s),c=Math.min(o,a),u=r<s&&o<s||r>a&&o>a;return{count:i,start:l,loop:e.loop,ilen:c<l&&!u?i+c-l:c-l}}function qp(t,e,n,i){const{points:r,options:o}=e,{count:s,start:a,loop:l,ilen:c}=$p(r,n,i),u=function(t){return t.stepped?Yh:t.tension||"monotone"===t.cubicInterpolationMode?$h:Yp}(o);let h,d,f,{move:p=!0,reverse:g}=i||{};for(h=0;h<=c;++h)d=r[(a+(g?c-h:h))%s],d.skip||(p?(t.moveTo(d.x,d.y),p=!1):u(t,f,d,g,o.stepped),f=d);return l&&(d=r[(a+(g?c:0))%s],u(t,f,d,g,o.stepped)),!!l}function Vp(t,e,n,i){const r=e.points,{count:o,start:s,ilen:a}=$p(r,n,i),{move:l=!0,reverse:c}=i||{};let u,h,d,f,p,g,m=0,y=0;const b=t=>(s+(c?a-t:t))%o,v=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(h=r[b(0)],t.moveTo(h.x,h.y)),u=0;u<=a;++u){if(h=r[b(u)],h.skip)continue;const e=h.x,n=h.y,i=0|e;i===d?(n<f?f=n:n>p&&(p=n),m=(y*m+e)/++y):(v(),t.lineTo(e,n),d=i,y=0,f=p=n),g=n}v()}function Qp(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n?qp:Vp}const Kp="function"==typeof Path2D;class Xp extends tp{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;kd(this._points,n,t,i,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const n=t.points,i=t.options.spanGaps,r=n.length;if(!r)return[];const o=!!t._loop,{start:s,end:a}=function(t,e,n,i){let r=0,o=e-1;if(n&&!i)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,n&&(o+=r);o>r&&t[o%e].skip;)o--;return o%=e,{start:r,end:o}}(n,r,o,i);return function(t,e,n,i){return i&&i.setContext&&n?function(t,e,n,i){const r=t._chart.getContext(),o=Vd(t.options),{_datasetIndex:s,options:{spanGaps:a}}=t,l=n.length,c=[];let u=o,h=e[0].start,d=h;function f(t,e,i,r){const o=a?-1:1;if(t!==e){for(t+=l;n[t%l].skip;)t-=o;for(;n[e%l].skip;)e+=o;t%l!==e%l&&(c.push({start:t%l,end:e%l,loop:i,style:r}),u=r,h=e%l)}}for(const t of e){h=a?h:t.start;let e,o=n[h%l];for(d=h+1;d<=t.end;d++){const a=n[d%l];e=Vd(i.setContext(sd(r,{type:"segment",p0:o,p1:a,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:s}))),Qd(e,u)&&f(h,d-1,t.loop,u),o=a,u=e}h<d-1&&f(h,d-1,t.loop,u)}return c}(t,e,n,i):e}(t,!0===i?[{start:s,end:a,loop:o}]:function(t,e,n,i){const r=t.length,o=[];let s,a=e,l=t[e];for(s=e+1;s<=n;++s){const n=t[s%r];n.skip||n.stop?l.skip||(i=!1,o.push({start:e%r,end:(s-1)%r,loop:i}),e=a=n.stop?s:null):(a=s,l.skip&&(e=s)),l=n}return null!==a&&o.push({start:e%r,end:a%r,loop:i}),o}(n,s,a<s?a+r:a,!!t._fullLoop&&0===s&&a===r-1),n,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,i=t[e],r=this.points,o=qd(this,{property:e,start:i,end:i});if(!o.length)return;const s=[],a=function(t){return t.stepped?Fd:t.tension||"monotone"===t.cubicInterpolationMode?Wd:jd}(n);let l,c;for(l=0,c=o.length;l<c;++l){const{start:c,end:u}=o[l],h=r[c],d=r[u];if(h===d){s.push(h);continue}const f=a(h,d,Math.abs((i-h[e])/(d[e]-h[e])),n.stepped);f[e]=t[e],s.push(f)}return 1===s.length?s[0]:s}pathSegment(t,e,n){return Qp(this)(t,this,e,n)}path(t,e,n){const i=this.segments,r=Qp(this);let o=this._loop;e=e||0,n=n||this.points.length-e;for(const s of i)o&=r(t,this,s,{start:e,end:e+n-1});return!!o}draw(t,e,n,i){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),function(t,e,n,i){Kp&&!e.options.segment?function(t,e,n,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,i)&&r.closePath()),zp(t,e.options),t.stroke(r)}(t,e,n,i):function(t,e,n,i){const{segments:r,options:o}=e,s=Qp(e);for(const a of r)zp(t,o,a.style),t.beginPath(),s(t,e,a,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Gp(t,e,n,i){const r=t.options,{[n]:o}=t.getProps([n],i);return Math.abs(e-o)<r.radius+r.hitRadius}function Zp(t,e){const{x:n,y:i,base:r,width:o,height:s}=t.getProps(["x","y","base","width","height"],e);let a,l,c,u,h;return t.horizontal?(h=s/2,a=Math.min(n,r),l=Math.max(n,r),c=i-h,u=i+h):(h=o/2,a=n-h,l=n+h,c=Math.min(i,r),u=Math.max(i,r)),{left:a,top:c,right:l,bottom:u}}function Jp(t,e,n,i){return t?0:sh(e,n,i)}function tg(t,e,n,i){const r=null===e,o=null===n,s=t&&!(r&&o)&&Zp(t,i);return s&&(r||ah(e,s.left,s.right))&&(o||ah(n,s.top,s.bottom))}function eg(t,e){t.rect(e.x,e.y,e.w,e.h)}function ng(t,e,n={}){const i=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-i,s=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+i,y:t.y+r,w:t.w+o,h:t.h+s,radius:t.radius}}function ig(t,e,n,i){if(i)return;let r=e[t],o=n[t];return"angle"===t&&(r=rh(r),o=rh(o)),{property:t,start:r,end:o}}function rg(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function og(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function sg(t,e){let n=[],i=!1;return vu(t)?(i=!0,n=t):n=function(t,e){const{x:n=null,y:i=null}=t||{},r=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=rg(t,e,r);const s=r[t],a=r[e];null!==i?(o.push({x:s.x,y:i}),o.push({x:a.x,y:i})):null!==n&&(o.push({x:n,y:s.y}),o.push({x:n,y:a.y}))}),o}(t,e),n.length?new Xp({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function ag(t){return t&&!1!==t.fill}function lg(t,e,n){let i=t[e].fill;const r=[e];let o;if(!n)return i;for(;!1!==i&&-1===r.indexOf(i);){if(!wu(i))return i;if(o=t[i],!o)return!1;if(o.visible)return i;r.push(i),i=o.fill}return!1}function cg(t,e,n){const i=function(t){const e=t.options,n=e.fill;let i=Mu(n&&n.target,n);return void 0===i&&(i=!!e.backgroundColor),!1!==i&&null!==i&&(!0===i?"origin":i)}(t);if(xu(i))return!isNaN(i.value)&&i;let r=parseFloat(i);return wu(r)&&Math.floor(r)===r?function(t,e,n,i){return"-"!==t&&"+"!==t||(n=e+n),!(n===e||n<0||n>=i)&&n}(i[0],e,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function ug(t,e,n){const i=[];for(let r=0;r<n.length;r++){const o=n[r],{first:s,last:a,point:l}=hg(o,e,"x");if(!(!l||s&&a))if(s)i.unshift(l);else if(t.push(l),!a)break}t.push(...i)}function hg(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const r=i[n],o=t.segments,s=t.points;let a=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],i=s[e.start][n],c=s[e.end][n];if(ah(r,i,c)){a=r===i,l=r===c;break}}return{first:a,last:l,point:i}}class dg{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:i,y:r,radius:o}=this;return e=e||{start:0,end:Bu},t.arc(i,r,o,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:i}=this,r=t.angle;return{x:e+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}}function fg(t,e,n){const i=function(t){const{chart:e,fill:n,line:i}=t;if(wu(n))return function(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}(e,n);if("stack"===n)return function(t){const{scale:e,index:n,line:i}=t,r=[],o=i.segments,s=i.points,a=function(t,e){const n=[],i=t.getMatchingVisibleMetas("line");for(let t=0;t<i.length;t++){const r=i[t];if(r.index===e)break;r.hidden||n.unshift(r.dataset)}return n}(e,n);a.push(sg({x:null,y:e.bottom},i));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)ug(r,s[t],a)}return new Xp({points:r,options:{}})}(t);if("shape"===n)return!0;const r=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:n}=t,i=e.options,r=e.getLabels().length,o=i.reverse?e.max:e.min,s=function(t,e,n){let i;return i="start"===t?n:"end"===t?e.options.reverse?e.min:e.max:xu(t)?t.value:e.getBaseValue(),i}(n,e,o),a=[];if(i.grid.circular){const t=e.getPointPositionForValue(0,o);return new dg({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(s)})}for(let t=0;t<r;++t)a.push(e.getPointPositionForValue(t,s));return a}(t):function(t){const{scale:e={},fill:n}=t,i=function(t,e){let n=null;return"start"===t?n=e.bottom:"end"===t?n=e.top:xu(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}(n,e);if(wu(i)){const t=e.isHorizontal();return{x:t?i:null,y:t?null:i}}return null}(t)}(t);return r instanceof dg?r:sg(r,i)}(e),{chart:r,index:o,line:s,scale:a,axis:l}=e,c=s.options,u=c.fill,h=c.backgroundColor,{above:d=h,below:f=h}=u||{},p=r.getDatasetMeta(o),g=Xd(r,p);i&&s.points.length&&(Hh(t,n),function(t,e){const{line:n,target:i,above:r,below:o,area:s,scale:a,clip:l}=e,c=n._loop?"angle":e.axis;t.save();let u=o;o!==r&&("x"===c?(pg(t,i,s.top),mg(t,{line:n,target:i,color:r,scale:a,property:c,clip:l}),t.restore(),t.save(),pg(t,i,s.bottom)):"y"===c&&(gg(t,i,s.left),mg(t,{line:n,target:i,color:o,scale:a,property:c,clip:l}),t.restore(),t.save(),gg(t,i,s.right),u=r)),mg(t,{line:n,target:i,color:u,scale:a,property:c,clip:l}),t.restore()}(t,{line:s,target:i,above:d,below:f,area:n,scale:a,axis:l,clip:g}),zh(t))}function pg(t,e,n){const{segments:i,points:r}=e;let o=!0,s=!1;t.beginPath();for(const a of i){const{start:i,end:l}=a,c=r[i],u=r[rg(i,l,r)];o?(t.moveTo(c.x,c.y),o=!1):(t.lineTo(c.x,n),t.lineTo(c.x,c.y)),s=!!e.pathSegment(t,a,{move:s}),s?t.closePath():t.lineTo(u.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function gg(t,e,n){const{segments:i,points:r}=e;let o=!0,s=!1;t.beginPath();for(const a of i){const{start:i,end:l}=a,c=r[i],u=r[rg(i,l,r)];o?(t.moveTo(c.x,c.y),o=!1):(t.lineTo(n,c.y),t.lineTo(c.x,c.y)),s=!!e.pathSegment(t,a,{move:s}),s?t.closePath():t.lineTo(n,u.y)}t.lineTo(n,e.first().y),t.closePath(),t.clip()}function mg(t,e){const{line:n,target:i,property:r,color:o,scale:s,clip:a}=e,l=function(t,e,n){const i=t.segments,r=t.points,o=e.points,s=[];for(const t of i){let{start:i,end:a}=t;a=rg(i,a,r);const l=ig(n,r[i],r[a],t.loop);if(!e.segments){s.push({source:t,target:l,start:r[i],end:r[a]});continue}const c=qd(e,l);for(const e of c){const i=ig(n,o[e.start],o[e.end],e.loop),a=$d(t,r,i);for(const t of a)s.push({source:t,target:e,start:{[n]:og(l,i,"start",Math.max)},end:{[n]:og(l,i,"end",Math.min)}})}}return s}(n,i,r);for(const{source:e,target:c,start:u,end:h}of l){const{style:{backgroundColor:l=o}={}}=e,d=!0!==i;t.save(),t.fillStyle=l,yg(t,s,a,d&&ig(r,u,h)),t.beginPath();const f=!!n.pathSegment(t,e);let p;if(d){f?t.closePath():bg(t,i,h,r);const e=!!i.pathSegment(t,c,{move:f,reverse:!0});p=f&&e,p||bg(t,i,u,r)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function yg(t,e,n,i){const r=e.chart.chartArea,{property:o,start:s,end:a}=i||{};if("x"===o||"y"===o){let e,i,l,c;"x"===o?(e=s,i=r.top,l=a,c=r.bottom):(e=r.left,i=s,l=r.right,c=a),t.beginPath(),n&&(e=Math.max(e,n.left),l=Math.min(l,n.right),i=Math.max(i,n.top),c=Math.min(c,n.bottom)),t.rect(e,i,l-e,c-i),t.clip()}}function bg(t,e,n,i){const r=e.interpolate(n,i);r&&t.lineTo(r.x,r.y)}var vg={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,r=[];let o,s,a,l;for(s=0;s<i;++s)o=t.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof Xp&&(l={visible:t.isDatasetVisible(s),index:s,fill:cg(a,s,i),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,r.push(l);for(s=0;s<i;++s)l=r[s],l&&!1!==l.fill&&(l.fill=lg(r,s,n.propagate))},beforeDraw(t,e,n){const i="beforeDraw"===n.drawTime,r=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=r.length-1;e>=0;--e){const n=r[e].$filler;n&&(n.line.updateControlPoints(o,n.axis),i&&n.fill&&fg(t.ctx,n,o))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=t.getSortedVisibleDatasetMetas();for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;ag(n)&&fg(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;ag(i)&&"beforeDatasetDraw"===n.drawTime&&fg(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const xg=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=t.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}};class wg extends tp{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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 t=this.options.labels||{};let e=ku(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,n)=>t.sort(e,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const n=t.labels,i=rd(n.font),r=i.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:a}=xg(n,r);let l,c;e.font=i.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,r,s,a)+10):(c=this.maxHeight,l=this._fitCols(o,i,s,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,i){const{ctx:r,maxWidth:o,options:{labels:{padding:s}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=i+s;let u=t;r.textAlign="left",r.textBaseline="middle";let h=-1,d=-c;return this.legendItems.forEach((t,f)=>{const p=n+e/2+r.measureText(t.text).width;(0===f||l[l.length-1]+p+2*s>o)&&(u+=c,l[l.length-(f>0?0:1)]=0,d+=c,h++),a[f]={left:0,top:d,row:h,width:p,height:i},l[l.length-1]+=p+s}),u}_fitCols(t,e,n,i){const{ctx:r,maxHeight:o,options:{labels:{padding:s}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let u=s,h=0,d=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,n,i,r){const o=function(t,e,n,i){let r=t.text;return r&&"string"!=typeof r&&(r=r.reduce((t,e)=>t.length>e.length?t:e)),e+n.size/2+i.measureText(r).width}(i,t,e,n),s=function(t,e,n){let i=t;return"string"!=typeof e.text&&(i=_g(e,n)),i}(r,i,e.lineHeight);return{itemWidth:o,itemHeight:s}}(n,e,r,t,i);o>0&&d+m+2*s>c&&(u+=h+s,l.push({width:h,height:d}),f+=h+s,p++,h=d=0),a[o]={left:f,top:d,col:p,width:g,height:m},h=Math.max(h,g),d+=m+s}),u+=h,l.push({width:h,height:d}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:i},rtl:r}}=this,o=Ud(r,this.left,this.width);if(this.isHorizontal()){let r=0,s=mh(n,this.left+i,this.right-this.lineWidths[r]);for(const a of e)r!==a.row&&(r=a.row,s=mh(n,this.left+i,this.right-this.lineWidths[r])),a.top+=this.top+t+i,a.left=o.leftForLtr(o.x(s),a.width),s+=a.width+i}else{let r=0,s=mh(n,this.top+t+i,this.bottom-this.columnSizes[r].height);for(const a of e)a.col!==r&&(r=a.col,s=mh(n,this.top+t+i,this.bottom-this.columnSizes[r].height)),a.top=s,a.left+=this.left+i,a.left=o.leftForLtr(o.x(a.left),a.width),s+=a.height+i}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Hh(t,this),this._draw(),zh(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:i}=this,{align:r,labels:o}=t,s=Ih.color,a=Ud(t.rtl,this.left,this.width),l=rd(o.font),{padding:c}=o,u=l.size,h=u/2;let d;this.drawTitle(),i.textAlign=a.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=xg(o,u),m=this.isHorizontal(),y=this._computeTitleHeight();d=m?{x:mh(r,this.left+c,this.right-n[0]),y:this.top+c+y,line:0}:{x:this.left+c,y:mh(r,this.top+y+c,this.bottom-e[0].height),line:0},Bd(this.ctx,t.textDirection);const b=g+c;this.legendItems.forEach((v,x)=>{i.strokeStyle=v.fontColor,i.fillStyle=v.fontColor;const w=i.measureText(v.text).width,_=a.textAlign(v.textAlign||(v.textAlign=o.textAlign)),M=f+h+w;let S=d.x,k=d.y;if(a.setWidth(this.width),m?x>0&&S+M+c>this.right&&(k=d.y+=b,d.line++,S=d.x=mh(r,this.left+c,this.right-n[d.line])):x>0&&k+b>this.bottom&&(S=d.x=S+e[d.line].width+c,d.line++,k=d.y=mh(r,this.top+y+c,this.bottom-e[d.line].height)),function(t,e,n){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;i.save();const r=Mu(n.lineWidth,1);if(i.fillStyle=Mu(n.fillStyle,s),i.lineCap=Mu(n.lineCap,"butt"),i.lineDashOffset=Mu(n.lineDashOffset,0),i.lineJoin=Mu(n.lineJoin,"miter"),i.lineWidth=r,i.strokeStyle=Mu(n.strokeStyle,s),i.setLineDash(Mu(n.lineDash,[])),o.usePointStyle){const s={radius:p*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},l=a.xPlus(t,f/2);Uh(i,s,l,e+h,o.pointStyleWidth&&f)}else{const o=e+Math.max((u-p)/2,0),s=a.leftForLtr(t,f),l=nd(n.borderRadius);i.beginPath(),Object.values(l).some(t=>0!==t)?Kh(i,{x:s,y:o,w:f,h:p,radius:l}):i.rect(s,o,f,p),i.fill(),0!==r&&i.stroke()}i.restore()}(a.x(S),k,v),S=((t,e,n,i)=>t===(i?"left":"right")?n:"center"===t?(e+n)/2:e)(_,S+f+h,m?S+M:this.right,t.rtl),function(t,e,n){Qh(i,n.text,t,e+g/2,l,{strikethrough:n.hidden,textAlign:a.textAlign(n.textAlign)})}(a.x(S),k,v),m)d.x+=M+c;else if("string"!=typeof v.text){const t=l.lineHeight;d.y+=_g(v,t)+c}else d.y+=b}),Hd(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=rd(e.font),i=id(e.padding);if(!e.display)return;const r=Ud(t.rtl,this.left,this.width),o=this.ctx,s=e.position,a=n.size/2,l=i.top+a;let c,u=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+l,u=mh(t.align,u,this.right-h);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+mh(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const d=mh(s,u,u+h);o.textAlign=r.textAlign(gh(s)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=n.string,Qh(o,e.text,d,c,n)}_computeTitleHeight(){const t=this.options.title,e=rd(t.font),n=id(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,i,r;if(ah(t,this.left,this.right)&&ah(e,this.top,this.bottom))for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(i=r[n],ah(t,i.left,i.left+i.width)&&ah(e,i.top,i.top+i.height))return this.legendItems[n];return null}handleEvent(t){const e=this.options;if(!function(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,s=(r=n,null!==(i=o)&&null!==r&&i.datasetIndex===r.datasetIndex&&i.index===r.index);o&&!s&&ku(e.onLeave,[t,o,this],this),this._hoveredItem=n,n&&!s&&ku(e.onHover,[t,n,this],this)}else n&&ku(e.onClick,[t,n,this],this);var i,r}}function _g(t,e){return e*(t.text?t.text.length:0)}var Mg={id:"legend",_element:wg,start(t,e,n){const i=t.legend=new wg({ctx:t.ctx,options:n,chart:t});Lf.configure(t,i,n),Lf.addBox(t,i)},stop(t){Lf.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;Lf.configure(t,i,n),i.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 i=e.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),e.hidden=!0):(r.show(i),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:i,textAlign:r,color:o,useBorderRadius:s,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(n?0:void 0),c=id(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:i||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:s&&(a||l.borderRadius),datasetIndex:t.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 Sg extends tp{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const i=vu(n.text)?n.text.length:1;this._padding=id(n.padding);const r=i*rd(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:n,bottom:i,right:r,options:o}=this,s=o.align;let a,l,c,u=0;return this.isHorizontal()?(l=mh(s,n,r),c=e+t,a=r-n):("left"===o.position?(l=n+t,c=mh(s,i,e),u=-.5*Uu):(l=r-t,c=mh(s,e,i),u=.5*Uu),a=i-e),{titleX:l,titleY:c,maxWidth:a,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=rd(e.font),i=n.lineHeight/2+this._padding.top,{titleX:r,titleY:o,maxWidth:s,rotation:a}=this._drawArgs(i);Qh(t,e.text,0,0,n,{color:e.color,maxWidth:s,rotation:a,textAlign:gh(e.align),textBaseline:"middle",translation:[r,o]})}}var kg={id:"title",_element:Sg,start(t,e,n){!function(t,e){const n=new Sg({ctx:t.ctx,options:e,chart:t});Lf.configure(t,n,e),Lf.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;Lf.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;Lf.configure(t,i,n),i.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}};new WeakMap;const Cg={average(t){if(!t.length)return!1;let e,n,i=new Set,r=0,o=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();i.add(t.x),r+=t.y,++o}}return 0!==o&&0!==i.size&&{x:[...i].reduce((t,e)=>t+e)/i.size,y:r/o}},nearest(t,e){if(!t.length)return!1;let n,i,r,o=e.x,s=e.y,a=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){const i=t[n].element;if(i&&i.hasValue()){const t=nh(e,i.getCenterPoint());t<a&&(a=t,r=i)}}if(r){const t=r.tooltipPosition();o=t.x,s=t.y}return{x:o,y:s}}};function Dg(t,e){return e&&(vu(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Og(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Rg(t,e){const{element:n,datasetIndex:i,index:r}=e,o=t.getDatasetMeta(i).controller,{label:s,value:a}=o.getLabelAndValue(r);return{chart:t,label:s,parsed:o.getParsed(r),raw:t.data.datasets[i].data[r],formattedValue:a,dataset:o.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Pg(t,e){const n=t.chart.ctx,{body:i,footer:r,title:o}=t,{boxWidth:s,boxHeight:a}=e,l=rd(e.bodyFont),c=rd(e.titleFont),u=rd(e.footerFont),h=o.length,d=r.length,f=i.length,p=id(e.padding);let g=p.height,m=0,y=i.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);y+=t.beforeBody.length+t.afterBody.length,h&&(g+=h*c.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),y&&(g+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(y-f)*l.lineHeight+(y-1)*e.bodySpacing),d&&(g+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let b=0;const v=function(t){m=Math.max(m,n.measureText(t).width+b)};return n.save(),n.font=c.string,Cu(t.title,v),n.font=l.string,Cu(t.beforeBody.concat(t.afterBody),v),b=e.displayColors?s+2+e.boxPadding:0,Cu(i,t=>{Cu(t.before,v),Cu(t.lines,v),Cu(t.after,v)}),b=0,n.font=u.string,Cu(t.footer,v),n.restore(),m+=p.width,{width:m,height:g}}function Tg(t,e,n,i){const{x:r,width:o}=n,{width:s,chartArea:{left:a,right:l}}=t;let c="center";return"center"===i?c=r<=(a+l)/2?"left":"right":r<=o/2?c="left":r>=s-o/2&&(c="right"),function(t,e,n,i){const{x:r,width:o}=i,s=n.caretSize+n.caretPadding;return"left"===t&&r+o+s>e.width||"right"===t&&r-o-s<0||void 0}(c,t,e,n)&&(c="center"),c}function Eg(t,e,n){const i=n.yAlign||e.yAlign||function(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}(t,n);return{xAlign:n.xAlign||e.xAlign||Tg(t,e,n,i),yAlign:i}}function Ag(t,e,n,i){const{caretSize:r,caretPadding:o,cornerRadius:s}=t,{xAlign:a,yAlign:l}=n,c=r+o,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:f}=nd(s);let p=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,a);const g=function(t,e,n){let{y:i,height:r}=t;return"top"===e?i+=n:i-="bottom"===e?r+n:r/2,i}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(u,d)+r:"right"===a&&(p+=Math.max(h,f)+r),{x:sh(p,0,i.width-e.width),y:sh(g,0,i.height-e.height)}}function Ng(t,e,n){const i=id(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function Ig(t){return Dg([],Og(t))}function Lg(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const jg={beforeTitle:mu,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:mu,beforeBody:mu,beforeLabel:mu,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return bu(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:mu,afterBody:mu,beforeFooter:mu,footer:mu,afterFooter:mu};function Fg(t,e,n,i){const r=t[e].call(n,i);return void 0===r?jg[e].call(n,i):r}class Wg extends tp{static positioners=Cg;constructor(t){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=t.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&e.options.animation&&n.animations,r=new nf(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=sd(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,e){const{callbacks:n}=e,i=Fg(n,"beforeTitle",this,t),r=Fg(n,"title",this,t),o=Fg(n,"afterTitle",this,t);let s=[];return s=Dg(s,Og(i)),s=Dg(s,Og(r)),s=Dg(s,Og(o)),s}getBeforeBody(t,e){return Ig(Fg(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,i=[];return Cu(t,t=>{const e={before:[],lines:[],after:[]},r=Lg(n,t);Dg(e.before,Og(Fg(r,"beforeLabel",this,t))),Dg(e.lines,Fg(r,"label",this,t)),Dg(e.after,Og(Fg(r,"afterLabel",this,t))),i.push(e)}),i}getAfterBody(t,e){return Ig(Fg(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,i=Fg(n,"beforeFooter",this,t),r=Fg(n,"footer",this,t),o=Fg(n,"afterFooter",this,t);let s=[];return s=Dg(s,Og(i)),s=Dg(s,Og(r)),s=Dg(s,Og(o)),s}_createItems(t){const e=this._active,n=this.chart.data,i=[],r=[],o=[];let s,a,l=[];for(s=0,a=e.length;s<a;++s)l.push(Rg(this.chart,e[s]));return t.filter&&(l=l.filter((e,i,r)=>t.filter(e,i,r,n))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,n))),Cu(l,e=>{const n=Lg(t.callbacks,e);i.push(Fg(n,"labelColor",this,e)),r.push(Fg(n,"labelPointStyle",this,e)),o.push(Fg(n,"labelTextColor",this,e))}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),i=this._active;let r,o=[];if(i.length){const t=Cg[n.position].call(this,i,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const e=this._size=Pg(this,n),s=Object.assign({},t,e),a=Eg(this.chart,n,s),l=Ag(n,s,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,r={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,i){const r=this.getCaretPosition(t,n,i);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:r}=this,{caretSize:o,cornerRadius:s}=n,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:u}=nd(s),{x:h,y:d}=t,{width:f,height:p}=e;let g,m,y,b,v,x;return"center"===r?(v=d+p/2,"left"===i?(g=h,m=g-o,b=v+o,x=v-o):(g=h+f,m=g+o,b=v-o,x=v+o),y=g):(m="left"===i?h+Math.max(a,c)+o:"right"===i?h+f-Math.max(l,u)-o:this.caretX,"top"===r?(b=d,v=b-o,g=m-o,y=m+o):(b=d+p,v=b+o,g=m+o,y=m-o),x=b),{x1:g,x2:m,x3:y,y1:b,y2:v,y3:x}}drawTitle(t,e,n){const i=this.title,r=i.length;let o,s,a;if(r){const l=Ud(n.rtl,this.x,this.width);for(t.x=Ng(this,n.titleAlign,n),e.textAlign=l.textAlign(n.titleAlign),e.textBaseline="middle",o=rd(n.titleFont),s=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,a=0;a<r;++a)e.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+s,a+1===r&&(t.y+=n.titleMarginBottom-s)}}_drawColorBox(t,e,n,i,r){const o=this.labelColors[n],s=this.labelPointStyles[n],{boxHeight:a,boxWidth:l}=r,c=rd(r.bodyFont),u=Ng(this,"left",r),h=i.x(u),d=a<c.lineHeight?(c.lineHeight-a)/2:0,f=e.y+d;if(r.usePointStyle){const e={radius:Math.min(l,a)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},n=i.leftForLtr(h,l)+l/2,c=f+a/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Wh(t,e,n,c),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Wh(t,e,n,c)}else{t.lineWidth=xu(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=i.leftForLtr(h,l),n=i.leftForLtr(i.xPlus(h,1),l-2),s=nd(o.borderRadius);Object.values(s).some(t=>0!==t)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Kh(t,{x:e,y:f,w:l,h:a,radius:s}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Kh(t,{x:n,y:f+1,w:l-2,h:a-2,radius:s}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,f,l,a),t.strokeRect(e,f,l,a),t.fillStyle=o.backgroundColor,t.fillRect(n,f+1,l-2,a-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:i}=this,{bodySpacing:r,bodyAlign:o,displayColors:s,boxHeight:a,boxWidth:l,boxPadding:c}=n,u=rd(n.bodyFont);let h=u.lineHeight,d=0;const f=Ud(n.rtl,this.x,this.width),p=function(n){e.fillText(n,f.x(t.x+d),t.y+h/2),t.y+=h+r},g=f.textAlign(o);let m,y,b,v,x,w,_;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=Ng(this,g,n),e.fillStyle=n.bodyColor,Cu(this.beforeBody,p),d=s&&"right"!==g?"center"===o?l/2+c:l+2+c:0,v=0,w=i.length;v<w;++v){for(m=i[v],y=this.labelTextColors[v],e.fillStyle=y,Cu(m.before,p),b=m.lines,s&&b.length&&(this._drawColorBox(e,t,v,f,n),h=Math.max(u.lineHeight,a)),x=0,_=b.length;x<_;++x)p(b[x]),h=u.lineHeight;Cu(m.after,p)}d=0,h=u.lineHeight,Cu(this.afterBody,p),t.y-=r}drawFooter(t,e,n){const i=this.footer,r=i.length;let o,s;if(r){const a=Ud(n.rtl,this.x,this.width);for(t.x=Ng(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=a.textAlign(n.footerAlign),e.textBaseline="middle",o=rd(n.footerFont),e.fillStyle=n.footerColor,e.font=o.string,s=0;s<r;++s)e.fillText(i[s],a.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,e,n,i){const{xAlign:r,yAlign:o}=this,{x:s,y:a}=t,{width:l,height:c}=n,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:f}=nd(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(s+u,a),"top"===o&&this.drawCaret(t,e,n,i),e.lineTo(s+l-h,a),e.quadraticCurveTo(s+l,a,s+l,a+h),"center"===o&&"right"===r&&this.drawCaret(t,e,n,i),e.lineTo(s+l,a+c-f),e.quadraticCurveTo(s+l,a+c,s+l-f,a+c),"bottom"===o&&this.drawCaret(t,e,n,i),e.lineTo(s+d,a+c),e.quadraticCurveTo(s,a+c,s,a+c-d),"center"===o&&"left"===r&&this.drawCaret(t,e,n,i),e.lineTo(s,a+u),e.quadraticCurveTo(s,a,s+u,a),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){const n=Cg[t.position].call(this,this._active,this._eventPosition);if(!n)return;const o=this._size=Pg(this,t),s=Object.assign({},n,this._size),a=Eg(e,t,s),l=Ag(t,s,a,e);i._to===l.x&&r._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=id(e.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&s&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,i,e),Bd(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Hd(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,i=t.map(({datasetIndex:t,index:e})=>{const n=this.chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}),r=!Du(n,i),o=this._positionChanged(i,e);(r||o)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,n),s=this._positionChanged(o,t),a=e||!Du(o,r)||s;return a&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,n,i){const r=this.options;if("mouseout"===t.type)return[];if(!i)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:n,caretY:i,options:r}=this,o=Cg[r.position].call(this,t,e);return!1!==o&&(n!==o.x||i!==o.y)}}var Ug={id:"tooltip",_element:Wg,positioners:Cg,afterInit(t,e,n){n&&(t.tooltip=new Wg({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(!1===t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))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:jg},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Bg(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function Hg(t,e,{horizontal:n,minRotation:i}){const r=Ju(i),o=(n?Math.sin(r):Math.cos(r))||.001,s=.75*e*(""+t).length;return Math.min(e/o,s)}class zg extends cp{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return bu(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this;const o=t=>i=e?i:t,s=t=>r=n?r:t;if(t){const t=Ku(i),e=Ku(r);t<0&&e<0?s(0):t>0&&e>0&&o(0)}if(i===r){let e=0===r?1:Math.abs(.05*r);s(r+e),t||o(i-e)}this.min=i,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:n,stepSize:i}=t;return i?(e=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i=function(t,e){const n=[],{bounds:i,step:r,min:o,max:s,precision:a,count:l,maxTicks:c,maxDigits:u,includeBounds:h}=t,d=r||1,f=c-1,{min:p,max:g}=e,m=!bu(o),y=!bu(s),b=!bu(l),v=(g-p)/(u+1);let x,w,_,M,S=Gu((g-p)/f/d)*d;if(S<1e-14&&!m&&!y)return[{value:p},{value:g}];M=Math.ceil(g/S)-Math.floor(p/S),M>f&&(S=Gu(M*S/f/d)*d),bu(a)||(x=Math.pow(10,a),S=Math.ceil(S*x)/x),"ticks"===i?(w=Math.floor(p/S)*S,_=Math.ceil(g/S)*S):(w=p,_=g),m&&y&&r&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((s-o)/r,S/1e3)?(M=Math.round(Math.min((s-o)/S,c)),S=(s-o)/M,w=o,_=s):b?(w=m?o:w,_=y?s:_,M=l-1,S=(_-w)/M):(M=(_-w)/S,M=Xu(M,Math.round(M),S/1e3)?Math.round(M):Math.ceil(M));const k=Math.max(th(S),th(w));x=Math.pow(10,bu(a)?k:a),w=Math.round(w*x)/x,_=Math.round(_*x)/x;let C=0;for(m&&(h&&w!==o?(n.push({value:o}),w<o&&C++,Xu(Math.round((w+C*S)*x)/x,o,Hg(o,v,t))&&C++):w<o&&C++);C<M;++C){const t=Math.round((w+C*S)*x)/x;if(y&&t>s)break;n.push({value:t})}return y&&h&&_!==s?n.length&&Xu(n[n.length-1].value,s,Hg(s,v,t))?n[n.length-1].value=s:n.push({value:s}):y&&_!==s||n.push({value:_}),n}({maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&function(t,e,n){let i,r,o;for(i=0,r=t.length;i<r;i++)o=t[i][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-e)/Math.max(t.length-1,1)/2;e-=i,n+=i}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Dh(t,this.chart.options.locale,this.options.ticks.format)}}class Yg extends zg{static id="linear";static defaults={ticks:{callback:Rh.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=wu(t)?t:0,this.max=wu(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=Ju(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/i))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Rh.formatters.logarithmic,Rh.formatters.numeric;const $g="label";function qg(t,e){"function"==typeof t?t(e):t&&(t.current=e)}function Vg(t,e){t.labels=e}function Qg(t,e,n=$g){const i=[];t.datasets=e.map(e=>{const r=t.datasets.find(t=>t[n]===e[n]);return r&&e.data&&!i.includes(r)?(i.push(r),Object.assign(r,e),r):{...e}})}function Kg(t,e=$g){const n={labels:[],datasets:[]};return Vg(n,t.labels),Qg(n,t.datasets,e),n}function Xg(t,e){const{height:n=150,width:i=300,redraw:r=!1,datasetIdKey:o,type:s,data:a,options:c,plugins:u=[],fallbackContent:h,updateMode:d,...f}=t,p=(0,l.useRef)(null),m=(0,l.useRef)(null),y=()=>{p.current&&(m.current=new Wp(p.current,{type:s,data:Kg(a,o),options:c&&{...c},plugins:u}),qg(e,m.current))},b=()=>{qg(e,null),m.current&&(m.current.destroy(),m.current=null)};return(0,l.useEffect)(()=>{!r&&m.current&&c&&function(t,e){const n=t.options;n&&e&&Object.assign(n,e)}(m.current,c)},[r,c]),(0,l.useEffect)(()=>{!r&&m.current&&Vg(m.current.config.data,a.labels)},[r,a.labels]),(0,l.useEffect)(()=>{!r&&m.current&&a.datasets&&Qg(m.current.config.data,a.datasets,o)},[r,a.datasets]),(0,l.useEffect)(()=>{m.current&&(r?(b(),setTimeout(y)):m.current.update(d))},[r,c,a.labels,a.datasets,d]),(0,l.useEffect)(()=>{m.current&&(b(),setTimeout(y))},[s]),(0,l.useEffect)(()=>(y(),()=>b()),[]),(0,g.jsx)("canvas",{ref:p,role:"img",height:n,width:i,...f,children:h})}const Gg=(0,l.forwardRef)(Xg);function Zg(t,e){return Wp.register(e),(0,l.forwardRef)((e,n)=>(0,g.jsx)(Gg,{...e,ref:n,type:t}))}const Jg=Zg("line",yf),tm=Zg("pie",bf),em={id:"HTMLLegend",afterUpdate(t,e,n){const i=n.containerID;if(!i)return;const r=document.getElementById(i);if(!r)return;for(;r.firstChild;)r.firstChild.remove();const o=t.options.plugins?.legend?.labels?.generateLabels?.(t);if(!o||o.length<=1)return;const s=document.createElement("ul");s.className="UR-Analytics-Chart__LegendList",o.forEach(e=>{const n=((t,e,n="UR-Analytics-Chart__LegendItem")=>{const i=document.createElement("li");i.className=n,t.hidden&&i.classList.add("UR-Analytics-Chart__LegendItem--hidden");const r=document.createElement("span");r.className="UR-Analytics-Chart__LegendColor",r.style.background=t.strokeStyle,r.style.borderColor=t.strokeStyle,r.style.borderWidth=t.lineWidth+"px";const o=document.createElement("span");return o.className="UR-Analytics-Chart__LegendText",o.textContent=t.text,i.appendChild(r),i.appendChild(o),i.onclick=n=>{n.stopPropagation(),void 0!==t.index?e.toggleDataVisibility(t.index):void 0!==t.datasetIndex&&e.setDatasetVisibility(t.datasetIndex,!e.isDatasetVisible(t.datasetIndex)),e.update()},i})(e,t);s.appendChild(n)}),r.appendChild(s)}};Wp.register(class extends cp{static id="category";static defaults={ticks:{callback:Bg}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:n,label:i}of e)t[n]===i&&t.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(bu(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:sh(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:function(t,e,n,i){const r=t.indexOf(e);return-1===r?((t,e,n,i)=>("string"==typeof e?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n))(t,e,n,i):r!==t.lastIndexOf(e)?n:r}(n,t,Mu(e,t),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(n=0),e||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,i=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=t;n<=e;n++)i.push({value:n});return i}getLabelForValue(t){return Bg.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},Yg,class extends tp{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,e){return Gp(this,t,"x",e)}inYRange(t,e){return Gp(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const n=this.options;this.skip||n.radius<.1||!Bh(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Wh(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}},Xp,class extends tp{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){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,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:n,backgroundColor:i}}=this,{inner:r,outer:o}=function(t){const e=Zp(t),n=e.right-e.left,i=e.bottom-e.top,r=function(t,e,n){const i=t.options.borderWidth,r=t.borderSkipped,o=ed(i);return{t:Jp(r.top,o.top,0,n),r:Jp(r.right,o.right,0,e),b:Jp(r.bottom,o.bottom,0,n),l:Jp(r.left,o.left,0,e)}}(t,n/2,i/2),o=function(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,o=nd(r),s=Math.min(e,n),a=t.borderSkipped,l=i||xu(r);return{topLeft:Jp(!l||a.top||a.left,o.topLeft,0,s),topRight:Jp(!l||a.top||a.right,o.topRight,0,s),bottomLeft:Jp(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:Jp(!l||a.bottom||a.right,o.bottomRight,0,s)}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:o},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,o.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(r.b,r.r))}}}}(this),s=(a=o.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?Kh:eg;var a;t.save(),o.w===r.w&&o.h===r.h||(t.beginPath(),s(t,ng(o,e,r)),t.clip(),s(t,ng(r,-e,o)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),s(t,ng(r,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,n){return tg(this,t,e,n)}inXRange(t,e){return tg(this,t,null,e)}inYRange(t,e){return tg(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+i)/2:e,y:r?n:(n+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},class extends tp{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.getProps(["x","y"],n),{angle:r,distance:o}=eh(i,{x:t,y:e}),{startAngle:s,endAngle:a,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),h=(this.options.spacing+this.options.borderWidth)/2,d=Mu(u,a-s),f=oh(r,s,a)&&s!==a,p=d>=Bu||f,g=ah(o,l+h,c+h);return p&&g}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:r,innerRadius:o,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,c=(i+r)/2,u=(o+s+l+a)/2;return{x:e+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,i=(e.offset||0)/4,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=n>Bu?Math.floor(n/Bu):0,0===n||this.innerRadius<0||this.outerRadius<0)return;t.save();const s=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(s)*i,Math.sin(s)*i);const a=i*(1-Math.sin(Math.min(Uu,n||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,n,i,r){const{fullCircles:o,startAngle:s,circumference:a}=e;let l=e.endAngle;if(o){Hp(t,e,n,i,l,r);for(let e=0;e<o;++e)t.fill();isNaN(a)||(l=s+(a%Bu||Bu))}Hp(t,e,n,i,l,r),t.fill()}(t,this,a,r,o),function(t,e,n,i,r){const{fullCircles:o,startAngle:s,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:d,borderRadius:f}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(h||[]),t.lineDashOffset=d,p?(t.lineWidth=2*c,t.lineJoin=u||"round"):(t.lineWidth=c,t.lineJoin=u||"bevel");let g=e.endAngle;if(o){Hp(t,e,n,i,g,r);for(let e=0;e<o;++e)t.stroke();isNaN(a)||(g=s+(a%Bu||Bu))}p&&function(t,e,n){const{startAngle:i,pixelMargin:r,x:o,y:s,outerRadius:a,innerRadius:l}=e;let c=r/a;t.beginPath(),t.arc(o,s,a,i-c,n+c),l>r?(c=r/l,t.arc(o,s,l,n+c,i-c,!0)):t.arc(o,s,r,n+$u,i-$u),t.closePath(),t.clip()}(t,e,g),l.selfJoin&&g-s>=Uu&&0===f&&"miter"!==u&&function(t,e,n){const{startAngle:i,x:r,y:o,outerRadius:s,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/s,rh(i-n));if(t.beginPath(),t.arc(r,o,s-c/2,i+h/2,n-h/2),a>0){const e=Math.min(c/a,rh(i-n));t.arc(r,o,a+c/2,n-e/2,i+e/2,!0)}else{const e=Math.min(c/2,s*rh(i-n));if("round"===u)t.arc(r,o,e,n-Uu/2,i+Uu/2,!0);else if("bevel"===u){const s=2*e*e,a=-s*Math.cos(n+Uu/2)+r,l=-s*Math.sin(n+Uu/2)+o,c=s*Math.cos(i+Uu/2)+r,u=s*Math.sin(i+Uu/2)+o;t.lineTo(a,l),t.lineTo(c,u)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(Hp(t,e,n,i,g,r),t.stroke())}(t,this,a,r,o),t.restore()}},kg,Ug,Mg,vg,em);const nm=window?.__UR_ANALYTICS__?.memberships?.length?[{id:"total_revenue",title:(0,Cl.__)("Total Revenue","user-registration")},{id:"new_members",title:(0,Cl.__)("New Members","user-registration")},{id:"average_order_value",title:(0,Cl.__)("Average Order Value","user-registration")},{id:"refunded_revenue",title:(0,Cl.__)("Refunded Revenue","user-registration")}]:[{id:"new_members",title:(0,Cl.__)("New Members","user-registration")},{id:"approved_members",title:(0,Cl.__)("Approved Members","user-registration")},{id:"pending_members",title:(0,Cl.__)("Pending Members","user-registration")},{id:"denied_members",title:(0,Cl.__)("Denied Members","user-registration")}],im={0:(0,Cl.__)("Revenue Overview","user-registration"),1:(0,Cl.__)("Members Overview","user-registration"),2:(0,Cl.__)("Recurring Revenue","user-registration"),3:(0,Cl.__)("Memberships Distribution","user-registration")};class rm{constructor(t){this.seed=t}next(){return this.seed=(9301*this.seed+49297)%233280,this.seed/233280}}function om(t,e,n="day"){const i=function(t,e,n){const i=[],r=new Date(t),o=new Date(e),s={hour:t=>t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),day:t=>t.toLocaleDateString("en-US",{month:"short",day:"numeric"}),week:t=>`Week ${function(t){const e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);const n=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)}(t)}`,month:t=>t.toLocaleDateString("en-US",{month:"short",year:"numeric"}),year:t=>t.getFullYear().toString()},a={hour:t=>t.setHours(t.getHours()+1),day:t=>t.setDate(t.getDate()+1),week:t=>t.setDate(t.getDate()+7),month:t=>t.setMonth(t.getMonth()+1),year:t=>t.setFullYear(t.getFullYear()+1)};for(;r<=o;)i.push(s[n](new Date(r))),a[n](r);return i}(t,e,n),r=i.length,o=function(t,e,n){const i=`${t.getTime()}-${e.getTime()}-${n}`;let r=0;for(let t=0;t<i.length;t++)r=(r<<5)-r+i.charCodeAt(t),r&=r;return Math.abs(r)}(t,e,n),s=.05,a=sm(r,5e4,s,.15,!1,new rm(o+1)),l=sm(r,35e3,s,.1,!1,new rm(o+2)),c=sm(r,150,.015,.08,!1,new rm(o+3)),u=sm(r,50,s,.2,!0,new rm(o+4)),h=sm(r,15,0,.3,!0,new rm(o+5)),d=sm(r,1e3,s,.05,!0,new rm(o+6)),f=sm(r,42e4,s,.08,!1,new rm(o+7)),p=sm(r,35e3,s,.1,!1,new rm(o+8)),g=new rm(o+9);return[{id:"revenue-overview",type:"line",title:"Revenue Overview",labels:i,datasets:[{label:"Total Revenue",data:a,borderColor:"rgb(75, 192, 192)",backgroundColor:"rgba(75, 192, 192, 0.2)",tension:.2},{label:"Recurring Revenue",data:l,borderColor:"rgb(54, 162, 235)",backgroundColor:"rgba(54, 162, 235, 0.2)",tension:.2},{label:"Average Order Value",data:c,borderColor:"rgb(255, 205, 86)",backgroundColor:"rgba(255, 205, 86, 0.2)",tension:.2}]},{id:"members-overview",type:"line",title:"Members Overview",labels:i,datasets:[{label:"New Members",data:u,borderColor:"rgb(153, 102, 255)",backgroundColor:"rgba(153, 102, 255, 0.2)",tension:.2},{label:"Pending Members",data:h,borderColor:"rgb(255, 159, 64)",backgroundColor:"rgba(255, 159, 64, 0.2)",tension:.2},{label:"Approved Members",data:d,borderColor:"rgb(75, 192, 192)",backgroundColor:"rgba(75, 192, 192, 0.2)",tension:.2}]},{id:"recurring-revenue",type:"line",title:"Recurring Revenue",labels:i,datasets:[{label:"Annual Recurring Revenue (ARR)",data:f,backgroundColor:"rgba(54, 162, 235, 0.6)",borderColor:"rgb(54, 162, 235)",tension:.2},{label:"Monthly Recurring Revenue (MRR)",data:p,backgroundColor:"rgba(75, 192, 192, 0.6)",borderColor:"rgb(75, 192, 192)",tension:.2}]},{id:"membership-distribution",type:"pie",title:"Membership Distribution",labels:["Basic","Premium","Enterprise"],datasets:[{label:"Members",data:[Math.floor(500+100*g.next()),Math.floor(350+80*g.next()),Math.floor(150+50*g.next())],backgroundColor:["#0088FE","#00C49F","#FFBB28"],borderColor:["#0088FE","#00C49F","#FFBB28"]}]}]}function sm(t,e,n,i,r,o){const s=[];for(let a=0;a<t;a++){const l=e*(1+n*(a/t))*(1+(o.next()-.5)*i);s.push(r?Math.round(l):Math.round(100*l)/100)}return s}const am=[{id:"new_payments_revenue",title:(0,Cl.__)("New Payments Revenue","user-registration")},{id:"new_subscription_revenue",title:(0,Cl.__)("New Subscription Revenue","user-registration")},{id:"mrr",title:(0,Cl.__)("Monthly Recurring Revenue (MRR)","user-registration")},{id:"arr",title:(0,Cl.__)("Annual Recurring Revenue (ARR)","user-registration")},{id:"new-orders",title:(0,Cl.__)("New Orders/Payments","user-registration")},{id:"new-subscriptions",title:(0,Cl.__)("New Subscriptions","user-registration")},{id:"refunds",title:(0,Cl.__)("Refunds","user-registration")}],lm=({overviewData:t})=>{const{filters:e}=Il(),{dateFrom:n,dateTo:i,unit:r}=e,o=om(n?new Date(n):new Date((new Date).setDate((new Date).getDate()-30)),i?new Date(i):new Date,null!=r?r:"day"),[s,a]=function(t,e){const[n,i]=(0,l.useState)(()=>{try{let n=localStorage.getItem(t);return(n?JSON.parse(n):void 0)||e}catch{return e}});return[n,function(e){"function"==typeof e?i(n=>{const i=e(n);return localStorage.setItem(t,JSON.stringify(i)),i}):(i(e),localStorage.setItem(t,JSON.stringify(e)))},function(){i(void 0),localStorage.removeItem(t)}]}("analytics-metrics",nm.map(t=>t.id));return(0,g.jsxs)("div",{className:"UR-Analytics-Content",children:[(0,g.jsx)("div",{className:"UR-Analytics-Metrics",children:nm.map((e,n)=>{const i=t?.[s[n]];if(!i)return null;const r=i.count>i.previous,o=i.count<i.previous;return(0,g.jsxs)("div",{className:"UR-Analytics-Metric",children:[(0,g.jsx)("div",{className:"UR-Analytics-Metric__Header",children:(0,g.jsxs)(yl,{value:s[n],onValueChange:t=>{nm.some(e=>e.id===t)&&a(e=>{const i=[...e];return i[n]=t,i})},children:[(0,g.jsx)(xl,{className:"UR-Analytics-Metric__MetricSelector",children:(0,g.jsx)(vl,{})}),(0,g.jsxs)(wl,{align:"start",collisionPadding:32,className:"UR-UI-Select-Content",children:[nm.map(t=>(0,g.jsx)(_l,{value:t.id,children:t.title},t.id)),(0,g.jsx)(Ml,{}),(0,g.jsx)(bl,{className:"UR-Analytics-Metric__MetricGroup-Pro",children:am.map(t=>(0,g.jsxs)(_l,{value:t.id,title:(0,Cl.__)("Available in Pro","user-registration"),children:[(0,g.jsx)("span",{children:t.title}),(0,g.jsx)("span",{className:"UR-Analytics-Metrics__Crown",children:(0,g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,g.jsx)("path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z"}),(0,g.jsx)("path",{d:"M5 21h14"})]})})]},t.id))})]})]})}),(0,g.jsxs)("div",{className:"UR-Analytics-Metric__Content",children:[(0,g.jsxs)("div",{className:"UR-Analytics-Metric__Value",children:[i.currency?new Intl.NumberFormat("en-US",{style:"currency",currency:window.__UR_ANALYTICS__.currency}).format(i.count):i.count,(0,g.jsxs)("span",{className:O("UR-Analytics-Metric__Delta",r&&"UR-Analytics-Metric__Delta--positive",o&&"UR-Analytics-Metric__Delta--negative"),children:[r&&(0,g.jsx)(Fc,{size:"16",className:"UR-Analytics-Metric__DeltaIcon"}),o&&(0,g.jsx)(Wc,{size:"16",className:"UR-Analytics-Metric__DeltaIcon"}),Math.abs(i.percentage_change).toFixed(1),"%"]})]}),(0,g.jsxs)("div",{className:"UR-Analytics-Metric__Comparison",children:[(0,Cl.__)("vs.","user-registration")," ",i.currency?new Intl.NumberFormat("en-US",{style:"currency",currency:window.__UR_ANALYTICS__.currency}).format(i.previous):i.previous," ",(0,Cl.__)("last period","user-registration")]})]})]},JSON.stringify(e))})}),(0,g.jsxs)("div",{className:"UR-Analytics-Upgrade",children:[(0,g.jsx)("div",{className:"UR-Analytics-Charts",children:o.map((t,e)=>{const o=0===e?400:300,s=`${e}-${n||"default"}-${i||"default"}-${r||"day"}`,a="line"===t.type?Jg:tm;return(0,g.jsxs)("div",{className:O("UR-Analytics-Chart","UR-Analytics-Chart--Multi",0===e&&"UR-Analytics-Chart--Primary"),children:[(0,g.jsxs)("div",{className:"UR-Analytics-Chart__Header",children:[(0,g.jsx)("div",{className:"UR-Analytics-Chart__ParentSelector",children:(0,g.jsx)("span",{className:"UR-Analytics-Metric__MetricTitle",children:im[e]})}),(0,g.jsx)("div",{id:`UR-Analytics-Legend-Container-${e}`,className:O("UR-Analytics-Chart__HTMLLegend",0===e&&"UR-Analytics-Chart__HTMLLegend--Primary")})]}),(0,g.jsx)("div",{className:"UR-Analytics-Chart__Content",style:{height:`${o}px`},children:(0,g.jsx)("div",{className:"UR-Analytics-Chart__ChartContainer",style:{pointerEvents:"none"},children:(0,g.jsx)(a,{height:o,data:{labels:t.labels,datasets:t.datasets},options:{responsive:!0,maintainAspectRatio:!1,plugins:{HTMLLegend:{containerID:`UR-Analytics-Legend-Container-${e}`},legend:{display:!1},tooltip:{enabled:!1}}}})})})]},s)})}),(0,g.jsx)("div",{className:"UR-Analytics-Charts__Overlay",children:(0,g.jsxs)("div",{className:"UR-Analytics-Charts__Overlay-Content",children:[(0,g.jsx)("h3",{className:"UR-Analytics-Charts__Overlay-Title",children:(0,Cl.__)("Unlock Advanced Analytics","user-registration")}),(0,g.jsx)("div",{className:"UR-Analytics-Charts__Overlay-Description",children:(0,Cl.__)("Get powerful analytics with revenue tracking, member insights, recurring revenue analysis, and advanced visualizations.","user-registration")}),(0,g.jsx)(T,{className:"UR-Analytics-Charts__Overlay-Btn",asChild:!0,children:(0,g.jsxs)("a",{target:"_blank",href:"https://wpuserregistration.com/upgrade/?utm_source=ur-analytics&utm_medium=upgrade-link&utm_campaign=lite-version",children:[(0,g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,g.jsx)("path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z"}),(0,g.jsx)("path",{d:"M5 21h14"})]}),(0,g.jsx)("span",{children:(0,Cl.__)("Upgrade to Pro","user-registration")})]})})]})})]})]})},cm=()=>{const{setFilters:t,dateFrom:e,dateTo:n,filters:i,validUnits:r}=Il(),[o]=function({queries:t,...e},n){const i=Pc(n),r=l.useContext(Ec),o=l.useContext(Ac),s=l.useMemo(()=>t.map(t=>{const e=i.defaultQueryOptions(t);return e._optimisticResults=r?"isRestoring":"optimistic",e}),[t,i,r]);s.forEach(t=>{(t=>{if(t.suspense){const e=1e3,n=t=>"static"===t?t:Math.max(t??e,e),i=t.staleTime;t.staleTime="function"==typeof i?(...t)=>n(i(...t)):n(i),"number"==typeof t.gcTime&&(t.gcTime=Math.max(t.gcTime,e))}})(t);const e=i.getQueryCache().get(t.queryHash);((t,e,n)=>{const i=n?.state.error&&"function"==typeof t.throwOnError?cc(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(e.isReset()||(t.retryOnMount=!1))})(t,o,e)}),(t=>{l.useEffect(()=>{t.clearReset()},[t])})(o);const[a]=l.useState(()=>new Oc(i,s,e)),[c,u,h]=a.getOptimisticResult(s,e.combine),d=!r&&!1!==e.subscribed;l.useSyncExternalStore(l.useCallback(t=>d?a.subscribe(Wl.batchCalls(t)):Hl,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),l.useEffect(()=>{a.setQueries(s,e)},[s,e,a]);const f=c.some((t,e)=>Nc(s[e],t)),p=f?c.flatMap((t,e)=>{const n=s[e];if(n){const e=new _c(i,n);if(Nc(n,t))return Ic(n,e,o);((t,e)=>t.isLoading&&t.isFetching&&!e)(t,r)&&Ic(n,e,o)}return[]}):[];if(p.length>0)throw Promise.all(p);const g=c.find((t,e)=>{const n=s[e];return n&&(({result:t,errorResetBoundary:e,throwOnError:n,query:i,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(r&&void 0===t.data||cc(n,[t.error,i])))({result:t,errorResetBoundary:o,throwOnError:n.throwOnError,query:i.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(g?.error)throw g.error;return u(h())}({queries:[{queryKey:["overview",i],queryFn:async()=>{const t=(t=>Object.entries(t).map(([t,e])=>e?`${t.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}=${encodeURIComponent(e)}`:null).filter(Boolean).join("&"))(i);return jc()({path:`/user-registration/v1/analytics?${t}`})}}]}),s=(0,l.useCallback)(e=>{e.range.from&&e.range.to&&t({dateFrom:Fr(e.range.from,"yyyy-MM-dd"),dateTo:Fr(e.range.to,"yyyy-MM-dd")})},[t]),a=(0,l.useCallback)(e=>{t({unit:e})},[t]),c=o.isLoading,u=o.error,h=o.data&&!c&&!u;return(0,g.jsxs)(Qs,{children:[(0,g.jsx)(Ks,{children:(0,g.jsx)("div",{className:"UR-Analytics-Header-Content",children:(0,g.jsxs)("div",{className:"UR-Analytics-Filters",children:[(0,g.jsx)("div",{children:(0,g.jsx)(Vs,{align:"start",initialDateFrom:e,initialDateTo:n,onUpdate:s})}),(0,g.jsx)("div",{children:(0,g.jsxs)(yl,{value:i.unit,onValueChange:a,children:[(0,g.jsx)(xl,{children:(0,g.jsx)(vl,{placeholder:(0,Cl.__)("Day","user-registration")})}),(0,g.jsx)(wl,{className:"UR-UI-Select-Content",children:Rl.filter(t=>r.includes(t.value)).map(t=>(0,g.jsx)(_l,{value:t.value,children:t.label},t.value))})]})}),!!window.__UR_ANALYTICS__.memberships.length&&(0,g.jsx)("div",{children:(0,g.jsxs)(yl,{defaultValue:i?.membership?i.membership.toString():i.scope,onValueChange:e=>{let n={};n="others"===e||"all"===e?{scope:e,membership:void 0}:{membership:parseInt(e),scope:"membership"},t(n)},children:[(0,g.jsx)(xl,{children:(0,g.jsx)(vl,{placeholder:(0,Cl.__)("All Forms","user-registration")})}),(0,g.jsxs)(wl,{className:"UR-UI-Select-Content",children:[(0,g.jsx)(_l,{value:"all",children:(0,Cl.__)("All","user-registration")}),window.__UR_ANALYTICS__.memberships.map(t=>(0,g.jsx)(_l,{value:t.id.toString(),children:t.name},t.id)),(0,g.jsx)(_l,{value:"others",children:(0,Cl.__)("Others","user-registration")})]})]})})]})})}),(0,g.jsx)(Xs,{children:c?(0,g.jsxs)("div",{className:"UR-Analytics-Loading",children:[(0,g.jsx)("div",{className:"UR-Analytics-Loading-Spinner"}),(0,g.jsx)("p",{children:(0,Cl.__)("Loading analytics data...","user-registration")})]}):u?(0,g.jsxs)("div",{className:"UR-Analytics-Error",children:[(0,g.jsx)("div",{className:"UR-Analytics-Error-Icon",children:"⚠️"}),(0,g.jsx)("p",{className:"UR-Analytics-Error-Message",children:(()=>{const t=[];if(o.error){const e=o.error instanceof Error?o.error.message:"object"==typeof o.error&&null!==o.error&&"message"in o.error?String(o.error):(0,Cl.__)("Failed to load analytics overview data.","user-registration");t.push(e)}return t.length>0?t.join(" "):(0,Cl.__)("Failed to load analytics data.","user-registration")})()}),(0,g.jsx)("button",{className:"UR-Analytics-Error-Retry",onClick:()=>{o.refetch()},children:(0,Cl.__)("Retry","user-registration")})]}):h?(0,g.jsx)("div",{children:(0,g.jsx)(lm,{overviewData:o.data})}):(0,g.jsx)("div",{className:"UR-Analytics-Error",children:(0,g.jsx)("p",{children:(0,Cl.__)("Failed to load analytics data.","user-registration")})})})]})};var um=class extends Ul{constructor(t={}){super(),this.config=t,this.#W=new Map}#W;build(t,e,n){const i=e.queryKey,r=e.queryHash??Kl(i,e);let o=this.get(r);return o||(o=new bc({client:t,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){this.#W.has(t.queryHash)||(this.#W.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#W.get(t.queryHash);e&&(t.destroy(),e===t&&this.#W.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Wl.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#W.get(t)}getAll(){return[...this.#W.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>Vl(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>Vl(t,e)):e}notify(t){Wl.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Wl.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Wl.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},hm=class extends yc{#u;#B;#X;#h;constructor(t){super(),this.#u=t.client,this.mutationId=t.mutationId,this.#X=t.mutationCache,this.#B=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#B.includes(t)||(this.#B.push(t),this.clearGcTimeout(),this.#X.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#B=this.#B.filter(e=>e!==t),this.scheduleGc(),this.#X.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#B.length||("pending"===this.state.status?this.scheduleGc():this.#X.remove(this))}continue(){return this.#h?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#p({type:"continue"})},n={client:this.#u,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#h=mc({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#p({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#p({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#X.canRun(this)});const i="pending"===this.state.status,r=!this.#h.canStart();try{if(i)e();else{this.#p({type:"pending",variables:t,isPaused:r}),await(this.#X.config.onMutate?.(t,this,n));const e=await(this.options.onMutate?.(t,n));e!==this.state.context&&this.#p({type:"pending",context:e,variables:t,isPaused:r})}const o=await this.#h.start();return await(this.#X.config.onSuccess?.(o,t,this.state.context,this,n)),await(this.options.onSuccess?.(o,t,this.state.context,n)),await(this.#X.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n)),await(this.options.onSettled?.(o,null,t,this.state.context,n)),this.#p({type:"success",data:o}),o}catch(e){try{await(this.#X.config.onError?.(e,t,this.state.context,this,n))}catch(t){Promise.reject(t)}try{await(this.options.onError?.(e,t,this.state.context,n))}catch(t){Promise.reject(t)}try{await(this.#X.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,n))}catch(t){Promise.reject(t)}try{await(this.options.onSettled?.(void 0,e,t,this.state.context,n))}catch(t){Promise.reject(t)}throw this.#p({type:"error",error:e}),e}finally{this.#X.runNext(this)}}#p(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),Wl.batch(()=>{this.#B.forEach(e=>{e.onMutationUpdate(t)}),this.#X.notify({mutation:this,type:"updated",action:t})})}},dm=class extends Ul{constructor(t={}){super(),this.config=t,this.#G=new Set,this.#Z=new Map,this.#J=0}#G;#Z;#J;build(t,e,n){const i=new hm({client:t,mutationCache:this,mutationId:++this.#J,options:t.defaultMutationOptions(e),state:n});return this.add(i),i}add(t){this.#G.add(t);const e=fm(t);if("string"==typeof e){const n=this.#Z.get(e);n?n.push(t):this.#Z.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#G.delete(t)){const e=fm(t);if("string"==typeof e){const n=this.#Z.get(e);if(n)if(n.length>1){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}else n[0]===t&&this.#Z.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=fm(t);if("string"==typeof e){const n=this.#Z.get(e),i=n?.find(t=>"pending"===t.state.status);return!i||i===t}return!0}runNext(t){const e=fm(t);if("string"==typeof e){const n=this.#Z.get(e)?.find(e=>e!==t&&e.state.isPaused);return n?.continue()??Promise.resolve()}return Promise.resolve()}clear(){Wl.batch(()=>{this.#G.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#G.clear(),this.#Z.clear()})}getAll(){return Array.from(this.#G)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>Ql(e,t))}findAll(t={}){return this.getAll().filter(e=>Ql(t,e))}notify(t){Wl.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return Wl.batch(()=>Promise.all(t.map(t=>t.continue().catch(Hl))))}};function fm(t){return t.options.scope?.id}function pm(t){return{onFetch:(e,n)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,o=e.state.data?.pages||[],s=e.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let n=!1;const c=t=>{!function(t,n,i){let r,o=!1;Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??=e.signal,o||(o=!0,r.aborted?i():r.addEventListener("abort",i,{once:!0})),r)})}(t,0,()=>n=!0)},u=lc(e.options,e.fetchOptions),h=async(t,i,r)=>{if(n)return Promise.reject();if(null==i&&t.pages.length)return Promise.resolve(t);const o=(()=>{const t={client:e.client,queryKey:e.queryKey,pageParam:i,direction:r?"backward":"forward",meta:e.options.meta};return c(t),t})(),s=await u(o),{maxPages:a}=e.options,l=r?sc:oc;return{pages:l(t.pages,s,a),pageParams:l(t.pageParams,i,a)}};if(r&&o.length){const t="backward"===r,e={pages:o,pageParams:s},n=(t?mm:gm)(i,e);a=await h(e,n,t)}else{const e=t??o.length;do{const t=0===l?s[0]??i.initialPageParam:gm(i,a);if(l>0&&null==t)break;a=await h(a,t),l++}while(l<e)}return a};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=c}}}function gm(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function mm(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}function ym(...t){const e=t[0];if(1===t.length)return e;const n=()=>{const n=t.map(t=>({useScope:t(),scopeName:t.scopeName}));return function(t){const i=n.reduce((e,{useScope:n,scopeName:i})=>({...e,...n(t)[`__scope${i}`]}),{});return l.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return n.scopeName=e.scopeName,n}var bm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,e)=>{const n=v(`Primitive.${e}`),i=l.forwardRef((t,i)=>{const{asChild:r,...o}=t,s=r?n:e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(s,{...o,ref:i})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),vm="Progress",[xm,wm]=function(t,e=[]){let n=[];const i=()=>{const e=n.map(t=>l.createContext(t));return function(n){const i=n?.[t]||e;return l.useMemo(()=>({[`__scope${t}`]:{...n,[t]:i}}),[n,i])}};return i.scopeName=t,[function(e,i){const r=l.createContext(i);r.displayName=e+"Context";const o=n.length;n=[...n,i];const s=e=>{const{scope:n,children:i,...s}=e,a=n?.[t]?.[o]||r,c=l.useMemo(()=>s,Object.values(s));return(0,g.jsx)(a.Provider,{value:c,children:i})};return s.displayName=e+"Provider",[s,function(n,s){const a=s?.[t]?.[o]||r,c=l.useContext(a);if(c)return c;if(void 0!==i)return i;throw new Error(`\`${n}\` must be used within \`${e}\``)}]},ym(i,...e)]}(vm),[_m,Mm]=xm(vm),Sm=l.forwardRef((t,e)=>{const{__scopeProgress:n,value:i=null,max:r,getValueLabel:o=Dm,...s}=t;!r&&0!==r||Pm(r)||console.error(`Invalid prop \`max\` of value \`${r}\` supplied to \`Progress\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`);const a=Pm(r)?r:100;null===i||Tm(i,a)||console.error(`Invalid prop \`value\` of value \`${`${i}`}\` supplied to \`Progress\`. The \`value\` prop must be:\n - a positive number\n - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)\n - \`null\` or \`undefined\` if the progress is indeterminate.\n\nDefaulting to \`null\`.`);const l=Tm(i,a)?i:null,c=Rm(l)?o(l,a):void 0;return(0,g.jsx)(_m,{scope:n,value:l,max:a,children:(0,g.jsx)(bm.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Rm(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":Om(l,a),"data-value":l??void 0,"data-max":a,...s,ref:e})})});Sm.displayName=vm;var km="ProgressIndicator",Cm=l.forwardRef((t,e)=>{const{__scopeProgress:n,...i}=t,r=Mm(km,n);return(0,g.jsx)(bm.div,{"data-state":Om(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...i,ref:e})});function Dm(t,e){return`${Math.round(t/e*100)}%`}function Om(t,e){return null==t?"indeterminate":t===e?"complete":"loading"}function Rm(t){return"number"==typeof t}function Pm(t){return Rm(t)&&!isNaN(t)&&t>0}function Tm(t,e){return Rm(t)&&!isNaN(t)&&t<=e&&t>=0}Cm.displayName=km;var Em=Sm,Am=Cm;function Nm({className:t,value:e,...n}){return(0,g.jsx)(Em,{"data-slot":"progress",className:O("UR-UI-Progress-Root",t),...n,children:(0,g.jsx)(Am,{"data-slot":"progress-indicator",className:"UR-UI-Progress-Indicator",style:{transform:`translateX(-${100-(e||0)}%)`}})})}const Im=()=>{const t=function(t){const e=Pc(void 0),n=e.getQueryCache();return l.useSyncExternalStore(l.useCallback(t=>n.subscribe(Wl.batchCalls(t)),[n]),()=>e.isFetching(t),()=>e.isFetching(t))}({queryKey:["overview","forms","preferences"]}),[e,n]=(0,l.useState)(0),i=(0,l.useRef)(null),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>(i.current&&clearInterval(i.current),r.current&&clearTimeout(r.current),t?(n(20),document.body.dataset.wait="true",i.current=setInterval(()=>{n(t=>t>=90?(i.current&&clearInterval(i.current),90):t+10)},500)):(n(100),r.current=setTimeout(()=>{n(0)},200),document.body.removeAttribute("data-wait")),()=>{i.current&&clearInterval(i.current),r.current&&clearTimeout(r.current),document.body.removeAttribute("data-wait")}),[t]),0===e?null:(0,g.jsx)("div",{className:"UR-Progress-Indicator-Container",children:(0,g.jsx)(Nm,{value:e,className:"UR-Progress-Indicator-Progress"})})};Im.displayName="ProgressIndicator";const Lm=document.getElementById("UR-Pro-Analytics-Root"),jm=new class{#tt;#X;#d;#et;#nt;#it;#rt;#ot;constructor(t={}){this.#tt=t.queryCache||new um,this.#X=t.mutationCache||new dm,this.#d=t.defaultOptions||{},this.#et=new Map,this.#nt=new Map,this.#it=0}mount(){this.#it++,1===this.#it&&(this.#rt=uc.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#tt.onFocus())}),this.#ot=hc.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#tt.onOnline())}))}unmount(){this.#it--,0===this.#it&&(this.#rt?.(),this.#rt=void 0,this.#ot?.(),this.#ot=void 0)}isFetching(t){return this.#tt.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#X.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#tt.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#tt.build(this,e),i=n.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime($l(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#tt.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,n){const i=this.defaultQueryOptions({queryKey:t}),r=this.#tt.get(i.queryHash),o=r?.state.data,s=function(t,e){return"function"==typeof t?t(e):t}(e,o);if(void 0!==s)return this.#tt.build(this,i).setData(s,{...n,manual:!0})}setQueriesData(t,e,n){return Wl.batch(()=>this.#tt.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#tt.get(e.queryHash)?.state}removeQueries(t){const e=this.#tt;Wl.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const n=this.#tt;return Wl.batch(()=>(n.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},i=Wl.batch(()=>this.#tt.findAll(t).map(t=>t.cancel(n)));return Promise.all(i).then(Hl).catch(Hl)}invalidateQueries(t,e={}){return Wl.batch(()=>(this.#tt.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},i=Wl.batch(()=>this.#tt.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,n);return n.throwOnError||(e=e.catch(Hl)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(i).then(Hl)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const n=this.#tt.build(this,e);return n.isStaleByTime($l(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Hl).catch(Hl)}fetchInfiniteQuery(t){return t.behavior=pm(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Hl).catch(Hl)}ensureInfiniteQueryData(t){return t.behavior=pm(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return hc.isOnline()?this.#X.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#tt}getMutationCache(){return this.#X}getDefaultOptions(){return this.#d}setDefaultOptions(t){this.#d=t}setQueryDefaults(t,e){this.#et.set(Xl(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#et.values()],n={};return e.forEach(e=>{Gl(t,e.queryKey)&&Object.assign(n,e.defaultOptions)}),n}setMutationDefaults(t,e){this.#nt.set(Xl(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#nt.values()],n={};return e.forEach(e=>{Gl(t,e.mutationKey)&&Object.assign(n,e.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#d.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Kl(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===ac&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#d.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#tt.clear(),this.#X.clear()}},Fm=u().lazy(async()=>{try{return await Promise.resolve().then(function(){var t=new Error("Cannot find module './ProApp'");throw t.code="MODULE_NOT_FOUND",t})}catch{return{default:cm}}});Lm&&h.createRoot(Lm).render((0,g.jsx)(u().StrictMode,{children:(0,g.jsx)(u().Suspense,{fallback:(0,g.jsx)("div",{children:"Loading..."}),children:(0,g.jsxs)(Tc,{client:jm,children:[(0,g.jsx)(Fm,{}),(0,g.jsx)(Im,{})]})})}))})();
Copyright ©2021 || Defacer Indonesia