semaphor 0.0.47 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/dashboard-plus-4h_dG_jo.js +210 -0
- package/dist/chunks/dashboard-plus-zWycIkYs.js +4326 -0
- package/dist/chunks/index-TDaW4qPC.js +421 -0
- package/dist/chunks/index-qjDx7Ig8.js +53791 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +64 -2
- package/dist/types/main.d.ts +570 -12
- package/dist/types/surfboard.d.ts +64 -2
- package/dist/types/types.d.ts +64 -2
- package/package.json +5 -1
- package/dist/chunks/dashboard-plus-1eyVwWds.js +0 -228
- package/dist/chunks/dashboard-plus-k_LsKxv1.js +0 -10751
- package/dist/chunks/index-J6hHt1a9.js +0 -43449
- package/dist/chunks/index-gGj_6O-g.js +0 -364
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
"use strict";var oN=Object.defineProperty;var iN=(e,t,n)=>t in e?oN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e,t,n)=>(iN(e,typeof t!="symbol"?t+"":t,n),n),em=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var U=(e,t,n)=>(em(e,t,"read from private field"),n?n.call(e):t.get(e)),Ie=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Pe=(e,t,n,r)=>(em(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Yd=(e,t,n,r)=>({set _(o){Pe(e,t,o,n)},get _(){return U(e,t,r)}}),ot=(e,t,n)=>(em(e,t,"access private method"),n);const m=require("react"),So=require("react-dom");function SE(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const le=SE(m),sN=SE(So);var ks=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Bb(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var mv={exports:{}},pc={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.development.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var k1;function aN(){return k1||(k1=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),b=Symbol.iterator,y="@@iterator";function x($){if($===null||typeof $!="object")return null;var H=b&&$[b]||$[y];return typeof H=="function"?H:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w($){{for(var H=arguments.length,re=new Array(H>1?H-1:0),xe=1;xe<H;xe++)re[xe-1]=arguments[xe];C("error",$,re)}}function C($,H,re){{var xe=_.ReactDebugCurrentFrame,Me=xe.getStackAddendum();Me!==""&&(H+="%s",re=re.concat([Me]));var Ae=re.map(function($e){return String($e)});Ae.unshift("Warning: "+H),Function.prototype.apply.call(console[$],console,Ae)}}var R=!1,E=!1,M=!1,D=!1,A=!1,k;k=Symbol.for("react.module.reference");function L($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===i||A||$===o||$===u||$===d||D||$===g||R||E||M||typeof $=="object"&&$!==null&&($.$$typeof===p||$.$$typeof===h||$.$$typeof===s||$.$$typeof===a||$.$$typeof===l||$.$$typeof===k||$.getModuleId!==void 0))}function W($,H,re){var xe=$.displayName;if(xe)return xe;var Me=H.displayName||H.name||"";return Me!==""?re+"("+Me+")":re}function Y($){return $.displayName||"Context"}function ne($){if($==null)return null;if(typeof $.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof $=="object")switch($.$$typeof){case a:var H=$;return Y(H)+".Consumer";case s:var re=$;return Y(re._context)+".Provider";case l:return W($,$.render,"ForwardRef");case h:var xe=$.displayName||null;return xe!==null?xe:ne($.type)||"Memo";case p:{var Me=$,Ae=Me._payload,$e=Me._init;try{return ne($e(Ae))}catch{return null}}}return null}var Q=Object.assign,F=0,J,q,X,ae,j,V,oe;function ce(){}ce.__reactDisabledLog=!0;function ue(){{if(F===0){J=console.log,q=console.info,X=console.warn,ae=console.error,j=console.group,V=console.groupCollapsed,oe=console.groupEnd;var $={configurable:!0,enumerable:!0,value:ce,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}F++}}function ge(){{if(F--,F===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Q({},$,{value:J}),info:Q({},$,{value:q}),warn:Q({},$,{value:X}),error:Q({},$,{value:ae}),group:Q({},$,{value:j}),groupCollapsed:Q({},$,{value:V}),groupEnd:Q({},$,{value:oe})})}F<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ve=_.ReactCurrentDispatcher,fe;function ee($,H,re){{if(fe===void 0)try{throw Error()}catch(Me){var xe=Me.stack.trim().match(/\n( *(at )?)/);fe=xe&&xe[1]||""}return`
|
|
10
|
-
`+fe+$}}var K=!1,ie;{var ye=typeof WeakMap=="function"?WeakMap:Map;ie=new ye}function Z($,H){if(!$||K)return"";{var re=ie.get($);if(re!==void 0)return re}var xe;K=!0;var Me=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ae;Ae=ve.current,ve.current=null,ue();try{if(H){var $e=function(){throw Error()};if(Object.defineProperty($e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($e,[])}catch(zt){xe=zt}Reflect.construct($,[],$e)}else{try{$e.call()}catch(zt){xe=zt}$.call($e.prototype)}}else{try{throw Error()}catch(zt){xe=zt}$()}}catch(zt){if(zt&&xe&&typeof zt.stack=="string"){for(var Ee=zt.stack.split(`
|
|
11
|
-
`),gt=xe.stack.split(`
|
|
12
|
-
`),We=Ee.length-1,Ge=gt.length-1;We>=1&&Ge>=0&&Ee[We]!==gt[Ge];)Ge--;for(;We>=1&&Ge>=0;We--,Ge--)if(Ee[We]!==gt[Ge]){if(We!==1||Ge!==1)do if(We--,Ge--,Ge<0||Ee[We]!==gt[Ge]){var Rt=`
|
|
13
|
-
`+Ee[We].replace(" at new "," at ");return $.displayName&&Rt.includes("<anonymous>")&&(Rt=Rt.replace("<anonymous>",$.displayName)),typeof $=="function"&&ie.set($,Rt),Rt}while(We>=1&&Ge>=0);break}}}finally{K=!1,ve.current=Ae,ge(),Error.prepareStackTrace=Me}var an=$?$.displayName||$.name:"",ps=an?ee(an):"";return typeof $=="function"&&ie.set($,ps),ps}function De($,H,re){return Z($,!1)}function Ne($){var H=$.prototype;return!!(H&&H.isReactComponent)}function Ve($,H,re){if($==null)return"";if(typeof $=="function")return Z($,Ne($));if(typeof $=="string")return ee($);switch($){case u:return ee("Suspense");case d:return ee("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return De($.render);case h:return Ve($.type,H,re);case p:{var xe=$,Me=xe._payload,Ae=xe._init;try{return Ve(Ae(Me),H,re)}catch{}}}return""}var qe=Object.prototype.hasOwnProperty,pt={},dt=_.ReactDebugCurrentFrame;function ft($){if($){var H=$._owner,re=Ve($.type,$._source,H?H.type:null);dt.setExtraStackFrame(re)}else dt.setExtraStackFrame(null)}function Bt($,H,re,xe,Me){{var Ae=Function.call.bind(qe);for(var $e in $)if(Ae($,$e)){var Ee=void 0;try{if(typeof $[$e]!="function"){var gt=Error((xe||"React class")+": "+re+" type `"+$e+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[$e]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw gt.name="Invariant Violation",gt}Ee=$[$e](H,$e,xe,re,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(We){Ee=We}Ee&&!(Ee instanceof Error)&&(ft(Me),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",xe||"React class",re,$e,typeof Ee),ft(null)),Ee instanceof Error&&!(Ee.message in pt)&&(pt[Ee.message]=!0,ft(Me),w("Failed %s type: %s",re,Ee.message),ft(null))}}}var Vt=Array.isArray;function xn($){return Vt($)}function Jt($){{var H=typeof Symbol=="function"&&Symbol.toStringTag,re=H&&$[Symbol.toStringTag]||$.constructor.name||"Object";return re}}function ql($){try{return jr($),!1}catch{return!0}}function jr($){return""+$}function Ji($){if(ql($))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Jt($)),jr($)}var fn=_.ReactCurrentOwner,no={key:!0,ref:!0,__self:!0,__source:!0},Oo,Do,Vr;Vr={};function es($){if(qe.call($,"ref")){var H=Object.getOwnPropertyDescriptor($,"ref").get;if(H&&H.isReactWarning)return!1}return $.ref!==void 0}function ts($){if(qe.call($,"key")){var H=Object.getOwnPropertyDescriptor($,"key").get;if(H&&H.isReactWarning)return!1}return $.key!==void 0}function ns($,H){if(typeof $.ref=="string"&&fn.current&&H&&fn.current.stateNode!==H){var re=ne(fn.current.type);Vr[re]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ne(fn.current.type),$.ref),Vr[re]=!0)}}function rs($,H){{var re=function(){Oo||(Oo=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",H))};re.isReactWarning=!0,Object.defineProperty($,"key",{get:re,configurable:!0})}}function os($,H){{var re=function(){Do||(Do=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",H))};re.isReactWarning=!0,Object.defineProperty($,"ref",{get:re,configurable:!0})}}var is=function($,H,re,xe,Me,Ae,$e){var Ee={$$typeof:t,type:$,key:H,ref:re,props:$e,_owner:Ae};return Ee._store={},Object.defineProperty(Ee._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ee,"_self",{configurable:!1,enumerable:!1,writable:!1,value:xe}),Object.defineProperty(Ee,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Me}),Object.freeze&&(Object.freeze(Ee.props),Object.freeze(Ee)),Ee};function Gl($,H,re,xe,Me){{var Ae,$e={},Ee=null,gt=null;re!==void 0&&(Ji(re),Ee=""+re),ts(H)&&(Ji(H.key),Ee=""+H.key),es(H)&&(gt=H.ref,ns(H,Me));for(Ae in H)qe.call(H,Ae)&&!no.hasOwnProperty(Ae)&&($e[Ae]=H[Ae]);if($&&$.defaultProps){var We=$.defaultProps;for(Ae in We)$e[Ae]===void 0&&($e[Ae]=We[Ae])}if(Ee||gt){var Ge=typeof $=="function"?$.displayName||$.name||"Unknown":$;Ee&&rs($e,Ge),gt&&os($e,Ge)}return is($,Ee,gt,Me,xe,fn.current,$e)}}var Mo=_.ReactCurrentOwner,ss=_.ReactDebugCurrentFrame;function wn($){if($){var H=$._owner,re=Ve($.type,$._source,H?H.type:null);ss.setExtraStackFrame(re)}else ss.setExtraStackFrame(null)}var ro;ro=!1;function To($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function as(){{if(Mo.current){var $=ne(Mo.current.type);if($)return`
|
|
14
|
-
|
|
15
|
-
Check the render method of \``+$+"`."}return""}}function Yl($){{if($!==void 0){var H=$.fileName.replace(/^.*[\\\/]/,""),re=$.lineNumber;return`
|
|
16
|
-
|
|
17
|
-
Check your code at `+H+":"+re+"."}return""}}var ls={};function Sa($){{var H=as();if(!H){var re=typeof $=="string"?$:$.displayName||$.name;re&&(H=`
|
|
18
|
-
|
|
19
|
-
Check the top-level render call using <`+re+">.")}return H}}function cs($,H){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var re=Sa(H);if(ls[re])return;ls[re]=!0;var xe="";$&&$._owner&&$._owner!==Mo.current&&(xe=" It was passed a child from "+ne($._owner.type)+"."),wn($),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',re,xe),wn(null)}}function us($,H){{if(typeof $!="object")return;if(xn($))for(var re=0;re<$.length;re++){var xe=$[re];To(xe)&&cs(xe,H)}else if(To($))$._store&&($._store.validated=!0);else if($){var Me=x($);if(typeof Me=="function"&&Me!==$.entries)for(var Ae=Me.call($),$e;!($e=Ae.next()).done;)To($e.value)&&cs($e.value,H)}}}function Kl($){{var H=$.type;if(H==null||typeof H=="string")return;var re;if(typeof H=="function")re=H.propTypes;else if(typeof H=="object"&&(H.$$typeof===l||H.$$typeof===h))re=H.propTypes;else return;if(re){var xe=ne(H);Bt(re,$.props,"prop",xe,$)}else if(H.PropTypes!==void 0&&!ro){ro=!0;var Me=ne(H);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Me||"Unknown")}typeof H.getDefaultProps=="function"&&!H.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ds($){{for(var H=Object.keys($.props),re=0;re<H.length;re++){var xe=H[re];if(xe!=="children"&&xe!=="key"){wn($),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",xe),wn(null);break}}$.ref!==null&&(wn($),w("Invalid attribute `ref` supplied to `React.Fragment`."),wn(null))}}function fs($,H,re,xe,Me,Ae){{var $e=L($);if(!$e){var Ee="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(Ee+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var gt=Yl(Me);gt?Ee+=gt:Ee+=as();var We;$===null?We="null":xn($)?We="array":$!==void 0&&$.$$typeof===t?(We="<"+(ne($.type)||"Unknown")+" />",Ee=" Did you accidentally export a JSX literal instead of a component?"):We=typeof $,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",We,Ee)}var Ge=Gl($,H,re,Me,Ae);if(Ge==null)return Ge;if($e){var Rt=H.children;if(Rt!==void 0)if(xe)if(xn(Rt)){for(var an=0;an<Rt.length;an++)us(Rt[an],$);Object.freeze&&Object.freeze(Rt)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else us(Rt,$)}return $===r?ds(Ge):Kl(Ge),Ge}}function hs($,H,re){return fs($,H,re,!0)}function Xl($,H,re){return fs($,H,re,!1)}var Ql=Xl,Zl=hs;pc.Fragment=r,pc.jsx=Ql,pc.jsxs=Zl}()),pc}var gc={};/**
|
|
20
|
-
* @license React
|
|
21
|
-
* react-jsx-runtime.production.min.js
|
|
22
|
-
*
|
|
23
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the MIT license found in the
|
|
26
|
-
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var N1;function lN(){if(N1)return gc;N1=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,u){var d,h={},p=null,g=null;u!==void 0&&(p=""+u),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(g=l.ref);for(d in l)r.call(l,d)&&!i.hasOwnProperty(d)&&(h[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)h[d]===void 0&&(h[d]=l[d]);return{$$typeof:t,type:a,key:p,ref:g,props:h,_owner:o.current}}return gc.Fragment=n,gc.jsx=s,gc.jsxs=s,gc}process.env.NODE_ENV==="production"?mv.exports=lN():mv.exports=aN();var I=mv.exports;function CE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=CE(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function th(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=CE(e))&&(r&&(r+=" "),r+=t);return r}const cN=Object.freeze(Object.defineProperty({__proto__:null,clsx:th,default:th},Symbol.toStringTag,{value:"Module"})),Ub="-";function uN(e){const t=fN(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(Ub);return a[0]===""&&a.length!==1&&a.shift(),EE(a,t)||dN(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function EE(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?EE(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Ub);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const L1=/^\[(.+)\]$/;function dN(e){if(L1.test(e)){const t=L1.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function fN(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return pN(Object.entries(e.classGroups),n).forEach(([i,s])=>{vv(s,r,i,t)}),r}function vv(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:F1(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(hN(o)){vv(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{vv(s,F1(t,i),n,r)})})}function F1(e,t){let n=e;return t.split(Ub).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function hN(e){return e.isThemeGetter}function pN(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function gN(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const RE="!";function mN(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,u=0,d;for(let y=0;y<s.length;y++){let x=s[y];if(l===0){if(x===r&&(n||s.slice(y,y+o)===t)){a.push(s.slice(u,y)),u=y+o;continue}if(x==="/"){d=y;continue}}x==="["?l++:x==="]"&&l--}const h=a.length===0?s:s.substring(u),p=h.startsWith(RE),g=p?h.substring(1):h,b=d&&d>u?d-u:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:b}}}function vN(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function bN(e){return{cache:gN(e.cacheSize),splitModifiers:mN(e),...uN(e)}}const yN=/\s+/;function xN(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(yN).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(s);let h=r(d?u.substring(0,d):u),p=!!d;if(!h){if(!d)return{isTailwindClass:!1,originalClassName:s};if(h=r(u),!h)return{isTailwindClass:!1,originalClassName:s};p=!1}const g=vN(a).join(":");return{isTailwindClass:!0,modifierId:l?g+RE:g,classGroupId:h,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:u}=s,d=a+l;return i.has(d)?!1:(i.add(d),o(l,u).forEach(h=>i.add(a+h)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function wN(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=$E(t))&&(r&&(r+=" "),r+=n);return r}function $E(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=$E(e[r]))&&(n&&(n+=" "),n+=t);return n}function _N(e,...t){let n,r,o,i=s;function s(l){const u=t.reduce((d,h)=>h(d),e());return n=bN(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=xN(l,n);return o(l,d),d}return function(){return i(wN.apply(null,arguments))}}function Tt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const PE=/^\[(?:([a-z-]+):)?(.+)\]$/i,SN=/^\d+\/\d+$/,CN=new Set(["px","full","screen"]),EN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$N=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,PN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function qr(e){return Ls(e)||CN.has(e)||SN.test(e)}function yi(e){return Fl(e,"length",NN)}function Ls(e){return!!e&&!Number.isNaN(Number(e))}function Kd(e){return Fl(e,"number",Ls)}function mc(e){return!!e&&Number.isInteger(Number(e))}function ON(e){return e.endsWith("%")&&Ls(e.slice(0,-1))}function tt(e){return PE.test(e)}function xi(e){return EN.test(e)}const DN=new Set(["length","size","percentage"]);function MN(e){return Fl(e,DN,OE)}function TN(e){return Fl(e,"position",OE)}const AN=new Set(["image","url"]);function IN(e){return Fl(e,AN,FN)}function kN(e){return Fl(e,"",LN)}function vc(){return!0}function Fl(e,t,n){const r=PE.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function NN(e){return RN.test(e)}function OE(){return!1}function LN(e){return $N.test(e)}function FN(e){return PN.test(e)}function zN(){const e=Tt("colors"),t=Tt("spacing"),n=Tt("blur"),r=Tt("brightness"),o=Tt("borderColor"),i=Tt("borderRadius"),s=Tt("borderSpacing"),a=Tt("borderWidth"),l=Tt("contrast"),u=Tt("grayscale"),d=Tt("hueRotate"),h=Tt("invert"),p=Tt("gap"),g=Tt("gradientColorStops"),b=Tt("gradientColorStopPositions"),y=Tt("inset"),x=Tt("margin"),_=Tt("opacity"),w=Tt("padding"),C=Tt("saturate"),R=Tt("scale"),E=Tt("sepia"),M=Tt("skew"),D=Tt("space"),A=Tt("translate"),k=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto",tt,t],Y=()=>[tt,t],ne=()=>["",qr,yi],Q=()=>["auto",Ls,tt],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],X=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",tt],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Ls,Kd],oe=()=>[Ls,tt];return{cacheSize:500,separator:":",theme:{colors:[vc],spacing:[qr,yi],blur:["none","",xi,tt],brightness:V(),borderColor:[e],borderRadius:["none","","full",xi,tt],borderSpacing:Y(),borderWidth:ne(),contrast:V(),grayscale:ae(),hueRotate:oe(),invert:ae(),gap:Y(),gradientColorStops:[e],gradientColorStopPositions:[ON,yi],inset:W(),margin:W(),opacity:V(),padding:Y(),saturate:V(),scale:V(),sepia:ae(),skew:oe(),space:Y(),translate:Y()},classGroups:{aspect:[{aspect:["auto","square","video",tt]}],container:["container"],columns:[{columns:[xi]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),tt]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mc,tt]}],basis:[{basis:W()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",tt]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",mc,tt]}],"grid-cols":[{"grid-cols":[vc]}],"col-start-end":[{col:["auto",{span:["full",mc,tt]},tt]}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":[vc]}],"row-start-end":[{row:["auto",{span:[mc,tt]},tt]}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",tt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",tt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",tt,t]}],"min-w":[{"min-w":["min","max","fit",tt,qr]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[xi]},xi,tt]}],h:[{h:[tt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",qr,tt]}],"max-h":[{"max-h":[tt,t,"min","max","fit"]}],"font-size":[{text:["base",xi,yi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Kd]}],"font-family":[{font:[vc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",tt]}],"line-clamp":[{"line-clamp":["none",Ls,Kd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qr,tt]}],"list-image":[{"list-image":["none",tt]}],"list-style-type":[{list:["none","disc","decimal",tt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qr,yi]}],"underline-offset":[{"underline-offset":["auto",qr,tt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:Y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),TN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",MN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},IN]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...J(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:J()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[qr,tt]}],"outline-w":[{outline:[qr,yi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[qr,yi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xi,kN]}],"shadow-color":[{shadow:[vc]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":q()}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",xi,tt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[C]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",tt]}],duration:[{duration:oe()}],ease:[{ease:["linear","in","out","in-out",tt]}],delay:[{delay:oe()}],animate:[{animate:["none","spin","ping","pulse","bounce",tt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[mc,tt]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",tt]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[qr,yi,Kd]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const jN=_N(zN);class VN extends Error{}VN.prototype.name="InvalidTokenError";function _e(...e){return jN(th(e))}async function HN(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function jh(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(i=>{throw console.log(i.detail||"Unknown error occurred"),new Error((i==null?void 0:i.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function WN(e){var t;if(navigator.clipboard&&e.current)navigator.clipboard.writeText(e.current.innerText).then(()=>console.log("Content copied to clipboard")).catch(n=>console.error("Failed to copy: ",n));else{const n=document.createElement("textarea");n.value=((t=e==null?void 0:e.current)==null?void 0:t.innerText)??"",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),console.log("Content copied to clipboard")}}function DE(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>BN(i,t))}function BN(e,t){const n=t==null?void 0:t.find(r=>r.name===e);return n?`(${n.sql}) as ${n.name}`:(console.log(e),`'${e}_table'`)}function UN(e){return e.charAt(0).toUpperCase()+e.slice(1)}const qN="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";var GN={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const z1=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,h))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(GN?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},YN=e=>e?z1(e):z1;var bv={exports:{}},tm={},Xd={exports:{}},nm={};/**
|
|
28
|
-
* @license React
|
|
29
|
-
* use-sync-external-store-shim.development.js
|
|
30
|
-
*
|
|
31
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
-
*
|
|
33
|
-
* This source code is licensed under the MIT license found in the
|
|
34
|
-
* LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/var j1;function KN(){return j1||(j1=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(C){{for(var R=arguments.length,E=new Array(R>1?R-1:0),M=1;M<R;M++)E[M-1]=arguments[M];r("error",C,E)}}function r(C,R,E){{var M=t.ReactDebugCurrentFrame,D=M.getStackAddendum();D!==""&&(R+="%s",E=E.concat([D]));var A=E.map(function(k){return String(k)});A.unshift("Warning: "+R),Function.prototype.apply.call(console[C],console,A)}}function o(C,R){return C===R&&(C!==0||1/C===1/R)||C!==C&&R!==R}var i=typeof Object.is=="function"?Object.is:o,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,d=!1,h=!1;function p(C,R,E){d||e.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var M=R();if(!h){var D=R();i(M,D)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}var A=s({inst:{value:M,getSnapshot:R}}),k=A[0].inst,L=A[1];return l(function(){k.value=M,k.getSnapshot=R,g(k)&&L({inst:k})},[C,M,R]),a(function(){g(k)&&L({inst:k});var W=function(){g(k)&&L({inst:k})};return C(W)},[C]),u(M),M}function g(C){var R=C.getSnapshot,E=C.value;try{var M=R();return!i(E,M)}catch{return!0}}function b(C,R,E){return R()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!y,_=x?b:p,w=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_;nm.useSyncExternalStore=w,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),nm}var rm={};/**
|
|
36
|
-
* @license React
|
|
37
|
-
* use-sync-external-store-shim.production.min.js
|
|
38
|
-
*
|
|
39
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the MIT license found in the
|
|
42
|
-
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/var V1;function XN(){if(V1)return rm;V1=1;var e=m;function t(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(h,p){var g=p(),b=r({inst:{value:g,getSnapshot:p}}),y=b[0].inst,x=b[1];return i(function(){y.value=g,y.getSnapshot=p,l(y)&&x({inst:y})},[h,g,p]),o(function(){return l(y)&&x({inst:y}),h(function(){l(y)&&x({inst:y})})},[h]),s(g),g}function l(h){var p=h.getSnapshot;h=h.value;try{var g=p();return!n(h,g)}catch{return!0}}function u(h,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return rm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,rm}var H1;function ME(){return H1||(H1=1,process.env.NODE_ENV==="production"?Xd.exports=XN():Xd.exports=KN()),Xd.exports}/**
|
|
44
|
-
* @license React
|
|
45
|
-
* use-sync-external-store-shim/with-selector.development.js
|
|
46
|
-
*
|
|
47
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the MIT license found in the
|
|
50
|
-
* LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/var W1;function QN(){return W1||(W1=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=ME();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function u(d,h,p,g,b){var y=i(null),x;y.current===null?(x={hasValue:!1,value:null},y.current=x):x=y.current;var _=a(function(){var E=!1,M,D,A=function(Y){if(!E){E=!0,M=Y;var ne=g(Y);if(b!==void 0&&x.hasValue){var Q=x.value;if(b(Q,ne))return D=Q,Q}return D=ne,ne}var F=M,J=D;if(r(F,Y))return J;var q=g(Y);return b!==void 0&&b(J,q)?J:(M=Y,D=q,q)},k=p===void 0?null:p,L=function(){return A(h())},W=k===null?void 0:function(){return A(k())};return[L,W]},[h,p,g,b]),w=_[0],C=_[1],R=o(d,w,C);return s(function(){x.hasValue=!0,x.value=R},[R]),l(R),R}tm.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),tm}var om={};/**
|
|
52
|
-
* @license React
|
|
53
|
-
* use-sync-external-store-shim/with-selector.production.min.js
|
|
54
|
-
*
|
|
55
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the MIT license found in the
|
|
58
|
-
* LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var B1;function ZN(){if(B1)return om;B1=1;var e=m,t=ME();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return om.useSyncExternalStoreWithSelector=function(u,d,h,p,g){var b=i(null);if(b.current===null){var y={hasValue:!1,value:null};b.current=y}else y=b.current;b=a(function(){function _(M){if(!w){if(w=!0,C=M,M=p(M),g!==void 0&&y.hasValue){var D=y.value;if(g(D,M))return R=D}return R=M}if(D=R,r(C,M))return D;var A=p(M);return g!==void 0&&g(D,A)?D:(C=M,R=A)}var w=!1,C,R,E=h===void 0?null:h;return[function(){return _(d())},E===null?void 0:function(){return _(E())}]},[d,h,p,g]);var x=o(u,b[0],b[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},om}process.env.NODE_ENV==="production"?bv.exports=ZN():bv.exports=QN();var JN=bv.exports;const e6=Lu(JN);var TE={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:t6}=m,{useSyncExternalStoreWithSelector:n6}=e6;let U1=!1;function r6(e,t=e.getState,n){(TE?"production":void 0)!=="production"&&n&&!U1&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),U1=!0);const r=n6(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return t6(r),r}const q1=e=>{(TE?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?YN(e):e,n=(r,o)=>r6(t,r,o);return Object.assign(n,t),n},AE=e=>e?q1(e):q1;var IE=Symbol.for("immer-nothing"),G1=Symbol.for("immer-draftable"),pr=Symbol.for("immer-state"),o6=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Un(e,...t){if(process.env.NODE_ENV!=="production"){const n=o6[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var _l=Object.getPrototypeOf;function Sl(e){return!!e&&!!e[pr]}function ra(e){var t;return e?kE(e)||Array.isArray(e)||!!e[G1]||!!((t=e.constructor)!=null&&t[G1])||Hh(e)||Wh(e):!1}var i6=Object.prototype.constructor.toString();function kE(e){if(!e||typeof e!="object")return!1;const t=_l(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===i6}function Jc(e,t){Vh(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Vh(e){const t=e[pr];return t?t.type_:Array.isArray(e)?1:Hh(e)?2:Wh(e)?3:0}function yv(e,t){return Vh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function NE(e,t,n){const r=Vh(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function s6(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Hh(e){return e instanceof Map}function Wh(e){return e instanceof Set}function Ms(e){return e.copy_||e.base_}function xv(e,t){if(Hh(e))return new Map(e);if(Wh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&kE(e))return _l(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[pr];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(_l(e),n)}function qb(e,t=!1){return Bh(e)||Sl(e)||!ra(e)||(Vh(e)>1&&(e.set=e.add=e.clear=e.delete=a6),Object.freeze(e),t&&Jc(e,(n,r)=>qb(r,!0))),e}function a6(){Un(2)}function Bh(e){return Object.isFrozen(e)}var l6={};function oa(e){const t=l6[e];return t||Un(0,e),t}var eu;function LE(){return eu}function c6(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Y1(e,t){t&&(oa("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function wv(e){_v(e),e.drafts_.forEach(u6),e.drafts_=null}function _v(e){e===eu&&(eu=e.parent_)}function K1(e){return eu=c6(eu,e)}function u6(e){const t=e[pr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function X1(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[pr].modified_&&(wv(t),Un(4)),ra(e)&&(e=nh(t,e),t.parent_||rh(t,e)),t.patches_&&oa("Patches").generateReplacementPatches_(n[pr].base_,e,t.patches_,t.inversePatches_)):e=nh(t,n,[]),wv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==IE?e:void 0}function nh(e,t,n){if(Bh(t))return t;const r=t[pr];if(!r)return Jc(t,(o,i)=>Q1(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return rh(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),Jc(i,(a,l)=>Q1(e,r,o,a,l,n,s)),rh(e,o,!1),n&&e.patches_&&oa("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Q1(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Un(5),Sl(o)){const a=i&&t&&t.type_!==3&&!yv(t.assigned_,r)?i.concat(r):void 0,l=nh(e,o,a);if(NE(n,r,l),Sl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(ra(o)&&!Bh(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;nh(e,o),(!t||!t.scope_.parent_)&&rh(e,o)}}function rh(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&qb(t,n)}function d6(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:LE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Gb;n&&(o=[r],i=tu);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Gb={get(e,t){if(t===pr)return e;const n=Ms(e);if(!yv(n,t))return f6(e,n,t);const r=n[t];return e.finalized_||!ra(r)?r:r===im(e.base_,t)?(sm(e),e.copy_[t]=Cv(r,e)):r},has(e,t){return t in Ms(e)},ownKeys(e){return Reflect.ownKeys(Ms(e))},set(e,t,n){const r=FE(Ms(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=im(Ms(e),t),i=o==null?void 0:o[pr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(s6(n,o)&&(n!==void 0||yv(e.base_,t)))return!0;sm(e),Sv(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return im(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,sm(e),Sv(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ms(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Un(11)},getPrototypeOf(e){return _l(e.base_)},setPrototypeOf(){Un(12)}},tu={};Jc(Gb,(e,t)=>{tu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});tu.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Un(13),tu.set.call(this,e,t,void 0)};tu.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Un(14),Gb.set.call(this,e[0],t,n,e[0])};function im(e,t){const n=e[pr];return(n?Ms(n):e)[t]}function f6(e,t,n){var o;const r=FE(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function FE(e,t){if(!(t in e))return;let n=_l(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=_l(n)}}function Sv(e){e.modified_||(e.modified_=!0,e.parent_&&Sv(e.parent_))}function sm(e){e.copy_||(e.copy_=xv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var h6=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...u){return s.produce(l,d=>n.call(this,d,...u))}}typeof n!="function"&&Un(6),r!==void 0&&typeof r!="function"&&Un(7);let o;if(ra(t)){const i=K1(this),s=Cv(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?wv(i):_v(i)}return Y1(i,r),X1(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===IE&&(o=void 0),this.autoFreeze_&&qb(o,!0),r){const i=[],s=[];oa("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Un(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ra(e)||Un(8),Sl(e)&&(e=p6(e));const t=K1(this),n=Cv(e,void 0);return n[pr].isManual_=!0,_v(t),n}finishDraft(e,t){const n=e&&e[pr];(!n||!n.isManual_)&&Un(9);const{scope_:r}=n;return Y1(r,t),X1(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=oa("Patches").applyPatches_;return Sl(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Cv(e,t){const n=Hh(e)?oa("MapSet").proxyMap_(e,t):Wh(e)?oa("MapSet").proxySet_(e,t):d6(e,t);return(t?t.scope_:LE()).drafts_.push(n),n}function p6(e){return Sl(e)||Un(10,e),zE(e)}function zE(e){if(!ra(e)||Bh(e))return e;const t=e[pr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=xv(e,t.scope_.immer_.useStrictShallowCopy_)}else n=xv(e,!0);return Jc(n,(r,o)=>{NE(n,r,zE(o))}),t&&(t.finalized_=!1),n}var gr=new h6,g6=gr.produce;gr.produceWithPatches.bind(gr);gr.setAutoFreeze.bind(gr);gr.setUseStrictShallowCopy.bind(gr);gr.applyPatches.bind(gr);gr.createDraft.bind(gr);gr.finishDraft.bind(gr);const m6=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?g6(o):o;return t(a,i,...s)},e(r.setState,n,r)),jE=m6;var Ev,Qd=So;if(process.env.NODE_ENV==="production")Ev=Qd.createRoot,Qd.hydrateRoot;else{var Z1=Qd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Ev=function(e,t){Z1.usingClientEntryPoint=!0;try{return Qd.createRoot(e,t)}finally{Z1.usingClientEntryPoint=!1}}}var VE={},HE={},Yb={exports:{}},At=String,WE=function(){return{isColorSupported:!1,reset:At,bold:At,dim:At,italic:At,underline:At,inverse:At,hidden:At,strikethrough:At,black:At,red:At,green:At,yellow:At,blue:At,magenta:At,cyan:At,white:At,gray:At,bgBlack:At,bgRed:At,bgGreen:At,bgYellow:At,bgBlue:At,bgMagenta:At,bgCyan:At,bgWhite:At}};Yb.exports=WE();Yb.exports.createColors=WE;var v6=Yb.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,u){for(var d in u)Object.defineProperty(l,d,{enumerable:!0,get:u[d]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(v6);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,u,d){typeof process<"u"&&process.env.JEST_WORKER_ID||d&&o.has(d)||(d&&o.add(d),console.warn(""),u.forEach(h=>console.warn(l,"-",h)))}function s(l){return n.default.dim(l)}const a={info(l,u){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[u,l])},warn(l,u){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[u,l])},risk(l,u){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[u,l])}}})(HE);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(HE);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(VE);let am=VE;var b6=(am.__esModule?am:{default:am}).default;const Ot=Lu(b6),BE=`import pandas as pd
|
|
60
|
-
df = pd.DataFrame(data) # 'data' contains the query result
|
|
61
|
-
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
62
|
-
`,Rv={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Ot.blue[500],Ot.teal[500],Ot.amber[500],Ot.red[500],Ot.indigo[500],Ot.green[500]],borderColor:[Ot.blue[500],Ot.teal[500],Ot.amber[500],Ot.red[500],Ot.indigo[500],Ot.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:J1},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[Ot.blue[500],Ot.teal[500],Ot.amber[500],Ot.red[500],Ot.indigo[500],Ot.green[500]],borderColor:[Ot.blue[500],Ot.teal[500],Ot.amber[500],Ot.red[500],Ot.indigo[500],Ot.green[500]],datalables:{color:J1}},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:Ot.slate[800]}},y:{grid:{display:!0,color:Ot.slate[800]}}}}}}};function J1(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=oh()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=oh()),ih(n)}function oh(){return Ce.getState().theme==="dark"?"#000000":"#FFFFFF"}function ih(e){let t=0,n=0,r=0,o=0;const i=d=>{const h=d.replace("#",""),p=parseInt(h.substring(0,2),16),g=parseInt(h.substring(2,4),16),b=parseInt(h.substring(4,6),16);t+=p,n+=g,r+=b,o++};Array.isArray(e)?e.forEach(d=>{i(d)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const Uh=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],Cl=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],Fu=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],Kb=["boolean"];function Xb(e){return e.match(/[A-Z]/)?`"${e}"`:e}function y6(e,t,n){const{measures:r,dimensions:o}=e,i=r==null?void 0:r.map(u=>`${u.calc}(${u.name}) as ${u.calc}_${u.name.replace(/"/g,"")}`).join(", "),s=(o==null?void 0:o.join(", "))||"";let a="";const l=UE(t,n);if(i&&s)return a=`SELECT ${s}, COUNT(*), ${i} FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(!i&&s)return a=`SELECT ${s}, COUNT(*) FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(i&&!s)return a=`SELECT ${i} FROM ${l}`,a}function x6(e,t,n="AVG"){var i,s,a,l;let r={};const o=Xb(e.column_name);return Uh.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(d=>d!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),Cl.includes(e.data_type)&&(((a=t.measures)==null?void 0:a.some(d=>d.name===o&&d.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(d=>!(d.name===o&&d.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function sh(e){return Uh.includes(e.dataType)?"string":Cl.includes(e.dataType)?"number":Fu.includes(e.dataType)?"date":Kb.includes(e.dataType)?"boolean":"string"}function w6(e){let t;const n=e.data_type.toLowerCase();return Uh.includes(n)?t="T":Cl.includes(n)?t="#":Fu.includes(n)?t="D":Kb.includes(n)?t="B":t="?",t}function _6(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function UE(e,t){return t==="api"||e===Xb("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const S6=e=>{const t=new Date(e);return!isNaN(t.getTime())},C6=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),nu=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?S6(e)?t="date":C6(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function E6({get:e,dataPoint:t,card:n}){var p;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:u,columnValue:d}=t,h={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:u,expression:(p=n.preferences)==null?void 0:p.filterOnClickField,valueType:nu(d),operation:"=",values:[d]};if(l!=null&&l.find(g=>g.id===n.id)){const g=n.id;if(d==null){a(n),i(g);return}else s(h)}o(n),r(h)}var ah={exports:{}};/**
|
|
63
|
-
* @license
|
|
64
|
-
* Lodash <https://lodash.com/>
|
|
65
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
66
|
-
* Released under MIT license <https://lodash.com/license>
|
|
67
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
68
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
69
|
-
*/ah.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,p=2,g=4,b=1,y=2,x=1,_=2,w=4,C=8,R=16,E=32,M=64,D=128,A=256,k=512,L=30,W="...",Y=800,ne=16,Q=1,F=2,J=3,q=1/0,X=9007199254740991,ae=17976931348623157e292,j=NaN,V=4294967295,oe=V-1,ce=V>>>1,ue=[["ary",D],["bind",x],["bindKey",_],["curry",C],["curryRight",R],["flip",k],["partial",E],["partialRight",M],["rearg",A]],ge="[object Arguments]",ve="[object Array]",fe="[object AsyncFunction]",ee="[object Boolean]",K="[object Date]",ie="[object DOMException]",ye="[object Error]",Z="[object Function]",De="[object GeneratorFunction]",Ne="[object Map]",Ve="[object Number]",qe="[object Null]",pt="[object Object]",dt="[object Promise]",ft="[object Proxy]",Bt="[object RegExp]",Vt="[object Set]",xn="[object String]",Jt="[object Symbol]",ql="[object Undefined]",jr="[object WeakMap]",Ji="[object WeakSet]",fn="[object ArrayBuffer]",no="[object DataView]",Oo="[object Float32Array]",Do="[object Float64Array]",Vr="[object Int8Array]",es="[object Int16Array]",ts="[object Int32Array]",ns="[object Uint8Array]",rs="[object Uint8ClampedArray]",os="[object Uint16Array]",is="[object Uint32Array]",Gl=/\b__p \+= '';/g,Mo=/\b(__p \+=) '' \+/g,ss=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wn=/&(?:amp|lt|gt|quot|#39);/g,ro=/[&<>"']/g,To=RegExp(wn.source),as=RegExp(ro.source),Yl=/<%-([\s\S]+?)%>/g,ls=/<%([\s\S]+?)%>/g,Sa=/<%=([\s\S]+?)%>/g,cs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,us=/^\w*$/,Kl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ds=/[\\^$.*+?()[\]{}|]/g,fs=RegExp(ds.source),hs=/^\s+/,Xl=/\s/,Ql=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Zl=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,H=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,re=/[()=,{}\[\]\/\s]/,xe=/\\(\\)?/g,Me=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ae=/\w*$/,$e=/^[-+]0x[0-9a-f]+$/i,Ee=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,We=/^0o[0-7]+$/i,Ge=/^(?:0|[1-9]\d*)$/,Rt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,an=/($^)/,ps=/['\n\r\u2028\u2029\\]/g,zt="\\ud800-\\udfff",QM="\\u0300-\\u036f",ZM="\\ufe20-\\ufe2f",JM="\\u20d0-\\u20ff",ux=QM+ZM+JM,dx="\\u2700-\\u27bf",fx="a-z\\xdf-\\xf6\\xf8-\\xff",eT="\\xac\\xb1\\xd7\\xf7",tT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nT="\\u2000-\\u206f",rT=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",hx="A-Z\\xc0-\\xd6\\xd8-\\xde",px="\\ufe0e\\ufe0f",gx=eT+tT+nT+rT,Bp="['’]",oT="["+zt+"]",mx="["+gx+"]",ld="["+ux+"]",vx="\\d+",iT="["+dx+"]",bx="["+fx+"]",yx="[^"+zt+gx+vx+dx+fx+hx+"]",Up="\\ud83c[\\udffb-\\udfff]",sT="(?:"+ld+"|"+Up+")",xx="[^"+zt+"]",qp="(?:\\ud83c[\\udde6-\\uddff]){2}",Gp="[\\ud800-\\udbff][\\udc00-\\udfff]",Ca="["+hx+"]",wx="\\u200d",_x="(?:"+bx+"|"+yx+")",aT="(?:"+Ca+"|"+yx+")",Sx="(?:"+Bp+"(?:d|ll|m|re|s|t|ve))?",Cx="(?:"+Bp+"(?:D|LL|M|RE|S|T|VE))?",Ex=sT+"?",Rx="["+px+"]?",lT="(?:"+wx+"(?:"+[xx,qp,Gp].join("|")+")"+Rx+Ex+")*",cT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",uT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$x=Rx+Ex+lT,dT="(?:"+[iT,qp,Gp].join("|")+")"+$x,fT="(?:"+[xx+ld+"?",ld,qp,Gp,oT].join("|")+")",hT=RegExp(Bp,"g"),pT=RegExp(ld,"g"),Yp=RegExp(Up+"(?="+Up+")|"+fT+$x,"g"),gT=RegExp([Ca+"?"+bx+"+"+Sx+"(?="+[mx,Ca,"$"].join("|")+")",aT+"+"+Cx+"(?="+[mx,Ca+_x,"$"].join("|")+")",Ca+"?"+_x+"+"+Sx,Ca+"+"+Cx,uT,cT,vx,dT].join("|"),"g"),mT=RegExp("["+wx+zt+ux+px+"]"),vT=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,bT=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],yT=-1,Mt={};Mt[Oo]=Mt[Do]=Mt[Vr]=Mt[es]=Mt[ts]=Mt[ns]=Mt[rs]=Mt[os]=Mt[is]=!0,Mt[ge]=Mt[ve]=Mt[fn]=Mt[ee]=Mt[no]=Mt[K]=Mt[ye]=Mt[Z]=Mt[Ne]=Mt[Ve]=Mt[pt]=Mt[Bt]=Mt[Vt]=Mt[xn]=Mt[jr]=!1;var Pt={};Pt[ge]=Pt[ve]=Pt[fn]=Pt[no]=Pt[ee]=Pt[K]=Pt[Oo]=Pt[Do]=Pt[Vr]=Pt[es]=Pt[ts]=Pt[Ne]=Pt[Ve]=Pt[pt]=Pt[Bt]=Pt[Vt]=Pt[xn]=Pt[Jt]=Pt[ns]=Pt[rs]=Pt[os]=Pt[is]=!0,Pt[ye]=Pt[Z]=Pt[jr]=!1;var xT={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},wT={"&":"&","<":"<",">":">",'"':""","'":"'"},_T={"&":"&","<":"<",">":">",""":'"',"'":"'"},ST={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},CT=parseFloat,ET=parseInt,Px=typeof ks=="object"&&ks&&ks.Object===Object&&ks,RT=typeof self=="object"&&self&&self.Object===Object&&self,hn=Px||RT||Function("return this")(),Kp=t&&!t.nodeType&&t,gs=Kp&&!0&&e&&!e.nodeType&&e,Ox=gs&&gs.exports===Kp,Xp=Ox&&Px.process,xr=function(){try{var B=gs&&gs.require&&gs.require("util").types;return B||Xp&&Xp.binding&&Xp.binding("util")}catch{}}(),Dx=xr&&xr.isArrayBuffer,Mx=xr&&xr.isDate,Tx=xr&&xr.isMap,Ax=xr&&xr.isRegExp,Ix=xr&&xr.isSet,kx=xr&&xr.isTypedArray;function Xn(B,de,se){switch(se.length){case 0:return B.call(de);case 1:return B.call(de,se[0]);case 2:return B.call(de,se[0],se[1]);case 3:return B.call(de,se[0],se[1],se[2])}return B.apply(de,se)}function $T(B,de,se,Oe){for(var Ue=-1,vt=B==null?0:B.length;++Ue<vt;){var en=B[Ue];de(Oe,en,se(en),B)}return Oe}function wr(B,de){for(var se=-1,Oe=B==null?0:B.length;++se<Oe&&de(B[se],se,B)!==!1;);return B}function PT(B,de){for(var se=B==null?0:B.length;se--&&de(B[se],se,B)!==!1;);return B}function Nx(B,de){for(var se=-1,Oe=B==null?0:B.length;++se<Oe;)if(!de(B[se],se,B))return!1;return!0}function ui(B,de){for(var se=-1,Oe=B==null?0:B.length,Ue=0,vt=[];++se<Oe;){var en=B[se];de(en,se,B)&&(vt[Ue++]=en)}return vt}function cd(B,de){var se=B==null?0:B.length;return!!se&&Ea(B,de,0)>-1}function Qp(B,de,se){for(var Oe=-1,Ue=B==null?0:B.length;++Oe<Ue;)if(se(de,B[Oe]))return!0;return!1}function jt(B,de){for(var se=-1,Oe=B==null?0:B.length,Ue=Array(Oe);++se<Oe;)Ue[se]=de(B[se],se,B);return Ue}function di(B,de){for(var se=-1,Oe=de.length,Ue=B.length;++se<Oe;)B[Ue+se]=de[se];return B}function Zp(B,de,se,Oe){var Ue=-1,vt=B==null?0:B.length;for(Oe&&vt&&(se=B[++Ue]);++Ue<vt;)se=de(se,B[Ue],Ue,B);return se}function OT(B,de,se,Oe){var Ue=B==null?0:B.length;for(Oe&&Ue&&(se=B[--Ue]);Ue--;)se=de(se,B[Ue],Ue,B);return se}function Jp(B,de){for(var se=-1,Oe=B==null?0:B.length;++se<Oe;)if(de(B[se],se,B))return!0;return!1}var DT=eg("length");function MT(B){return B.split("")}function TT(B){return B.match(H)||[]}function Lx(B,de,se){var Oe;return se(B,function(Ue,vt,en){if(de(Ue,vt,en))return Oe=vt,!1}),Oe}function ud(B,de,se,Oe){for(var Ue=B.length,vt=se+(Oe?1:-1);Oe?vt--:++vt<Ue;)if(de(B[vt],vt,B))return vt;return-1}function Ea(B,de,se){return de===de?BT(B,de,se):ud(B,Fx,se)}function AT(B,de,se,Oe){for(var Ue=se-1,vt=B.length;++Ue<vt;)if(Oe(B[Ue],de))return Ue;return-1}function Fx(B){return B!==B}function zx(B,de){var se=B==null?0:B.length;return se?ng(B,de)/se:j}function eg(B){return function(de){return de==null?n:de[B]}}function tg(B){return function(de){return B==null?n:B[de]}}function jx(B,de,se,Oe,Ue){return Ue(B,function(vt,en,$t){se=Oe?(Oe=!1,vt):de(se,vt,en,$t)}),se}function IT(B,de){var se=B.length;for(B.sort(de);se--;)B[se]=B[se].value;return B}function ng(B,de){for(var se,Oe=-1,Ue=B.length;++Oe<Ue;){var vt=de(B[Oe]);vt!==n&&(se=se===n?vt:se+vt)}return se}function rg(B,de){for(var se=-1,Oe=Array(B);++se<B;)Oe[se]=de(se);return Oe}function kT(B,de){return jt(de,function(se){return[se,B[se]]})}function Vx(B){return B&&B.slice(0,Ux(B)+1).replace(hs,"")}function Qn(B){return function(de){return B(de)}}function og(B,de){return jt(de,function(se){return B[se]})}function Jl(B,de){return B.has(de)}function Hx(B,de){for(var se=-1,Oe=B.length;++se<Oe&&Ea(de,B[se],0)>-1;);return se}function Wx(B,de){for(var se=B.length;se--&&Ea(de,B[se],0)>-1;);return se}function NT(B,de){for(var se=B.length,Oe=0;se--;)B[se]===de&&++Oe;return Oe}var LT=tg(xT),FT=tg(wT);function zT(B){return"\\"+ST[B]}function jT(B,de){return B==null?n:B[de]}function Ra(B){return mT.test(B)}function VT(B){return vT.test(B)}function HT(B){for(var de,se=[];!(de=B.next()).done;)se.push(de.value);return se}function ig(B){var de=-1,se=Array(B.size);return B.forEach(function(Oe,Ue){se[++de]=[Ue,Oe]}),se}function Bx(B,de){return function(se){return B(de(se))}}function fi(B,de){for(var se=-1,Oe=B.length,Ue=0,vt=[];++se<Oe;){var en=B[se];(en===de||en===d)&&(B[se]=d,vt[Ue++]=se)}return vt}function dd(B){var de=-1,se=Array(B.size);return B.forEach(function(Oe){se[++de]=Oe}),se}function WT(B){var de=-1,se=Array(B.size);return B.forEach(function(Oe){se[++de]=[Oe,Oe]}),se}function BT(B,de,se){for(var Oe=se-1,Ue=B.length;++Oe<Ue;)if(B[Oe]===de)return Oe;return-1}function UT(B,de,se){for(var Oe=se+1;Oe--;)if(B[Oe]===de)return Oe;return Oe}function $a(B){return Ra(B)?GT(B):DT(B)}function Hr(B){return Ra(B)?YT(B):MT(B)}function Ux(B){for(var de=B.length;de--&&Xl.test(B.charAt(de)););return de}var qT=tg(_T);function GT(B){for(var de=Yp.lastIndex=0;Yp.test(B);)++de;return de}function YT(B){return B.match(Yp)||[]}function KT(B){return B.match(gT)||[]}var XT=function B(de){de=de==null?hn:Pa.defaults(hn.Object(),de,Pa.pick(hn,bT));var se=de.Array,Oe=de.Date,Ue=de.Error,vt=de.Function,en=de.Math,$t=de.Object,sg=de.RegExp,QT=de.String,_r=de.TypeError,fd=se.prototype,ZT=vt.prototype,Oa=$t.prototype,hd=de["__core-js_shared__"],pd=ZT.toString,St=Oa.hasOwnProperty,JT=0,qx=function(){var c=/[^.]+$/.exec(hd&&hd.keys&&hd.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),gd=Oa.toString,e5=pd.call($t),t5=hn._,n5=sg("^"+pd.call(St).replace(ds,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),md=Ox?de.Buffer:n,hi=de.Symbol,vd=de.Uint8Array,Gx=md?md.allocUnsafe:n,bd=Bx($t.getPrototypeOf,$t),Yx=$t.create,Kx=Oa.propertyIsEnumerable,yd=fd.splice,Xx=hi?hi.isConcatSpreadable:n,ec=hi?hi.iterator:n,ms=hi?hi.toStringTag:n,xd=function(){try{var c=ws($t,"defineProperty");return c({},"",{}),c}catch{}}(),r5=de.clearTimeout!==hn.clearTimeout&&de.clearTimeout,o5=Oe&&Oe.now!==hn.Date.now&&Oe.now,i5=de.setTimeout!==hn.setTimeout&&de.setTimeout,wd=en.ceil,_d=en.floor,ag=$t.getOwnPropertySymbols,s5=md?md.isBuffer:n,Qx=de.isFinite,a5=fd.join,l5=Bx($t.keys,$t),tn=en.max,_n=en.min,c5=Oe.now,u5=de.parseInt,Zx=en.random,d5=fd.reverse,lg=ws(de,"DataView"),tc=ws(de,"Map"),cg=ws(de,"Promise"),Da=ws(de,"Set"),nc=ws(de,"WeakMap"),rc=ws($t,"create"),Sd=nc&&new nc,Ma={},f5=_s(lg),h5=_s(tc),p5=_s(cg),g5=_s(Da),m5=_s(nc),Cd=hi?hi.prototype:n,oc=Cd?Cd.valueOf:n,Jx=Cd?Cd.toString:n;function O(c){if(Ut(c)&&!Ye(c)&&!(c instanceof ut)){if(c instanceof Sr)return c;if(St.call(c,"__wrapped__"))return e1(c)}return new Sr(c)}var Ta=function(){function c(){}return function(f){if(!Ht(f))return{};if(Yx)return Yx(f);c.prototype=f;var v=new c;return c.prototype=n,v}}();function Ed(){}function Sr(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}O.templateSettings={escape:Yl,evaluate:ls,interpolate:Sa,variable:"",imports:{_:O}},O.prototype=Ed.prototype,O.prototype.constructor=O,Sr.prototype=Ta(Ed.prototype),Sr.prototype.constructor=Sr;function ut(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=V,this.__views__=[]}function v5(){var c=new ut(this.__wrapped__);return c.__actions__=Nn(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Nn(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Nn(this.__views__),c}function b5(){if(this.__filtered__){var c=new ut(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function y5(){var c=this.__wrapped__.value(),f=this.__dir__,v=Ye(c),S=f<0,P=v?c.length:0,T=MA(0,P,this.__views__),N=T.start,z=T.end,G=z-N,he=S?z:N-1,pe=this.__iteratees__,be=pe.length,Re=0,Te=_n(G,this.__takeCount__);if(!v||!S&&P==G&&Te==G)return Sw(c,this.__actions__);var Fe=[];e:for(;G--&&Re<Te;){he+=f;for(var et=-1,ze=c[he];++et<be;){var lt=pe[et],ht=lt.iteratee,er=lt.type,Tn=ht(ze);if(er==F)ze=Tn;else if(!Tn){if(er==Q)continue e;break e}}Fe[Re++]=ze}return Fe}ut.prototype=Ta(Ed.prototype),ut.prototype.constructor=ut;function vs(c){var f=-1,v=c==null?0:c.length;for(this.clear();++f<v;){var S=c[f];this.set(S[0],S[1])}}function x5(){this.__data__=rc?rc(null):{},this.size=0}function w5(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f}function _5(c){var f=this.__data__;if(rc){var v=f[c];return v===l?n:v}return St.call(f,c)?f[c]:n}function S5(c){var f=this.__data__;return rc?f[c]!==n:St.call(f,c)}function C5(c,f){var v=this.__data__;return this.size+=this.has(c)?0:1,v[c]=rc&&f===n?l:f,this}vs.prototype.clear=x5,vs.prototype.delete=w5,vs.prototype.get=_5,vs.prototype.has=S5,vs.prototype.set=C5;function Ao(c){var f=-1,v=c==null?0:c.length;for(this.clear();++f<v;){var S=c[f];this.set(S[0],S[1])}}function E5(){this.__data__=[],this.size=0}function R5(c){var f=this.__data__,v=Rd(f,c);if(v<0)return!1;var S=f.length-1;return v==S?f.pop():yd.call(f,v,1),--this.size,!0}function $5(c){var f=this.__data__,v=Rd(f,c);return v<0?n:f[v][1]}function P5(c){return Rd(this.__data__,c)>-1}function O5(c,f){var v=this.__data__,S=Rd(v,c);return S<0?(++this.size,v.push([c,f])):v[S][1]=f,this}Ao.prototype.clear=E5,Ao.prototype.delete=R5,Ao.prototype.get=$5,Ao.prototype.has=P5,Ao.prototype.set=O5;function Io(c){var f=-1,v=c==null?0:c.length;for(this.clear();++f<v;){var S=c[f];this.set(S[0],S[1])}}function D5(){this.size=0,this.__data__={hash:new vs,map:new(tc||Ao),string:new vs}}function M5(c){var f=Fd(this,c).delete(c);return this.size-=f?1:0,f}function T5(c){return Fd(this,c).get(c)}function A5(c){return Fd(this,c).has(c)}function I5(c,f){var v=Fd(this,c),S=v.size;return v.set(c,f),this.size+=v.size==S?0:1,this}Io.prototype.clear=D5,Io.prototype.delete=M5,Io.prototype.get=T5,Io.prototype.has=A5,Io.prototype.set=I5;function bs(c){var f=-1,v=c==null?0:c.length;for(this.__data__=new Io;++f<v;)this.add(c[f])}function k5(c){return this.__data__.set(c,l),this}function N5(c){return this.__data__.has(c)}bs.prototype.add=bs.prototype.push=k5,bs.prototype.has=N5;function Wr(c){var f=this.__data__=new Ao(c);this.size=f.size}function L5(){this.__data__=new Ao,this.size=0}function F5(c){var f=this.__data__,v=f.delete(c);return this.size=f.size,v}function z5(c){return this.__data__.get(c)}function j5(c){return this.__data__.has(c)}function V5(c,f){var v=this.__data__;if(v instanceof Ao){var S=v.__data__;if(!tc||S.length<o-1)return S.push([c,f]),this.size=++v.size,this;v=this.__data__=new Io(S)}return v.set(c,f),this.size=v.size,this}Wr.prototype.clear=L5,Wr.prototype.delete=F5,Wr.prototype.get=z5,Wr.prototype.has=j5,Wr.prototype.set=V5;function ew(c,f){var v=Ye(c),S=!v&&Ss(c),P=!v&&!S&&bi(c),T=!v&&!S&&!P&&Na(c),N=v||S||P||T,z=N?rg(c.length,QT):[],G=z.length;for(var he in c)(f||St.call(c,he))&&!(N&&(he=="length"||P&&(he=="offset"||he=="parent")||T&&(he=="buffer"||he=="byteLength"||he=="byteOffset")||Fo(he,G)))&&z.push(he);return z}function tw(c){var f=c.length;return f?c[xg(0,f-1)]:n}function H5(c,f){return zd(Nn(c),ys(f,0,c.length))}function W5(c){return zd(Nn(c))}function ug(c,f,v){(v!==n&&!Br(c[f],v)||v===n&&!(f in c))&&ko(c,f,v)}function ic(c,f,v){var S=c[f];(!(St.call(c,f)&&Br(S,v))||v===n&&!(f in c))&&ko(c,f,v)}function Rd(c,f){for(var v=c.length;v--;)if(Br(c[v][0],f))return v;return-1}function B5(c,f,v,S){return pi(c,function(P,T,N){f(S,P,v(P),N)}),S}function nw(c,f){return c&&io(f,ln(f),c)}function U5(c,f){return c&&io(f,Fn(f),c)}function ko(c,f,v){f=="__proto__"&&xd?xd(c,f,{configurable:!0,enumerable:!0,value:v,writable:!0}):c[f]=v}function dg(c,f){for(var v=-1,S=f.length,P=se(S),T=c==null;++v<S;)P[v]=T?n:Ug(c,f[v]);return P}function ys(c,f,v){return c===c&&(v!==n&&(c=c<=v?c:v),f!==n&&(c=c>=f?c:f)),c}function Cr(c,f,v,S,P,T){var N,z=f&h,G=f&p,he=f&g;if(v&&(N=P?v(c,S,P,T):v(c)),N!==n)return N;if(!Ht(c))return c;var pe=Ye(c);if(pe){if(N=AA(c),!z)return Nn(c,N)}else{var be=Sn(c),Re=be==Z||be==De;if(bi(c))return Rw(c,z);if(be==pt||be==ge||Re&&!P){if(N=G||Re?{}:Uw(c),!z)return G?_A(c,U5(N,c)):wA(c,nw(N,c))}else{if(!Pt[be])return P?c:{};N=IA(c,be,z)}}T||(T=new Wr);var Te=T.get(c);if(Te)return Te;T.set(c,N),x1(c)?c.forEach(function(ze){N.add(Cr(ze,f,v,ze,c,T))}):b1(c)&&c.forEach(function(ze,lt){N.set(lt,Cr(ze,f,v,lt,c,T))});var Fe=he?G?Mg:Dg:G?Fn:ln,et=pe?n:Fe(c);return wr(et||c,function(ze,lt){et&&(lt=ze,ze=c[lt]),ic(N,lt,Cr(ze,f,v,lt,c,T))}),N}function q5(c){var f=ln(c);return function(v){return rw(v,c,f)}}function rw(c,f,v){var S=v.length;if(c==null)return!S;for(c=$t(c);S--;){var P=v[S],T=f[P],N=c[P];if(N===n&&!(P in c)||!T(N))return!1}return!0}function ow(c,f,v){if(typeof c!="function")throw new _r(s);return fc(function(){c.apply(n,v)},f)}function sc(c,f,v,S){var P=-1,T=cd,N=!0,z=c.length,G=[],he=f.length;if(!z)return G;v&&(f=jt(f,Qn(v))),S?(T=Qp,N=!1):f.length>=o&&(T=Jl,N=!1,f=new bs(f));e:for(;++P<z;){var pe=c[P],be=v==null?pe:v(pe);if(pe=S||pe!==0?pe:0,N&&be===be){for(var Re=he;Re--;)if(f[Re]===be)continue e;G.push(pe)}else T(f,be,S)||G.push(pe)}return G}var pi=Mw(oo),iw=Mw(hg,!0);function G5(c,f){var v=!0;return pi(c,function(S,P,T){return v=!!f(S,P,T),v}),v}function $d(c,f,v){for(var S=-1,P=c.length;++S<P;){var T=c[S],N=f(T);if(N!=null&&(z===n?N===N&&!Jn(N):v(N,z)))var z=N,G=T}return G}function Y5(c,f,v,S){var P=c.length;for(v=Qe(v),v<0&&(v=-v>P?0:P+v),S=S===n||S>P?P:Qe(S),S<0&&(S+=P),S=v>S?0:_1(S);v<S;)c[v++]=f;return c}function sw(c,f){var v=[];return pi(c,function(S,P,T){f(S,P,T)&&v.push(S)}),v}function pn(c,f,v,S,P){var T=-1,N=c.length;for(v||(v=NA),P||(P=[]);++T<N;){var z=c[T];f>0&&v(z)?f>1?pn(z,f-1,v,S,P):di(P,z):S||(P[P.length]=z)}return P}var fg=Tw(),aw=Tw(!0);function oo(c,f){return c&&fg(c,f,ln)}function hg(c,f){return c&&aw(c,f,ln)}function Pd(c,f){return ui(f,function(v){return zo(c[v])})}function xs(c,f){f=mi(f,c);for(var v=0,S=f.length;c!=null&&v<S;)c=c[so(f[v++])];return v&&v==S?c:n}function lw(c,f,v){var S=f(c);return Ye(c)?S:di(S,v(c))}function Dn(c){return c==null?c===n?ql:qe:ms&&ms in $t(c)?DA(c):WA(c)}function pg(c,f){return c>f}function K5(c,f){return c!=null&&St.call(c,f)}function X5(c,f){return c!=null&&f in $t(c)}function Q5(c,f,v){return c>=_n(f,v)&&c<tn(f,v)}function gg(c,f,v){for(var S=v?Qp:cd,P=c[0].length,T=c.length,N=T,z=se(T),G=1/0,he=[];N--;){var pe=c[N];N&&f&&(pe=jt(pe,Qn(f))),G=_n(pe.length,G),z[N]=!v&&(f||P>=120&&pe.length>=120)?new bs(N&&pe):n}pe=c[0];var be=-1,Re=z[0];e:for(;++be<P&&he.length<G;){var Te=pe[be],Fe=f?f(Te):Te;if(Te=v||Te!==0?Te:0,!(Re?Jl(Re,Fe):S(he,Fe,v))){for(N=T;--N;){var et=z[N];if(!(et?Jl(et,Fe):S(c[N],Fe,v)))continue e}Re&&Re.push(Fe),he.push(Te)}}return he}function Z5(c,f,v,S){return oo(c,function(P,T,N){f(S,v(P),T,N)}),S}function ac(c,f,v){f=mi(f,c),c=Kw(c,f);var S=c==null?c:c[so(Rr(f))];return S==null?n:Xn(S,c,v)}function cw(c){return Ut(c)&&Dn(c)==ge}function J5(c){return Ut(c)&&Dn(c)==fn}function eA(c){return Ut(c)&&Dn(c)==K}function lc(c,f,v,S,P){return c===f?!0:c==null||f==null||!Ut(c)&&!Ut(f)?c!==c&&f!==f:tA(c,f,v,S,lc,P)}function tA(c,f,v,S,P,T){var N=Ye(c),z=Ye(f),G=N?ve:Sn(c),he=z?ve:Sn(f);G=G==ge?pt:G,he=he==ge?pt:he;var pe=G==pt,be=he==pt,Re=G==he;if(Re&&bi(c)){if(!bi(f))return!1;N=!0,pe=!1}if(Re&&!pe)return T||(T=new Wr),N||Na(c)?Hw(c,f,v,S,P,T):PA(c,f,G,v,S,P,T);if(!(v&b)){var Te=pe&&St.call(c,"__wrapped__"),Fe=be&&St.call(f,"__wrapped__");if(Te||Fe){var et=Te?c.value():c,ze=Fe?f.value():f;return T||(T=new Wr),P(et,ze,v,S,T)}}return Re?(T||(T=new Wr),OA(c,f,v,S,P,T)):!1}function nA(c){return Ut(c)&&Sn(c)==Ne}function mg(c,f,v,S){var P=v.length,T=P,N=!S;if(c==null)return!T;for(c=$t(c);P--;){var z=v[P];if(N&&z[2]?z[1]!==c[z[0]]:!(z[0]in c))return!1}for(;++P<T;){z=v[P];var G=z[0],he=c[G],pe=z[1];if(N&&z[2]){if(he===n&&!(G in c))return!1}else{var be=new Wr;if(S)var Re=S(he,pe,G,c,f,be);if(!(Re===n?lc(pe,he,b|y,S,be):Re))return!1}}return!0}function uw(c){if(!Ht(c)||FA(c))return!1;var f=zo(c)?n5:gt;return f.test(_s(c))}function rA(c){return Ut(c)&&Dn(c)==Bt}function oA(c){return Ut(c)&&Sn(c)==Vt}function iA(c){return Ut(c)&&Ud(c.length)&&!!Mt[Dn(c)]}function dw(c){return typeof c=="function"?c:c==null?zn:typeof c=="object"?Ye(c)?pw(c[0],c[1]):hw(c):A1(c)}function vg(c){if(!dc(c))return l5(c);var f=[];for(var v in $t(c))St.call(c,v)&&v!="constructor"&&f.push(v);return f}function sA(c){if(!Ht(c))return HA(c);var f=dc(c),v=[];for(var S in c)S=="constructor"&&(f||!St.call(c,S))||v.push(S);return v}function bg(c,f){return c<f}function fw(c,f){var v=-1,S=Ln(c)?se(c.length):[];return pi(c,function(P,T,N){S[++v]=f(P,T,N)}),S}function hw(c){var f=Ag(c);return f.length==1&&f[0][2]?Gw(f[0][0],f[0][1]):function(v){return v===c||mg(v,c,f)}}function pw(c,f){return kg(c)&&qw(f)?Gw(so(c),f):function(v){var S=Ug(v,c);return S===n&&S===f?qg(v,c):lc(f,S,b|y)}}function Od(c,f,v,S,P){c!==f&&fg(f,function(T,N){if(P||(P=new Wr),Ht(T))aA(c,f,N,v,Od,S,P);else{var z=S?S(Lg(c,N),T,N+"",c,f,P):n;z===n&&(z=T),ug(c,N,z)}},Fn)}function aA(c,f,v,S,P,T,N){var z=Lg(c,v),G=Lg(f,v),he=N.get(G);if(he){ug(c,v,he);return}var pe=T?T(z,G,v+"",c,f,N):n,be=pe===n;if(be){var Re=Ye(G),Te=!Re&&bi(G),Fe=!Re&&!Te&&Na(G);pe=G,Re||Te||Fe?Ye(z)?pe=z:Yt(z)?pe=Nn(z):Te?(be=!1,pe=Rw(G,!0)):Fe?(be=!1,pe=$w(G,!0)):pe=[]:hc(G)||Ss(G)?(pe=z,Ss(z)?pe=S1(z):(!Ht(z)||zo(z))&&(pe=Uw(G))):be=!1}be&&(N.set(G,pe),P(pe,G,S,T,N),N.delete(G)),ug(c,v,pe)}function gw(c,f){var v=c.length;if(v)return f+=f<0?v:0,Fo(f,v)?c[f]:n}function mw(c,f,v){f.length?f=jt(f,function(T){return Ye(T)?function(N){return xs(N,T.length===1?T[0]:T)}:T}):f=[zn];var S=-1;f=jt(f,Qn(Le()));var P=fw(c,function(T,N,z){var G=jt(f,function(he){return he(T)});return{criteria:G,index:++S,value:T}});return IT(P,function(T,N){return xA(T,N,v)})}function lA(c,f){return vw(c,f,function(v,S){return qg(c,S)})}function vw(c,f,v){for(var S=-1,P=f.length,T={};++S<P;){var N=f[S],z=xs(c,N);v(z,N)&&cc(T,mi(N,c),z)}return T}function cA(c){return function(f){return xs(f,c)}}function yg(c,f,v,S){var P=S?AT:Ea,T=-1,N=f.length,z=c;for(c===f&&(f=Nn(f)),v&&(z=jt(c,Qn(v)));++T<N;)for(var G=0,he=f[T],pe=v?v(he):he;(G=P(z,pe,G,S))>-1;)z!==c&&yd.call(z,G,1),yd.call(c,G,1);return c}function bw(c,f){for(var v=c?f.length:0,S=v-1;v--;){var P=f[v];if(v==S||P!==T){var T=P;Fo(P)?yd.call(c,P,1):Sg(c,P)}}return c}function xg(c,f){return c+_d(Zx()*(f-c+1))}function uA(c,f,v,S){for(var P=-1,T=tn(wd((f-c)/(v||1)),0),N=se(T);T--;)N[S?T:++P]=c,c+=v;return N}function wg(c,f){var v="";if(!c||f<1||f>X)return v;do f%2&&(v+=c),f=_d(f/2),f&&(c+=c);while(f);return v}function rt(c,f){return Fg(Yw(c,f,zn),c+"")}function dA(c){return tw(La(c))}function fA(c,f){var v=La(c);return zd(v,ys(f,0,v.length))}function cc(c,f,v,S){if(!Ht(c))return c;f=mi(f,c);for(var P=-1,T=f.length,N=T-1,z=c;z!=null&&++P<T;){var G=so(f[P]),he=v;if(G==="__proto__"||G==="constructor"||G==="prototype")return c;if(P!=N){var pe=z[G];he=S?S(pe,G,z):n,he===n&&(he=Ht(pe)?pe:Fo(f[P+1])?[]:{})}ic(z,G,he),z=z[G]}return c}var yw=Sd?function(c,f){return Sd.set(c,f),c}:zn,hA=xd?function(c,f){return xd(c,"toString",{configurable:!0,enumerable:!1,value:Yg(f),writable:!0})}:zn;function pA(c){return zd(La(c))}function Er(c,f,v){var S=-1,P=c.length;f<0&&(f=-f>P?0:P+f),v=v>P?P:v,v<0&&(v+=P),P=f>v?0:v-f>>>0,f>>>=0;for(var T=se(P);++S<P;)T[S]=c[S+f];return T}function gA(c,f){var v;return pi(c,function(S,P,T){return v=f(S,P,T),!v}),!!v}function Dd(c,f,v){var S=0,P=c==null?S:c.length;if(typeof f=="number"&&f===f&&P<=ce){for(;S<P;){var T=S+P>>>1,N=c[T];N!==null&&!Jn(N)&&(v?N<=f:N<f)?S=T+1:P=T}return P}return _g(c,f,zn,v)}function _g(c,f,v,S){var P=0,T=c==null?0:c.length;if(T===0)return 0;f=v(f);for(var N=f!==f,z=f===null,G=Jn(f),he=f===n;P<T;){var pe=_d((P+T)/2),be=v(c[pe]),Re=be!==n,Te=be===null,Fe=be===be,et=Jn(be);if(N)var ze=S||Fe;else he?ze=Fe&&(S||Re):z?ze=Fe&&Re&&(S||!Te):G?ze=Fe&&Re&&!Te&&(S||!et):Te||et?ze=!1:ze=S?be<=f:be<f;ze?P=pe+1:T=pe}return _n(T,oe)}function xw(c,f){for(var v=-1,S=c.length,P=0,T=[];++v<S;){var N=c[v],z=f?f(N):N;if(!v||!Br(z,G)){var G=z;T[P++]=N===0?0:N}}return T}function ww(c){return typeof c=="number"?c:Jn(c)?j:+c}function Zn(c){if(typeof c=="string")return c;if(Ye(c))return jt(c,Zn)+"";if(Jn(c))return Jx?Jx.call(c):"";var f=c+"";return f=="0"&&1/c==-q?"-0":f}function gi(c,f,v){var S=-1,P=cd,T=c.length,N=!0,z=[],G=z;if(v)N=!1,P=Qp;else if(T>=o){var he=f?null:RA(c);if(he)return dd(he);N=!1,P=Jl,G=new bs}else G=f?[]:z;e:for(;++S<T;){var pe=c[S],be=f?f(pe):pe;if(pe=v||pe!==0?pe:0,N&&be===be){for(var Re=G.length;Re--;)if(G[Re]===be)continue e;f&&G.push(be),z.push(pe)}else P(G,be,v)||(G!==z&&G.push(be),z.push(pe))}return z}function Sg(c,f){return f=mi(f,c),c=Kw(c,f),c==null||delete c[so(Rr(f))]}function _w(c,f,v,S){return cc(c,f,v(xs(c,f)),S)}function Md(c,f,v,S){for(var P=c.length,T=S?P:-1;(S?T--:++T<P)&&f(c[T],T,c););return v?Er(c,S?0:T,S?T+1:P):Er(c,S?T+1:0,S?P:T)}function Sw(c,f){var v=c;return v instanceof ut&&(v=v.value()),Zp(f,function(S,P){return P.func.apply(P.thisArg,di([S],P.args))},v)}function Cg(c,f,v){var S=c.length;if(S<2)return S?gi(c[0]):[];for(var P=-1,T=se(S);++P<S;)for(var N=c[P],z=-1;++z<S;)z!=P&&(T[P]=sc(T[P]||N,c[z],f,v));return gi(pn(T,1),f,v)}function Cw(c,f,v){for(var S=-1,P=c.length,T=f.length,N={};++S<P;){var z=S<T?f[S]:n;v(N,c[S],z)}return N}function Eg(c){return Yt(c)?c:[]}function Rg(c){return typeof c=="function"?c:zn}function mi(c,f){return Ye(c)?c:kg(c,f)?[c]:Jw(yt(c))}var mA=rt;function vi(c,f,v){var S=c.length;return v=v===n?S:v,!f&&v>=S?c:Er(c,f,v)}var Ew=r5||function(c){return hn.clearTimeout(c)};function Rw(c,f){if(f)return c.slice();var v=c.length,S=Gx?Gx(v):new c.constructor(v);return c.copy(S),S}function $g(c){var f=new c.constructor(c.byteLength);return new vd(f).set(new vd(c)),f}function vA(c,f){var v=f?$g(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.byteLength)}function bA(c){var f=new c.constructor(c.source,Ae.exec(c));return f.lastIndex=c.lastIndex,f}function yA(c){return oc?$t(oc.call(c)):{}}function $w(c,f){var v=f?$g(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.length)}function Pw(c,f){if(c!==f){var v=c!==n,S=c===null,P=c===c,T=Jn(c),N=f!==n,z=f===null,G=f===f,he=Jn(f);if(!z&&!he&&!T&&c>f||T&&N&&G&&!z&&!he||S&&N&&G||!v&&G||!P)return 1;if(!S&&!T&&!he&&c<f||he&&v&&P&&!S&&!T||z&&v&&P||!N&&P||!G)return-1}return 0}function xA(c,f,v){for(var S=-1,P=c.criteria,T=f.criteria,N=P.length,z=v.length;++S<N;){var G=Pw(P[S],T[S]);if(G){if(S>=z)return G;var he=v[S];return G*(he=="desc"?-1:1)}}return c.index-f.index}function Ow(c,f,v,S){for(var P=-1,T=c.length,N=v.length,z=-1,G=f.length,he=tn(T-N,0),pe=se(G+he),be=!S;++z<G;)pe[z]=f[z];for(;++P<N;)(be||P<T)&&(pe[v[P]]=c[P]);for(;he--;)pe[z++]=c[P++];return pe}function Dw(c,f,v,S){for(var P=-1,T=c.length,N=-1,z=v.length,G=-1,he=f.length,pe=tn(T-z,0),be=se(pe+he),Re=!S;++P<pe;)be[P]=c[P];for(var Te=P;++G<he;)be[Te+G]=f[G];for(;++N<z;)(Re||P<T)&&(be[Te+v[N]]=c[P++]);return be}function Nn(c,f){var v=-1,S=c.length;for(f||(f=se(S));++v<S;)f[v]=c[v];return f}function io(c,f,v,S){var P=!v;v||(v={});for(var T=-1,N=f.length;++T<N;){var z=f[T],G=S?S(v[z],c[z],z,v,c):n;G===n&&(G=c[z]),P?ko(v,z,G):ic(v,z,G)}return v}function wA(c,f){return io(c,Ig(c),f)}function _A(c,f){return io(c,Ww(c),f)}function Td(c,f){return function(v,S){var P=Ye(v)?$T:B5,T=f?f():{};return P(v,c,Le(S,2),T)}}function Aa(c){return rt(function(f,v){var S=-1,P=v.length,T=P>1?v[P-1]:n,N=P>2?v[2]:n;for(T=c.length>3&&typeof T=="function"?(P--,T):n,N&&Mn(v[0],v[1],N)&&(T=P<3?n:T,P=1),f=$t(f);++S<P;){var z=v[S];z&&c(f,z,S,T)}return f})}function Mw(c,f){return function(v,S){if(v==null)return v;if(!Ln(v))return c(v,S);for(var P=v.length,T=f?P:-1,N=$t(v);(f?T--:++T<P)&&S(N[T],T,N)!==!1;);return v}}function Tw(c){return function(f,v,S){for(var P=-1,T=$t(f),N=S(f),z=N.length;z--;){var G=N[c?z:++P];if(v(T[G],G,T)===!1)break}return f}}function SA(c,f,v){var S=f&x,P=uc(c);function T(){var N=this&&this!==hn&&this instanceof T?P:c;return N.apply(S?v:this,arguments)}return T}function Aw(c){return function(f){f=yt(f);var v=Ra(f)?Hr(f):n,S=v?v[0]:f.charAt(0),P=v?vi(v,1).join(""):f.slice(1);return S[c]()+P}}function Ia(c){return function(f){return Zp(M1(D1(f).replace(hT,"")),c,"")}}function uc(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var v=Ta(c.prototype),S=c.apply(v,f);return Ht(S)?S:v}}function CA(c,f,v){var S=uc(c);function P(){for(var T=arguments.length,N=se(T),z=T,G=ka(P);z--;)N[z]=arguments[z];var he=T<3&&N[0]!==G&&N[T-1]!==G?[]:fi(N,G);if(T-=he.length,T<v)return Fw(c,f,Ad,P.placeholder,n,N,he,n,n,v-T);var pe=this&&this!==hn&&this instanceof P?S:c;return Xn(pe,this,N)}return P}function Iw(c){return function(f,v,S){var P=$t(f);if(!Ln(f)){var T=Le(v,3);f=ln(f),v=function(z){return T(P[z],z,P)}}var N=c(f,v,S);return N>-1?P[T?f[N]:N]:n}}function kw(c){return Lo(function(f){var v=f.length,S=v,P=Sr.prototype.thru;for(c&&f.reverse();S--;){var T=f[S];if(typeof T!="function")throw new _r(s);if(P&&!N&&Ld(T)=="wrapper")var N=new Sr([],!0)}for(S=N?S:v;++S<v;){T=f[S];var z=Ld(T),G=z=="wrapper"?Tg(T):n;G&&Ng(G[0])&&G[1]==(D|C|E|A)&&!G[4].length&&G[9]==1?N=N[Ld(G[0])].apply(N,G[3]):N=T.length==1&&Ng(T)?N[z]():N.thru(T)}return function(){var he=arguments,pe=he[0];if(N&&he.length==1&&Ye(pe))return N.plant(pe).value();for(var be=0,Re=v?f[be].apply(this,he):pe;++be<v;)Re=f[be].call(this,Re);return Re}})}function Ad(c,f,v,S,P,T,N,z,G,he){var pe=f&D,be=f&x,Re=f&_,Te=f&(C|R),Fe=f&k,et=Re?n:uc(c);function ze(){for(var lt=arguments.length,ht=se(lt),er=lt;er--;)ht[er]=arguments[er];if(Te)var Tn=ka(ze),tr=NT(ht,Tn);if(S&&(ht=Ow(ht,S,P,Te)),T&&(ht=Dw(ht,T,N,Te)),lt-=tr,Te&<<he){var Kt=fi(ht,Tn);return Fw(c,f,Ad,ze.placeholder,v,ht,Kt,z,G,he-lt)}var Ur=be?v:this,Vo=Re?Ur[c]:c;return lt=ht.length,z?ht=BA(ht,z):Fe&<>1&&ht.reverse(),pe&&G<lt&&(ht.length=G),this&&this!==hn&&this instanceof ze&&(Vo=et||uc(Vo)),Vo.apply(Ur,ht)}return ze}function Nw(c,f){return function(v,S){return Z5(v,c,f(S),{})}}function Id(c,f){return function(v,S){var P;if(v===n&&S===n)return f;if(v!==n&&(P=v),S!==n){if(P===n)return S;typeof v=="string"||typeof S=="string"?(v=Zn(v),S=Zn(S)):(v=ww(v),S=ww(S)),P=c(v,S)}return P}}function Pg(c){return Lo(function(f){return f=jt(f,Qn(Le())),rt(function(v){var S=this;return c(f,function(P){return Xn(P,S,v)})})})}function kd(c,f){f=f===n?" ":Zn(f);var v=f.length;if(v<2)return v?wg(f,c):f;var S=wg(f,wd(c/$a(f)));return Ra(f)?vi(Hr(S),0,c).join(""):S.slice(0,c)}function EA(c,f,v,S){var P=f&x,T=uc(c);function N(){for(var z=-1,G=arguments.length,he=-1,pe=S.length,be=se(pe+G),Re=this&&this!==hn&&this instanceof N?T:c;++he<pe;)be[he]=S[he];for(;G--;)be[he++]=arguments[++z];return Xn(Re,P?v:this,be)}return N}function Lw(c){return function(f,v,S){return S&&typeof S!="number"&&Mn(f,v,S)&&(v=S=n),f=jo(f),v===n?(v=f,f=0):v=jo(v),S=S===n?f<v?1:-1:jo(S),uA(f,v,S,c)}}function Nd(c){return function(f,v){return typeof f=="string"&&typeof v=="string"||(f=$r(f),v=$r(v)),c(f,v)}}function Fw(c,f,v,S,P,T,N,z,G,he){var pe=f&C,be=pe?N:n,Re=pe?n:N,Te=pe?T:n,Fe=pe?n:T;f|=pe?E:M,f&=~(pe?M:E),f&w||(f&=~(x|_));var et=[c,f,P,Te,be,Fe,Re,z,G,he],ze=v.apply(n,et);return Ng(c)&&Xw(ze,et),ze.placeholder=S,Qw(ze,c,f)}function Og(c){var f=en[c];return function(v,S){if(v=$r(v),S=S==null?0:_n(Qe(S),292),S&&Qx(v)){var P=(yt(v)+"e").split("e"),T=f(P[0]+"e"+(+P[1]+S));return P=(yt(T)+"e").split("e"),+(P[0]+"e"+(+P[1]-S))}return f(v)}}var RA=Da&&1/dd(new Da([,-0]))[1]==q?function(c){return new Da(c)}:Qg;function zw(c){return function(f){var v=Sn(f);return v==Ne?ig(f):v==Vt?WT(f):kT(f,c(f))}}function No(c,f,v,S,P,T,N,z){var G=f&_;if(!G&&typeof c!="function")throw new _r(s);var he=S?S.length:0;if(he||(f&=~(E|M),S=P=n),N=N===n?N:tn(Qe(N),0),z=z===n?z:Qe(z),he-=P?P.length:0,f&M){var pe=S,be=P;S=P=n}var Re=G?n:Tg(c),Te=[c,f,v,S,P,pe,be,T,N,z];if(Re&&VA(Te,Re),c=Te[0],f=Te[1],v=Te[2],S=Te[3],P=Te[4],z=Te[9]=Te[9]===n?G?0:c.length:tn(Te[9]-he,0),!z&&f&(C|R)&&(f&=~(C|R)),!f||f==x)var Fe=SA(c,f,v);else f==C||f==R?Fe=CA(c,f,z):(f==E||f==(x|E))&&!P.length?Fe=EA(c,f,v,S):Fe=Ad.apply(n,Te);var et=Re?yw:Xw;return Qw(et(Fe,Te),c,f)}function jw(c,f,v,S){return c===n||Br(c,Oa[v])&&!St.call(S,v)?f:c}function Vw(c,f,v,S,P,T){return Ht(c)&&Ht(f)&&(T.set(f,c),Od(c,f,n,Vw,T),T.delete(f)),c}function $A(c){return hc(c)?n:c}function Hw(c,f,v,S,P,T){var N=v&b,z=c.length,G=f.length;if(z!=G&&!(N&&G>z))return!1;var he=T.get(c),pe=T.get(f);if(he&&pe)return he==f&&pe==c;var be=-1,Re=!0,Te=v&y?new bs:n;for(T.set(c,f),T.set(f,c);++be<z;){var Fe=c[be],et=f[be];if(S)var ze=N?S(et,Fe,be,f,c,T):S(Fe,et,be,c,f,T);if(ze!==n){if(ze)continue;Re=!1;break}if(Te){if(!Jp(f,function(lt,ht){if(!Jl(Te,ht)&&(Fe===lt||P(Fe,lt,v,S,T)))return Te.push(ht)})){Re=!1;break}}else if(!(Fe===et||P(Fe,et,v,S,T))){Re=!1;break}}return T.delete(c),T.delete(f),Re}function PA(c,f,v,S,P,T,N){switch(v){case no:if(c.byteLength!=f.byteLength||c.byteOffset!=f.byteOffset)return!1;c=c.buffer,f=f.buffer;case fn:return!(c.byteLength!=f.byteLength||!T(new vd(c),new vd(f)));case ee:case K:case Ve:return Br(+c,+f);case ye:return c.name==f.name&&c.message==f.message;case Bt:case xn:return c==f+"";case Ne:var z=ig;case Vt:var G=S&b;if(z||(z=dd),c.size!=f.size&&!G)return!1;var he=N.get(c);if(he)return he==f;S|=y,N.set(c,f);var pe=Hw(z(c),z(f),S,P,T,N);return N.delete(c),pe;case Jt:if(oc)return oc.call(c)==oc.call(f)}return!1}function OA(c,f,v,S,P,T){var N=v&b,z=Dg(c),G=z.length,he=Dg(f),pe=he.length;if(G!=pe&&!N)return!1;for(var be=G;be--;){var Re=z[be];if(!(N?Re in f:St.call(f,Re)))return!1}var Te=T.get(c),Fe=T.get(f);if(Te&&Fe)return Te==f&&Fe==c;var et=!0;T.set(c,f),T.set(f,c);for(var ze=N;++be<G;){Re=z[be];var lt=c[Re],ht=f[Re];if(S)var er=N?S(ht,lt,Re,f,c,T):S(lt,ht,Re,c,f,T);if(!(er===n?lt===ht||P(lt,ht,v,S,T):er)){et=!1;break}ze||(ze=Re=="constructor")}if(et&&!ze){var Tn=c.constructor,tr=f.constructor;Tn!=tr&&"constructor"in c&&"constructor"in f&&!(typeof Tn=="function"&&Tn instanceof Tn&&typeof tr=="function"&&tr instanceof tr)&&(et=!1)}return T.delete(c),T.delete(f),et}function Lo(c){return Fg(Yw(c,n,r1),c+"")}function Dg(c){return lw(c,ln,Ig)}function Mg(c){return lw(c,Fn,Ww)}var Tg=Sd?function(c){return Sd.get(c)}:Qg;function Ld(c){for(var f=c.name+"",v=Ma[f],S=St.call(Ma,f)?v.length:0;S--;){var P=v[S],T=P.func;if(T==null||T==c)return P.name}return f}function ka(c){var f=St.call(O,"placeholder")?O:c;return f.placeholder}function Le(){var c=O.iteratee||Kg;return c=c===Kg?dw:c,arguments.length?c(arguments[0],arguments[1]):c}function Fd(c,f){var v=c.__data__;return LA(f)?v[typeof f=="string"?"string":"hash"]:v.map}function Ag(c){for(var f=ln(c),v=f.length;v--;){var S=f[v],P=c[S];f[v]=[S,P,qw(P)]}return f}function ws(c,f){var v=jT(c,f);return uw(v)?v:n}function DA(c){var f=St.call(c,ms),v=c[ms];try{c[ms]=n;var S=!0}catch{}var P=gd.call(c);return S&&(f?c[ms]=v:delete c[ms]),P}var Ig=ag?function(c){return c==null?[]:(c=$t(c),ui(ag(c),function(f){return Kx.call(c,f)}))}:Zg,Ww=ag?function(c){for(var f=[];c;)di(f,Ig(c)),c=bd(c);return f}:Zg,Sn=Dn;(lg&&Sn(new lg(new ArrayBuffer(1)))!=no||tc&&Sn(new tc)!=Ne||cg&&Sn(cg.resolve())!=dt||Da&&Sn(new Da)!=Vt||nc&&Sn(new nc)!=jr)&&(Sn=function(c){var f=Dn(c),v=f==pt?c.constructor:n,S=v?_s(v):"";if(S)switch(S){case f5:return no;case h5:return Ne;case p5:return dt;case g5:return Vt;case m5:return jr}return f});function MA(c,f,v){for(var S=-1,P=v.length;++S<P;){var T=v[S],N=T.size;switch(T.type){case"drop":c+=N;break;case"dropRight":f-=N;break;case"take":f=_n(f,c+N);break;case"takeRight":c=tn(c,f-N);break}}return{start:c,end:f}}function TA(c){var f=c.match(Zl);return f?f[1].split($):[]}function Bw(c,f,v){f=mi(f,c);for(var S=-1,P=f.length,T=!1;++S<P;){var N=so(f[S]);if(!(T=c!=null&&v(c,N)))break;c=c[N]}return T||++S!=P?T:(P=c==null?0:c.length,!!P&&Ud(P)&&Fo(N,P)&&(Ye(c)||Ss(c)))}function AA(c){var f=c.length,v=new c.constructor(f);return f&&typeof c[0]=="string"&&St.call(c,"index")&&(v.index=c.index,v.input=c.input),v}function Uw(c){return typeof c.constructor=="function"&&!dc(c)?Ta(bd(c)):{}}function IA(c,f,v){var S=c.constructor;switch(f){case fn:return $g(c);case ee:case K:return new S(+c);case no:return vA(c,v);case Oo:case Do:case Vr:case es:case ts:case ns:case rs:case os:case is:return $w(c,v);case Ne:return new S;case Ve:case xn:return new S(c);case Bt:return bA(c);case Vt:return new S;case Jt:return yA(c)}}function kA(c,f){var v=f.length;if(!v)return c;var S=v-1;return f[S]=(v>1?"& ":"")+f[S],f=f.join(v>2?", ":" "),c.replace(Ql,`{
|
|
70
|
-
/* [wrapped with `+f+`] */
|
|
71
|
-
`)}function NA(c){return Ye(c)||Ss(c)||!!(Xx&&c&&c[Xx])}function Fo(c,f){var v=typeof c;return f=f??X,!!f&&(v=="number"||v!="symbol"&&Ge.test(c))&&c>-1&&c%1==0&&c<f}function Mn(c,f,v){if(!Ht(v))return!1;var S=typeof f;return(S=="number"?Ln(v)&&Fo(f,v.length):S=="string"&&f in v)?Br(v[f],c):!1}function kg(c,f){if(Ye(c))return!1;var v=typeof c;return v=="number"||v=="symbol"||v=="boolean"||c==null||Jn(c)?!0:us.test(c)||!cs.test(c)||f!=null&&c in $t(f)}function LA(c){var f=typeof c;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?c!=="__proto__":c===null}function Ng(c){var f=Ld(c),v=O[f];if(typeof v!="function"||!(f in ut.prototype))return!1;if(c===v)return!0;var S=Tg(v);return!!S&&c===S[0]}function FA(c){return!!qx&&qx in c}var zA=hd?zo:Jg;function dc(c){var f=c&&c.constructor,v=typeof f=="function"&&f.prototype||Oa;return c===v}function qw(c){return c===c&&!Ht(c)}function Gw(c,f){return function(v){return v==null?!1:v[c]===f&&(f!==n||c in $t(v))}}function jA(c){var f=Wd(c,function(S){return v.size===u&&v.clear(),S}),v=f.cache;return f}function VA(c,f){var v=c[1],S=f[1],P=v|S,T=P<(x|_|D),N=S==D&&v==C||S==D&&v==A&&c[7].length<=f[8]||S==(D|A)&&f[7].length<=f[8]&&v==C;if(!(T||N))return c;S&x&&(c[2]=f[2],P|=v&x?0:w);var z=f[3];if(z){var G=c[3];c[3]=G?Ow(G,z,f[4]):z,c[4]=G?fi(c[3],d):f[4]}return z=f[5],z&&(G=c[5],c[5]=G?Dw(G,z,f[6]):z,c[6]=G?fi(c[5],d):f[6]),z=f[7],z&&(c[7]=z),S&D&&(c[8]=c[8]==null?f[8]:_n(c[8],f[8])),c[9]==null&&(c[9]=f[9]),c[0]=f[0],c[1]=P,c}function HA(c){var f=[];if(c!=null)for(var v in $t(c))f.push(v);return f}function WA(c){return gd.call(c)}function Yw(c,f,v){return f=tn(f===n?c.length-1:f,0),function(){for(var S=arguments,P=-1,T=tn(S.length-f,0),N=se(T);++P<T;)N[P]=S[f+P];P=-1;for(var z=se(f+1);++P<f;)z[P]=S[P];return z[f]=v(N),Xn(c,this,z)}}function Kw(c,f){return f.length<2?c:xs(c,Er(f,0,-1))}function BA(c,f){for(var v=c.length,S=_n(f.length,v),P=Nn(c);S--;){var T=f[S];c[S]=Fo(T,v)?P[T]:n}return c}function Lg(c,f){if(!(f==="constructor"&&typeof c[f]=="function")&&f!="__proto__")return c[f]}var Xw=Zw(yw),fc=i5||function(c,f){return hn.setTimeout(c,f)},Fg=Zw(hA);function Qw(c,f,v){var S=f+"";return Fg(c,kA(S,UA(TA(S),v)))}function Zw(c){var f=0,v=0;return function(){var S=c5(),P=ne-(S-v);if(v=S,P>0){if(++f>=Y)return arguments[0]}else f=0;return c.apply(n,arguments)}}function zd(c,f){var v=-1,S=c.length,P=S-1;for(f=f===n?S:f;++v<f;){var T=xg(v,P),N=c[T];c[T]=c[v],c[v]=N}return c.length=f,c}var Jw=jA(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(Kl,function(v,S,P,T){f.push(P?T.replace(xe,"$1"):S||v)}),f});function so(c){if(typeof c=="string"||Jn(c))return c;var f=c+"";return f=="0"&&1/c==-q?"-0":f}function _s(c){if(c!=null){try{return pd.call(c)}catch{}try{return c+""}catch{}}return""}function UA(c,f){return wr(ue,function(v){var S="_."+v[0];f&v[1]&&!cd(c,S)&&c.push(S)}),c.sort()}function e1(c){if(c instanceof ut)return c.clone();var f=new Sr(c.__wrapped__,c.__chain__);return f.__actions__=Nn(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}function qA(c,f,v){(v?Mn(c,f,v):f===n)?f=1:f=tn(Qe(f),0);var S=c==null?0:c.length;if(!S||f<1)return[];for(var P=0,T=0,N=se(wd(S/f));P<S;)N[T++]=Er(c,P,P+=f);return N}function GA(c){for(var f=-1,v=c==null?0:c.length,S=0,P=[];++f<v;){var T=c[f];T&&(P[S++]=T)}return P}function YA(){var c=arguments.length;if(!c)return[];for(var f=se(c-1),v=arguments[0],S=c;S--;)f[S-1]=arguments[S];return di(Ye(v)?Nn(v):[v],pn(f,1))}var KA=rt(function(c,f){return Yt(c)?sc(c,pn(f,1,Yt,!0)):[]}),XA=rt(function(c,f){var v=Rr(f);return Yt(v)&&(v=n),Yt(c)?sc(c,pn(f,1,Yt,!0),Le(v,2)):[]}),QA=rt(function(c,f){var v=Rr(f);return Yt(v)&&(v=n),Yt(c)?sc(c,pn(f,1,Yt,!0),n,v):[]});function ZA(c,f,v){var S=c==null?0:c.length;return S?(f=v||f===n?1:Qe(f),Er(c,f<0?0:f,S)):[]}function JA(c,f,v){var S=c==null?0:c.length;return S?(f=v||f===n?1:Qe(f),f=S-f,Er(c,0,f<0?0:f)):[]}function eI(c,f){return c&&c.length?Md(c,Le(f,3),!0,!0):[]}function tI(c,f){return c&&c.length?Md(c,Le(f,3),!0):[]}function nI(c,f,v,S){var P=c==null?0:c.length;return P?(v&&typeof v!="number"&&Mn(c,f,v)&&(v=0,S=P),Y5(c,f,v,S)):[]}function t1(c,f,v){var S=c==null?0:c.length;if(!S)return-1;var P=v==null?0:Qe(v);return P<0&&(P=tn(S+P,0)),ud(c,Le(f,3),P)}function n1(c,f,v){var S=c==null?0:c.length;if(!S)return-1;var P=S-1;return v!==n&&(P=Qe(v),P=v<0?tn(S+P,0):_n(P,S-1)),ud(c,Le(f,3),P,!0)}function r1(c){var f=c==null?0:c.length;return f?pn(c,1):[]}function rI(c){var f=c==null?0:c.length;return f?pn(c,q):[]}function oI(c,f){var v=c==null?0:c.length;return v?(f=f===n?1:Qe(f),pn(c,f)):[]}function iI(c){for(var f=-1,v=c==null?0:c.length,S={};++f<v;){var P=c[f];S[P[0]]=P[1]}return S}function o1(c){return c&&c.length?c[0]:n}function sI(c,f,v){var S=c==null?0:c.length;if(!S)return-1;var P=v==null?0:Qe(v);return P<0&&(P=tn(S+P,0)),Ea(c,f,P)}function aI(c){var f=c==null?0:c.length;return f?Er(c,0,-1):[]}var lI=rt(function(c){var f=jt(c,Eg);return f.length&&f[0]===c[0]?gg(f):[]}),cI=rt(function(c){var f=Rr(c),v=jt(c,Eg);return f===Rr(v)?f=n:v.pop(),v.length&&v[0]===c[0]?gg(v,Le(f,2)):[]}),uI=rt(function(c){var f=Rr(c),v=jt(c,Eg);return f=typeof f=="function"?f:n,f&&v.pop(),v.length&&v[0]===c[0]?gg(v,n,f):[]});function dI(c,f){return c==null?"":a5.call(c,f)}function Rr(c){var f=c==null?0:c.length;return f?c[f-1]:n}function fI(c,f,v){var S=c==null?0:c.length;if(!S)return-1;var P=S;return v!==n&&(P=Qe(v),P=P<0?tn(S+P,0):_n(P,S-1)),f===f?UT(c,f,P):ud(c,Fx,P,!0)}function hI(c,f){return c&&c.length?gw(c,Qe(f)):n}var pI=rt(i1);function i1(c,f){return c&&c.length&&f&&f.length?yg(c,f):c}function gI(c,f,v){return c&&c.length&&f&&f.length?yg(c,f,Le(v,2)):c}function mI(c,f,v){return c&&c.length&&f&&f.length?yg(c,f,n,v):c}var vI=Lo(function(c,f){var v=c==null?0:c.length,S=dg(c,f);return bw(c,jt(f,function(P){return Fo(P,v)?+P:P}).sort(Pw)),S});function bI(c,f){var v=[];if(!(c&&c.length))return v;var S=-1,P=[],T=c.length;for(f=Le(f,3);++S<T;){var N=c[S];f(N,S,c)&&(v.push(N),P.push(S))}return bw(c,P),v}function zg(c){return c==null?c:d5.call(c)}function yI(c,f,v){var S=c==null?0:c.length;return S?(v&&typeof v!="number"&&Mn(c,f,v)?(f=0,v=S):(f=f==null?0:Qe(f),v=v===n?S:Qe(v)),Er(c,f,v)):[]}function xI(c,f){return Dd(c,f)}function wI(c,f,v){return _g(c,f,Le(v,2))}function _I(c,f){var v=c==null?0:c.length;if(v){var S=Dd(c,f);if(S<v&&Br(c[S],f))return S}return-1}function SI(c,f){return Dd(c,f,!0)}function CI(c,f,v){return _g(c,f,Le(v,2),!0)}function EI(c,f){var v=c==null?0:c.length;if(v){var S=Dd(c,f,!0)-1;if(Br(c[S],f))return S}return-1}function RI(c){return c&&c.length?xw(c):[]}function $I(c,f){return c&&c.length?xw(c,Le(f,2)):[]}function PI(c){var f=c==null?0:c.length;return f?Er(c,1,f):[]}function OI(c,f,v){return c&&c.length?(f=v||f===n?1:Qe(f),Er(c,0,f<0?0:f)):[]}function DI(c,f,v){var S=c==null?0:c.length;return S?(f=v||f===n?1:Qe(f),f=S-f,Er(c,f<0?0:f,S)):[]}function MI(c,f){return c&&c.length?Md(c,Le(f,3),!1,!0):[]}function TI(c,f){return c&&c.length?Md(c,Le(f,3)):[]}var AI=rt(function(c){return gi(pn(c,1,Yt,!0))}),II=rt(function(c){var f=Rr(c);return Yt(f)&&(f=n),gi(pn(c,1,Yt,!0),Le(f,2))}),kI=rt(function(c){var f=Rr(c);return f=typeof f=="function"?f:n,gi(pn(c,1,Yt,!0),n,f)});function NI(c){return c&&c.length?gi(c):[]}function LI(c,f){return c&&c.length?gi(c,Le(f,2)):[]}function FI(c,f){return f=typeof f=="function"?f:n,c&&c.length?gi(c,n,f):[]}function jg(c){if(!(c&&c.length))return[];var f=0;return c=ui(c,function(v){if(Yt(v))return f=tn(v.length,f),!0}),rg(f,function(v){return jt(c,eg(v))})}function s1(c,f){if(!(c&&c.length))return[];var v=jg(c);return f==null?v:jt(v,function(S){return Xn(f,n,S)})}var zI=rt(function(c,f){return Yt(c)?sc(c,f):[]}),jI=rt(function(c){return Cg(ui(c,Yt))}),VI=rt(function(c){var f=Rr(c);return Yt(f)&&(f=n),Cg(ui(c,Yt),Le(f,2))}),HI=rt(function(c){var f=Rr(c);return f=typeof f=="function"?f:n,Cg(ui(c,Yt),n,f)}),WI=rt(jg);function BI(c,f){return Cw(c||[],f||[],ic)}function UI(c,f){return Cw(c||[],f||[],cc)}var qI=rt(function(c){var f=c.length,v=f>1?c[f-1]:n;return v=typeof v=="function"?(c.pop(),v):n,s1(c,v)});function a1(c){var f=O(c);return f.__chain__=!0,f}function GI(c,f){return f(c),c}function jd(c,f){return f(c)}var YI=Lo(function(c){var f=c.length,v=f?c[0]:0,S=this.__wrapped__,P=function(T){return dg(T,c)};return f>1||this.__actions__.length||!(S instanceof ut)||!Fo(v)?this.thru(P):(S=S.slice(v,+v+(f?1:0)),S.__actions__.push({func:jd,args:[P],thisArg:n}),new Sr(S,this.__chain__).thru(function(T){return f&&!T.length&&T.push(n),T}))});function KI(){return a1(this)}function XI(){return new Sr(this.value(),this.__chain__)}function QI(){this.__values__===n&&(this.__values__=w1(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function ZI(){return this}function JI(c){for(var f,v=this;v instanceof Ed;){var S=e1(v);S.__index__=0,S.__values__=n,f?P.__wrapped__=S:f=S;var P=S;v=v.__wrapped__}return P.__wrapped__=c,f}function ek(){var c=this.__wrapped__;if(c instanceof ut){var f=c;return this.__actions__.length&&(f=new ut(this)),f=f.reverse(),f.__actions__.push({func:jd,args:[zg],thisArg:n}),new Sr(f,this.__chain__)}return this.thru(zg)}function tk(){return Sw(this.__wrapped__,this.__actions__)}var nk=Td(function(c,f,v){St.call(c,v)?++c[v]:ko(c,v,1)});function rk(c,f,v){var S=Ye(c)?Nx:G5;return v&&Mn(c,f,v)&&(f=n),S(c,Le(f,3))}function ok(c,f){var v=Ye(c)?ui:sw;return v(c,Le(f,3))}var ik=Iw(t1),sk=Iw(n1);function ak(c,f){return pn(Vd(c,f),1)}function lk(c,f){return pn(Vd(c,f),q)}function ck(c,f,v){return v=v===n?1:Qe(v),pn(Vd(c,f),v)}function l1(c,f){var v=Ye(c)?wr:pi;return v(c,Le(f,3))}function c1(c,f){var v=Ye(c)?PT:iw;return v(c,Le(f,3))}var uk=Td(function(c,f,v){St.call(c,v)?c[v].push(f):ko(c,v,[f])});function dk(c,f,v,S){c=Ln(c)?c:La(c),v=v&&!S?Qe(v):0;var P=c.length;return v<0&&(v=tn(P+v,0)),qd(c)?v<=P&&c.indexOf(f,v)>-1:!!P&&Ea(c,f,v)>-1}var fk=rt(function(c,f,v){var S=-1,P=typeof f=="function",T=Ln(c)?se(c.length):[];return pi(c,function(N){T[++S]=P?Xn(f,N,v):ac(N,f,v)}),T}),hk=Td(function(c,f,v){ko(c,v,f)});function Vd(c,f){var v=Ye(c)?jt:fw;return v(c,Le(f,3))}function pk(c,f,v,S){return c==null?[]:(Ye(f)||(f=f==null?[]:[f]),v=S?n:v,Ye(v)||(v=v==null?[]:[v]),mw(c,f,v))}var gk=Td(function(c,f,v){c[v?0:1].push(f)},function(){return[[],[]]});function mk(c,f,v){var S=Ye(c)?Zp:jx,P=arguments.length<3;return S(c,Le(f,4),v,P,pi)}function vk(c,f,v){var S=Ye(c)?OT:jx,P=arguments.length<3;return S(c,Le(f,4),v,P,iw)}function bk(c,f){var v=Ye(c)?ui:sw;return v(c,Bd(Le(f,3)))}function yk(c){var f=Ye(c)?tw:dA;return f(c)}function xk(c,f,v){(v?Mn(c,f,v):f===n)?f=1:f=Qe(f);var S=Ye(c)?H5:fA;return S(c,f)}function wk(c){var f=Ye(c)?W5:pA;return f(c)}function _k(c){if(c==null)return 0;if(Ln(c))return qd(c)?$a(c):c.length;var f=Sn(c);return f==Ne||f==Vt?c.size:vg(c).length}function Sk(c,f,v){var S=Ye(c)?Jp:gA;return v&&Mn(c,f,v)&&(f=n),S(c,Le(f,3))}var Ck=rt(function(c,f){if(c==null)return[];var v=f.length;return v>1&&Mn(c,f[0],f[1])?f=[]:v>2&&Mn(f[0],f[1],f[2])&&(f=[f[0]]),mw(c,pn(f,1),[])}),Hd=o5||function(){return hn.Date.now()};function Ek(c,f){if(typeof f!="function")throw new _r(s);return c=Qe(c),function(){if(--c<1)return f.apply(this,arguments)}}function u1(c,f,v){return f=v?n:f,f=c&&f==null?c.length:f,No(c,D,n,n,n,n,f)}function d1(c,f){var v;if(typeof f!="function")throw new _r(s);return c=Qe(c),function(){return--c>0&&(v=f.apply(this,arguments)),c<=1&&(f=n),v}}var Vg=rt(function(c,f,v){var S=x;if(v.length){var P=fi(v,ka(Vg));S|=E}return No(c,S,f,v,P)}),f1=rt(function(c,f,v){var S=x|_;if(v.length){var P=fi(v,ka(f1));S|=E}return No(f,S,c,v,P)});function h1(c,f,v){f=v?n:f;var S=No(c,C,n,n,n,n,n,f);return S.placeholder=h1.placeholder,S}function p1(c,f,v){f=v?n:f;var S=No(c,R,n,n,n,n,n,f);return S.placeholder=p1.placeholder,S}function g1(c,f,v){var S,P,T,N,z,G,he=0,pe=!1,be=!1,Re=!0;if(typeof c!="function")throw new _r(s);f=$r(f)||0,Ht(v)&&(pe=!!v.leading,be="maxWait"in v,T=be?tn($r(v.maxWait)||0,f):T,Re="trailing"in v?!!v.trailing:Re);function Te(Kt){var Ur=S,Vo=P;return S=P=n,he=Kt,N=c.apply(Vo,Ur),N}function Fe(Kt){return he=Kt,z=fc(lt,f),pe?Te(Kt):N}function et(Kt){var Ur=Kt-G,Vo=Kt-he,I1=f-Ur;return be?_n(I1,T-Vo):I1}function ze(Kt){var Ur=Kt-G,Vo=Kt-he;return G===n||Ur>=f||Ur<0||be&&Vo>=T}function lt(){var Kt=Hd();if(ze(Kt))return ht(Kt);z=fc(lt,et(Kt))}function ht(Kt){return z=n,Re&&S?Te(Kt):(S=P=n,N)}function er(){z!==n&&Ew(z),he=0,S=G=P=z=n}function Tn(){return z===n?N:ht(Hd())}function tr(){var Kt=Hd(),Ur=ze(Kt);if(S=arguments,P=this,G=Kt,Ur){if(z===n)return Fe(G);if(be)return Ew(z),z=fc(lt,f),Te(G)}return z===n&&(z=fc(lt,f)),N}return tr.cancel=er,tr.flush=Tn,tr}var Rk=rt(function(c,f){return ow(c,1,f)}),$k=rt(function(c,f,v){return ow(c,$r(f)||0,v)});function Pk(c){return No(c,k)}function Wd(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new _r(s);var v=function(){var S=arguments,P=f?f.apply(this,S):S[0],T=v.cache;if(T.has(P))return T.get(P);var N=c.apply(this,S);return v.cache=T.set(P,N)||T,N};return v.cache=new(Wd.Cache||Io),v}Wd.Cache=Io;function Bd(c){if(typeof c!="function")throw new _r(s);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}function Ok(c){return d1(2,c)}var Dk=mA(function(c,f){f=f.length==1&&Ye(f[0])?jt(f[0],Qn(Le())):jt(pn(f,1),Qn(Le()));var v=f.length;return rt(function(S){for(var P=-1,T=_n(S.length,v);++P<T;)S[P]=f[P].call(this,S[P]);return Xn(c,this,S)})}),Hg=rt(function(c,f){var v=fi(f,ka(Hg));return No(c,E,n,f,v)}),m1=rt(function(c,f){var v=fi(f,ka(m1));return No(c,M,n,f,v)}),Mk=Lo(function(c,f){return No(c,A,n,n,n,f)});function Tk(c,f){if(typeof c!="function")throw new _r(s);return f=f===n?f:Qe(f),rt(c,f)}function Ak(c,f){if(typeof c!="function")throw new _r(s);return f=f==null?0:tn(Qe(f),0),rt(function(v){var S=v[f],P=vi(v,0,f);return S&&di(P,S),Xn(c,this,P)})}function Ik(c,f,v){var S=!0,P=!0;if(typeof c!="function")throw new _r(s);return Ht(v)&&(S="leading"in v?!!v.leading:S,P="trailing"in v?!!v.trailing:P),g1(c,f,{leading:S,maxWait:f,trailing:P})}function kk(c){return u1(c,1)}function Nk(c,f){return Hg(Rg(f),c)}function Lk(){if(!arguments.length)return[];var c=arguments[0];return Ye(c)?c:[c]}function Fk(c){return Cr(c,g)}function zk(c,f){return f=typeof f=="function"?f:n,Cr(c,g,f)}function jk(c){return Cr(c,h|g)}function Vk(c,f){return f=typeof f=="function"?f:n,Cr(c,h|g,f)}function Hk(c,f){return f==null||rw(c,f,ln(f))}function Br(c,f){return c===f||c!==c&&f!==f}var Wk=Nd(pg),Bk=Nd(function(c,f){return c>=f}),Ss=cw(function(){return arguments}())?cw:function(c){return Ut(c)&&St.call(c,"callee")&&!Kx.call(c,"callee")},Ye=se.isArray,Uk=Dx?Qn(Dx):J5;function Ln(c){return c!=null&&Ud(c.length)&&!zo(c)}function Yt(c){return Ut(c)&&Ln(c)}function qk(c){return c===!0||c===!1||Ut(c)&&Dn(c)==ee}var bi=s5||Jg,Gk=Mx?Qn(Mx):eA;function Yk(c){return Ut(c)&&c.nodeType===1&&!hc(c)}function Kk(c){if(c==null)return!0;if(Ln(c)&&(Ye(c)||typeof c=="string"||typeof c.splice=="function"||bi(c)||Na(c)||Ss(c)))return!c.length;var f=Sn(c);if(f==Ne||f==Vt)return!c.size;if(dc(c))return!vg(c).length;for(var v in c)if(St.call(c,v))return!1;return!0}function Xk(c,f){return lc(c,f)}function Qk(c,f,v){v=typeof v=="function"?v:n;var S=v?v(c,f):n;return S===n?lc(c,f,n,v):!!S}function Wg(c){if(!Ut(c))return!1;var f=Dn(c);return f==ye||f==ie||typeof c.message=="string"&&typeof c.name=="string"&&!hc(c)}function Zk(c){return typeof c=="number"&&Qx(c)}function zo(c){if(!Ht(c))return!1;var f=Dn(c);return f==Z||f==De||f==fe||f==ft}function v1(c){return typeof c=="number"&&c==Qe(c)}function Ud(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=X}function Ht(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function Ut(c){return c!=null&&typeof c=="object"}var b1=Tx?Qn(Tx):nA;function Jk(c,f){return c===f||mg(c,f,Ag(f))}function e7(c,f,v){return v=typeof v=="function"?v:n,mg(c,f,Ag(f),v)}function t7(c){return y1(c)&&c!=+c}function n7(c){if(zA(c))throw new Ue(i);return uw(c)}function r7(c){return c===null}function o7(c){return c==null}function y1(c){return typeof c=="number"||Ut(c)&&Dn(c)==Ve}function hc(c){if(!Ut(c)||Dn(c)!=pt)return!1;var f=bd(c);if(f===null)return!0;var v=St.call(f,"constructor")&&f.constructor;return typeof v=="function"&&v instanceof v&&pd.call(v)==e5}var Bg=Ax?Qn(Ax):rA;function i7(c){return v1(c)&&c>=-X&&c<=X}var x1=Ix?Qn(Ix):oA;function qd(c){return typeof c=="string"||!Ye(c)&&Ut(c)&&Dn(c)==xn}function Jn(c){return typeof c=="symbol"||Ut(c)&&Dn(c)==Jt}var Na=kx?Qn(kx):iA;function s7(c){return c===n}function a7(c){return Ut(c)&&Sn(c)==jr}function l7(c){return Ut(c)&&Dn(c)==Ji}var c7=Nd(bg),u7=Nd(function(c,f){return c<=f});function w1(c){if(!c)return[];if(Ln(c))return qd(c)?Hr(c):Nn(c);if(ec&&c[ec])return HT(c[ec]());var f=Sn(c),v=f==Ne?ig:f==Vt?dd:La;return v(c)}function jo(c){if(!c)return c===0?c:0;if(c=$r(c),c===q||c===-q){var f=c<0?-1:1;return f*ae}return c===c?c:0}function Qe(c){var f=jo(c),v=f%1;return f===f?v?f-v:f:0}function _1(c){return c?ys(Qe(c),0,V):0}function $r(c){if(typeof c=="number")return c;if(Jn(c))return j;if(Ht(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=Ht(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=Vx(c);var v=Ee.test(c);return v||We.test(c)?ET(c.slice(2),v?2:8):$e.test(c)?j:+c}function S1(c){return io(c,Fn(c))}function d7(c){return c?ys(Qe(c),-X,X):c===0?c:0}function yt(c){return c==null?"":Zn(c)}var f7=Aa(function(c,f){if(dc(f)||Ln(f)){io(f,ln(f),c);return}for(var v in f)St.call(f,v)&&ic(c,v,f[v])}),C1=Aa(function(c,f){io(f,Fn(f),c)}),Gd=Aa(function(c,f,v,S){io(f,Fn(f),c,S)}),h7=Aa(function(c,f,v,S){io(f,ln(f),c,S)}),p7=Lo(dg);function g7(c,f){var v=Ta(c);return f==null?v:nw(v,f)}var m7=rt(function(c,f){c=$t(c);var v=-1,S=f.length,P=S>2?f[2]:n;for(P&&Mn(f[0],f[1],P)&&(S=1);++v<S;)for(var T=f[v],N=Fn(T),z=-1,G=N.length;++z<G;){var he=N[z],pe=c[he];(pe===n||Br(pe,Oa[he])&&!St.call(c,he))&&(c[he]=T[he])}return c}),v7=rt(function(c){return c.push(n,Vw),Xn(E1,n,c)});function b7(c,f){return Lx(c,Le(f,3),oo)}function y7(c,f){return Lx(c,Le(f,3),hg)}function x7(c,f){return c==null?c:fg(c,Le(f,3),Fn)}function w7(c,f){return c==null?c:aw(c,Le(f,3),Fn)}function _7(c,f){return c&&oo(c,Le(f,3))}function S7(c,f){return c&&hg(c,Le(f,3))}function C7(c){return c==null?[]:Pd(c,ln(c))}function E7(c){return c==null?[]:Pd(c,Fn(c))}function Ug(c,f,v){var S=c==null?n:xs(c,f);return S===n?v:S}function R7(c,f){return c!=null&&Bw(c,f,K5)}function qg(c,f){return c!=null&&Bw(c,f,X5)}var $7=Nw(function(c,f,v){f!=null&&typeof f.toString!="function"&&(f=gd.call(f)),c[f]=v},Yg(zn)),P7=Nw(function(c,f,v){f!=null&&typeof f.toString!="function"&&(f=gd.call(f)),St.call(c,f)?c[f].push(v):c[f]=[v]},Le),O7=rt(ac);function ln(c){return Ln(c)?ew(c):vg(c)}function Fn(c){return Ln(c)?ew(c,!0):sA(c)}function D7(c,f){var v={};return f=Le(f,3),oo(c,function(S,P,T){ko(v,f(S,P,T),S)}),v}function M7(c,f){var v={};return f=Le(f,3),oo(c,function(S,P,T){ko(v,P,f(S,P,T))}),v}var T7=Aa(function(c,f,v){Od(c,f,v)}),E1=Aa(function(c,f,v,S){Od(c,f,v,S)}),A7=Lo(function(c,f){var v={};if(c==null)return v;var S=!1;f=jt(f,function(T){return T=mi(T,c),S||(S=T.length>1),T}),io(c,Mg(c),v),S&&(v=Cr(v,h|p|g,$A));for(var P=f.length;P--;)Sg(v,f[P]);return v});function I7(c,f){return R1(c,Bd(Le(f)))}var k7=Lo(function(c,f){return c==null?{}:lA(c,f)});function R1(c,f){if(c==null)return{};var v=jt(Mg(c),function(S){return[S]});return f=Le(f),vw(c,v,function(S,P){return f(S,P[0])})}function N7(c,f,v){f=mi(f,c);var S=-1,P=f.length;for(P||(P=1,c=n);++S<P;){var T=c==null?n:c[so(f[S])];T===n&&(S=P,T=v),c=zo(T)?T.call(c):T}return c}function L7(c,f,v){return c==null?c:cc(c,f,v)}function F7(c,f,v,S){return S=typeof S=="function"?S:n,c==null?c:cc(c,f,v,S)}var $1=zw(ln),P1=zw(Fn);function z7(c,f,v){var S=Ye(c),P=S||bi(c)||Na(c);if(f=Le(f,4),v==null){var T=c&&c.constructor;P?v=S?new T:[]:Ht(c)?v=zo(T)?Ta(bd(c)):{}:v={}}return(P?wr:oo)(c,function(N,z,G){return f(v,N,z,G)}),v}function j7(c,f){return c==null?!0:Sg(c,f)}function V7(c,f,v){return c==null?c:_w(c,f,Rg(v))}function H7(c,f,v,S){return S=typeof S=="function"?S:n,c==null?c:_w(c,f,Rg(v),S)}function La(c){return c==null?[]:og(c,ln(c))}function W7(c){return c==null?[]:og(c,Fn(c))}function B7(c,f,v){return v===n&&(v=f,f=n),v!==n&&(v=$r(v),v=v===v?v:0),f!==n&&(f=$r(f),f=f===f?f:0),ys($r(c),f,v)}function U7(c,f,v){return f=jo(f),v===n?(v=f,f=0):v=jo(v),c=$r(c),Q5(c,f,v)}function q7(c,f,v){if(v&&typeof v!="boolean"&&Mn(c,f,v)&&(f=v=n),v===n&&(typeof f=="boolean"?(v=f,f=n):typeof c=="boolean"&&(v=c,c=n)),c===n&&f===n?(c=0,f=1):(c=jo(c),f===n?(f=c,c=0):f=jo(f)),c>f){var S=c;c=f,f=S}if(v||c%1||f%1){var P=Zx();return _n(c+P*(f-c+CT("1e-"+((P+"").length-1))),f)}return xg(c,f)}var G7=Ia(function(c,f,v){return f=f.toLowerCase(),c+(v?O1(f):f)});function O1(c){return Gg(yt(c).toLowerCase())}function D1(c){return c=yt(c),c&&c.replace(Rt,LT).replace(pT,"")}function Y7(c,f,v){c=yt(c),f=Zn(f);var S=c.length;v=v===n?S:ys(Qe(v),0,S);var P=v;return v-=f.length,v>=0&&c.slice(v,P)==f}function K7(c){return c=yt(c),c&&as.test(c)?c.replace(ro,FT):c}function X7(c){return c=yt(c),c&&fs.test(c)?c.replace(ds,"\\$&"):c}var Q7=Ia(function(c,f,v){return c+(v?"-":"")+f.toLowerCase()}),Z7=Ia(function(c,f,v){return c+(v?" ":"")+f.toLowerCase()}),J7=Aw("toLowerCase");function e3(c,f,v){c=yt(c),f=Qe(f);var S=f?$a(c):0;if(!f||S>=f)return c;var P=(f-S)/2;return kd(_d(P),v)+c+kd(wd(P),v)}function t3(c,f,v){c=yt(c),f=Qe(f);var S=f?$a(c):0;return f&&S<f?c+kd(f-S,v):c}function n3(c,f,v){c=yt(c),f=Qe(f);var S=f?$a(c):0;return f&&S<f?kd(f-S,v)+c:c}function r3(c,f,v){return v||f==null?f=0:f&&(f=+f),u5(yt(c).replace(hs,""),f||0)}function o3(c,f,v){return(v?Mn(c,f,v):f===n)?f=1:f=Qe(f),wg(yt(c),f)}function i3(){var c=arguments,f=yt(c[0]);return c.length<3?f:f.replace(c[1],c[2])}var s3=Ia(function(c,f,v){return c+(v?"_":"")+f.toLowerCase()});function a3(c,f,v){return v&&typeof v!="number"&&Mn(c,f,v)&&(f=v=n),v=v===n?V:v>>>0,v?(c=yt(c),c&&(typeof f=="string"||f!=null&&!Bg(f))&&(f=Zn(f),!f&&Ra(c))?vi(Hr(c),0,v):c.split(f,v)):[]}var l3=Ia(function(c,f,v){return c+(v?" ":"")+Gg(f)});function c3(c,f,v){return c=yt(c),v=v==null?0:ys(Qe(v),0,c.length),f=Zn(f),c.slice(v,v+f.length)==f}function u3(c,f,v){var S=O.templateSettings;v&&Mn(c,f,v)&&(f=n),c=yt(c),f=Gd({},f,S,jw);var P=Gd({},f.imports,S.imports,jw),T=ln(P),N=og(P,T),z,G,he=0,pe=f.interpolate||an,be="__p += '",Re=sg((f.escape||an).source+"|"+pe.source+"|"+(pe===Sa?Me:an).source+"|"+(f.evaluate||an).source+"|$","g"),Te="//# sourceURL="+(St.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yT+"]")+`
|
|
72
|
-
`;c.replace(Re,function(ze,lt,ht,er,Tn,tr){return ht||(ht=er),be+=c.slice(he,tr).replace(ps,zT),lt&&(z=!0,be+=`' +
|
|
73
|
-
__e(`+lt+`) +
|
|
74
|
-
'`),Tn&&(G=!0,be+=`';
|
|
75
|
-
`+Tn+`;
|
|
76
|
-
__p += '`),ht&&(be+=`' +
|
|
77
|
-
((__t = (`+ht+`)) == null ? '' : __t) +
|
|
78
|
-
'`),he=tr+ze.length,ze}),be+=`';
|
|
79
|
-
`;var Fe=St.call(f,"variable")&&f.variable;if(!Fe)be=`with (obj) {
|
|
80
|
-
`+be+`
|
|
81
|
-
}
|
|
82
|
-
`;else if(re.test(Fe))throw new Ue(a);be=(G?be.replace(Gl,""):be).replace(Mo,"$1").replace(ss,"$1;"),be="function("+(Fe||"obj")+`) {
|
|
83
|
-
`+(Fe?"":`obj || (obj = {});
|
|
84
|
-
`)+"var __t, __p = ''"+(z?", __e = _.escape":"")+(G?`, __j = Array.prototype.join;
|
|
85
|
-
function print() { __p += __j.call(arguments, '') }
|
|
86
|
-
`:`;
|
|
87
|
-
`)+be+`return __p
|
|
88
|
-
}`;var et=T1(function(){return vt(T,Te+"return "+be).apply(n,N)});if(et.source=be,Wg(et))throw et;return et}function d3(c){return yt(c).toLowerCase()}function f3(c){return yt(c).toUpperCase()}function h3(c,f,v){if(c=yt(c),c&&(v||f===n))return Vx(c);if(!c||!(f=Zn(f)))return c;var S=Hr(c),P=Hr(f),T=Hx(S,P),N=Wx(S,P)+1;return vi(S,T,N).join("")}function p3(c,f,v){if(c=yt(c),c&&(v||f===n))return c.slice(0,Ux(c)+1);if(!c||!(f=Zn(f)))return c;var S=Hr(c),P=Wx(S,Hr(f))+1;return vi(S,0,P).join("")}function g3(c,f,v){if(c=yt(c),c&&(v||f===n))return c.replace(hs,"");if(!c||!(f=Zn(f)))return c;var S=Hr(c),P=Hx(S,Hr(f));return vi(S,P).join("")}function m3(c,f){var v=L,S=W;if(Ht(f)){var P="separator"in f?f.separator:P;v="length"in f?Qe(f.length):v,S="omission"in f?Zn(f.omission):S}c=yt(c);var T=c.length;if(Ra(c)){var N=Hr(c);T=N.length}if(v>=T)return c;var z=v-$a(S);if(z<1)return S;var G=N?vi(N,0,z).join(""):c.slice(0,z);if(P===n)return G+S;if(N&&(z+=G.length-z),Bg(P)){if(c.slice(z).search(P)){var he,pe=G;for(P.global||(P=sg(P.source,yt(Ae.exec(P))+"g")),P.lastIndex=0;he=P.exec(pe);)var be=he.index;G=G.slice(0,be===n?z:be)}}else if(c.indexOf(Zn(P),z)!=z){var Re=G.lastIndexOf(P);Re>-1&&(G=G.slice(0,Re))}return G+S}function v3(c){return c=yt(c),c&&To.test(c)?c.replace(wn,qT):c}var b3=Ia(function(c,f,v){return c+(v?" ":"")+f.toUpperCase()}),Gg=Aw("toUpperCase");function M1(c,f,v){return c=yt(c),f=v?n:f,f===n?VT(c)?KT(c):TT(c):c.match(f)||[]}var T1=rt(function(c,f){try{return Xn(c,n,f)}catch(v){return Wg(v)?v:new Ue(v)}}),y3=Lo(function(c,f){return wr(f,function(v){v=so(v),ko(c,v,Vg(c[v],c))}),c});function x3(c){var f=c==null?0:c.length,v=Le();return c=f?jt(c,function(S){if(typeof S[1]!="function")throw new _r(s);return[v(S[0]),S[1]]}):[],rt(function(S){for(var P=-1;++P<f;){var T=c[P];if(Xn(T[0],this,S))return Xn(T[1],this,S)}})}function w3(c){return q5(Cr(c,h))}function Yg(c){return function(){return c}}function _3(c,f){return c==null||c!==c?f:c}var S3=kw(),C3=kw(!0);function zn(c){return c}function Kg(c){return dw(typeof c=="function"?c:Cr(c,h))}function E3(c){return hw(Cr(c,h))}function R3(c,f){return pw(c,Cr(f,h))}var $3=rt(function(c,f){return function(v){return ac(v,c,f)}}),P3=rt(function(c,f){return function(v){return ac(c,v,f)}});function Xg(c,f,v){var S=ln(f),P=Pd(f,S);v==null&&!(Ht(f)&&(P.length||!S.length))&&(v=f,f=c,c=this,P=Pd(f,ln(f)));var T=!(Ht(v)&&"chain"in v)||!!v.chain,N=zo(c);return wr(P,function(z){var G=f[z];c[z]=G,N&&(c.prototype[z]=function(){var he=this.__chain__;if(T||he){var pe=c(this.__wrapped__),be=pe.__actions__=Nn(this.__actions__);return be.push({func:G,args:arguments,thisArg:c}),pe.__chain__=he,pe}return G.apply(c,di([this.value()],arguments))})}),c}function O3(){return hn._===this&&(hn._=t5),this}function Qg(){}function D3(c){return c=Qe(c),rt(function(f){return gw(f,c)})}var M3=Pg(jt),T3=Pg(Nx),A3=Pg(Jp);function A1(c){return kg(c)?eg(so(c)):cA(c)}function I3(c){return function(f){return c==null?n:xs(c,f)}}var k3=Lw(),N3=Lw(!0);function Zg(){return[]}function Jg(){return!1}function L3(){return{}}function F3(){return""}function z3(){return!0}function j3(c,f){if(c=Qe(c),c<1||c>X)return[];var v=V,S=_n(c,V);f=Le(f),c-=V;for(var P=rg(S,f);++v<c;)f(v);return P}function V3(c){return Ye(c)?jt(c,so):Jn(c)?[c]:Nn(Jw(yt(c)))}function H3(c){var f=++JT;return yt(c)+f}var W3=Id(function(c,f){return c+f},0),B3=Og("ceil"),U3=Id(function(c,f){return c/f},1),q3=Og("floor");function G3(c){return c&&c.length?$d(c,zn,pg):n}function Y3(c,f){return c&&c.length?$d(c,Le(f,2),pg):n}function K3(c){return zx(c,zn)}function X3(c,f){return zx(c,Le(f,2))}function Q3(c){return c&&c.length?$d(c,zn,bg):n}function Z3(c,f){return c&&c.length?$d(c,Le(f,2),bg):n}var J3=Id(function(c,f){return c*f},1),eN=Og("round"),tN=Id(function(c,f){return c-f},0);function nN(c){return c&&c.length?ng(c,zn):0}function rN(c,f){return c&&c.length?ng(c,Le(f,2)):0}return O.after=Ek,O.ary=u1,O.assign=f7,O.assignIn=C1,O.assignInWith=Gd,O.assignWith=h7,O.at=p7,O.before=d1,O.bind=Vg,O.bindAll=y3,O.bindKey=f1,O.castArray=Lk,O.chain=a1,O.chunk=qA,O.compact=GA,O.concat=YA,O.cond=x3,O.conforms=w3,O.constant=Yg,O.countBy=nk,O.create=g7,O.curry=h1,O.curryRight=p1,O.debounce=g1,O.defaults=m7,O.defaultsDeep=v7,O.defer=Rk,O.delay=$k,O.difference=KA,O.differenceBy=XA,O.differenceWith=QA,O.drop=ZA,O.dropRight=JA,O.dropRightWhile=eI,O.dropWhile=tI,O.fill=nI,O.filter=ok,O.flatMap=ak,O.flatMapDeep=lk,O.flatMapDepth=ck,O.flatten=r1,O.flattenDeep=rI,O.flattenDepth=oI,O.flip=Pk,O.flow=S3,O.flowRight=C3,O.fromPairs=iI,O.functions=C7,O.functionsIn=E7,O.groupBy=uk,O.initial=aI,O.intersection=lI,O.intersectionBy=cI,O.intersectionWith=uI,O.invert=$7,O.invertBy=P7,O.invokeMap=fk,O.iteratee=Kg,O.keyBy=hk,O.keys=ln,O.keysIn=Fn,O.map=Vd,O.mapKeys=D7,O.mapValues=M7,O.matches=E3,O.matchesProperty=R3,O.memoize=Wd,O.merge=T7,O.mergeWith=E1,O.method=$3,O.methodOf=P3,O.mixin=Xg,O.negate=Bd,O.nthArg=D3,O.omit=A7,O.omitBy=I7,O.once=Ok,O.orderBy=pk,O.over=M3,O.overArgs=Dk,O.overEvery=T3,O.overSome=A3,O.partial=Hg,O.partialRight=m1,O.partition=gk,O.pick=k7,O.pickBy=R1,O.property=A1,O.propertyOf=I3,O.pull=pI,O.pullAll=i1,O.pullAllBy=gI,O.pullAllWith=mI,O.pullAt=vI,O.range=k3,O.rangeRight=N3,O.rearg=Mk,O.reject=bk,O.remove=bI,O.rest=Tk,O.reverse=zg,O.sampleSize=xk,O.set=L7,O.setWith=F7,O.shuffle=wk,O.slice=yI,O.sortBy=Ck,O.sortedUniq=RI,O.sortedUniqBy=$I,O.split=a3,O.spread=Ak,O.tail=PI,O.take=OI,O.takeRight=DI,O.takeRightWhile=MI,O.takeWhile=TI,O.tap=GI,O.throttle=Ik,O.thru=jd,O.toArray=w1,O.toPairs=$1,O.toPairsIn=P1,O.toPath=V3,O.toPlainObject=S1,O.transform=z7,O.unary=kk,O.union=AI,O.unionBy=II,O.unionWith=kI,O.uniq=NI,O.uniqBy=LI,O.uniqWith=FI,O.unset=j7,O.unzip=jg,O.unzipWith=s1,O.update=V7,O.updateWith=H7,O.values=La,O.valuesIn=W7,O.without=zI,O.words=M1,O.wrap=Nk,O.xor=jI,O.xorBy=VI,O.xorWith=HI,O.zip=WI,O.zipObject=BI,O.zipObjectDeep=UI,O.zipWith=qI,O.entries=$1,O.entriesIn=P1,O.extend=C1,O.extendWith=Gd,Xg(O,O),O.add=W3,O.attempt=T1,O.camelCase=G7,O.capitalize=O1,O.ceil=B3,O.clamp=B7,O.clone=Fk,O.cloneDeep=jk,O.cloneDeepWith=Vk,O.cloneWith=zk,O.conformsTo=Hk,O.deburr=D1,O.defaultTo=_3,O.divide=U3,O.endsWith=Y7,O.eq=Br,O.escape=K7,O.escapeRegExp=X7,O.every=rk,O.find=ik,O.findIndex=t1,O.findKey=b7,O.findLast=sk,O.findLastIndex=n1,O.findLastKey=y7,O.floor=q3,O.forEach=l1,O.forEachRight=c1,O.forIn=x7,O.forInRight=w7,O.forOwn=_7,O.forOwnRight=S7,O.get=Ug,O.gt=Wk,O.gte=Bk,O.has=R7,O.hasIn=qg,O.head=o1,O.identity=zn,O.includes=dk,O.indexOf=sI,O.inRange=U7,O.invoke=O7,O.isArguments=Ss,O.isArray=Ye,O.isArrayBuffer=Uk,O.isArrayLike=Ln,O.isArrayLikeObject=Yt,O.isBoolean=qk,O.isBuffer=bi,O.isDate=Gk,O.isElement=Yk,O.isEmpty=Kk,O.isEqual=Xk,O.isEqualWith=Qk,O.isError=Wg,O.isFinite=Zk,O.isFunction=zo,O.isInteger=v1,O.isLength=Ud,O.isMap=b1,O.isMatch=Jk,O.isMatchWith=e7,O.isNaN=t7,O.isNative=n7,O.isNil=o7,O.isNull=r7,O.isNumber=y1,O.isObject=Ht,O.isObjectLike=Ut,O.isPlainObject=hc,O.isRegExp=Bg,O.isSafeInteger=i7,O.isSet=x1,O.isString=qd,O.isSymbol=Jn,O.isTypedArray=Na,O.isUndefined=s7,O.isWeakMap=a7,O.isWeakSet=l7,O.join=dI,O.kebabCase=Q7,O.last=Rr,O.lastIndexOf=fI,O.lowerCase=Z7,O.lowerFirst=J7,O.lt=c7,O.lte=u7,O.max=G3,O.maxBy=Y3,O.mean=K3,O.meanBy=X3,O.min=Q3,O.minBy=Z3,O.stubArray=Zg,O.stubFalse=Jg,O.stubObject=L3,O.stubString=F3,O.stubTrue=z3,O.multiply=J3,O.nth=hI,O.noConflict=O3,O.noop=Qg,O.now=Hd,O.pad=e3,O.padEnd=t3,O.padStart=n3,O.parseInt=r3,O.random=q7,O.reduce=mk,O.reduceRight=vk,O.repeat=o3,O.replace=i3,O.result=N7,O.round=eN,O.runInContext=B,O.sample=yk,O.size=_k,O.snakeCase=s3,O.some=Sk,O.sortedIndex=xI,O.sortedIndexBy=wI,O.sortedIndexOf=_I,O.sortedLastIndex=SI,O.sortedLastIndexBy=CI,O.sortedLastIndexOf=EI,O.startCase=l3,O.startsWith=c3,O.subtract=tN,O.sum=nN,O.sumBy=rN,O.template=u3,O.times=j3,O.toFinite=jo,O.toInteger=Qe,O.toLength=_1,O.toLower=d3,O.toNumber=$r,O.toSafeInteger=d7,O.toString=yt,O.toUpper=f3,O.trim=h3,O.trimEnd=p3,O.trimStart=g3,O.truncate=m3,O.unescape=v3,O.uniqueId=H3,O.upperCase=b3,O.upperFirst=Gg,O.each=l1,O.eachRight=c1,O.first=o1,Xg(O,function(){var c={};return oo(O,function(f,v){St.call(O.prototype,v)||(c[v]=f)}),c}(),{chain:!1}),O.VERSION=r,wr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){O[c].placeholder=O}),wr(["drop","take"],function(c,f){ut.prototype[c]=function(v){v=v===n?1:tn(Qe(v),0);var S=this.__filtered__&&!f?new ut(this):this.clone();return S.__filtered__?S.__takeCount__=_n(v,S.__takeCount__):S.__views__.push({size:_n(v,V),type:c+(S.__dir__<0?"Right":"")}),S},ut.prototype[c+"Right"]=function(v){return this.reverse()[c](v).reverse()}}),wr(["filter","map","takeWhile"],function(c,f){var v=f+1,S=v==Q||v==J;ut.prototype[c]=function(P){var T=this.clone();return T.__iteratees__.push({iteratee:Le(P,3),type:v}),T.__filtered__=T.__filtered__||S,T}}),wr(["head","last"],function(c,f){var v="take"+(f?"Right":"");ut.prototype[c]=function(){return this[v](1).value()[0]}}),wr(["initial","tail"],function(c,f){var v="drop"+(f?"":"Right");ut.prototype[c]=function(){return this.__filtered__?new ut(this):this[v](1)}}),ut.prototype.compact=function(){return this.filter(zn)},ut.prototype.find=function(c){return this.filter(c).head()},ut.prototype.findLast=function(c){return this.reverse().find(c)},ut.prototype.invokeMap=rt(function(c,f){return typeof c=="function"?new ut(this):this.map(function(v){return ac(v,c,f)})}),ut.prototype.reject=function(c){return this.filter(Bd(Le(c)))},ut.prototype.slice=function(c,f){c=Qe(c);var v=this;return v.__filtered__&&(c>0||f<0)?new ut(v):(c<0?v=v.takeRight(-c):c&&(v=v.drop(c)),f!==n&&(f=Qe(f),v=f<0?v.dropRight(-f):v.take(f-c)),v)},ut.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},ut.prototype.toArray=function(){return this.take(V)},oo(ut.prototype,function(c,f){var v=/^(?:filter|find|map|reject)|While$/.test(f),S=/^(?:head|last)$/.test(f),P=O[S?"take"+(f=="last"?"Right":""):f],T=S||/^find/.test(f);P&&(O.prototype[f]=function(){var N=this.__wrapped__,z=S?[1]:arguments,G=N instanceof ut,he=z[0],pe=G||Ye(N),be=function(lt){var ht=P.apply(O,di([lt],z));return S&&Re?ht[0]:ht};pe&&v&&typeof he=="function"&&he.length!=1&&(G=pe=!1);var Re=this.__chain__,Te=!!this.__actions__.length,Fe=T&&!Re,et=G&&!Te;if(!T&&pe){N=et?N:new ut(this);var ze=c.apply(N,z);return ze.__actions__.push({func:jd,args:[be],thisArg:n}),new Sr(ze,Re)}return Fe&&et?c.apply(this,z):(ze=this.thru(be),Fe?S?ze.value()[0]:ze.value():ze)})}),wr(["pop","push","shift","sort","splice","unshift"],function(c){var f=fd[c],v=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",S=/^(?:pop|shift)$/.test(c);O.prototype[c]=function(){var P=arguments;if(S&&!this.__chain__){var T=this.value();return f.apply(Ye(T)?T:[],P)}return this[v](function(N){return f.apply(Ye(N)?N:[],P)})}}),oo(ut.prototype,function(c,f){var v=O[f];if(v){var S=v.name+"";St.call(Ma,S)||(Ma[S]=[]),Ma[S].push({name:f,func:v})}}),Ma[Ad(n,_).name]=[{name:"wrapper",func:n}],ut.prototype.clone=v5,ut.prototype.reverse=b5,ut.prototype.value=y5,O.prototype.at=YI,O.prototype.chain=KI,O.prototype.commit=XI,O.prototype.next=QI,O.prototype.plant=JI,O.prototype.reverse=ek,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=tk,O.prototype.first=O.prototype.head,ec&&(O.prototype[ec]=ZI),O},Pa=XT();gs?((gs.exports=Pa)._=Pa,Kp._=Pa):hn._=Pa}).call(ks)})(ah,ah.exports);var Za=ah.exports;const ia=Lu(Za),e_=["lg","md","sm","xs","xxs"],Ce=AE()(jE((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Rv},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&Za.forEach(i.frames,l=>{var d;const u=(d=l.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&Za.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&Za.forEach(i.frames,l=>{var d;const u=(d=l.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&Za.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,u,d;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n);if(s){const h=(u=s.cards)==null?void 0:u.find(p=>p.id===r);h&&(h.sql=o,(d=i.onUpdateCard)==null||d.call(i,h,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&Za.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(u=>u.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var o;r.dashboard.filters?(o=r.dashboard.filters)==null||o.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1))}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,u,d,h,p;const s=(u=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:u.find(g=>g.id===n);if(!s)return;const a=(d=s==null?void 0:s.frames)==null?void 0:d.find(g=>g.id===r);if(a){const g=(h=a.cards)==null?void 0:h.findIndex(b=>b.id===o.id);g>-1&&((p=a.cards)==null||p.splice(g,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{e(o=>{var s,a,l,u,d;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(h=>h.id===n);if(i){i.frames||(i.frames=[]),(l=i.frames)==null||l.push(r);const h={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(u=i.layout)==null||u.push(h),i!=null&&i.layouts||(i.layouts={}),e_.forEach(p=>{i.layouts[p]||(i.layouts[p]=[]),i.layouts[p].push(h)}),(d=o.onAddFrame)==null||d.call(o,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,u,d;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(h=>h.id===n);if(i){const h=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(h),typeof h=="number"&&h>-1&&((u=i.frames)==null||u.splice(h,1),(d=i.layout)==null||d.splice(h,1),i.layouts=e_.reduce((p,g)=>{if(p&&p[g]){const b=p[g].findIndex(y=>y.i===r);typeof b=="number"&&b>-1&&p[g].splice(b,1)}return p},i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(u=i==null?void 0:i.frames)==null?void 0:u.findIndex(h=>h.id===r.id);i&&((d=i.frames)==null||d.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,u,d,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(u=i==null?void 0:i.cards)==null?void 0:u.findIndex(p=>p.id===r.id);i&&((d=i.cards)==null||d.splice(s,1,r),(h=o.onUpdateCard)==null||h.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,u,d,h,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(u=i==null?void 0:i.cards)==null?void 0:u.findIndex(g=>g.id===r.id);i&&((d=i.cards)==null||d.splice(s,1),(h=i.layout)==null||h.splice(s,1),(p=o.onRemoveCard)==null||p.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(u=>u.id===n);i&&(((l=i.cards)==null?void 0:l.find(d=>d.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const u=(i=a[l].cards)==null?void 0:i.find(d=>d.id===n);if(u)return u}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{E6({card:n,dataPoint:r,set:e,get:t})}}}))),Ki=()=>Ce(e=>e.actions);var zu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},El=typeof window>"u"||"Deno"in window;function Tr(){}function R6(e,t){return typeof e=="function"?e(t):e}function $v(e){return typeof e=="number"&&e>=0&&e!==1/0}function qE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function t_(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Qb(s,t.options))return!1}else if(!ou(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function n_(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ru(t.options.mutationKey)!==ru(i))return!1}else if(!ou(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Qb(e,t){return((t==null?void 0:t.queryKeyHashFn)||ru)(e)}function ru(e){return JSON.stringify(e,(t,n)=>Ov(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ou(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ou(e[n],t[n])):!1}function GE(e,t){if(e===t)return e;const n=r_(e)&&r_(t);if(n||Ov(e)&&Ov(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let u=0;u<s;u++){const d=n?u:i[u];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=GE(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function Pv(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function r_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ov(e){if(!o_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!o_(n)||!n.hasOwnProperty("isPrototypeOf"))}function o_(e){return Object.prototype.toString.call(e)==="[object Object]"}function $6(e){return new Promise(t=>{setTimeout(t,e)})}function Dv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?GE(e,t):t}function P6(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function O6(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Hs,Pi,al,pE,D6=(pE=class extends zu{constructor(){super();Ie(this,Hs,void 0);Ie(this,Pi,void 0);Ie(this,al,void 0);Pe(this,al,t=>{if(!El&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Pi)||this.setEventListener(U(this,al))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Pi))==null||t.call(this),Pe(this,Pi,void 0))}setEventListener(t){var n;Pe(this,al,t),(n=U(this,Pi))==null||n.call(this),Pe(this,Pi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){U(this,Hs)!==t&&(Pe(this,Hs,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof U(this,Hs)=="boolean"?U(this,Hs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Hs=new WeakMap,Pi=new WeakMap,al=new WeakMap,pE),lh=new D6,ll,Oi,cl,gE,M6=(gE=class extends zu{constructor(){super();Ie(this,ll,!0);Ie(this,Oi,void 0);Ie(this,cl,void 0);Pe(this,cl,t=>{if(!El&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){U(this,Oi)||this.setEventListener(U(this,cl))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Oi))==null||t.call(this),Pe(this,Oi,void 0))}setEventListener(t){var n;Pe(this,cl,t),(n=U(this,Oi))==null||n.call(this),Pe(this,Oi,t(this.setOnline.bind(this)))}setOnline(t){U(this,ll)!==t&&(Pe(this,ll,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return U(this,ll)}},ll=new WeakMap,Oi=new WeakMap,cl=new WeakMap,gE),ch=new M6;function T6(e){return Math.min(1e3*2**e,3e4)}function qh(e){return(e??"online")==="online"?ch.isOnline():!0}var YE=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function lm(e){return e instanceof YE}function KE(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((x,_)=>{i=x,s=_}),l=x=>{var _;r||(g(new YE(x)),(_=e.abort)==null||_.call(e))},u=()=>{t=!0},d=()=>{t=!1},h=()=>!lh.isFocused()||e.networkMode!=="always"&&!ch.isOnline(),p=x=>{var _;r||(r=!0,(_=e.onSuccess)==null||_.call(e,x),o==null||o(),i(x))},g=x=>{var _;r||(r=!0,(_=e.onError)==null||_.call(e,x),o==null||o(),s(x))},b=()=>new Promise(x=>{var _;o=w=>{const C=r||!h();return C&&x(w),C},(_=e.onPause)==null||_.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;try{x=e.fn()}catch(_){x=Promise.reject(_)}Promise.resolve(x).then(p).catch(_=>{var M;if(r)return;const w=e.retry??(El?0:3),C=e.retryDelay??T6,R=typeof C=="function"?C(n,_):C,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,_);if(t||!E){g(_);return}n++,(M=e.onFail)==null||M.call(e,n,_),$6(R).then(()=>{if(h())return b()}).then(()=>{t?g(_):y()})})};return qh(e.networkMode)?y():b().then(y),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:u,continueRetry:d}}function A6(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const i=p=>{o=p},s=p=>{let g;t++;try{g=p()}finally{t--,t||u()}return g},a=p=>{t?e.push(p):o(()=>{n(p)})},l=p=>(...g)=>{a(()=>{p(...g)})},u=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:i}}var vn=A6(),Ws,mE,XE=(mE=class{constructor(){Ie(this,Ws,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$v(this.gcTime)&&Pe(this,Ws,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(El?1/0:5*60*1e3))}clearGcTimeout(){U(this,Ws)&&(clearTimeout(U(this,Ws)),Pe(this,Ws,void 0))}},Ws=new WeakMap,mE),ul,dl,Or,Di,Dr,cn,Eu,Bs,fl,Wf,Yr,Uo,vE,I6=(vE=class extends XE{constructor(t){super();Ie(this,fl);Ie(this,Yr);Ie(this,ul,void 0);Ie(this,dl,void 0);Ie(this,Or,void 0);Ie(this,Di,void 0);Ie(this,Dr,void 0);Ie(this,cn,void 0);Ie(this,Eu,void 0);Ie(this,Bs,void 0);Pe(this,Bs,!1),Pe(this,Eu,t.defaultOptions),ot(this,fl,Wf).call(this,t.options),Pe(this,cn,[]),Pe(this,Or,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Pe(this,ul,t.state||k6(this.options)),this.state=U(this,ul),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!U(this,cn).length&&this.state.fetchStatus==="idle"&&U(this,Or).remove(this)}setData(t,n){const r=Dv(this.state.data,t,this.options);return ot(this,Yr,Uo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ot(this,Yr,Uo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=U(this,Di);return(r=U(this,Dr))==null||r.cancel(t),n?n.then(Tr).catch(Tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(U(this,ul))}isActive(){return U(this,cn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||U(this,cn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!qE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=U(this,cn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Dr))==null||n.continue()}onOnline(){var n;const t=U(this,cn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Dr))==null||n.continue()}addObserver(t){U(this,cn).includes(t)||(U(this,cn).push(t),this.clearGcTimeout(),U(this,Or).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){U(this,cn).includes(t)&&(Pe(this,cn,U(this,cn).filter(n=>n!==t)),U(this,cn).length||(U(this,Dr)&&(U(this,Bs)?U(this,Dr).cancel({revert:!0}):U(this,Dr).cancelRetry()),this.scheduleGc()),U(this,Or).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return U(this,cn).length}invalidate(){this.state.isInvalidated||ot(this,Yr,Uo).call(this,{type:"invalidate"})}fetch(t,n){var u,d,h,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,Di))return(u=U(this,Dr))==null||u.continueRetry(),U(this,Di)}if(t&&ot(this,fl,Wf).call(this,t),!this.options.queryFn){const g=U(this,cn).find(b=>b.options.queryFn);g&&ot(this,fl,Wf).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(Pe(this,Bs,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Pe(this,Bs,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(d=this.options.behavior)==null||d.onFetch(a,this),Pe(this,dl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&ot(this,Yr,Uo).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=g=>{var b,y,x,_;lm(g)&&g.silent||ot(this,Yr,Uo).call(this,{type:"error",error:g}),lm(g)||((y=(b=U(this,Or).config).onError)==null||y.call(b,g,this),(_=(x=U(this,Or).config).onSettled)==null||_.call(x,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Pe(this,Dr,KE({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var b,y,x,_;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(y=(b=U(this,Or).config).onSuccess)==null||y.call(b,g,this),(_=(x=U(this,Or).config).onSettled)==null||_.call(x,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,b)=>{ot(this,Yr,Uo).call(this,{type:"failed",failureCount:g,error:b})},onPause:()=>{ot(this,Yr,Uo).call(this,{type:"pause"})},onContinue:()=>{ot(this,Yr,Uo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Pe(this,Di,U(this,Dr).promise),U(this,Di)}},ul=new WeakMap,dl=new WeakMap,Or=new WeakMap,Di=new WeakMap,Dr=new WeakMap,cn=new WeakMap,Eu=new WeakMap,Bs=new WeakMap,fl=new WeakSet,Wf=function(t){this.options={...U(this,Eu),...t},this.updateGcTime(this.options.gcTime)},Yr=new WeakSet,Uo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:qh(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return lm(o)&&o.revert&&U(this,dl)?{...U(this,dl),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),vn.batch(()=>{U(this,cn).forEach(r=>{r.onQueryUpdate()}),U(this,Or).notify({query:this,type:"updated",action:t})})},vE);function k6(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var uo,bE,QE=(bE=class extends zu{constructor(t={}){super();Ie(this,uo,void 0);this.config=t,Pe(this,uo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Qb(o,n);let s=this.get(i);return s||(s=new I6({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){U(this,uo).has(t.queryHash)||(U(this,uo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=U(this,uo).get(t.queryHash);n&&(t.destroy(),n===t&&U(this,uo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return U(this,uo).get(t)}getAll(){return[...U(this,uo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>t_(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>t_(t,r)):n}notify(t){vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){vn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},uo=new WeakMap,bE),fo,Ru,ir,hl,ho,Ri,yE,N6=(yE=class extends XE{constructor(t){super();Ie(this,ho);Ie(this,fo,void 0);Ie(this,Ru,void 0);Ie(this,ir,void 0);Ie(this,hl,void 0);this.mutationId=t.mutationId,Pe(this,Ru,t.defaultOptions),Pe(this,ir,t.mutationCache),Pe(this,fo,[]),this.state=t.state||L6(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...U(this,Ru),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){U(this,fo).includes(t)||(U(this,fo).push(t),this.clearGcTimeout(),U(this,ir).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Pe(this,fo,U(this,fo).filter(n=>n!==t)),this.scheduleGc(),U(this,ir).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){U(this,fo).length||(this.state.status==="pending"?this.scheduleGc():U(this,ir).remove(this))}continue(){var t;return((t=U(this,hl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,u,d,h,p,g,b,y,x,_,w,C,R,E,M,D;const n=()=>(Pe(this,hl,KE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,k)=>{ot(this,ho,Ri).call(this,{type:"failed",failureCount:A,error:k})},onPause:()=>{ot(this,ho,Ri).call(this,{type:"pause"})},onContinue:()=>{ot(this,ho,Ri).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),U(this,hl).promise),r=this.state.status==="pending";try{if(!r){ot(this,ho,Ri).call(this,{type:"pending",variables:t}),await((i=(o=U(this,ir).config).onMutate)==null?void 0:i.call(o,t,this));const k=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));k!==this.state.context&&ot(this,ho,Ri).call(this,{type:"pending",context:k,variables:t})}const A=await n();return await((u=(l=U(this,ir).config).onSuccess)==null?void 0:u.call(l,A,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,A,t,this.state.context)),await((g=(p=U(this,ir).config).onSettled)==null?void 0:g.call(p,A,null,this.state.variables,this.state.context,this)),await((y=(b=this.options).onSettled)==null?void 0:y.call(b,A,null,t,this.state.context)),ot(this,ho,Ri).call(this,{type:"success",data:A}),A}catch(A){try{throw await((_=(x=U(this,ir).config).onError)==null?void 0:_.call(x,A,t,this.state.context,this)),await((C=(w=this.options).onError)==null?void 0:C.call(w,A,t,this.state.context)),await((E=(R=U(this,ir).config).onSettled)==null?void 0:E.call(R,void 0,A,this.state.variables,this.state.context,this)),await((D=(M=this.options).onSettled)==null?void 0:D.call(M,void 0,A,t,this.state.context)),A}finally{ot(this,ho,Ri).call(this,{type:"error",error:A})}}}},fo=new WeakMap,Ru=new WeakMap,ir=new WeakMap,hl=new WeakMap,ho=new WeakSet,Ri=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!qh(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),vn.batch(()=>{U(this,fo).forEach(r=>{r.onMutationUpdate(t)}),U(this,ir).notify({mutation:this,type:"updated",action:t})})},yE);function L6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mr,$u,Us,xE,F6=(xE=class extends zu{constructor(t={}){super();Ie(this,Mr,void 0);Ie(this,$u,void 0);Ie(this,Us,void 0);this.config=t,Pe(this,Mr,[]),Pe(this,$u,0)}build(t,n,r){const o=new N6({mutationCache:this,mutationId:++Yd(this,$u)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){U(this,Mr).push(t),this.notify({type:"added",mutation:t})}remove(t){Pe(this,Mr,U(this,Mr).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){vn.batch(()=>{U(this,Mr).forEach(t=>{this.remove(t)})})}getAll(){return U(this,Mr)}find(t){const n={exact:!0,...t};return U(this,Mr).find(r=>n_(n,r))}findAll(t={}){return U(this,Mr).filter(n=>n_(t,n))}notify(t){vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Pe(this,Us,(U(this,Us)??Promise.resolve()).then(()=>{const t=U(this,Mr).filter(n=>n.state.isPaused);return vn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Tr)),Promise.resolve()))}).then(()=>{Pe(this,Us,void 0)})),U(this,Us)}},Mr=new WeakMap,$u=new WeakMap,Us=new WeakMap,xE);function z6(e){return{onFetch:(t,n)=>{const r=async()=>{var b,y,x,_,w;const o=t.options,i=(x=(y=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,s=((_=t.state.data)==null?void 0:_.pages)||[],a=((w=t.state.data)==null?void 0:w.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const d=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(C,R,E)=>{if(u)return Promise.reject();if(R==null&&C.pages.length)return Promise.resolve(C);const M={queryKey:t.queryKey,pageParam:R,direction:E?"backward":"forward",meta:t.options.meta};d(M);const D=await h(M),{maxPages:A}=t.options,k=E?O6:P6;return{pages:k(C.pages,D,A),pageParams:k(C.pageParams,R,A)}};let g;if(i&&s.length){const C=i==="backward",R=C?j6:i_,E={pages:s,pageParams:a},M=R(o,E);g=await p(E,M,C)}else{g=await p(l,a[0]??o.initialPageParam);const C=e??s.length;for(let R=1;R<C;R++){const E=i_(o,g);g=await p(g,E)}}return g};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function i_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function j6(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var nn,Mi,Ti,pl,gl,Ai,ml,vl,wE,V6=(wE=class{constructor(e={}){Ie(this,nn,void 0);Ie(this,Mi,void 0);Ie(this,Ti,void 0);Ie(this,pl,void 0);Ie(this,gl,void 0);Ie(this,Ai,void 0);Ie(this,ml,void 0);Ie(this,vl,void 0);Pe(this,nn,e.queryCache||new QE),Pe(this,Mi,e.mutationCache||new F6),Pe(this,Ti,e.defaultOptions||{}),Pe(this,pl,new Map),Pe(this,gl,new Map),Pe(this,Ai,0)}mount(){Yd(this,Ai)._++,U(this,Ai)===1&&(Pe(this,ml,lh.subscribe(()=>{lh.isFocused()&&(this.resumePausedMutations(),U(this,nn).onFocus())})),Pe(this,vl,ch.subscribe(()=>{ch.isOnline()&&(this.resumePausedMutations(),U(this,nn).onOnline())})))}unmount(){var e,t;Yd(this,Ai)._--,U(this,Ai)===0&&((e=U(this,ml))==null||e.call(this),Pe(this,ml,void 0),(t=U(this,vl))==null||t.call(this),Pe(this,vl,void 0))}isFetching(e){return U(this,nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return U(this,Mi).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=U(this,nn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=U(this,nn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=R6(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return U(this,nn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return vn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=U(this,nn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=U(this,nn);vn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=U(this,nn),r={type:"active",...e};return vn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=vn.batch(()=>U(this,nn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Tr).catch(Tr)}invalidateQueries(e={},t={}){return vn.batch(()=>{if(U(this,nn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=vn.batch(()=>U(this,nn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Tr)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Tr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=U(this,nn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tr).catch(Tr)}fetchInfiniteQuery(e){return e.behavior=z6(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tr).catch(Tr)}resumePausedMutations(){return U(this,Mi).resumePausedMutations()}getQueryCache(){return U(this,nn)}getMutationCache(){return U(this,Mi)}getDefaultOptions(){return U(this,Ti)}setDefaultOptions(e){Pe(this,Ti,e)}setQueryDefaults(e,t){U(this,pl).set(ru(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...U(this,pl).values()];let n={};return t.forEach(r=>{ou(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){U(this,gl).set(ru(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...U(this,gl).values()];let n={};return t.forEach(r=>{ou(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...U(this,Ti).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Qb(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...U(this,Ti).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){U(this,nn).clear(),U(this,Mi).clear()}},nn=new WeakMap,Mi=new WeakMap,Ti=new WeakMap,pl=new WeakMap,gl=new WeakMap,Ai=new WeakMap,ml=new WeakMap,vl=new WeakMap,wE),Bn,It,Pu,In,qs,bl,po,Ou,yl,xl,Gs,Ys,Ii,wl,Ks,Mc,Du,Mv,Mu,Tv,Tu,Av,Au,Iv,Iu,kv,ku,Nv,Nu,Lv,zh,ZE,_E,H6=(_E=class extends zu{constructor(t,n){super();Ie(this,Ks);Ie(this,Du);Ie(this,Mu);Ie(this,Tu);Ie(this,Au);Ie(this,Iu);Ie(this,ku);Ie(this,Nu);Ie(this,zh);Ie(this,Bn,void 0);Ie(this,It,void 0);Ie(this,Pu,void 0);Ie(this,In,void 0);Ie(this,qs,void 0);Ie(this,bl,void 0);Ie(this,po,void 0);Ie(this,Ou,void 0);Ie(this,yl,void 0);Ie(this,xl,void 0);Ie(this,Gs,void 0);Ie(this,Ys,void 0);Ie(this,Ii,void 0);Ie(this,wl,new Set);this.options=n,Pe(this,Bn,t),Pe(this,po,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,It).addObserver(this),s_(U(this,It),this.options)?ot(this,Ks,Mc).call(this):this.updateResult(),ot(this,Au,Iv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fv(U(this,It),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fv(U(this,It),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,Iu,kv).call(this),ot(this,ku,Nv).call(this),U(this,It).removeObserver(this)}setOptions(t,n){const r=this.options,o=U(this,It);if(this.options=U(this,Bn).defaultQueryOptions(t),Pv(r,this.options)||U(this,Bn).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,It),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),ot(this,Nu,Lv).call(this);const i=this.hasListeners();i&&a_(U(this,It),o,this.options,r)&&ot(this,Ks,Mc).call(this),this.updateResult(n),i&&(U(this,It)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&ot(this,Du,Mv).call(this);const s=ot(this,Mu,Tv).call(this);i&&(U(this,It)!==o||this.options.enabled!==r.enabled||s!==U(this,Ii))&&ot(this,Tu,Av).call(this,s)}getOptimisticResult(t){const n=U(this,Bn).getQueryCache().build(U(this,Bn),t),r=this.createResult(n,t);return B6(this,r)&&(Pe(this,In,r),Pe(this,bl,this.options),Pe(this,qs,U(this,It).state)),r}getCurrentResult(){return U(this,In)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(U(this,wl).add(r),t[r])})}),n}getCurrentQuery(){return U(this,It)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=U(this,Bn).defaultQueryOptions(t),r=U(this,Bn).getQueryCache().build(U(this,Bn),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ot(this,Ks,Mc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,In)))}createResult(t,n){var M;const r=U(this,It),o=this.options,i=U(this,In),s=U(this,qs),a=U(this,bl),u=t!==r?t.state:U(this,Pu),{state:d}=t;let{error:h,errorUpdatedAt:p,fetchStatus:g,status:b}=d,y=!1,x;if(n._optimisticResults){const D=this.hasListeners(),A=!D&&s_(t,n),k=D&&a_(t,r,n,o);(A||k)&&(g=qh(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(b="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof d.data<"u")if(i&&d.data===(s==null?void 0:s.data)&&n.select===U(this,Ou))x=U(this,yl);else try{Pe(this,Ou,n.select),x=n.select(d.data),x=Dv(i==null?void 0:i.data,x,n),Pe(this,yl,x),Pe(this,po,null)}catch(D){Pe(this,po,D)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&b==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((M=U(this,xl))==null?void 0:M.state.data,U(this,xl)):n.placeholderData,n.select&&typeof D<"u")try{D=n.select(D),Pe(this,po,null)}catch(A){Pe(this,po,A)}typeof D<"u"&&(b="success",x=Dv(i==null?void 0:i.data,D,n),y=!0)}U(this,po)&&(h=U(this,po),x=U(this,yl),p=Date.now(),b="error");const _=g==="fetching",w=b==="pending",C=b==="error",R=w&&_;return{status:b,fetchStatus:g,isPending:w,isSuccess:b==="success",isError:C,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:_,isRefetching:_&&!w,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:Zb(t,n),refetch:this.refetch}}updateResult(t){const n=U(this,In),r=this.createResult(U(this,It),this.options);if(Pe(this,qs,U(this,It).state),Pe(this,bl,this.options),U(this,qs).data!==void 0&&Pe(this,xl,U(this,It)),Pv(r,n))return;Pe(this,In,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!U(this,wl).size)return!0;const l=new Set(a??U(this,wl));return this.options.throwOnError&&l.add("error"),Object.keys(U(this,In)).some(u=>{const d=u;return U(this,In)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ot(this,zh,ZE).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,Au,Iv).call(this)}},Bn=new WeakMap,It=new WeakMap,Pu=new WeakMap,In=new WeakMap,qs=new WeakMap,bl=new WeakMap,po=new WeakMap,Ou=new WeakMap,yl=new WeakMap,xl=new WeakMap,Gs=new WeakMap,Ys=new WeakMap,Ii=new WeakMap,wl=new WeakMap,Ks=new WeakSet,Mc=function(t){ot(this,Nu,Lv).call(this);let n=U(this,It).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tr)),n},Du=new WeakSet,Mv=function(){if(ot(this,Iu,kv).call(this),El||U(this,In).isStale||!$v(this.options.staleTime))return;const n=qE(U(this,In).dataUpdatedAt,this.options.staleTime)+1;Pe(this,Gs,setTimeout(()=>{U(this,In).isStale||this.updateResult()},n))},Mu=new WeakSet,Tv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,It)):this.options.refetchInterval)??!1},Tu=new WeakSet,Av=function(t){ot(this,ku,Nv).call(this),Pe(this,Ii,t),!(El||this.options.enabled===!1||!$v(U(this,Ii))||U(this,Ii)===0)&&Pe(this,Ys,setInterval(()=>{(this.options.refetchIntervalInBackground||lh.isFocused())&&ot(this,Ks,Mc).call(this)},U(this,Ii)))},Au=new WeakSet,Iv=function(){ot(this,Du,Mv).call(this),ot(this,Tu,Av).call(this,ot(this,Mu,Tv).call(this))},Iu=new WeakSet,kv=function(){U(this,Gs)&&(clearTimeout(U(this,Gs)),Pe(this,Gs,void 0))},ku=new WeakSet,Nv=function(){U(this,Ys)&&(clearInterval(U(this,Ys)),Pe(this,Ys,void 0))},Nu=new WeakSet,Lv=function(){const t=U(this,Bn).getQueryCache().build(U(this,Bn),this.options);if(t===U(this,It))return;const n=U(this,It);Pe(this,It,t),Pe(this,Pu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},zh=new WeakSet,ZE=function(t){vn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(U(this,In))}),U(this,Bn).getQueryCache().notify({query:U(this,It),type:"observerResultsUpdated"})})},_E);function W6(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function s_(e,t){return W6(e,t)||e.state.dataUpdatedAt>0&&Fv(e,t,t.refetchOnMount)}function Fv(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Zb(e,t)}return!1}function a_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Zb(e,n)}function Zb(e,t){return e.isStaleByTime(t.staleTime)}function B6(e,t){return!Pv(e.getCurrentResult(),t)}var JE=le.createContext(void 0),U6=e=>{const t=le.useContext(JE);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},q6=({client:e,children:t})=>(le.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),le.createElement(JE.Provider,{value:e},t)),eR=le.createContext(!1),G6=()=>le.useContext(eR);eR.Provider;function Y6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var K6=le.createContext(Y6()),X6=()=>le.useContext(K6);function Q6(e,t){return typeof e=="function"?e(...t):!!e}var Z6=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},J6=e=>{le.useEffect(()=>{e.clearReset()},[e])},e9=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Q6(n,[e.error,r]),t9=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},n9=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,r9=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function o9(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=U6(n),o=G6(),i=X6(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",t9(s),Z6(s,i),J6(i);const[a]=le.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(le.useSyncExternalStore(le.useCallback(u=>{const d=o?()=>{}:a.subscribe(vn.batchCalls(u));return a.updateResult(),d},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),le.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),n9(s,l))throw r9(s,a,i);if(e9({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function ju(e,t){return o9(e,H6,t)}const i9={theme:"system",setTheme:()=>null},tR=m.createContext(i9);function s9({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return I.jsx(tR.Provider,{...r,value:s,children:e})}const nR=()=>{const e=m.useContext(tR);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function a9(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function rR(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function l_(e,t){const n=rR(e);return n==="dark"?ia.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function l9({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=ju({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>a9(e==null?void 0:e.accessToken),enabled:!1}),{theme:u,setTheme:d}=nR(),{setDashboard:h,setSelectedSheetId:p,setStyle:g,setOnSaveFunction:b}=Ce(E=>E.actions);Ce(E=>E.actions.setCustomCards);const y=Ce(E=>E.actions.setFilterValues),x=Ce(E=>E.actions.setBookmarkKey),_=Ce(E=>E.actions.setAuthToken),w=Ce(E=>E.actions.setThemeStyle),C=Ce(E=>E.actions.setDashboardTheme),R=Ce(E=>E.actions.setOnEvent);return m.useEffect(()=>{if(u){const E=rR(u);C(E)}},[u,C]),m.useEffect(()=>{n&&d(n)},[n,d]),m.useEffect(()=>{const E=ia.cloneDeep(Rv);if(t){const M=ia.merge(E,t),D=l_(u,M);w(D),g(M)}else{const M=l_(u,E);w(M),g(Rv)}},[u,t,g,w]),m.useEffect(()=>{var k;if(!i||!i.dashboard)return;const E=i.dashboard,M=uD(E.id),D=JSON.parse(localStorage.getItem(M)||"[]"),A=D.find(L=>L.default===!0);if(A)h(A.template),x(A.name),A.filterValues&&y(A.filterValues);else{h(E);const L=D.find(W=>(W==null?void 0:W.name)==="Original");L?L.template=E:D.push({name:"Original",template:E,default:!1}),localStorage.setItem(M,JSON.stringify(D))}p((k=E.sheets)==null?void 0:k[0].id)},[i,h,p,y,x]),m.useEffect(()=>{r&&b(r),o&&R(o)},[r,b,o,R]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function Jb({className:e,...t}){return I.jsx("div",{className:_e("animate-pulse rounded-md bg-muted",e),...t})}const e0=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));e0.displayName="Card";const Gh=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));Gh.displayName="CardHeader";const Vu=le.forwardRef(({className:e,...t},n)=>I.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight",e),...t}));Vu.displayName="CardTitle";const t0=le.forwardRef(({className:e,...t},n)=>I.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));t0.displayName="CardDescription";const Yh=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("px-6 pt-0",e),...t}));Yh.displayName="CardContent";const n0=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));n0.displayName="CardFooter";function oR({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:u,version:d,customCards:h,...p}){Ce(_=>_.selectedSheetId);const g=Ce(_=>_.themeStyle),b=Ce(_=>_.isSessionExpired),{isLoading:y,isError:x}=l9({authToken:l,customStyle:t,currentTheme:u,onSave:n,onEvent:r});return y||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?I.jsx(o,{message:"loading"}):I.jsx("div",{className:"flex items-center gap-3",children:I.jsx(Jb,{className:"h-1 w-full dark:h-[2px]"})})):x?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),I.jsx(i,{})):I.jsx("div",{children:"Error"})):b?(r==null||r({type:"error",message:"Session Expired"}),I.jsx("div",{className:"flex h-full items-center justify-center",children:I.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[I.jsx(Vu,{children:"Session Expired"}),I.jsx("p",{className:"text-muted-foreground",children:"Your session has expired. Please refresh the page to continue."})]})})):I.jsx("div",{className:_e("flex h-full grow flex-col justify-between",g==null?void 0:g.dashboardPanel,e),role:"dashboard-panel",...p})}function te(){return te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},te.apply(this,arguments)}function we(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function dn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function u(h){const{scope:p,children:g,...b}=h,y=(p==null?void 0:p[e][l])||a,x=m.useMemo(()=>b,Object.values(b));return m.createElement(y.Provider,{value:x},g)}function d(h,p){const g=(p==null?void 0:p[e][l])||a,b=m.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,c9(o,...t)]}function c9(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function u9(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Kh(...e){return t=>e.forEach(n=>u9(n,t))}function Xe(...e){return m.useCallback(Kh(...e),e)}const ni=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(d9);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(zv,te({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(zv,te({},r,{ref:t}),n)});ni.displayName="Slot";const zv=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...f9(r,n.props),ref:t?Kh(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});zv.displayName="SlotClone";const iR=({children:e})=>m.createElement(m.Fragment,null,e);function d9(e){return m.isValidElement(e)&&e.type===iR}function f9(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Xh(e){const t=e+"CollectionProvider",[n,r]=dn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:b,children:y}=g,x=m.useRef(null),_=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:_,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((g,b)=>{const{scope:y,children:x}=g,_=i(a,y),w=Xe(b,_.collectionRef);return m.createElement(ni,{ref:w},x)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=m.forwardRef((g,b)=>{const{scope:y,children:x,..._}=g,w=m.useRef(null),C=Xe(b,w),R=i(u,y);return m.useEffect(()=>(R.itemMap.set(w,{ref:w,..._}),()=>void R.itemMap.delete(w))),m.createElement(ni,{[d]:"",ref:C},x)});function p(g){const b=i(e+"CollectionConsumer",g);return m.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((R,E)=>_.indexOf(R.ref.current)-_.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:l,ItemSlot:h},p,r]}const Pn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},h9=le.useId||(()=>{});let p9=0;function Yn(e){const[t,n]=le.useState(h9());return Pn(()=>{e||n(r=>r??String(p9++))},[e]),e||(t?`radix-${t}`:"")}const g9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ke=g9.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ni:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,te({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function sR(e,t){e&&So.flushSync(()=>e.dispatchEvent(t))}function on(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function On({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=m9({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=on(n),l=m.useCallback(u=>{if(i){const h=typeof u=="function"?u(e):u;h!==e&&a(h)}else o(u)},[i,e,o,a]);return[s,l]}function m9({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=on(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const v9=m.createContext(void 0);function ha(e){const t=m.useContext(v9);return e||t||"ltr"}const cm="rovingFocusGroup.onEntryFocus",b9={bubbles:!1,cancelable:!0},r0="RovingFocusGroup",[jv,aR,y9]=Xh(r0),[x9,zl]=dn(r0,[y9]),[w9,_9]=x9(r0),S9=m.forwardRef((e,t)=>m.createElement(jv.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(jv.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(C9,te({},e,{ref:t}))))),C9=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=m.useRef(null),p=Xe(t,h),g=ha(i),[b=null,y]=On({prop:s,defaultProp:a,onChange:l}),[x,_]=m.useState(!1),w=on(u),C=aR(n),R=m.useRef(!1),[E,M]=m.useState(0);return m.useEffect(()=>{const D=h.current;if(D)return D.addEventListener(cm,w),()=>D.removeEventListener(cm,w)},[w]),m.createElement(w9,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(D=>y(D),[y]),onItemShiftTab:m.useCallback(()=>_(!0),[]),onFocusableItemAdd:m.useCallback(()=>M(D=>D+1),[]),onFocusableItemRemove:m.useCallback(()=>M(D=>D-1),[])},m.createElement(ke.div,te({tabIndex:x||E===0?-1:0,"data-orientation":r},d,{ref:p,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{R.current=!0}),onFocus:we(e.onFocus,D=>{const A=!R.current;if(D.target===D.currentTarget&&A&&!x){const k=new CustomEvent(cm,b9);if(D.currentTarget.dispatchEvent(k),!k.defaultPrevented){const L=C().filter(F=>F.focusable),W=L.find(F=>F.active),Y=L.find(F=>F.id===b),Q=[W,Y,...L].filter(Boolean).map(F=>F.ref.current);lR(Q)}}R.current=!1}),onBlur:we(e.onBlur,()=>_(!1))})))}),E9="RovingFocusGroupItem",R9=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Yn(),l=i||a,u=_9(E9,n),d=u.currentTabStopId===l,h=aR(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=u;return m.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),m.createElement(jv.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(ke.span,te({tabIndex:d?0:-1,"data-orientation":u.orientation},s,{ref:t,onMouseDown:we(e.onMouseDown,b=>{r?u.onItemFocus(l):b.preventDefault()}),onFocus:we(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:we(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=O9(b,u.orientation,u.dir);if(y!==void 0){b.preventDefault();let _=h().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")_.reverse();else if(y==="prev"||y==="next"){y==="prev"&&_.reverse();const w=_.indexOf(b.currentTarget);_=u.loop?D9(_,w+1):_.slice(w+1)}setTimeout(()=>lR(_))}})})))}),$9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function P9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function O9(e,t,n){const r=P9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return $9[r]}function lR(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function D9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const o0=S9,i0=R9;function M9(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Zt=e=>{const{present:t,children:n}=e,r=T9(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Xe(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};Zt.displayName="Presence";function T9(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=M9(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Zd(r.current);i.current=a==="mounted"?u:"none"},[a]),Pn(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,g=Zd(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Pn(()=>{if(t){const u=h=>{const g=Zd(r.current).includes(h.animationName);h.target===t&&g&&So.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(i.current=Zd(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Zd(e){return(e==null?void 0:e.animationName)||"none"}const cR="Tabs",[A9,Qre]=dn(cR,[zl]),uR=zl(),[I9,s0]=A9(cR),k9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=ha(a),[h,p]=On({prop:r,onChange:o,defaultProp:i});return m.createElement(I9,{scope:n,baseId:Yn(),value:h,onValueChange:p,orientation:s,dir:d,activationMode:l},m.createElement(ke.div,te({dir:d,"data-orientation":s},u,{ref:t})))}),N9="TabsList",L9=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=s0(N9,n),s=uR(n);return m.createElement(o0,te({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(ke.div,te({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),F9="TabsTrigger",z9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=s0(F9,n),a=uR(n),l=dR(s.baseId,r),u=fR(s.baseId,r),d=r===s.value;return m.createElement(i0,te({asChild:!0},a,{focusable:!o,active:d}),m.createElement(ke.button,te({type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:we(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:we(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:we(e.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!o&&h&&s.onValueChange(r)})})))}),j9="TabsContent",V9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=s0(j9,n),l=dR(a.baseId,r),u=fR(a.baseId,r),d=r===a.value,h=m.useRef(d);return m.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),m.createElement(Zt,{present:o||d},({present:p})=>m.createElement(ke.div,te({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0}}),p&&i))});function dR(e,t){return`${e}-trigger-${t}`}function fR(e,t){return`${e}-content-${t}`}const H9=k9,hR=L9,pR=z9,gR=V9,mR=H9,vR=le.forwardRef(({className:e,...t},n)=>I.jsx(hR,{ref:n,className:_e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));vR.displayName=hR.displayName;const bR=le.forwardRef(({className:e,...t},n)=>I.jsx(pR,{ref:n,className:_e("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));bR.displayName=pR.displayName;const a0=le.forwardRef(({className:e,...t},n)=>I.jsx(gR,{ref:n,className:_e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));a0.displayName=gR.displayName;var yR={exports:{}},Hu={},Vv={exports:{}};(function(e,t){(function(n,r){r(t)})(ks,function(n){function r(ee){return function(ie,ye,Z,De,Ne,Ve,qe){return ee(ie,ye,qe)}}function o(ee){return function(ie,ye,Z,De){if(!ie||!ye||typeof ie!="object"||typeof ye!="object")return ee(ie,ye,Z,De);var Ne=De.get(ie),Ve=De.get(ye);if(Ne&&Ve)return Ne===ye&&Ve===ie;De.set(ie,ye),De.set(ye,ie);var qe=ee(ie,ye,Z,De);return De.delete(ie),De.delete(ye),qe}}function i(ee,K){var ie={};for(var ye in ee)ie[ye]=ee[ye];for(var ye in K)ie[ye]=K[ye];return ie}function s(ee){return ee.constructor===Object||ee.constructor==null}function a(ee){return typeof ee.then=="function"}function l(ee,K){return ee===K||ee!==ee&&K!==K}var u="[object Arguments]",d="[object Boolean]",h="[object Date]",p="[object RegExp]",g="[object Map]",b="[object Number]",y="[object Object]",x="[object Set]",_="[object String]",w=Object.prototype.toString;function C(ee){var K=ee.areArraysEqual,ie=ee.areDatesEqual,ye=ee.areMapsEqual,Z=ee.areObjectsEqual,De=ee.areRegExpsEqual,Ne=ee.areSetsEqual,Ve=ee.createIsNestedEqual,qe=Ve(pt);function pt(dt,ft,Bt){if(dt===ft)return!0;if(!dt||!ft||typeof dt!="object"||typeof ft!="object")return dt!==dt&&ft!==ft;if(s(dt)&&s(ft))return Z(dt,ft,qe,Bt);var Vt=Array.isArray(dt),xn=Array.isArray(ft);if(Vt||xn)return Vt===xn&&K(dt,ft,qe,Bt);var Jt=w.call(dt);return Jt!==w.call(ft)?!1:Jt===h?ie(dt,ft,qe,Bt):Jt===p?De(dt,ft,qe,Bt):Jt===g?ye(dt,ft,qe,Bt):Jt===x?Ne(dt,ft,qe,Bt):Jt===y||Jt===u?a(dt)||a(ft)?!1:Z(dt,ft,qe,Bt):Jt===d||Jt===b||Jt===_?l(dt.valueOf(),ft.valueOf()):!1}return pt}function R(ee,K,ie,ye){var Z=ee.length;if(K.length!==Z)return!1;for(;Z-- >0;)if(!ie(ee[Z],K[Z],Z,Z,ee,K,ye))return!1;return!0}var E=o(R);function M(ee,K){return l(ee.valueOf(),K.valueOf())}function D(ee,K,ie,ye){var Z=ee.size===K.size;if(!Z)return!1;if(!ee.size)return!0;var De={},Ne=0;return ee.forEach(function(Ve,qe){if(Z){var pt=!1,dt=0;K.forEach(function(ft,Bt){!pt&&!De[dt]&&(pt=ie(qe,Bt,Ne,dt,ee,K,ye)&&ie(Ve,ft,qe,Bt,ee,K,ye))&&(De[dt]=!0),dt++}),Ne++,Z=pt}}),Z}var A=o(D),k="_owner",L=Object.prototype.hasOwnProperty;function W(ee,K,ie,ye){var Z=Object.keys(ee),De=Z.length;if(Object.keys(K).length!==De)return!1;for(var Ne;De-- >0;){if(Ne=Z[De],Ne===k){var Ve=!!ee.$$typeof,qe=!!K.$$typeof;if((Ve||qe)&&Ve!==qe)return!1}if(!L.call(K,Ne)||!ie(ee[Ne],K[Ne],Ne,Ne,ee,K,ye))return!1}return!0}var Y=o(W);function ne(ee,K){return ee.source===K.source&&ee.flags===K.flags}function Q(ee,K,ie,ye){var Z=ee.size===K.size;if(!Z)return!1;if(!ee.size)return!0;var De={};return ee.forEach(function(Ne,Ve){if(Z){var qe=!1,pt=0;K.forEach(function(dt,ft){!qe&&!De[pt]&&(qe=ie(Ne,dt,Ve,ft,ee,K,ye))&&(De[pt]=!0),pt++}),Z=qe}}),Z}var F=o(Q),J=Object.freeze({areArraysEqual:R,areDatesEqual:M,areMapsEqual:D,areObjectsEqual:W,areRegExpsEqual:ne,areSetsEqual:Q,createIsNestedEqual:r}),q=Object.freeze({areArraysEqual:E,areDatesEqual:M,areMapsEqual:A,areObjectsEqual:Y,areRegExpsEqual:ne,areSetsEqual:F,createIsNestedEqual:r}),X=C(J);function ae(ee,K){return X(ee,K,void 0)}var j=C(i(J,{createIsNestedEqual:function(){return l}}));function V(ee,K){return j(ee,K,void 0)}var oe=C(q);function ce(ee,K){return oe(ee,K,new WeakMap)}var ue=C(i(q,{createIsNestedEqual:function(){return l}}));function ge(ee,K){return ue(ee,K,new WeakMap)}function ve(ee){return C(i(J,ee(J)))}function fe(ee){var K=C(i(q,ee(q)));return function(ie,ye,Z){return Z===void 0&&(Z=new WeakMap),K(ie,ye,Z)}}n.circularDeepEqual=ce,n.circularShallowEqual=ge,n.createCustomCircularEqual=fe,n.createCustomEqual=ve,n.deepEqual=ae,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(Vv,Vv.exports);var l0=Vv.exports;const c0=Bb(cN);var at={},W9=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(at,"__esModule",{value:!0});at.bottom=u0;at.childrenEqual=G9;at.cloneLayout=xR;at.cloneLayoutItem=Xs;at.collides=Qh;at.compact=_R;at.compactItem=SR;at.compactType=aL;at.correctBounds=CR;at.fastPositionEqual=K9;at.fastRGLPropsEqual=void 0;at.getAllCollisions=ER;at.getFirstCollision=Fs;at.getLayoutItem=d0;at.getStatics=f0;at.modifyLayout=wR;at.moveElement=Ac;at.moveElementAwayFromCollision=Wv;at.noop=void 0;at.perc=Q9;at.resizeItemInDirection=rL;at.setTopLeft=iL;at.setTransform=oL;at.sortLayoutItems=b0;at.sortLayoutItemsByColRow=DR;at.sortLayoutItemsByRowCol=OR;at.synchronizeLayoutWithChildren=sL;at.validateLayout=MR;at.withLayoutItem=q9;var c_=l0,Tc=B9(m);function B9(e){return e&&e.__esModule?e:{default:e}}const U9=process.env.NODE_ENV==="production";function u0(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function xR(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Xs(e[n]);return t}function wR(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function q9(e,t,n){let r=d0(e,t);return r?(r=n(Xs(r)),e=wR(e,r),[e,r]):[e,null]}function Xs(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function G9(e,t){return(0,c_.deepEqual)(Tc.default.Children.map(e,n=>n==null?void 0:n.key),Tc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,c_.deepEqual)(Tc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Tc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const Y9=W9;at.fastRGLPropsEqual=Y9;function K9(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Qh(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function _R(e,t,n,r){const o=f0(e),i=b0(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let u=Xs(i[a]);u.static||(u=SR(o,u,t,n,i,r),o.push(u)),s[e.indexOf(i[a])]=u,u.moved=!1}return s}const X9={x:"w",y:"h"};function Hv(e,t,n,r){const o=X9[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Qh(t,a)&&Hv(e,a,n+t[o],r)}}t[r]=n}function SR(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(u0(e),t.y);t.y>0&&!Fs(e,t);)t.y--;else if(a)for(;t.x>0&&!Fs(e,t);)t.x--;let l;for(;(l=Fs(e,t))&&!(n===null&&i);)if(a?Hv(o,t,l.x+l.w,"x"):Hv(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Fs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function CR(e,t){const n=f0(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Fs(n,i);)i.y++}return e}function d0(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Fs(e,t){for(let n=0,r=e.length;n<r;n++)if(Qh(e[n],t))return e[n]}function ER(e,t){return e.filter(n=>Qh(n,t))}function f0(e){return e.filter(t=>t.static)}function Ac(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const u=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let h=b0(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?u>=n:!1)&&(h=h.reverse());const g=ER(h,t),b=g.length>0;if(b&&l)return xR(e);if(b&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=u,t.y=d,t.moved=!1,e;for(let y=0,x=g.length;y<x;y++){const _=g[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(_.i," at [").concat(_.x,",").concat(_.y,"]"),!_.moved&&(_.static?e=Wv(e,_,t,o,s):e=Wv(e,t,_,o,s))}return e}function Wv(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const h={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},p=Fs(e,h),g=p&&p.y+p.h>t.y,b=p&&t.x+t.w>p.x;if(p){if(g&&a)return Ac(e,n,void 0,t.y+1,r,l,o);if(g&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(b&&s)return Ac(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(h.x,",").concat(h.y,"]."),Ac(e,n,s?h.x:void 0,a?h.y:void 0,r,l,o)}const u=s?n.x+1:void 0,d=a?n.y+1:void 0;return u==null&&d==null?e:Ac(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function Q9(e){return e*100+"%"}const RR=(e,t,n,r)=>e+n>r?t:n,$R=(e,t,n)=>e<0?t:n,PR=e=>Math.max(0,e),h0=e=>Math.max(0,e),p0=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:$R(s,e.height,o),top:h0(s)}},g0=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:RR(e.left,e.width,s,n),left:PR(o)}},m0=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:RR(e.left,e.width,i,n),top:h0(r),left:PR(s)}},v0=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:$R(r,e.height,i),top:h0(r)}},Z9=function(){return p0(arguments.length<=0?void 0:arguments[0],g0(...arguments))},J9=function(){return p0(arguments.length<=0?void 0:arguments[0],m0(...arguments))},eL=function(){return v0(arguments.length<=0?void 0:arguments[0],g0(...arguments))},tL=function(){return v0(arguments.length<=0?void 0:arguments[0],m0(...arguments))},nL={n:p0,ne:Z9,e:g0,se:eL,s:v0,sw:tL,w:m0,nw:J9};function rL(e,t,n,r){const o=nL[e];return o?o(t,{...t,...n},r):n}function oL(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function iL(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function b0(e,t){return t==="horizontal"?DR(e):t==="vertical"?OR(e):e}function OR(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function DR(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function sL(e,t,n,r,o){e=e||[];const i=[];Tc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=d0(e,String(a.key)),u=a.props["data-grid"];l&&u==null?i.push(Xs(l)):u?(U9||MR([u],"ReactGridLayout.children"),i.push(Xs({...u,i:a.key}))):i.push(Xs({w:1,h:1,x:0,y:u0(i),i:String(a.key)}))});const s=CR(i,{cols:n});return o?s:_R(s,r,n)}function MR(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function aL(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const lL=()=>{};at.noop=lL;var Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.calcGridColWidth=Zh;Co.calcGridItemPosition=cL;Co.calcGridItemWHPx=Bv;Co.calcWH=dL;Co.calcXY=uL;Co.clamp=zs;function Zh(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Bv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function cL(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,u=Zh(e),d={};return i&&i.resizing?(d.width=Math.round(i.resizing.width),d.height=Math.round(i.resizing.height)):(d.width=Bv(r,u,s[0]),d.height=Bv(o,l,s[1])),i&&i.dragging?(d.top=Math.round(i.dragging.top),d.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(d.top=Math.round(i.resizing.top),d.left=Math.round(i.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((u+s[0])*t+a[0])),d}function uL(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,u=Zh(e);let d=Math.round((n-i[0])/(u+i[0])),h=Math.round((t-i[1])/(a+i[1]));return d=zs(d,0,s-r),h=zs(h,0,l-o),{x:d,y:h}}function dL(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:u}=e,d=Zh(e);let h=Math.round((t+s[0])/(d+s[0])),p=Math.round((n+s[1])/(u+s[1])),g=zs(h,0,l-r),b=zs(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=zs(h,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=zs(p,0,a)),{w:g,h:b}}function zs(e,t,n){return Math.max(Math.min(e,n),t)}var Jh={},Uv={exports:{}},um,u_;function y0(){if(u_)return um;u_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return um=e,um}var dm,d_;function fL(){if(d_)return dm;d_=1;var e=y0();function t(){}function n(){}return n.resetWarningCache=t,dm=function(){function r(s,a,l,u,d,h){if(h!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},dm}var Jd={exports:{}},xt={};/** @license React v16.13.1
|
|
89
|
-
* react-is.development.js
|
|
90
|
-
*
|
|
91
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the MIT license found in the
|
|
94
|
-
* LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/var f_;function hL(){return f_||(f_=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function C(Z){return typeof Z=="string"||typeof Z=="function"||Z===r||Z===u||Z===i||Z===o||Z===h||Z===p||typeof Z=="object"&&Z!==null&&(Z.$$typeof===b||Z.$$typeof===g||Z.$$typeof===s||Z.$$typeof===a||Z.$$typeof===d||Z.$$typeof===x||Z.$$typeof===_||Z.$$typeof===w||Z.$$typeof===y)}function R(Z){if(typeof Z=="object"&&Z!==null){var De=Z.$$typeof;switch(De){case t:var Ne=Z.type;switch(Ne){case l:case u:case r:case i:case o:case h:return Ne;default:var Ve=Ne&&Ne.$$typeof;switch(Ve){case a:case d:case b:case g:case s:return Ve;default:return De}}case n:return De}}}var E=l,M=u,D=a,A=s,k=t,L=d,W=r,Y=b,ne=g,Q=n,F=i,J=o,q=h,X=!1;function ae(Z){return X||(X=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),j(Z)||R(Z)===l}function j(Z){return R(Z)===u}function V(Z){return R(Z)===a}function oe(Z){return R(Z)===s}function ce(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===t}function ue(Z){return R(Z)===d}function ge(Z){return R(Z)===r}function ve(Z){return R(Z)===b}function fe(Z){return R(Z)===g}function ee(Z){return R(Z)===n}function K(Z){return R(Z)===i}function ie(Z){return R(Z)===o}function ye(Z){return R(Z)===h}xt.AsyncMode=E,xt.ConcurrentMode=M,xt.ContextConsumer=D,xt.ContextProvider=A,xt.Element=k,xt.ForwardRef=L,xt.Fragment=W,xt.Lazy=Y,xt.Memo=ne,xt.Portal=Q,xt.Profiler=F,xt.StrictMode=J,xt.Suspense=q,xt.isAsyncMode=ae,xt.isConcurrentMode=j,xt.isContextConsumer=V,xt.isContextProvider=oe,xt.isElement=ce,xt.isForwardRef=ue,xt.isFragment=ge,xt.isLazy=ve,xt.isMemo=fe,xt.isPortal=ee,xt.isProfiler=K,xt.isStrictMode=ie,xt.isSuspense=ye,xt.isValidElementType=C,xt.typeOf=R}()),xt}var wt={};/** @license React v16.13.1
|
|
96
|
-
* react-is.production.min.js
|
|
97
|
-
*
|
|
98
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
99
|
-
*
|
|
100
|
-
* This source code is licensed under the MIT license found in the
|
|
101
|
-
* LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/var h_;function pL(){if(h_)return wt;h_=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function C(E){if(typeof E=="object"&&E!==null){var M=E.$$typeof;switch(M){case t:switch(E=E.type,E){case l:case u:case r:case i:case o:case h:return E;default:switch(E=E&&E.$$typeof,E){case a:case d:case b:case g:case s:return E;default:return M}}case n:return M}}}function R(E){return C(E)===u}return wt.AsyncMode=l,wt.ConcurrentMode=u,wt.ContextConsumer=a,wt.ContextProvider=s,wt.Element=t,wt.ForwardRef=d,wt.Fragment=r,wt.Lazy=b,wt.Memo=g,wt.Portal=n,wt.Profiler=i,wt.StrictMode=o,wt.Suspense=h,wt.isAsyncMode=function(E){return R(E)||C(E)===l},wt.isConcurrentMode=R,wt.isContextConsumer=function(E){return C(E)===a},wt.isContextProvider=function(E){return C(E)===s},wt.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},wt.isForwardRef=function(E){return C(E)===d},wt.isFragment=function(E){return C(E)===r},wt.isLazy=function(E){return C(E)===b},wt.isMemo=function(E){return C(E)===g},wt.isPortal=function(E){return C(E)===n},wt.isProfiler=function(E){return C(E)===i},wt.isStrictMode=function(E){return C(E)===o},wt.isSuspense=function(E){return C(E)===h},wt.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===u||E===i||E===o||E===h||E===p||typeof E=="object"&&E!==null&&(E.$$typeof===b||E.$$typeof===g||E.$$typeof===s||E.$$typeof===a||E.$$typeof===d||E.$$typeof===x||E.$$typeof===_||E.$$typeof===w||E.$$typeof===y)},wt.typeOf=C,wt}var p_;function TR(){return p_||(p_=1,process.env.NODE_ENV==="production"?Jd.exports=pL():Jd.exports=hL()),Jd.exports}/*
|
|
103
|
-
object-assign
|
|
104
|
-
(c) Sindre Sorhus
|
|
105
|
-
@license MIT
|
|
106
|
-
*/var fm,g_;function gL(){if(g_)return fm;g_=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(d){return s[d]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return fm=o()?Object.assign:function(i,s){for(var a,l=r(i),u,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var h in a)t.call(a,h)&&(l[h]=a[h]);if(e){u=e(a);for(var p=0;p<u.length;p++)n.call(a,u[p])&&(l[u[p]]=a[u[p]])}}return l},fm}var hm,m_;function AR(){return m_||(m_=1,hm=Function.call.bind(Object.prototype.hasOwnProperty)),hm}var pm,v_;function mL(){if(v_)return pm;v_=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=y0(),n={},r=AR();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var d in i)if(r(i,d)){var h;try{if(typeof i[d]!="function"){var p=Error((l||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}h=i[d](s,d,l,a,null,t)}catch(b){h=b}if(h&&!(h instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in n)){n[h.message]=!0;var g=u?u():"";e("Failed "+a+" type: "+h.message+(g??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},pm=o,pm}var gm,b_;function vL(){if(b_)return gm;b_=1;var e=TR(),t=gL(),n=y0(),r=AR(),o=mL(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return gm=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function h(j){var V=j&&(u&&j[u]||j[d]);if(typeof V=="function")return V}var p="<<anonymous>>",g={array:_("array"),bigint:_("bigint"),bool:_("boolean"),func:_("function"),number:_("number"),object:_("object"),string:_("string"),symbol:_("symbol"),any:w(),arrayOf:C,element:R(),elementType:E(),instanceOf:M,node:L(),objectOf:A,oneOf:D,oneOfType:k,shape:Y,exact:ne};function b(j,V){return j===V?j!==0||1/j===1/V:j!==j&&V!==V}function y(j,V){this.message=j,this.data=V&&typeof V=="object"?V:{},this.stack=""}y.prototype=Error.prototype;function x(j){if(process.env.NODE_ENV!=="production")var V={},oe=0;function ce(ge,ve,fe,ee,K,ie,ye){if(ee=ee||p,ie=ie||fe,ye!==n){if(l){var Z=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Z.name="Invariant Violation",Z}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var De=ee+":"+fe;!V[De]&&oe<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ie+"` prop on `"+ee+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[De]=!0,oe++)}}return ve[fe]==null?ge?ve[fe]===null?new y("The "+K+" `"+ie+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new y("The "+K+" `"+ie+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:j(ve,fe,ee,K,ie)}var ue=ce.bind(null,!1);return ue.isRequired=ce.bind(null,!0),ue}function _(j){function V(oe,ce,ue,ge,ve,fe){var ee=oe[ce],K=J(ee);if(K!==j){var ie=q(ee);return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+ie+"` supplied to `"+ue+"`, expected ")+("`"+j+"`."),{expectedType:j})}return null}return x(V)}function w(){return x(s)}function C(j){function V(oe,ce,ue,ge,ve){if(typeof j!="function")return new y("Property `"+ve+"` of component `"+ue+"` has invalid PropType notation inside arrayOf.");var fe=oe[ce];if(!Array.isArray(fe)){var ee=J(fe);return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+ee+"` supplied to `"+ue+"`, expected an array."))}for(var K=0;K<fe.length;K++){var ie=j(fe,K,ue,ge,ve+"["+K+"]",n);if(ie instanceof Error)return ie}return null}return x(V)}function R(){function j(V,oe,ce,ue,ge){var ve=V[oe];if(!a(ve)){var fe=J(ve);return new y("Invalid "+ue+" `"+ge+"` of type "+("`"+fe+"` supplied to `"+ce+"`, expected a single ReactElement."))}return null}return x(j)}function E(){function j(V,oe,ce,ue,ge){var ve=V[oe];if(!e.isValidElementType(ve)){var fe=J(ve);return new y("Invalid "+ue+" `"+ge+"` of type "+("`"+fe+"` supplied to `"+ce+"`, expected a single ReactElement type."))}return null}return x(j)}function M(j){function V(oe,ce,ue,ge,ve){if(!(oe[ce]instanceof j)){var fe=j.name||p,ee=ae(oe[ce]);return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+ee+"` supplied to `"+ue+"`, expected ")+("instance of `"+fe+"`."))}return null}return x(V)}function D(j){if(!Array.isArray(j))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function V(oe,ce,ue,ge,ve){for(var fe=oe[ce],ee=0;ee<j.length;ee++)if(b(fe,j[ee]))return null;var K=JSON.stringify(j,function(ye,Z){var De=q(Z);return De==="symbol"?String(Z):Z});return new y("Invalid "+ge+" `"+ve+"` of value `"+String(fe)+"` "+("supplied to `"+ue+"`, expected one of "+K+"."))}return x(V)}function A(j){function V(oe,ce,ue,ge,ve){if(typeof j!="function")return new y("Property `"+ve+"` of component `"+ue+"` has invalid PropType notation inside objectOf.");var fe=oe[ce],ee=J(fe);if(ee!=="object")return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+ee+"` supplied to `"+ue+"`, expected an object."));for(var K in fe)if(r(fe,K)){var ie=j(fe,K,ue,ge,ve+"."+K,n);if(ie instanceof Error)return ie}return null}return x(V)}function k(j){if(!Array.isArray(j))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var V=0;V<j.length;V++){var oe=j[V];if(typeof oe!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+X(oe)+" at index "+V+"."),s}function ce(ue,ge,ve,fe,ee){for(var K=[],ie=0;ie<j.length;ie++){var ye=j[ie],Z=ye(ue,ge,ve,fe,ee,n);if(Z==null)return null;Z.data&&r(Z.data,"expectedType")&&K.push(Z.data.expectedType)}var De=K.length>0?", expected one of type ["+K.join(", ")+"]":"";return new y("Invalid "+fe+" `"+ee+"` supplied to "+("`"+ve+"`"+De+"."))}return x(ce)}function L(){function j(V,oe,ce,ue,ge){return Q(V[oe])?null:new y("Invalid "+ue+" `"+ge+"` supplied to "+("`"+ce+"`, expected a ReactNode."))}return x(j)}function W(j,V,oe,ce,ue){return new y((j||"React class")+": "+V+" type `"+oe+"."+ce+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ue+"`.")}function Y(j){function V(oe,ce,ue,ge,ve){var fe=oe[ce],ee=J(fe);if(ee!=="object")return new y("Invalid "+ge+" `"+ve+"` of type `"+ee+"` "+("supplied to `"+ue+"`, expected `object`."));for(var K in j){var ie=j[K];if(typeof ie!="function")return W(ue,ge,ve,K,q(ie));var ye=ie(fe,K,ue,ge,ve+"."+K,n);if(ye)return ye}return null}return x(V)}function ne(j){function V(oe,ce,ue,ge,ve){var fe=oe[ce],ee=J(fe);if(ee!=="object")return new y("Invalid "+ge+" `"+ve+"` of type `"+ee+"` "+("supplied to `"+ue+"`, expected `object`."));var K=t({},oe[ce],j);for(var ie in K){var ye=j[ie];if(r(j,ie)&&typeof ye!="function")return W(ue,ge,ve,ie,q(ye));if(!ye)return new y("Invalid "+ge+" `"+ve+"` key `"+ie+"` supplied to `"+ue+"`.\nBad object: "+JSON.stringify(oe[ce],null," ")+`
|
|
107
|
-
Valid keys: `+JSON.stringify(Object.keys(j),null," "));var Z=ye(fe,ie,ue,ge,ve+"."+ie,n);if(Z)return Z}return null}return x(V)}function Q(j){switch(typeof j){case"number":case"string":case"undefined":return!0;case"boolean":return!j;case"object":if(Array.isArray(j))return j.every(Q);if(j===null||a(j))return!0;var V=h(j);if(V){var oe=V.call(j),ce;if(V!==j.entries){for(;!(ce=oe.next()).done;)if(!Q(ce.value))return!1}else for(;!(ce=oe.next()).done;){var ue=ce.value;if(ue&&!Q(ue[1]))return!1}}else return!1;return!0;default:return!1}}function F(j,V){return j==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function J(j){var V=typeof j;return Array.isArray(j)?"array":j instanceof RegExp?"object":F(V,j)?"symbol":V}function q(j){if(typeof j>"u"||j===null)return""+j;var V=J(j);if(V==="object"){if(j instanceof Date)return"date";if(j instanceof RegExp)return"regexp"}return V}function X(j){var V=q(j);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function ae(j){return!j.constructor||!j.constructor.name?p:j.constructor.name}return g.checkPropTypes=o,g.resetWarningCache=o.resetWarningCache,g.PropTypes=g,g},gm}if(process.env.NODE_ENV!=="production"){var bL=TR(),yL=!0;Uv.exports=vL()(bL.isElement,yL)}else Uv.exports=fL()();var Xi=Uv.exports,ep={exports:{}},IR={};function kR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=kR(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function y_(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=kR(e))&&(r&&(r+=" "),r+=t);return r}const xL=Object.freeze(Object.defineProperty({__proto__:null,clsx:y_,default:y_},Symbol.toStringTag,{value:"Module"})),wL=Bb(xL);var Gt={},Eo={};Object.defineProperty(Eo,"__esModule",{value:!0});Eo.dontSetMe=RL;Eo.findInArray=_L;Eo.int=EL;Eo.isFunction=SL;Eo.isNum=CL;function _L(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function SL(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function CL(e){return typeof e=="number"&&!isNaN(e)}function EL(e){return parseInt(e,10)}function RL(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var pa={};Object.defineProperty(pa,"__esModule",{value:!0});pa.browserPrefixToKey=LR;pa.browserPrefixToStyle=$L;pa.default=void 0;pa.getPrefix=NR;const mm=["Moz","Webkit","O","ms"];function NR(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<mm.length;r++)if(LR(t,mm[r])in n)return mm[r];return""}function LR(e,t){return t?"".concat(t).concat(PL(e)):e}function $L(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function PL(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}pa.default=NR();Object.defineProperty(Gt,"__esModule",{value:!0});Gt.addClassName=jR;Gt.addEvent=ML;Gt.addUserSelectStyles=HL;Gt.createCSSTransform=FL;Gt.createSVGTransform=zL;Gt.getTouch=jL;Gt.getTouchIdentifier=VL;Gt.getTranslation=x0;Gt.innerHeight=kL;Gt.innerWidth=NL;Gt.matchesSelector=zR;Gt.matchesSelectorAndParentsTo=DL;Gt.offsetXYFromParent=LL;Gt.outerHeight=AL;Gt.outerWidth=IL;Gt.removeClassName=VR;Gt.removeEvent=TL;Gt.removeUserSelectStyles=WL;var fr=Eo,x_=OL(pa);function FR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(FR=function(r){return r?n:t})(e)}function OL(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=FR(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let ef="";function zR(e,t){return ef||(ef=(0,fr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,fr.isFunction)(e[n])})),(0,fr.isFunction)(e[ef])?e[ef](t):!1}function DL(e,t,n){let r=e;do{if(zR(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function ML(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function TL(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function AL(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,fr.int)(n.borderTopWidth),t+=(0,fr.int)(n.borderBottomWidth),t}function IL(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,fr.int)(n.borderLeftWidth),t+=(0,fr.int)(n.borderRightWidth),t}function kL(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,fr.int)(n.paddingTop),t-=(0,fr.int)(n.paddingBottom),t}function NL(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,fr.int)(n.paddingLeft),t-=(0,fr.int)(n.paddingRight),t}function LL(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function FL(e,t){const n=x0(e,t,"px");return{[(0,x_.browserPrefixToKey)("transform",x_.default)]:n}}function zL(e,t){return x0(e,t,"")}function x0(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function jL(e,t){return e.targetTouches&&(0,fr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,fr.findInArray)(e.changedTouches,n=>t===n.identifier)}function VL(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function HL(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
108
|
-
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
109
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&jR(e.body,"react-draggable-transparent-selection")}function WL(e){if(e)try{if(e.body&&VR(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function jR(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function VR(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Ro={};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.canDragX=qL;Ro.canDragY=GL;Ro.createCoreData=KL;Ro.createDraggableData=XL;Ro.getBoundPosition=BL;Ro.getControlPosition=YL;Ro.snapToGrid=UL;var nr=Eo,el=Gt;function BL(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:QL(r);const o=w0(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,u=s.getComputedStyle(o),d=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,nr.int)(d.paddingLeft)+(0,nr.int)(u.marginLeft),top:-o.offsetTop+(0,nr.int)(d.paddingTop)+(0,nr.int)(u.marginTop),right:(0,el.innerWidth)(l)-(0,el.outerWidth)(o)-o.offsetLeft+(0,nr.int)(d.paddingRight)-(0,nr.int)(u.marginRight),bottom:(0,el.innerHeight)(l)-(0,el.outerHeight)(o)-o.offsetTop+(0,nr.int)(d.paddingBottom)-(0,nr.int)(u.marginBottom)}}return(0,nr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,nr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,nr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,nr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function UL(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function qL(e){return e.props.axis==="both"||e.props.axis==="x"}function GL(e){return e.props.axis==="both"||e.props.axis==="y"}function YL(e,t,n){const r=typeof t=="number"?(0,el.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=w0(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,el.offsetXYFromParent)(r||e,i,n.props.scale)}function KL(e,t,n){const r=!(0,nr.isNum)(e.lastX),o=w0(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function XL(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function QL(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function w0(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var tp={},np={};Object.defineProperty(np,"__esModule",{value:!0});np.default=ZL;function ZL(){}Object.defineProperty(tp,"__esModule",{value:!0});tp.default=void 0;var vm=e4(m),jn=_0(Xi),JL=_0(So),Cn=Gt,wi=Ro,bm=Eo,bc=_0(np);function _0(e){return e&&e.__esModule?e:{default:e}}function HR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(HR=function(r){return r?n:t})(e)}function e4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=HR(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function An(e,t,n){return t=t4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t4(e){var t=n4(e,"string");return typeof t=="symbol"?t:String(t)}function n4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Gr={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let _i=Gr.mouse,rp=class extends vm.Component{constructor(){super(...arguments),An(this,"dragging",!1),An(this,"lastX",NaN),An(this,"lastY",NaN),An(this,"touchIdentifier",null),An(this,"mounted",!1),An(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Cn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Cn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Cn.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,wi.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,wi.createCoreData)(this,s,a);(0,bc.default)("DraggableCore: handleDragStart: %j",l),(0,bc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Cn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Cn.addEvent)(r,_i.move,this.handleDrag),(0,Cn.addEvent)(r,_i.stop,this.handleDragStop))}),An(this,"handleDrag",t=>{const n=(0,wi.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,wi.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,wi.createCoreData)(this,r,o);if((0,bc.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),An(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,wi.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,u=o-this.lastY||0;[l,u]=(0,wi.snapToGrid)(this.props.grid,l,u),r=this.lastX+l,o=this.lastY+u}const i=(0,wi.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Cn.removeUserSelectStyles)(a.ownerDocument),(0,bc.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,bc.default)("DraggableCore: Removing handlers"),(0,Cn.removeEvent)(a.ownerDocument,_i.move,this.handleDrag),(0,Cn.removeEvent)(a.ownerDocument,_i.stop,this.handleDragStop))}),An(this,"onMouseDown",t=>(_i=Gr.mouse,this.handleDragStart(t))),An(this,"onMouseUp",t=>(_i=Gr.mouse,this.handleDragStop(t))),An(this,"onTouchStart",t=>(_i=Gr.touch,this.handleDragStart(t))),An(this,"onTouchEnd",t=>(_i=Gr.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Cn.addEvent)(t,Gr.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Cn.removeEvent)(n,Gr.mouse.move,this.handleDrag),(0,Cn.removeEvent)(n,Gr.touch.move,this.handleDrag),(0,Cn.removeEvent)(n,Gr.mouse.stop,this.handleDragStop),(0,Cn.removeEvent)(n,Gr.touch.stop,this.handleDragStop),(0,Cn.removeEvent)(t,Gr.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Cn.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:JL.default.findDOMNode(this)}render(){return vm.cloneElement(vm.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};tp.default=rp;An(rp,"displayName","DraggableCore");An(rp,"propTypes",{allowAnyClick:jn.default.bool,children:jn.default.node.isRequired,disabled:jn.default.bool,enableUserSelectHack:jn.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:jn.default.arrayOf(jn.default.number),handle:jn.default.string,cancel:jn.default.string,nodeRef:jn.default.object,onStart:jn.default.func,onDrag:jn.default.func,onStop:jn.default.func,onMouseDown:jn.default.func,scale:jn.default.number,className:bm.dontSetMe,style:bm.dontSetMe,transform:bm.dontSetMe});An(rp,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=p(m),n=d(Xi),r=d(So),o=d(wL),i=Gt,s=Ro,a=Eo,l=d(tp),u=d(np);function d(w){return w&&w.__esModule?w:{default:w}}function h(w){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(h=function(E){return E?R:C})(w)}function p(w,C){if(!C&&w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=h(C);if(R&&R.has(w))return R.get(w);var E={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in w)if(D!=="default"&&Object.prototype.hasOwnProperty.call(w,D)){var A=M?Object.getOwnPropertyDescriptor(w,D):null;A&&(A.get||A.set)?Object.defineProperty(E,D,A):E[D]=w[D]}return E.default=w,R&&R.set(w,E),E}function g(){return g=Object.assign?Object.assign.bind():function(w){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(w[E]=R[E])}return w},g.apply(this,arguments)}function b(w,C,R){return C=y(C),C in w?Object.defineProperty(w,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[C]=R,w}function y(w){var C=x(w,"string");return typeof C=="symbol"?C:String(C)}function x(w,C){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var E=R.call(w,C||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}class _ extends t.Component{static getDerivedStateFromProps(C,R){let{position:E}=C,{prevPropsPosition:M}=R;return E&&(!M||E.x!==M.x||E.y!==M.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:M}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(C){super(C),b(this,"onDragStart",(R,E)=>{if((0,u.default)("Draggable: onDragStart: %j",E),this.props.onStart(R,(0,s.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(R,E)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",E);const M=(0,s.createDraggableData)(this,E),D={x:M.x,y:M.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:L}=D;D.x+=this.state.slackX,D.y+=this.state.slackY;const[W,Y]=(0,s.getBoundPosition)(this,D.x,D.y);D.x=W,D.y=Y,D.slackX=this.state.slackX+(k-D.x),D.slackY=this.state.slackY+(L-D.y),M.x=D.x,M.y=D.y,M.deltaX=D.x-this.state.x,M.deltaY=D.y-this.state.y}if(this.props.onDrag(R,M)===!1)return!1;this.setState(D)}),b(this,"onDragStop",(R,E)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,E))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",E);const D={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:k,y:L}=this.props.position;D.x=k,D.y=L}this.setState(D)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var C,R;return(C=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:R,children:E,defaultPosition:M,defaultClassName:D,defaultClassNameDragging:A,defaultClassNameDragged:k,position:L,positionOffset:W,scale:Y,...ne}=this.props;let Q={},F=null;const q=!!!L||this.state.dragging,X=L||M,ae={x:(0,s.canDragX)(this)&&q?this.state.x:X.x,y:(0,s.canDragY)(this)&&q?this.state.y:X.y};this.state.isElementSVG?F=(0,i.createSVGTransform)(ae,W):Q=(0,i.createCSSTransform)(ae,W);const j=(0,o.default)(E.props.className||"",D,{[A]:this.state.dragging,[k]:this.state.dragged});return t.createElement(l.default,g({},ne,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:j,style:{...E.props.style,...Q},transform:F}))}}e.default=_,b(_,"displayName","Draggable"),b(_,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),b(_,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(IR);const{default:WR,DraggableCore:r4}=IR;ep.exports=WR;ep.exports.default=WR;ep.exports.DraggableCore=r4;var BR=ep.exports,op={exports:{}},Wu={},S0={};S0.__esModule=!0;S0.cloneElement=c4;var o4=i4(m);function i4(e){return e&&e.__esModule?e:{default:e}}function w_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function __(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w_(Object(n),!0).forEach(function(r){s4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s4(e,t,n){return t=a4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a4(e){var t=l4(e,"string");return typeof t=="symbol"?t:String(t)}function l4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function c4(e,t){return t.style&&e.props.style&&(t.style=__(__({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),o4.default.cloneElement(e,t)}var Bu={};Bu.__esModule=!0;Bu.resizableProps=void 0;var Ze=u4(Xi);function u4(e){return e&&e.__esModule?e:{default:e}}var d4={axis:Ze.default.oneOf(["both","x","y","none"]),className:Ze.default.string,children:Ze.default.element.isRequired,draggableOpts:Ze.default.shape({allowAnyClick:Ze.default.bool,cancel:Ze.default.string,children:Ze.default.node,disabled:Ze.default.bool,enableUserSelectHack:Ze.default.bool,offsetParent:Ze.default.node,grid:Ze.default.arrayOf(Ze.default.number),handle:Ze.default.string,nodeRef:Ze.default.object,onStart:Ze.default.func,onDrag:Ze.default.func,onStop:Ze.default.func,onMouseDown:Ze.default.func,scale:Ze.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=Ze.default.number).isRequired.apply(i,n)}return Ze.default.number.apply(Ze.default,n)},handle:Ze.default.oneOfType([Ze.default.node,Ze.default.func]),handleSize:Ze.default.arrayOf(Ze.default.number),lockAspectRatio:Ze.default.bool,maxConstraints:Ze.default.arrayOf(Ze.default.number),minConstraints:Ze.default.arrayOf(Ze.default.number),onResizeStop:Ze.default.func,onResizeStart:Ze.default.func,onResize:Ze.default.func,resizeHandles:Ze.default.arrayOf(Ze.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Ze.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=Ze.default.number).isRequired.apply(i,n)}return Ze.default.number.apply(Ze.default,n)}};Bu.resizableProps=d4;Wu.__esModule=!0;Wu.default=void 0;var yc=m4(m),f4=BR,h4=S0,p4=Bu,g4=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function UR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(UR=function(o){return o?n:t})(e)}function m4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=UR(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function qv(){return qv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qv.apply(this,arguments)}function v4(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function S_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ym(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S_(Object(n),!0).forEach(function(r){b4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function b4(e,t,n){return t=y4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y4(e){var t=x4(e,"string");return typeof t=="symbol"?t:String(t)}function x4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function w4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Gv(e,t)}function Gv(e,t){return Gv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Gv(e,t)}var C0=function(e){w4(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,u=s.lockAspectRatio;if(!a&&!l&&!u)return[o,i];if(u){var d=this.props.width/this.props.height,h=o-this.props.width,p=i-this.props.height;Math.abs(h)>Math.abs(p*d)?i=o/d:o=i*d}var g=o,b=i,y=this.slack||[0,0],x=y[0],_=y[1];return o+=x,i+=_,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(g-o),_+(b-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var u=l.node,d=l.deltaX,h=l.deltaY;o==="onResizeStart"&&s.resetData();var p=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",g=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!p&&!g)){var b=i[0],y=i[i.length-1],x=u.getBoundingClientRect();if(s.lastHandleRect!=null){if(y==="w"){var _=x.left-s.lastHandleRect.left;d+=_}if(b==="n"){var w=x.top-s.lastHandleRect.top;h+=w}}s.lastHandleRect=x,y==="w"&&(d=-d),b==="n"&&(h=-h);var C=s.props.width+(p?d/s.props.transformScale:0),R=s.props.height+(g?h/s.props.transformScale:0),E=s.runConstraints(C,R);C=E[0],R=E[1];var M=C!==s.props.width||R!==s.props.height,D=typeof s.props[o]=="function"?s.props[o]:null,A=o==="onResize"&&!M;D&&!A&&(a.persist==null||a.persist(),D(a,{node:u,size:{width:C,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return yc.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=ym({ref:i},a?{}:{handleAxis:o});return yc.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var u=i.resizeHandles;i.transformScale;var d=v4(i,g4);return(0,h4.cloneElement)(s,ym(ym({},d),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,u.map(function(h){var p,g=(p=o.handleRefs[h])!=null?p:o.handleRefs[h]=yc.createRef();return yc.createElement(f4.DraggableCore,qv({},l,{nodeRef:g,key:"resizableHandle-"+h,onStop:o.resizeHandler("onResizeStop",h),onStart:o.resizeHandler("onResizeStart",h),onDrag:o.resizeHandler("onResize",h)}),o.renderResizeHandle(h,g))}))}))},t}(yc.Component);Wu.default=C0;C0.propTypes=p4.resizableProps;C0.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var ip={};ip.__esModule=!0;ip.default=void 0;var xm=R4(m),_4=qR(Xi),S4=qR(Wu),C4=Bu,E4=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function qR(e){return e&&e.__esModule?e:{default:e}}function GR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(GR=function(o){return o?n:t})(e)}function R4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=GR(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Yv(){return Yv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yv.apply(this,arguments)}function C_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function uh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C_(Object(n),!0).forEach(function(r){$4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $4(e,t,n){return t=P4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P4(e){var t=O4(e,"string");return typeof t=="symbol"?t:String(t)}function O4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function D4(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function M4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Kv(e,t)}function Kv(e,t){return Kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Kv(e,t)}var YR=function(e){M4(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var u=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(u,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(u)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,u=o.draggableOpts,d=o.minConstraints,h=o.maxConstraints,p=o.lockAspectRatio,g=o.axis;o.width,o.height;var b=o.resizeHandles,y=o.style,x=o.transformScale,_=D4(o,E4);return xm.createElement(S4.default,{axis:g,draggableOpts:u,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:h,minConstraints:d,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:b,transformScale:x,width:this.state.width},xm.createElement("div",Yv({},_,{style:uh(uh({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(xm.Component);ip.default=YR;YR.propTypes=uh(uh({},C4.resizableProps),{},{children:_4.default.element});op.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};op.exports.Resizable=Wu.default;op.exports.ResizableBox=ip.default;var T4=op.exports,ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.resizeHandleType=ti.resizeHandleAxesType=ti.default=void 0;var nt=KR(Xi),A4=KR(m);function KR(e){return e&&e.__esModule?e:{default:e}}const XR=nt.default.arrayOf(nt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));ti.resizeHandleAxesType=XR;const QR=nt.default.oneOfType([nt.default.node,nt.default.func]);ti.resizeHandleType=QR;var I4={className:nt.default.string,style:nt.default.object,width:nt.default.number,autoSize:nt.default.bool,cols:nt.default.number,draggableCancel:nt.default.string,draggableHandle:nt.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:nt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&at.validateLayout(t,"layout")},margin:nt.default.arrayOf(nt.default.number),containerPadding:nt.default.arrayOf(nt.default.number),rowHeight:nt.default.number,maxRows:nt.default.number,isBounded:nt.default.bool,isDraggable:nt.default.bool,isResizable:nt.default.bool,allowOverlap:nt.default.bool,preventCollision:nt.default.bool,useCSSTransforms:nt.default.bool,transformScale:nt.default.number,isDroppable:nt.default.bool,resizeHandles:XR,resizeHandle:QR,onLayoutChange:nt.default.func,onDragStart:nt.default.func,onDrag:nt.default.func,onDragStop:nt.default.func,onResizeStart:nt.default.func,onResize:nt.default.func,onResizeStop:nt.default.func,onDrop:nt.default.func,droppingItem:nt.default.shape({i:nt.default.string.isRequired,w:nt.default.number.isRequired,h:nt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};A4.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:nt.default.any};ti.default=I4;Object.defineProperty(Jh,"__esModule",{value:!0});Jh.default=void 0;var Fa=E0(m),bt=E0(Xi),k4=BR,N4=T4,za=at,gn=Co,E_=ti,L4=E0(c0);function E0(e){return e&&e.__esModule?e:{default:e}}function lo(e,t,n){return t=F4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F4(e){var t=z4(e,"string");return typeof t=="symbol"?t:String(t)}function z4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class R0 extends Fa.default.Component{constructor(){super(...arguments),lo(this,"state",{resizing:null,dragging:null,className:""}),lo(this,"elementRef",Fa.default.createRef()),lo(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),u=r.getBoundingClientRect(),d=u.left/i,h=l.left/i,p=u.top/i,g=l.top/i;s.left=d-h+a.scrollLeft,s.top=p-g+a.scrollTop,this.setState({dragging:s});const{x:b,y}=(0,gn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,b,y,{e:t,node:r,newPosition:s})}),lo(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:u,i:d,w:h,h:p,containerWidth:g}=this.props,b=this.getPositionParams();if(u){const{offsetParent:w}=r;if(w){const{margin:C,rowHeight:R}=this.props,E=w.clientHeight-(0,gn.calcGridItemWHPx)(p,R,C[1]);a=(0,gn.clamp)(a,0,E);const M=(0,gn.calcGridColWidth)(b),D=g-(0,gn.calcGridItemWHPx)(h,M,C[0]);l=(0,gn.clamp)(l,0,D)}}const y={top:a,left:l};this.setState({dragging:y});const{x,y:_}=(0,gn.calcXY)(b,a,l,h,p);return s.call(this,d,x,_,{e:t,node:r,newPosition:y})}),lo(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:u}=this.state.dragging,d={top:u,left:l};this.setState({dragging:null});const{x:h,y:p}=(0,gn.calcXY)(this.getPositionParams(),u,l,i,s);return o.call(this,a,h,p,{e:t,node:r,newPosition:d})}),lo(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),lo(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),lo(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,gn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,gn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,za.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,za.setTransform)(t):(i=(0,za.setTopLeft)(t),n&&(i.left=(0,za.perc)(t.left/r),i.width=(0,za.perc)(t.width/r))),i}mixinDraggable(t,n){return Fa.default.createElement(k4.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:u,resizeHandles:d,resizeHandle:h}=this.props,p=this.getPositionParams(),g=(0,gn.calcGridItemPosition)(p,0,0,o,0).width,b=(0,gn.calcGridItemPosition)(p,0,0,i,s),y=(0,gn.calcGridItemPosition)(p,0,0,a,l),x=[b.width,b.height],_=[Math.min(y.width,g),Math.min(y.height,1/0)];return Fa.default.createElement(N4.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:_,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:u,resizeHandles:d,handle:h},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:u,y:d,i:h,maxH:p,minH:g,containerWidth:b}=this.props,{minW:y,maxW:x}=this.props;let _=s;i&&(_=(0,za.resizeItemInDirection)(a,r,s,b),this.setState({resizing:o==="onResizeStop"?null:_}));let{w,h:C}=(0,gn.calcWH)(this.getPositionParams(),_.width,_.height,u,d,a);w=(0,gn.clamp)(w,Math.max(y,1),x),C=(0,gn.clamp)(C,g,p),l.call(this,h,w,C,{e:t,node:i,size:_,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,u=(0,gn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),d=Fa.default.Children.only(this.props.children);let h=Fa.default.cloneElement(d,{ref:this.elementRef,className:(0,L4.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(u)}});return h=this.mixinResizable(h,u,s),h=this.mixinDraggable(h,i),h}}Jh.default=R0;lo(R0,"propTypes",{children:bt.default.element,cols:bt.default.number.isRequired,containerWidth:bt.default.number.isRequired,rowHeight:bt.default.number.isRequired,margin:bt.default.array.isRequired,maxRows:bt.default.number.isRequired,containerPadding:bt.default.array.isRequired,x:bt.default.number.isRequired,y:bt.default.number.isRequired,w:bt.default.number.isRequired,h:bt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:bt.default.string.isRequired,resizeHandles:E_.resizeHandleAxesType,resizeHandle:E_.resizeHandleType,onDragStop:bt.default.func,onDragStart:bt.default.func,onDrag:bt.default.func,onResizeStop:bt.default.func,onResizeStart:bt.default.func,onResize:bt.default.func,isDraggable:bt.default.bool.isRequired,isResizable:bt.default.bool.isRequired,isBounded:bt.default.bool.isRequired,static:bt.default.bool,useCSSTransforms:bt.default.bool.isRequired,transformScale:bt.default.number,className:bt.default.string,handle:bt.default.string,cancel:bt.default.string,droppingPosition:bt.default.shape({e:bt.default.object.isRequired,left:bt.default.number.isRequired,top:bt.default.number.isRequired})});lo(R0,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(Hu,"__esModule",{value:!0});Hu.default=void 0;var Cs=W4(m),wm=l0,j4=$0(c0),He=at,V4=Co,R_=$0(Jh),H4=$0(ti);function $0(e){return e&&e.__esModule?e:{default:e}}function ZR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ZR=function(r){return r?n:t})(e)}function W4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ZR(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function En(e,t,n){return t=B4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B4(e){var t=U4(e,"string");return typeof t=="symbol"?t:String(t)}function U4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const $_="react-grid-layout";let JR=!1;try{JR=/firefox/i.test(navigator.userAgent)}catch{}class sp extends Cs.Component{constructor(){super(...arguments),En(this,"state",{activeDrag:null,layout:(0,He.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,He.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),En(this,"dragEnterCounter",0),En(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,He.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,He.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),En(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:u,allowOverlap:d,preventCollision:h}=this.props,p=(0,He.getLayoutItem)(l,t);if(!p)return;const g={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t},b=!0;l=(0,He.moveElement)(l,p,n,r,b,h,(0,He.compactType)(this.props),u,d),this.props.onDrag(l,a,p,g,i,s),this.setState({layout:d?l:(0,He.compact)(l,(0,He.compactType)(this.props),u),activeDrag:g})}),En(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:u,preventCollision:d,allowOverlap:h}=this.props,p=(0,He.getLayoutItem)(l,t);if(!p)return;const g=!0;l=(0,He.moveElement)(l,p,n,r,g,d,(0,He.compactType)(this.props),u,h);const b=h?l:(0,He.compact)(l,(0,He.compactType)(this.props),u);this.props.onDragStop(b,a,p,null,i,s);const{oldLayout:y}=this.state;this.setState({activeDrag:null,layout:b,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(b,y)}),En(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,He.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,He.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),En(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:u}=this.state;let{layout:d}=this.state;const{cols:h,preventCollision:p,allowOverlap:g}=this.props;let b=!1,y,x,_;const[w,C]=(0,He.withLayoutItem)(d,t,E=>{let M;return x=E.x,_=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=E.x+(E.w-n),n=E.x!==x&&x<0?E.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(_=E.y+(E.h-r),r=E.y!==_&&_<0?E.h:r,_=_<0?0:_),b=!0),p&&!g&&(M=(0,He.getAllCollisions)(d,{...E,w:n,h:r,x,y:_}).filter(A=>A.i!==E.i).length>0,M&&(_=E.y,r=E.h,x=E.x,n=E.w,b=!1)),E.w=n,E.h=r,E});if(!C)return;y=w,b&&(y=(0,He.moveElement)(w,C,x,_,!0,this.props.preventCollision,(0,He.compactType)(this.props),h,g));const R={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(y,u,C,R,i,s),this.setState({layout:g?y:(0,He.compact)(y,(0,He.compactType)(this.props),h),activeDrag:R})}),En(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:u,allowOverlap:d}=this.props,h=(0,He.getLayoutItem)(a,t),p=d?a:(0,He.compact)(a,(0,He.compactType)(this.props),u);this.props.onResizeStop(p,l,h,null,i,s);const{oldLayout:g}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,g)}),En(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),JR&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains($_)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:u,containerPadding:d,transformScale:h}=this.props,p=o==null?void 0:o(t);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const g={...r,...p},{layout:b}=this.state,{layerX:y,layerY:x}=t.nativeEvent,_={left:y/h,top:x/h,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:w,top:C}=this.state.droppingPosition;(w!=y||C!=x)&&this.setState({droppingPosition:_})}}else{const w={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:u,containerPadding:d||i},C=(0,V4.calcXY)(w,x,y,g.w,g.h);this.setState({droppingDOMNode:Cs.createElement("div",{key:g.i}),droppingPosition:_,layout:[...b,{...g,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),En(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,He.compact)(r.filter(i=>i.i!==t.i),(0,He.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),En(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),En(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),En(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,wm.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,He.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,He.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,He.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,He.fastRGLPropsEqual)(this.props,t,wm.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,He.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,wm.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:u}=this.props;return Cs.createElement(R_.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:u},Cs.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,He.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:u,isDraggable:d,isResizable:h,isBounded:p,useCSSTransforms:g,transformScale:b,draggableCancel:y,draggableHandle:x,resizeHandles:_,resizeHandle:w}=this.props,{mounted:C,droppingPosition:R}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,M=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&h,D=r.resizeHandles||_,A=E&&p&&r.isBounded!==!1;return Cs.createElement(R_.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:u,rowHeight:l,cancel:y,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:M,isBounded:A,useCSSTransforms:g&&C,usePercentages:!C,transformScale:b,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:D,resizeHandle:w},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,j4.default)($_,t),s={height:this.containerHeight(),...n};return Cs.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:He.noop,onDragLeave:r?this.onDragLeave:He.noop,onDragEnter:r?this.onDragEnter:He.noop,onDragOver:r?this.onDragOver:He.noop},Cs.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Hu.default=sp;En(sp,"displayName","ReactGridLayout");En(sp,"propTypes",H4.default);En(sp,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:He.noop,onDragStart:He.noop,onDrag:He.noop,onDragStop:He.noop,onResizeStart:He.noop,onResize:He.noop,onResizeStop:He.noop,onDrop:He.noop,onDropDragOver:He.noop});var ap={},ga={};Object.defineProperty(ga,"__esModule",{value:!0});ga.findOrGenerateResponsiveLayout=Y4;ga.getBreakpointFromWidth=q4;ga.getColsFromBreakpoint=G4;ga.sortBreakpoints=P0;var tf=at;function q4(e,t){const n=P0(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function G4(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Y4(e,t,n,r,o,i){if(e[n])return(0,tf.cloneLayout)(e[n]);let s=e[r];const a=P0(t),l=a.slice(a.indexOf(n));for(let u=0,d=l.length;u<d;u++){const h=l[u];if(e[h]){s=e[h];break}}return s=(0,tf.cloneLayout)(s||[]),(0,tf.compact)((0,tf.correctBounds)(s,{cols:o}),i,o)}function P0(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(ap,"__esModule",{value:!0});ap.default=void 0;var P_=X4(m),Vn=e$(Xi),_m=l0,ol=at,Es=ga,K4=e$(Hu);function e$(e){return e&&e.__esModule?e:{default:e}}function t$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(t$=function(r){return r?n:t})(e)}function X4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=t$(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Xv(){return Xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xv.apply(this,arguments)}function dh(e,t,n){return t=Q4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q4(e){var t=Z4(e,"string");return typeof t=="symbol"?t:String(t)}function Z4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const O_=e=>Object.prototype.toString.call(e);function nf(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class O0 extends P_.Component{constructor(){super(...arguments),dh(this,"state",this.generateInitialState()),dh(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,Es.getBreakpointFromWidth)(n,t),s=(0,Es.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Es.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,_m.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Es.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,_m.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,_m.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,Es.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Es.getColsFromBreakpoint)(s,r),u={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in u||(u[a]=(0,ol.cloneLayout)(this.state.layout));let p=(0,Es.findOrGenerateResponsiveLayout)(u,n,s,a,l,i);p=(0,ol.synchronizeLayoutWithChildren)(p,this.props.children,l,i,this.props.allowOverlap),u[s]=p,this.props.onLayoutChange(p,u),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:p,cols:l})}const d=nf(this.props.margin,s),h=nf(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,d,l,h)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:u,...d}=this.props;return P_.createElement(K4.default,Xv({},d,{margin:nf(i,this.state.breakpoint),containerPadding:nf(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}ap.default=O0;dh(O0,"propTypes",{breakpoint:Vn.default.string,breakpoints:Vn.default.object,allowOverlap:Vn.default.bool,cols:Vn.default.object,margin:Vn.default.oneOfType([Vn.default.array,Vn.default.object]),containerPadding:Vn.default.oneOfType([Vn.default.array,Vn.default.object]),layouts(e,t){if(O_(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+O_(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,ol.validateLayout)(e.layouts[n],"layouts."+n)})},width:Vn.default.number.isRequired,onBreakpointChange:Vn.default.func,onLayoutChange:Vn.default.func,onWidthChange:Vn.default.func});dh(O0,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:ol.noop,onLayoutChange:ol.noop,onWidthChange:ol.noop});var D0={},n$=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),Qv=typeof window<"u"&&typeof document<"u"&&window.document===document,fh=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),J4=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(fh):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),eF=2;function tF(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){J4(i)}function a(){var l=Date.now();if(n){if(l-o<eF)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var nF=20,rF=["top","right","bottom","left","width","height","size","weight"],oF=typeof MutationObserver<"u",iF=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=tF(this.refresh.bind(this),nF)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Qv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),oF?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Qv||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=rF.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),r$=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Rl=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||fh},o$=lp(0,0,0,0);function hh(e){return parseFloat(e)||0}function D_(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+hh(i)},0)}function sF(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=hh(s)}return n}function aF(e){var t=e.getBBox();return lp(0,0,t.width,t.height)}function lF(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return o$;var r=Rl(e).getComputedStyle(e),o=sF(r),i=o.left+o.right,s=o.top+o.bottom,a=hh(r.width),l=hh(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=D_(r,"left","right")+i),Math.round(l+s)!==n&&(l-=D_(r,"top","bottom")+s)),!uF(e)){var u=Math.round(a+i)-t,d=Math.round(l+s)-n;Math.abs(u)!==1&&(a-=u),Math.abs(d)!==1&&(l-=d)}return lp(o.left,o.top,a,l)}var cF=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Rl(e).SVGGraphicsElement}:function(e){return e instanceof Rl(e).SVGElement&&typeof e.getBBox=="function"}}();function uF(e){return e===Rl(e).document.documentElement}function dF(e){return Qv?cF(e)?aF(e):lF(e):o$}function fF(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return r$(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function lp(e,t,n,r){return{x:e,y:t,width:n,height:r}}var hF=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=lp(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=dF(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),pF=function(){function e(t,n){var r=fF(n);r$(this,{target:t,contentRect:r})}return e}(),gF=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new n$,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Rl(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new hF(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Rl(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new pF(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),i$=typeof WeakMap<"u"?new WeakMap:new n$,s$=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=iF.getInstance(),r=new gF(t,n,this);i$.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){s$.prototype[e]=function(){var t;return(t=i$.get(this))[e].apply(t,arguments)}});var mF=function(){return typeof fh.ResizeObserver<"u"?fh.ResizeObserver:s$}();const vF=Object.freeze(Object.defineProperty({__proto__:null,default:mF},Symbol.toStringTag,{value:"Module"})),bF=Bb(vF);Object.defineProperty(D0,"__esModule",{value:!0});D0.default=RF;var rf=_F(m),yF=M0(Xi),xF=M0(bF),wF=M0(c0);function M0(e){return e&&e.__esModule?e:{default:e}}function a$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(a$=function(r){return r?n:t})(e)}function _F(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=a$(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Zv(){return Zv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zv.apply(this,arguments)}function ja(e,t,n){return t=SF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SF(e){var t=CF(e,"string");return typeof t=="symbol"?t:String(t)}function CF(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const EF="react-grid-layout";function RF(e){var t;return t=class extends rf.Component{constructor(){super(...arguments),ja(this,"state",{width:1280}),ja(this,"elementRef",rf.createRef()),ja(this,"mounted",!1),ja(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new xF.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?rf.createElement("div",{className:(0,wF.default)(this.props.className,EF),style:this.props.style,ref:this.elementRef}):rf.createElement(e,Zv({innerRef:this.elementRef},o,this.state))}},ja(t,"defaultProps",{measureBeforeMount:!1}),ja(t,"propTypes",{measureBeforeMount:yF.default.bool}),t}(function(e){e.exports=Hu.default,e.exports.utils=at,e.exports.calculateUtils=Co,e.exports.Responsive=ap.default,e.exports.Responsive.utils=ga,e.exports.WidthProvider=D0.default})(yR);var M_=yR.exports;function sa({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),u=Ce(p=>p.isDashboardEditing),d=p=>{p.stopPropagation(),u&&s(!0)};function h(){return o==="textarea"?I.jsx("textarea",{className:_e(" grow px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:p=>l(p.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.key==="Enter"&&p.shiftKey||(p.key==="Enter"||p.key==="Tab")&&(s(!1),r(a))}}):I.jsx("input",{onMouseDown:p=>p.stopPropagation(),type:"text",className:_e("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:p=>l(p.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{(p.key==="Enter"||p.key==="Tab")&&(s(!1),r(a))}})}return I.jsx("div",{className:"flex",role:"editable",onDoubleClick:d,children:i?h():e})}/*!
|
|
110
|
-
* @kurkle/color v0.3.2
|
|
111
|
-
* https://github.com/kurkle/color#readme
|
|
112
|
-
* (c) 2023 Jukka Kurkela
|
|
113
|
-
* Released under the MIT License
|
|
114
|
-
*/function Uu(e){return e+.5|0}const ki=(e,t,n)=>Math.max(Math.min(e,n),t);function Ic(e){return ki(Uu(e*2.55),0,255)}function Vi(e){return ki(Uu(e*255),0,255)}function Ko(e){return ki(Uu(e/2.55)/100,0,1)}function T_(e){return ki(Uu(e*100),0,100)}const Pr={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},Jv=[..."0123456789ABCDEF"],$F=e=>Jv[e&15],PF=e=>Jv[(e&240)>>4]+Jv[e&15],of=e=>(e&240)>>4===(e&15),OF=e=>of(e.r)&&of(e.g)&&of(e.b)&&of(e.a);function DF(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Pr[e[1]]*17,g:255&Pr[e[2]]*17,b:255&Pr[e[3]]*17,a:t===5?Pr[e[4]]*17:255}:(t===7||t===9)&&(n={r:Pr[e[1]]<<4|Pr[e[2]],g:Pr[e[3]]<<4|Pr[e[4]],b:Pr[e[5]]<<4|Pr[e[6]],a:t===9?Pr[e[7]]<<4|Pr[e[8]]:255})),n}const MF=(e,t)=>e<255?t(e):"";function TF(e){var t=OF(e)?$F:PF;return e?"#"+t(e.r)+t(e.g)+t(e.b)+MF(e.a,t):void 0}const AF=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function l$(e,t,n){const r=t*Math.min(n,1-n),o=(i,s=(i+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[o(0),o(8),o(4)]}function IF(e,t,n){const r=(o,i=(o+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function kF(e,t,n){const r=l$(e,1,.5);let o;for(t+n>1&&(o=1/(t+n),t*=o,n*=o),o=0;o<3;o++)r[o]*=1-t-n,r[o]+=t;return r}function NF(e,t,n,r,o){return e===o?(t-n)/r+(t<n?6:0):t===o?(n-e)/r+2:(e-t)/r+4}function T0(e){const n=e.r/255,r=e.g/255,o=e.b/255,i=Math.max(n,r,o),s=Math.min(n,r,o),a=(i+s)/2;let l,u,d;return i!==s&&(d=i-s,u=a>.5?d/(2-i-s):d/(i+s),l=NF(n,r,o,d,i),l=l*60+.5),[l|0,u||0,a]}function A0(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Vi)}function I0(e,t,n){return A0(l$,e,t,n)}function LF(e,t,n){return A0(kF,e,t,n)}function FF(e,t,n){return A0(IF,e,t,n)}function c$(e){return(e%360+360)%360}function zF(e){const t=AF.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Ic(+t[5]):Vi(+t[5]));const o=c$(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=LF(o,i,s):t[1]==="hsv"?r=FF(o,i,s):r=I0(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function jF(e,t){var n=T0(e);n[0]=c$(n[0]+t),n=I0(n),e.r=n[0],e.g=n[1],e.b=n[2]}function VF(e){if(!e)return;const t=T0(e),n=t[0],r=T_(t[1]),o=T_(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Ko(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const A_={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"},I_={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function HF(){const e={},t=Object.keys(I_),n=Object.keys(A_);let r,o,i,s,a;for(r=0;r<t.length;r++){for(s=a=t[r],o=0;o<n.length;o++)i=n[o],a=a.replace(i,A_[i]);i=parseInt(I_[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let sf;function WF(e){sf||(sf=HF(),sf.transparent=[0,0,0,0]);const t=sf[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const BF=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function UF(e){const t=BF.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Ic(s):ki(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?Ic(r):ki(r,0,255)),o=255&(t[4]?Ic(o):ki(o,0,255)),i=255&(t[6]?Ic(i):ki(i,0,255)),{r,g:o,b:i,a:n}}}function qF(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ko(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Sm=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Va=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function GF(e,t,n){const r=Va(Ko(e.r)),o=Va(Ko(e.g)),i=Va(Ko(e.b));return{r:Vi(Sm(r+n*(Va(Ko(t.r))-r))),g:Vi(Sm(o+n*(Va(Ko(t.g))-o))),b:Vi(Sm(i+n*(Va(Ko(t.b))-i))),a:e.a+n*(t.a-e.a)}}function af(e,t,n){if(e){let r=T0(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=I0(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function u$(e,t){return e&&Object.assign(t||{},e)}function k_(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Vi(e[3]))):(t=u$(e,{r:0,g:0,b:0,a:1}),t.a=Vi(t.a)),t}function YF(e){return e.charAt(0)==="r"?UF(e):zF(e)}class iu{constructor(t){if(t instanceof iu)return t;const n=typeof t;let r;n==="object"?r=k_(t):n==="string"&&(r=DF(t)||WF(t)||YF(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=u$(this._rgb);return t&&(t.a=Ko(t.a)),t}set rgb(t){this._rgb=k_(t)}rgbString(){return this._valid?qF(this._rgb):void 0}hexString(){return this._valid?TF(this._rgb):void 0}hslString(){return this._valid?VF(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,o=t.rgb;let i;const s=n===i?.5:n,a=2*s-1,l=r.a-o.a,u=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-u,r.r=255&u*r.r+i*o.r+.5,r.g=255&u*r.g+i*o.g+.5,r.b=255&u*r.b+i*o.b+.5,r.a=s*r.a+(1-s)*o.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=GF(this._rgb,t._rgb,n)),this}clone(){return new iu(this.rgb)}alpha(t){return this._rgb.a=Vi(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Uu(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.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 af(this._rgb,2,t),this}darken(t){return af(this._rgb,2,-t),this}saturate(t){return af(this._rgb,1,t),this}desaturate(t){return af(this._rgb,1,-t),this}rotate(t){return jF(this._rgb,t),this}}/*!
|
|
115
|
-
* Chart.js v4.4.1
|
|
116
|
-
* https://www.chartjs.org
|
|
117
|
-
* (c) 2023 Chart.js Contributors
|
|
118
|
-
* Released under the MIT License
|
|
119
|
-
*/function Ho(){}const KF=(()=>{let e=0;return()=>e++})();function st(e){return e===null||typeof e>"u"}function Nt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ct(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function qt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function or(e,t){return qt(e)?e:t}function Ke(e,t){return typeof e>"u"?t:e}const XF=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,d$=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Et(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function _t(e,t,n,r){let o,i,s;if(Nt(e))if(i=e.length,r)for(o=i-1;o>=0;o--)t.call(n,e[o],o);else for(o=0;o<i;o++)t.call(n,e[o],o);else if(ct(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function ph(e,t){let n,r,o,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(o=e[n],i=t[n],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0}function gh(e){if(Nt(e))return e.map(gh);if(ct(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=gh(e[n[o]]);return t}return e}function f$(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function QF(e,t,n,r){if(!f$(e))return;const o=t[e],i=n[e];ct(o)&&ct(i)?xo(o,i,r):t[e]=gh(i)}function xo(e,t,n){const r=Nt(t)?t:[t],o=r.length;if(!ct(e))return e;n=n||{};const i=n.merger||QF;let s;for(let a=0;a<o;++a){if(s=r[a],!ct(s))continue;const l=Object.keys(s);for(let u=0,d=l.length;u<d;++u)i(l[u],e,s,n)}return e}function Vc(e,t){return xo(e,t,{merger:ZF})}function ZF(e,t,n){if(!f$(e))return;const r=t[e],o=n[e];ct(r)&&ct(o)?Vc(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=gh(o))}const N_={"":e=>e,x:e=>e.x,y:e=>e.y};function JF(e){const t=e.split("."),n=[];let r="";for(const o of t)r+=o,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function e8(e){const t=JF(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Wi(e,t){return(N_[t]||(N_[t]=e8(t)))(e)}function k0(e){return e.charAt(0).toUpperCase()+e.slice(1)}const su=e=>typeof e<"u",Bi=e=>typeof e=="function",L_=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function t8(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Ft=Math.PI,Lt=2*Ft,n8=Lt+Ft,mh=Number.POSITIVE_INFINITY,r8=Ft/180,Xt=Ft/2,Rs=Ft/4,F_=Ft*2/3,Ni=Math.log10,vo=Math.sign;function Hc(e,t,n){return Math.abs(e-t)<n}function z_(e){const t=Math.round(e);e=Hc(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Ni(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function o8(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((o,i)=>o-i).pop(),t}function $l(e){return!isNaN(parseFloat(e))&&isFinite(e)}function i8(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function h$(e,t,n){let r,o,i;for(r=0,o=e.length;r<o;r++)i=e[r][n],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function Kr(e){return e*(Ft/180)}function N0(e){return e*(180/Ft)}function j_(e){if(!qt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function p$(e,t){const n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*Ft&&(i+=Lt),{angle:i,distance:o}}function eb(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function s8(e,t){return(e-t+n8)%Lt-Ft}function lr(e){return(e%Lt+Lt)%Lt}function au(e,t,n,r){const o=lr(e),i=lr(t),s=lr(n),a=lr(i-o),l=lr(s-o),u=lr(o-i),d=lr(o-s);return o===i||o===s||r&&i===s||a>l&&u<d}function un(e,t,n){return Math.max(t,Math.min(n,e))}function a8(e){return un(e,-32768,32767)}function Qo(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function L0(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,o=0,i;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const Zo=(e,t,n,r)=>L0(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),l8=(e,t,n)=>L0(e,n,r=>e[r][t]>=n);function c8(e,t,n){let r=0,o=e.length;for(;r<o&&e[r]<t;)r++;for(;o>r&&e[o-1]>n;)o--;return r>0||o<e.length?e.slice(r,o):e}const g$=["push","pop","shift","splice","unshift"];function u8(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),g$.forEach(n=>{const r="_onData"+k0(n),o=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...i){const s=o.apply(this,i);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...i)}),s}})})}function V_(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(t);o!==-1&&r.splice(o,1),!(r.length>0)&&(g$.forEach(i=>{delete e[i]}),delete e._chartjs)}function m$(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const v$=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function b$(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,v$.call(window,()=>{r=!1,e.apply(t,n)}))}}function d8(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const F0=e=>e==="start"?"left":e==="end"?"right":"center",Rn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,f8=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function y$(e,t,n){const r=t.length;let o=0,i=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:u,max:d,minDefined:h,maxDefined:p}=s.getUserBounds();h&&(o=un(Math.min(Zo(a,l,u).lo,n?r:Zo(t,l,s.getPixelForValue(u)).lo),0,r-1)),p?i=un(Math.max(Zo(a,s.axis,d,!0).hi+1,n?0:Zo(t,l,s.getPixelForValue(d),!0).hi+1),o,r)-o:i=r-o}return{start:o,count:i}}function x$(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,o={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=o,!0;const i=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,o),i}const lf=e=>e===0||e===1,H_=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Lt/n)),W_=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Lt/n)+1,Wc={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Xt)+1,easeOutSine:e=>Math.sin(e*Xt),easeInOutSine:e=>-.5*(Math.cos(Ft*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>lf(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>lf(e)?e:H_(e,.075,.3),easeOutElastic:e=>lf(e)?e:W_(e,.075,.3),easeInOutElastic(e){return lf(e)?e:e<.5?.5*H_(e*2,.1125,.45):.5+.5*W_(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Wc.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Wc.easeInBounce(e*2)*.5:Wc.easeOutBounce(e*2-1)*.5+.5};function z0(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function B_(e){return z0(e)?e:new iu(e)}function Cm(e){return z0(e)?e:new iu(e).saturate(.5).darken(.1).hexString()}const h8=["x","y","borderWidth","radius","tension"],p8=["color","borderColor","backgroundColor"];function g8(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:p8},numbers:{type:"number",properties:h8}}),e.describe("animations",{_fallback:"animation"}),e.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=>t|0}}}})}function m8(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const U_=new Map;function v8(e,t){t=t||{};const n=e+JSON.stringify(t);let r=U_.get(n);return r||(r=new Intl.NumberFormat(e,t),U_.set(n,r)),r}function qu(e,t,n){return v8(t,n).format(e)}const w$={values(e){return Nt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let o,i=e;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(o="scientific"),i=b8(e,n)}const s=Ni(Math.abs(i)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:o,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),qu(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Ni(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?w$.numeric.call(this,e,t,n):""}};function b8(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var cp={formatters:w$};function y8(e){e.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,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:cp.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const aa=Object.create(null),tb=Object.create(null);function Bc(e,t){if(!t)return e;const n=t.split(".");for(let r=0,o=n.length;r<o;++r){const i=n[r];e=e[i]||(e[i]=Object.create(null))}return e}function Em(e,t,n){return typeof t=="string"?xo(Bc(e,t),n):xo(Bc(e,""),t)}class x8{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,o)=>Cm(o.backgroundColor),this.hoverBorderColor=(r,o)=>Cm(o.borderColor),this.hoverColor=(r,o)=>Cm(o.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Em(this,t,n)}get(t){return Bc(this,t)}describe(t,n){return Em(tb,t,n)}override(t,n){return Em(aa,t,n)}route(t,n,r,o){const i=Bc(this,t),s=Bc(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],u=s[o];return ct(l)?Object.assign({},u,l):Ke(l,u)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Wt=new x8({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[g8,m8,y8]);function w8(e){return!e||st(e.size)||st(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function vh(e,t,n,r,o){let i=t[o];return i||(i=t[o]=e.measureText(o).width,n.push(o)),i>r&&(r=i),r}function _8(e,t,n,r){r=r||{};let o=r.data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},i=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,u,d,h,p;for(l=0;l<a;l++)if(h=n[l],h!=null&&!Nt(h))s=vh(e,o,i,s,h);else if(Nt(h))for(u=0,d=h.length;u<d;u++)p=h[u],p!=null&&!Nt(p)&&(s=vh(e,o,i,s,p));e.restore();const g=i.length/2;if(g>n.length){for(l=0;l<g;l++)delete o[i[l]];i.splice(0,g)}return s}function $s(e,t,n){const r=e.currentDevicePixelRatio,o=n!==0?Math.max(n/2,.5):0;return Math.round((t-o)*r)/r+o}function q_(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function nb(e,t,n,r){_$(e,t,n,r,null)}function _$(e,t,n,r,o){let i,s,a,l,u,d,h,p;const g=t.pointStyle,b=t.rotation,y=t.radius;let x=(b||0)*r8;if(g&&typeof g=="object"&&(i=g.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(x),e.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),g){default:o?e.ellipse(n,r,o/2,y,0,0,Lt):e.arc(n,r,y,0,Lt),e.closePath();break;case"triangle":d=o?o/2:y,e.moveTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=F_,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=F_,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),e.closePath();break;case"rectRounded":u=y*.516,l=y-u,s=Math.cos(x+Rs)*l,h=Math.cos(x+Rs)*(o?o/2-u:l),a=Math.sin(x+Rs)*l,p=Math.sin(x+Rs)*(o?o/2-u:l),e.arc(n-h,r-a,u,x-Ft,x-Xt),e.arc(n+p,r-s,u,x-Xt,x),e.arc(n+h,r+a,u,x,x+Xt),e.arc(n-p,r+s,u,x+Xt,x+Ft),e.closePath();break;case"rect":if(!b){l=Math.SQRT1_2*y,d=o?o/2:l,e.rect(n-d,r-l,2*d,2*l);break}x+=Rs;case"rectRot":h=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,p=Math.sin(x)*(o?o/2:y),e.moveTo(n-h,r-a),e.lineTo(n+p,r-s),e.lineTo(n+h,r+a),e.lineTo(n-p,r+s),e.closePath();break;case"crossRot":x+=Rs;case"cross":h=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,p=Math.sin(x)*(o?o/2:y),e.moveTo(n-h,r-a),e.lineTo(n+h,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"star":h=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,p=Math.sin(x)*(o?o/2:y),e.moveTo(n-h,r-a),e.lineTo(n+h,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s),x+=Rs,h=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,p=Math.sin(x)*(o?o/2:y),e.moveTo(n-h,r-a),e.lineTo(n+h,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"line":s=o?o/2:Math.cos(x)*y,a=Math.sin(x)*y,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(x)*(o?o/2:y),r+Math.sin(x)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Jo(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function up(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function dp(e){e.restore()}function S8(e,t,n,r,o){if(!t)return e.lineTo(n.x,n.y);if(o==="middle"){const i=(t.x+n.x)/2;e.lineTo(i,t.y),e.lineTo(i,n.y)}else o==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function C8(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function E8(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),st(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function R8(e,t,n,r,o){if(o.strikethrough||o.underline){const i=e.measureText(r),s=t-i.actualBoundingBoxLeft,a=t+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,u=n+i.actualBoundingBoxDescent,d=o.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(s,d),e.lineTo(a,d),e.stroke()}}function $8(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function la(e,t,n,r,o,i={}){const s=Nt(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,u;for(e.save(),e.font=o.string,E8(e,i),l=0;l<s.length;++l)u=s[l],i.backdrop&&$8(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),st(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(u,n,r,i.maxWidth)),e.fillText(u,n,r,i.maxWidth),R8(e,n,r,u,i),r+=Number(o.lineHeight);e.restore()}function lu(e,t){const{x:n,y:r,w:o,h:i,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*Ft,Ft,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,Ft,Xt,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,Xt,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-Xt,!0),e.lineTo(n+s.topLeft,r)}const P8=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,O8=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function D8(e,t){const n=(""+e).match(P8);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const M8=e=>+e||0;function j0(e,t){const n={},r=ct(t),o=r?Object.keys(t):t,i=ct(e)?r?s=>Ke(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=M8(i(s));return n}function S$(e){return j0(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Qs(e){return j0(e,["topLeft","topRight","bottomLeft","bottomRight"])}function yn(e){const t=S$(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Qt(e,t){e=e||{},t=t||Wt.font;let n=Ke(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Ke(e.style,t.style);r&&!(""+r).match(O8)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:Ke(e.family,t.family),lineHeight:D8(Ke(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Ke(e.weight,t.weight),string:""};return o.string=w8(o),o}function kt(e,t,n,r){let o=!0,i,s,a;for(i=0,s=e.length;i<s;++i)if(a=e[i],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),o=!1),n!==void 0&&Nt(a)&&(a=a[n%a.length],o=!1),a!==void 0))return r&&!o&&(r.cacheable=!1),a}function T8(e,t,n){const{min:r,max:o}=e,i=d$(t,(o-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(i)),max:s(o,i)}}function Qi(e,t){return Object.assign(Object.create(e),t)}function V0(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=$$("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>V0([a,...e],t,i,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return E$(a,l,()=>j8(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Y_(a).includes(l)},ownKeys(a){return Y_(a)},set(a,l,u){const d=a._storage||(a._storage=o());return a[l]=d[l]=u,delete a._keys,!0}})}function Pl(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:C$(e,r),setContext:i=>Pl(e,i,n,r),override:i=>Pl(e.override(i),t,n,r)};return new Proxy(o,{deleteProperty(i,s){return delete i[s],delete e[s],!0},get(i,s,a){return E$(i,s,()=>I8(i,s,a))},getOwnPropertyDescriptor(i,s){return i._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(i,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(i,s,a){return e[s]=a,delete i[s],!0}})}function C$(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:o=t.allKeys}=e;return{allKeys:o,scriptable:n,indexable:r,isScriptable:Bi(n)?n:()=>n,isIndexable:Bi(r)?r:()=>r}}const A8=(e,t)=>e?e+k0(t):t,H0=(e,t)=>ct(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function E$(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function I8(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return Bi(a)&&s.isScriptable(t)&&(a=k8(t,a,e,n)),Nt(a)&&a.length&&(a=N8(t,a,e,s.isIndexable)),H0(t,a)&&(a=Pl(a,o,i&&i[t],s)),a}function k8(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(i,s||r);return a.delete(e),H0(e,l)&&(l=W0(o._scopes,o,e,l)),l}function N8(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_descriptors:a}=n;if(typeof i.index<"u"&&r(e))return t[i.index%t.length];if(ct(t[0])){const l=t,u=o._scopes.filter(d=>d!==l);t=[];for(const d of l){const h=W0(u,o,e,d);t.push(Pl(h,i,s&&s[e],a))}}return t}function R$(e,t,n){return Bi(e)?e(t,n):e}const L8=(e,t)=>e===!0?t:typeof e=="string"?Wi(t,e):void 0;function F8(e,t,n,r,o){for(const i of t){const s=L8(n,i);if(s){e.add(s);const a=R$(s._fallback,n,o);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function W0(e,t,n,r){const o=t._rootScopes,i=R$(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=G_(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=G_(a,s,i,l,r),l===null)?!1:V0(Array.from(a),[""],o,i,()=>z8(t,n,r))}function G_(e,t,n,r,o){for(;n;)n=F8(e,t,n,r,o);return n}function z8(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return Nt(o)&&ct(n)?n:o||{}}function j8(e,t,n,r){let o;for(const i of t)if(o=$$(A8(i,e),n),typeof o<"u")return H0(e,o)?W0(n,r,e,o):o}function $$(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function Y_(e){let t=e._keys;return t||(t=e._keys=V8(e._scopes)),t}function V8(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(o=>!o.startsWith("_")))t.add(r);return Array.from(t)}function P$(e,t,n,r){const{iScale:o}=e,{key:i="r"}=this._parsing,s=new Array(r);let a,l,u,d;for(a=0,l=r;a<l;++a)u=a+n,d=t[u],s[a]={r:o.parse(Wi(d,i),u)};return s}const H8=Number.EPSILON||1e-14,Ol=(e,t)=>t<e.length&&!e[t].skip&&e[t],O$=e=>e==="x"?"y":"x";function W8(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=eb(i,o),l=eb(s,i);let u=a/(a+l),d=l/(a+l);u=isNaN(u)?0:u,d=isNaN(d)?0:d;const h=r*u,p=r*d;return{previous:{x:i.x-h*(s.x-o.x),y:i.y-h*(s.y-o.y)},next:{x:i.x+p*(s.x-o.x),y:i.y+p*(s.y-o.y)}}}function B8(e,t,n){const r=e.length;let o,i,s,a,l,u=Ol(e,0);for(let d=0;d<r-1;++d)if(l=u,u=Ol(e,d+1),!(!l||!u)){if(Hc(t[d],0,H8)){n[d]=n[d+1]=0;continue}o=n[d]/t[d],i=n[d+1]/t[d],a=Math.pow(o,2)+Math.pow(i,2),!(a<=9)&&(s=3/Math.sqrt(a),n[d]=o*s*t[d],n[d+1]=i*s*t[d])}}function U8(e,t,n="x"){const r=O$(n),o=e.length;let i,s,a,l=Ol(e,0);for(let u=0;u<o;++u){if(s=a,a=l,l=Ol(e,u+1),!a)continue;const d=a[n],h=a[r];s&&(i=(d-s[n])/3,a[`cp1${n}`]=d-i,a[`cp1${r}`]=h-i*t[u]),l&&(i=(l[n]-d)/3,a[`cp2${n}`]=d+i,a[`cp2${r}`]=h+i*t[u])}}function q8(e,t="x"){const n=O$(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,u=Ol(e,0);for(s=0;s<r;++s)if(a=l,l=u,u=Ol(e,s+1),!!l){if(u){const d=u[t]-l[t];o[s]=d!==0?(u[n]-l[n])/d:0}i[s]=a?u?vo(o[s-1])!==vo(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}B8(e,o,i),U8(e,i,t)}function cf(e,t,n){return Math.max(Math.min(e,n),t)}function G8(e,t){let n,r,o,i,s,a=Jo(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&Jo(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=cf(o.cp1x,t.left,t.right),o.cp1y=cf(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=cf(o.cp2x,t.left,t.right),o.cp2y=cf(o.cp2y,t.top,t.bottom)))}function Y8(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")q8(e,o);else{let u=r?e[e.length-1]:e[0];for(i=0,s=e.length;i<s;++i)a=e[i],l=W8(u,a,e[Math.min(i+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,u=a}t.capBezierPoints&&G8(e,n)}function B0(){return typeof window<"u"&&typeof document<"u"}function U0(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function bh(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const fp=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function K8(e,t){return fp(e).getPropertyValue(t)}const X8=["top","right","bottom","left"];function Zs(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=X8[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Q8=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Z8(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(Q8(o,i,e.target))a=o,l=i;else{const u=t.getBoundingClientRect();a=r.clientX-u.left,l=r.clientY-u.top,s=!0}return{x:a,y:l,box:s}}function Ts(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=fp(n),i=o.boxSizing==="border-box",s=Zs(o,"padding"),a=Zs(o,"border","width"),{x:l,y:u,box:d}=Z8(e,n),h=s.left+(d&&a.left),p=s.top+(d&&a.top);let{width:g,height:b}=t;return i&&(g-=s.width+a.width,b-=s.height+a.height),{x:Math.round((l-h)/g*n.width/r),y:Math.round((u-p)/b*n.height/r)}}function J8(e,t,n){let r,o;if(t===void 0||n===void 0){const i=U0(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=fp(i),l=Zs(a,"border","width"),u=Zs(a,"padding");t=s.width-u.width-l.width,n=s.height-u.height-l.height,r=bh(a.maxWidth,i,"clientWidth"),o=bh(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||mh,maxHeight:o||mh}}const uf=e=>Math.round(e*10)/10;function ez(e,t,n,r){const o=fp(e),i=Zs(o,"margin"),s=bh(o.maxWidth,e,"clientWidth")||mh,a=bh(o.maxHeight,e,"clientHeight")||mh,l=J8(e,t,n);let{width:u,height:d}=l;if(o.boxSizing==="content-box"){const p=Zs(o,"border","width"),g=Zs(o,"padding");u-=g.width+p.width,d-=g.height+p.height}return u=Math.max(0,u-i.width),d=Math.max(0,r?u/r:d-i.height),u=uf(Math.min(u,s,l.maxWidth)),d=uf(Math.min(d,a,l.maxHeight)),u&&!d&&(d=uf(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,u=uf(Math.floor(d*r))),{width:u,height:d}}function K_(e,t,n){const r=t||1,o=Math.floor(e.height*r),i=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==o||s.width!==i?(e.currentDevicePixelRatio=r,s.height=o,s.width=i,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const tz=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};B0()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function X_(e,t){const n=K8(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function As(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function nz(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function rz(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=As(e,o,n),a=As(o,i,n),l=As(i,t,n),u=As(s,a,n),d=As(a,l,n);return As(u,d,n)}const oz=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},iz=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function il(e,t,n){return e?oz(t,n):iz()}function D$(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function M$(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function T$(e){return e==="angle"?{between:au,compare:s8,normalize:lr}:{between:Qo,compare:(t,n)=>t-n,normalize:t=>t}}function Q_({start:e,end:t,count:n,loop:r,style:o}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:o}}function sz(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=T$(r),l=t.length;let{start:u,end:d,loop:h}=e,p,g;if(h){for(u+=l,d+=l,p=0,g=l;p<g&&s(a(t[u%l][r]),o,i);++p)u--,d--;u%=l,d%=l}return d<u&&(d+=l),{start:u,end:d,loop:h,style:e.style}}function A$(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:u}=T$(r),{start:d,end:h,loop:p,style:g}=sz(e,t,n),b=[];let y=!1,x=null,_,w,C;const R=()=>l(o,C,_)&&a(o,C)!==0,E=()=>a(i,_)===0||l(i,C,_),M=()=>y||R(),D=()=>!y||E();for(let A=d,k=d;A<=h;++A)w=t[A%s],!w.skip&&(_=u(w[r]),_!==C&&(y=l(_,o,i),x===null&&M()&&(x=a(_,o)===0?A:k),x!==null&&D()&&(b.push(Q_({start:x,end:A,loop:p,count:s,style:g})),x=null),k=A,C=_));return x!==null&&b.push(Q_({start:x,end:h,loop:p,count:s,style:g})),b}function I$(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=A$(r[o],e.points,t);i.length&&n.push(...i)}return n}function az(e,t,n,r){let o=0,i=t-1;if(n&&!r)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(i+=o);i>o&&e[i%t].skip;)i--;return i%=t,{start:o,end:i}}function lz(e,t,n,r){const o=e.length,i=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const u=e[l%o];u.skip||u.stop?a.skip||(r=!1,i.push({start:t%o,end:(l-1)%o,loop:r}),t=s=u.stop?l:null):(s=l,a.skip&&(t=l)),a=u}return s!==null&&i.push({start:t%o,end:s%o,loop:r}),i}function cz(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=az(n,o,i,r);if(r===!0)return Z_(e,[{start:s,end:a,loop:i}],n,t);const l=a<s?a+o:a,u=!!e._fullLoop&&s===0&&a===o-1;return Z_(e,lz(n,s,l,u),n,t)}function Z_(e,t,n,r){return!r||!r.setContext||!n?t:uz(e,t,n,r)}function uz(e,t,n,r){const o=e._chart.getContext(),i=J_(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,u=[];let d=i,h=t[0].start,p=h;function g(b,y,x,_){const w=a?-1:1;if(b!==y){for(b+=l;n[b%l].skip;)b-=w;for(;n[y%l].skip;)y+=w;b%l!==y%l&&(u.push({start:b%l,end:y%l,loop:x,style:_}),d=_,h=y%l)}}for(const b of t){h=a?h:b.start;let y=n[h%l],x;for(p=h+1;p<=b.end;p++){const _=n[p%l];x=J_(r.setContext(Qi(o,{type:"segment",p0:y,p1:_,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),dz(x,d)&&g(h,p-1,b.loop,d),y=_,d=x}h<p-1&&g(h,p-1,b.loop,d)}return u}function J_(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function dz(e,t){if(!t)return!1;const n=[],r=function(o,i){return z0(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
|
120
|
-
* Chart.js v4.4.1
|
|
121
|
-
* https://www.chartjs.org
|
|
122
|
-
* (c) 2023 Chart.js Contributors
|
|
123
|
-
* Released under the MIT License
|
|
124
|
-
*/class fz{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,o){const i=n.listeners[o],s=n.duration;i.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=v$.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,o)=>{if(!r.running||!r.items.length)return;const i=r.items;let s=i.length-1,a=!1,l;for(;s>=0;--s)l=i[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(i[s]=i[i.length-1],i.pop());a&&(o.draw(),this._notify(o,r,t,"progress")),i.length||(r.running=!1,this._notify(o,r,t,"complete"),r.initial=!1),n+=i.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,o)=>Math.max(r,o._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let o=r.length-1;for(;o>=0;--o)r[o].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var qo=new fz;const eS="transparent",hz={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=B_(e||eS),o=r.valid&&B_(t||eS);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class pz{constructor(t,n,r,o){const i=n[r];o=kt([t.to,o,i,t.from]);const s=kt([t.from,i,o]);this._active=!0,this._fn=t.fn||hz[t.type||typeof s],this._easing=Wc[t.easing]||Wc.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=o,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const o=this._target[this._prop],i=r-this._start,s=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=kt([t.to,n,o,t.from]),this._from=kt([t.from,o,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,o=this._prop,i=this._from,s=this._loop,a=this._to;let l;if(this._active=i!==a&&(s||n<r),!this._active){this._target[o]=a,this._notify(!0);return}if(n<0){this._target[o]=i;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[o]=this._fn(i,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let o=0;o<r.length;o++)r[o][n]()}}class k${constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ct(t))return;const n=Object.keys(Wt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!ct(i))return;const s={};for(const a of n)s[a]=i[a];(Nt(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=mz(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&gz(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,o=[],i=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const u=s[l];if(u.charAt(0)==="$")continue;if(u==="options"){o.push(...this._animateOptions(t,n));continue}const d=n[u];let h=i[u];const p=r.get(u);if(h)if(p&&h.active()){h.update(p,d,a);continue}else h.cancel();if(!p||!p.duration){t[u]=d;continue}i[u]=h=new pz(p,t,u,d),o.push(h)}return o}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return qo.add(this._chart,r),!0}}function gz(e,t){const n=[],r=Object.keys(t);for(let o=0;o<r.length;o++){const i=e[r[o]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function mz(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function tS(e,t){const n=e&&e.options||{},r=n.reverse,o=n.min===void 0?t:0,i=n.max===void 0?t:0;return{start:r?i:o,end:r?o:i}}function vz(e,t,n){if(n===!1)return!1;const r=tS(e,n),o=tS(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function bz(e){let t,n,r,o;return ct(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:e===!1}}function N$(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function nS(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let s,a,l,u;if(t!==null){for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(r.all)continue;break}u=e.values[l],qt(u)&&(i||t===0||vo(t)===vo(u))&&(t+=u)}return t}}function yz(e){const t=Object.keys(e),n=new Array(t.length);let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r],n[r]={x:i,y:e[i]};return n}function rS(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function xz(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function wz(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function _z(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function oS(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const i=e[o.index];if(n&&i>0||!n&&i<0)return o.index}return null}function iS(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:a}=r,l=i.axis,u=s.axis,d=xz(i,s,r),h=t.length;let p;for(let g=0;g<h;++g){const b=t[g],{[l]:y,[u]:x}=b,_=b._stacks||(b._stacks={});p=_[u]=_z(o,d,y),p[a]=x,p._top=oS(p,s,!0,r.type),p._bottom=oS(p,s,!1,r.type);const w=p._visualValues||(p._visualValues={});w[a]=x}}function Rm(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Sz(e,t){return Qi(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Cz(e,t,n){return Qi(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function xc(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const o of t){const i=o._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const $m=e=>e==="reset"||e==="none",sS=(e,t)=>t?e:Object.assign({},e),Ez=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:N$(n,!0),values:null};class Xr{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=rS(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&&xc(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(h,p,g,b)=>h==="x"?p:h==="r"?b:g,i=n.xAxisID=Ke(r.xAxisID,Rm(t,"x")),s=n.yAxisID=Ke(r.yAxisID,Rm(t,"y")),a=n.rAxisID=Ke(r.rAxisID,Rm(t,"r")),l=n.indexAxis,u=n.iAxisID=o(l,i,s,a),d=n.vAxisID=o(l,s,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(d)}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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&V_(this._data,this),t._stacked&&xc(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(ct(n))this._data=yz(n);else if(r!==n){if(r){V_(r,this);const o=this._cachedMeta;xc(o),o._parsed=[]}n&&Object.isExtensible(n)&&u8(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let o=!1;this._dataCheck();const i=n._stacked;n._stacked=rS(n.vScale,n),n.stack!==r.stack&&(o=!0,xc(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&iS(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:o}=this,{iScale:i,_stacked:s}=r,a=i.axis;let l=t===0&&n===o.length?!0:r._sorted,u=t>0&&r._parsed[t-1],d,h,p;if(this._parsing===!1)r._parsed=o,r._sorted=!0,p=o;else{Nt(o[t])?p=this.parseArrayData(r,o,t,n):ct(o[t])?p=this.parseObjectData(r,o,t,n):p=this.parsePrimitiveData(r,o,t,n);const g=()=>h[a]===null||u&&h[a]<u[a];for(d=0;d<n;++d)r._parsed[d+t]=h=p[d],l&&(g()&&(l=!1),u=h);r._sorted=l}s&&iS(this,p)}parsePrimitiveData(t,n,r,o){const{iScale:i,vScale:s}=t,a=i.axis,l=s.axis,u=i.getLabels(),d=i===s,h=new Array(o);let p,g,b;for(p=0,g=o;p<g;++p)b=p+r,h[p]={[a]:d||i.parse(u[b],b),[l]:s.parse(n[b],b)};return h}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,u,d,h;for(l=0,u=o;l<u;++l)d=l+r,h=n[d],a[l]={x:i.parse(h[0],d),y:s.parse(h[1],d)};return a}parseObjectData(t,n,r,o){const{xScale:i,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(o);let d,h,p,g;for(d=0,h=o;d<h;++d)p=d+r,g=n[p],u[d]={x:i.parse(Wi(g,a),p),y:s.parse(Wi(g,l),p)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const o=this.chart,i=this._cachedMeta,s=n[t.axis],a={keys:N$(o,!0),values:n._stacks[t.axis]._visualValues};return nS(a,s,i.index,{mode:r})}updateRangeFromParsed(t,n,r,o){const i=r[n.axis];let s=i===null?NaN:i;const a=o&&r._stacks[n.axis];o&&a&&(o.values=a,s=nS(o,i,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,o=r._parsed,i=r._sorted&&t===r.iScale,s=o.length,a=this._getOtherScale(t),l=Ez(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=wz(a);let p,g;function b(){g=o[p];const y=g[a.axis];return!qt(g[t.axis])||d>y||h<y}for(p=0;p<s&&!(!b()&&(this.updateRangeFromParsed(u,t,g,l),i));++p);if(i){for(p=s-1;p>=0;--p)if(!b()){this.updateRangeFromParsed(u,t,g,l);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let o,i,s;for(o=0,i=n.length;o<i;++o)s=n[o][t.axis],qt(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,o=n.vScale,i=this.getParsed(t);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=bz(Ke(this.options.clip,vz(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,o=r.data||[],i=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||o.length-a,u=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(t,i,a,l),d=a;d<a+l;++d){const h=o[d];h.hidden||(h.active&&u?s.push(h):h.draw(t,i))}for(d=0;d<s.length;++d)s[d].draw(t,i)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const o=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];i=s.$context||(s.$context=Cz(this.getContext(),t,s)),i.parsed=this.getParsed(t),i.raw=o.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=Sz(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const o=n==="active",i=this._cachedDataOpts,s=t+"-"+n,a=i[s],l=this.enableOptionSharing&&su(r);if(a)return sS(a,l);const u=this.chart.config,d=u.datasetElementScopeKeys(this._type,t),h=o?[`${t}Hover`,"hover",t,""]:[t,""],p=u.getOptionScopes(this.getDataset(),d),g=Object.keys(Wt.elements[t]),b=()=>this.getContext(r,o,n),y=u.resolveNamedOptions(p,g,b,h);return y.$shared&&(y.$shared=l,i[s]=Object.freeze(sS(y,l))),y}_resolveAnimations(t,n,r){const o=this.chart,i=this._cachedDataOpts,s=`animation-${n}`,a=i[s];if(a)return a;let l;if(o.options.animation!==!1){const d=this.chart.config,h=d.datasetAnimationScopeKeys(this._type,n),p=d.getOptionScopes(this.getDataset(),h);l=d.createResolver(p,this.getContext(t,r,n))}const u=new k$(o,l&&l.animations);return l&&l._cacheable&&(i[s]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$m(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),o=this._sharedOptions,i=this.getSharedOptions(r),s=this.includeOptions(n,i)||i!==o;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:s}}updateElement(t,n,r,o){$m(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!$m(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,o){t.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"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 n=this._data,r=this._cachedMeta.data;for(const[a,l,u]of this._syncList)this[a](l,u);this._syncList=[];const o=r.length,i=n.length,s=Math.min(i,o);s&&this.parse(0,s),i>o?this._insertElements(o,i-o,t):i<o&&this._removeElements(i,o-i)}_insertElements(t,n,r=!0){const o=this._cachedMeta,i=o.data,s=t+n;let a;const l=u=>{for(u.length+=n,a=u.length-1;a>=s;a--)u[a]=u[a-n]};for(l(i),a=t;a<s;++a)i[a]=new this.dataElementType;this._parsing&&l(o._parsed),this.parse(t,n),r&&this.updateElements(i,t,n,"reset")}updateElements(t,n,r,o){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const o=r._parsed.splice(t,n);r._stacked&&xc(r,o)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,o]=t;this[n](r,o)}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,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Se(Xr,"defaults",{}),Se(Xr,"datasetElementType",null),Se(Xr,"dataElementType",null);function Rz(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let o=0,i=n.length;o<i;o++)r=r.concat(n[o].controller.getAllParsedValues(e));e._cache.$bar=m$(r.sort((o,i)=>o-i))}return e._cache.$bar}function $z(e){const t=e.iScale,n=Rz(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(su(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(o=0,i=n.length;o<i;++o)s=t.getPixelForValue(n[o]),l();for(a=void 0,o=0,i=t.ticks.length;o<i;++o)s=t.getPixelForTick(o),l();return r}function Pz(e,t,n,r){const o=n.barThickness;let i,s;return st(o)?(i=t.min*n.categoryPercentage,s=n.barPercentage):(i=o*r,s=1),{chunk:i/r,ratio:s,start:t.pixels[e]-i/2}}function Oz(e,t,n,r){const o=t.pixels,i=o[e];let s=e>0?o[e-1]:null,a=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;s===null&&(s=i-(a===null?t.end-t.start:a-i)),a===null&&(a=i+i-s);const u=i-(i-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:u}}function Dz(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),s=Math.min(o,i),a=Math.max(o,i);let l=s,u=a;Math.abs(s)>Math.abs(a)&&(l=a,u=s),t[n.axis]=u,t._custom={barStart:l,barEnd:u,start:o,end:i,min:s,max:a}}function L$(e,t,n,r){return Nt(e)?Dz(e,t,n,r):t[n.axis]=n.parse(e,r),t}function aS(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let u,d,h,p;for(u=n,d=n+r;u<d;++u)p=t[u],h={},h[o.axis]=a||o.parse(s[u],u),l.push(L$(p,h,i,u));return l}function Pm(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Mz(e,t,n){return e!==0?vo(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Tz(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}function Az(e,t,n,r){let o=t.borderSkipped;const i={};if(!o){e.borderSkipped=i;return}if(o===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:u,bottom:d}=Tz(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=u:(n._bottom||0)===r?o=d:(i[lS(d,s,a,l)]=!0,o=u)),i[lS(o,s,a,l)]=!0,e.borderSkipped=i}function lS(e,t,n,r){return r?(e=Iz(e,t,n),e=cS(e,n,t)):e=cS(e,t,n),e}function Iz(e,t,n){return e===t?n:e===n?t:e}function cS(e,t,n){return e==="start"?t:e==="end"?n:e}function kz(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Bf extends Xr{parsePrimitiveData(t,n,r,o){return aS(t,n,r,o)}parseArrayData(t,n,r,o){return aS(t,n,r,o)}parseObjectData(t,n,r,o){const{iScale:i,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=i.axis==="x"?a:l,d=s.axis==="x"?a:l,h=[];let p,g,b,y;for(p=r,g=r+o;p<g;++p)y=n[p],b={},b[i.axis]=i.parse(Wi(y,u),p),h.push(L$(Wi(y,d),b,s,p));return h}updateRangeFromParsed(t,n,r,o){super.updateRangeFromParsed(t,n,r,o);const i=r._custom;i&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:o}=n,i=this.getParsed(t),s=i._custom,a=Pm(s)?"["+s.start+", "+s.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,o){const i=o==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),u=a.isHorizontal(),d=this._getRuler(),{sharedOptions:h,includeOptions:p}=this._getSharedOptions(n,o);for(let g=n;g<n+r;g++){const b=this.getParsed(g),y=i||st(b[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,d),_=(b._stacks||{})[a.axis],w={horizontal:u,base:y.base,enableBorderRadius:!_||Pm(b._custom)||s===_._top||s===_._bottom,x:u?y.head:x.center,y:u?x.center:y.head,height:u?x.size:Math.abs(y.size),width:u?Math.abs(y.size):x.size};p&&(w.options=h||this.resolveDataElementOptions(g,t[g].active?"active":o));const C=w.options||t[g].options;Az(w,C,_,s),kz(w,C,d.ratio),this.updateElement(t[g],g,w,o)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),i=r.options.stacked,s=[],a=l=>{const u=l.controller.getParsed(n),d=u&&u[l.vScale.axis];if(st(d)||isNaN(d))return!0};for(const l of o)if(!(n!==void 0&&a(l))&&((i===!1||s.indexOf(l.stack)===-1||i===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const o=this._getStacks(t,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,s;for(i=0,s=n.data.length;i<s;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=t.barThickness;return{min:a||$z(n),pixels:o,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:o},options:{base:i,minBarLength:s}}=this,a=i||0,l=this.getParsed(t),u=l._custom,d=Pm(u);let h=l[n.axis],p=0,g=r?this.applyStack(n,l,r):h,b,y;g!==h&&(p=g-h,g=h),d&&(h=u.barStart,g=u.barEnd-u.barStart,h!==0&&vo(h)!==vo(u.barEnd)&&(p=0),p+=h);const x=!st(i)&&!d?i:p;let _=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?b=n.getPixelForValue(p+g):b=_,y=b-_,Math.abs(y)<s){y=Mz(y,n,a)*s,h===a&&(_-=y/2);const w=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),R=Math.min(w,C),E=Math.max(w,C);_=Math.max(Math.min(_,E),R),b=_+y,r&&!d&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(b)-n.getValueForPixel(_))}if(_===n.getPixelForValue(a)){const w=vo(y)*n.getLineWidthForValue(a)/2;_+=w,y-=w}return{size:y,base:_,head:b,center:b+y/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=Ke(o.maxBarThickness,1/0);let a,l;if(n.grouped){const u=i?this._getStackCount(t):n.stackCount,d=o.barThickness==="flex"?Oz(t,n,o,u):Pz(t,n,o,u),h=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=d.start+d.chunk*h+d.chunk/2,l=Math.min(s,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&r[i].draw(this._ctx)}}Se(Bf,"id","bar"),Se(Bf,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Se(Bf,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Uf extends Xr{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,o){const i=super.parsePrimitiveData(t,n,r,o);for(let s=0;s<i.length;s++)i[s]._custom=this.resolveDataElementOptions(s+r).radius;return i}parseArrayData(t,n,r,o){const i=super.parseArrayData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=Ke(a[2],this.resolveDataElementOptions(s+r).radius)}return i}parseObjectData(t,n,r,o){const i=super.parseObjectData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=Ke(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y),u=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(u?", "+u:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(n,o),d=s.axis,h=a.axis;for(let p=n;p<n+r;p++){const g=t[p],b=!i&&this.getParsed(p),y={},x=y[d]=i?s.getPixelForDecimal(.5):s.getPixelForValue(b[d]),_=y[h]=i?a.getBasePixel():a.getPixelForValue(b[h]);y.skip=isNaN(x)||isNaN(_),u&&(y.options=l||this.resolveDataElementOptions(p,g.active?"active":o),i&&(y.options.radius=0)),this.updateElement(g,p,y,o)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return n!=="active"&&(o.radius=0),o.radius+=Ke(r&&r._custom,i),o}}Se(Uf,"id","bubble"),Se(Uf,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Se(Uf,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Nz(e,t,n){let r=1,o=1,i=0,s=0;if(t<Lt){const a=e,l=a+t,u=Math.cos(a),d=Math.sin(a),h=Math.cos(l),p=Math.sin(l),g=(C,R,E)=>au(C,a,l,!0)?1:Math.max(R,R*n,E,E*n),b=(C,R,E)=>au(C,a,l,!0)?-1:Math.min(R,R*n,E,E*n),y=g(0,u,h),x=g(Xt,d,p),_=b(Ft,u,h),w=b(Ft+Xt,d,p);r=(y-_)/2,o=(x-w)/2,i=-(y+_)/2,s=-(x+w)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class js extends Xr{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let i=l=>+r[l];if(ct(r[t])){const{key:l="value"}=this._parsing;i=u=>+Wi(r[u],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return Kr(this.options.rotation-90)}_getCircumference(){return Kr(this.options.circumference)}_getRotationExtents(){let t=Lt,n=-Lt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const o=this.chart.getDatasetMeta(r).controller,i=o._getRotation(),s=o._getCircumference();t=Math.min(t,i),n=Math.max(n,i+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,o=this._cachedMeta,i=o.data,s=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(XF(this.options.cutout,a),1),u=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:p,ratioY:g,offsetX:b,offsetY:y}=Nz(h,d,l),x=(r.width-s)/p,_=(r.height-s)/g,w=Math.max(Math.min(x,_)/2,0),C=d$(this.options.radius,w),R=Math.max(C*l,0),E=(C-R)/this._getVisibleDatasetWeightTotal();this.offsetX=b*C,this.offsetY=y*C,o.total=this.calculateTotal(),this.outerRadius=C-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*u,0),this.updateElements(i,0,i.length,t)}_circumference(t,n){const r=this.options,o=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*i/Lt)}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,a=s.chartArea,u=s.options.animation,d=(a.left+a.right)/2,h=(a.top+a.bottom)/2,p=i&&u.animateScale,g=p?0:this.innerRadius,b=p?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(n,o);let _=this._getRotation(),w;for(w=0;w<n;++w)_+=this._circumference(w,i);for(w=n;w<n+r;++w){const C=this._circumference(w,i),R=t[w],E={x:d+this.offsetX,y:h+this.offsetY,startAngle:_,endAngle:_+C,circumference:C,outerRadius:b,innerRadius:g};x&&(E.options=y||this.resolveDataElementOptions(w,R.active?"active":o)),_+=C,this.updateElement(R,w,E,o)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,o;for(o=0;o<n.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Lt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=qu(n._parsed[t],r.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let o,i,s,a,l;if(!t){for(o=0,i=r.data.datasets.length;o<i;++o)if(r.isDatasetVisible(o)){s=r.getDatasetMeta(o),t=s.data,a=s.controller;break}}if(!t)return 0;for(o=0,i=t.length;o<i;++o)l=a.resolveDataElementOptions(o),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,o=t.length;r<o;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Ke(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Se(js,"id","doughnut"),Se(js,"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"}),Se(js,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Se(js,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class qf extends Xr{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:o=[],_dataset:i}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=y$(n,o,s);this._drawStart=a,this._drawCount=l,x$(n)&&(a=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:u},t),this.updateElements(o,a,l,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,o),p=s.axis,g=a.axis,{spanGaps:b,segment:y}=this.options,x=$l(b)?b:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||i||o==="none",w=n+r,C=t.length;let R=n>0&&this.getParsed(n-1);for(let E=0;E<C;++E){const M=t[E],D=_?M:{};if(E<n||E>=w){D.skip=!0;continue}const A=this.getParsed(E),k=st(A[g]),L=D[p]=s.getPixelForValue(A[p],E),W=D[g]=i||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[g],E);D.skip=isNaN(L)||isNaN(W)||k,D.stop=E>0&&Math.abs(A[p]-R[p])>x,y&&(D.parsed=A,D.raw=u.data[E]),h&&(D.options=d||this.resolveDataElementOptions(E,M.active?"active":o)),_||this.updateElement(M,E,D,o),R=A}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return r;const i=o[0].size(this.resolveDataElementOptions(0)),s=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,i,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Se(qf,"id","line"),Se(qf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Se(qf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Uc extends Xr{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=qu(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return P$.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),s=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),a=(i-s)/t.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,l=s.options.animation,u=this._cachedMeta.rScale,d=u.xCenter,h=u.yCenter,p=u.getIndexAngle(0)-.5*Ft;let g=p,b;const y=360/this.countVisibleElements();for(b=0;b<n;++b)g+=this._computeAngle(b,o,y);for(b=n;b<n+r;b++){const x=t[b];let _=g,w=g+this._computeAngle(b,o,y),C=s.getDataVisibility(b)?u.getDistanceFromCenterForValue(this.getParsed(b).r):0;g=w,i&&(l.animateScale&&(C=0),l.animateRotate&&(_=w=p));const R={x:d,y:h,innerRadius:0,outerRadius:C,startAngle:_,endAngle:w,options:this.resolveDataElementOptions(b,x.active?"active":o)};this.updateElement(x,b,R,o)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?Kr(this.resolveDataElementOptions(t,n).angle||r):0}}Se(Uc,"id","polarArea"),Se(Uc,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Se(Uc,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class rb extends js{}Se(rb,"id","pie"),Se(rb,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Gf extends Xr{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,o){return P$.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta,r=n.dataset,o=n.data||[],i=n.iScale.getLabels();if(r.points=o,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:i.length===o.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(o,0,o.length,t)}updateElements(t,n,r,o){const i=this._cachedMeta.rScale,s=o==="reset";for(let a=n;a<n+r;a++){const l=t[a],u=this.resolveDataElementOptions(a,l.active?"active":o),d=i.getPointPositionForValue(a,this.getParsed(a).r),h=s?i.xCenter:d.x,p=s?i.yCenter:d.y,g={x:h,y:p,angle:d.angle,skip:isNaN(h)||isNaN(p),options:u};this.updateElement(l,a,g,o)}}}Se(Gf,"id","radar"),Se(Gf,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Se(Gf,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Yf extends Xr{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,o=this.chart._animationsDisabled;let{start:i,count:s}=y$(n,r,o);if(this._drawStart=i,this._drawCount=s,x$(n)&&(i=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const u=this.resolveDatasetElementOptions(t);u.segment=this.options.segment,this.updateElement(a,void 0,{animated:!o,options:u},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,i,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,d=this.resolveDataElementOptions(n,o),h=this.getSharedOptions(d),p=this.includeOptions(o,h),g=s.axis,b=a.axis,{spanGaps:y,segment:x}=this.options,_=$l(y)?y:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||i||o==="none";let C=n>0&&this.getParsed(n-1);for(let R=n;R<n+r;++R){const E=t[R],M=this.getParsed(R),D=w?E:{},A=st(M[b]),k=D[g]=s.getPixelForValue(M[g],R),L=D[b]=i||A?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[b],R);D.skip=isNaN(k)||isNaN(L)||A,D.stop=R>0&&Math.abs(M[g]-C[g])>_,x&&(D.parsed=M,D.raw=u.data[R]),p&&(D.options=h||this.resolveDataElementOptions(R,E.active?"active":o)),w||this.updateElement(E,R,D,o),C=M}this.updateSharedOptions(h,o,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,o=r.options&&r.options.borderWidth||0;if(!n.length)return o;const i=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,i,s)/2}}Se(Yf,"id","scatter"),Se(Yf,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Se(Yf,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Lz=Object.freeze({__proto__:null,BarController:Bf,BubbleController:Uf,DoughnutController:js,LineController:qf,PieController:rb,PolarAreaController:Uc,RadarController:Gf,ScatterController:Yf});function Ps(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class q0{constructor(t){Se(this,"options");this.options=t||{}}static override(t){Object.assign(q0.prototype,t)}init(){}formats(){return Ps()}parse(){return Ps()}format(){return Ps()}add(){return Ps()}diff(){return Ps()}startOf(){return Ps()}endOf(){return Ps()}}var Fz={_date:q0};function zz(e,t,n,r){const{controller:o,data:i,_sorted:s}=e,a=o._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&i.length){const l=a._reversePixels?l8:Zo;if(r){if(o._sharedOptions){const u=i[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const h=l(i,t,n-d),p=l(i,t,n+d);return{lo:h.lo,hi:p.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function Gu(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=i.length;a<l;++a){const{index:u,data:d}=i[a],{lo:h,hi:p}=zz(i[a],t,s,o);for(let g=h;g<=p;++g){const b=d[g];b.skip||r(b,u,g)}}}function jz(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,o){const i=t?Math.abs(r.x-o.x):0,s=n?Math.abs(r.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(s,2))}}function Om(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||Gu(e,n,t,function(a,l,u){!o&&!Jo(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:u})},!0),i}function Vz(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:u,endAngle:d}=s.getProps(["startAngle","endAngle"],r),{angle:h}=p$(s,{x:t.x,y:t.y});au(h,u,d)&&o.push({element:s,datasetIndex:a,index:l})}return Gu(e,n,t,i),o}function Hz(e,t,n,r,o,i){let s=[];const a=jz(n);let l=Number.POSITIVE_INFINITY;function u(d,h,p){const g=d.inRange(t.x,t.y,o);if(r&&!g)return;const b=d.getCenterPoint(o);if(!(!!i||e.isPointInArea(b))&&!g)return;const x=a(t,b);x<l?(s=[{element:d,datasetIndex:h,index:p}],l=x):x===l&&s.push({element:d,datasetIndex:h,index:p})}return Gu(e,n,t,u),s}function Dm(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?Vz(e,t,n,o):Hz(e,t,n,r,o,i)}function uS(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Gu(e,n,t,(l,u,d)=>{l[s](t[n],o)&&(i.push({element:l,datasetIndex:u,index:d}),a=a||l.inRange(t.x,t.y,o))}),r&&!a?[]:i}var Wz={evaluateInteractionItems:Gu,modes:{index(e,t,n,r){const o=Ts(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Om(e,o,i,r,s):Dm(e,o,i,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const d=a[0].index,h=u.data[d];h&&!h.skip&&l.push({element:h,datasetIndex:u.index,index:d})}),l):[]},dataset(e,t,n,r){const o=Ts(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Om(e,o,i,r,s):Dm(e,o,i,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,u=e.getDatasetMeta(l).data;a=[];for(let d=0;d<u.length;++d)a.push({element:u[d],datasetIndex:l,index:d})}return a},point(e,t,n,r){const o=Ts(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Om(e,o,i,r,s)},nearest(e,t,n,r){const o=Ts(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Dm(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=Ts(t,e);return uS(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=Ts(t,e);return uS(e,o,"y",n.intersect,r)}}};const F$=["left","top","right","bottom"];function wc(e,t){return e.filter(n=>n.pos===t)}function dS(e,t){return e.filter(n=>F$.indexOf(n.pos)===-1&&n.box.axis===t)}function _c(e,t){return e.sort((n,r)=>{const o=t?r:n,i=t?n:r;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function Bz(e){const t=[];let n,r,o,i,s,a;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],{position:i,options:{stack:s,stackWeight:a=1}}=o,t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:s&&i+s,stackWeight:a});return t}function Uz(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!F$.includes(o))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=i}return t}function qz(e,t){const n=Uz(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,s,a;for(i=0,s=e.length;i<s;++i){a=e[i];const{fullSize:l}=a.box,u=n[a.stack],d=u&&a.stackWeight/u.weight;a.horizontal?(a.width=d?d*r:l&&t.availableWidth,a.height=o):(a.width=r,a.height=d?d*o:l&&t.availableHeight)}return n}function Gz(e){const t=Bz(e),n=_c(t.filter(u=>u.box.fullSize),!0),r=_c(wc(t,"left"),!0),o=_c(wc(t,"right")),i=_c(wc(t,"top"),!0),s=_c(wc(t,"bottom")),a=dS(t,"x"),l=dS(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:wc(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function fS(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function z$(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Yz(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!ct(o)){n.size&&(e[o]-=n.size);const h=r[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?i.height:i.width),n.size=h.size/h.count,e[o]+=n.size}i.getPadding&&z$(s,i.getPadding());const a=Math.max(0,t.outerWidth-fS(s,e,"left","right")),l=Math.max(0,t.outerHeight-fS(s,e,"top","bottom")),u=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:u,other:d}:{same:d,other:u}}function Kz(e){const t=e.maxPadding;function n(r){const o=Math.max(t[r]-e[r],0);return e[r]+=o,o}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Xz(e,t){const n=t.maxPadding;function r(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(s=>{i[s]=Math.max(t[s],n[s])}),i}return r(e?["left","right"]:["top","bottom"])}function kc(e,t,n,r){const o=[];let i,s,a,l,u,d;for(i=0,s=e.length,u=0;i<s;++i){a=e[i],l=a.box,l.update(a.width||t.w,a.height||t.h,Xz(a.horizontal,t));const{same:h,other:p}=Yz(t,n,a,r);u|=h&&o.length,d=d||p,l.fullSize||o.push(a)}return u&&kc(o,t,n,r)||d}function df(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function hS(e,t,n,r){const o=n.padding;let{x:i,y:s}=t;for(const a of e){const l=a.box,u=r[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/u.weight||1;if(a.horizontal){const h=t.w*d,p=u.size||l.height;su(u.start)&&(s=u.start),l.fullSize?df(l,o.left,s,n.outerWidth-o.right-o.left,p):df(l,t.left+u.placed,s,h,p),u.start=s,u.placed+=h,s=l.bottom}else{const h=t.h*d,p=u.size||l.width;su(u.start)&&(i=u.start),l.fullSize?df(l,i,o.top,p,n.outerHeight-o.bottom-o.top):df(l,i,t.top+u.placed,p,h),u.start=i,u.placed+=h,i=l.right}}t.x=i,t.y=s}var $n={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const o=yn(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=Gz(e.boxes),l=a.vertical,u=a.horizontal;_t(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const d=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/d,hBoxMaxHeight:s/2}),p=Object.assign({},o);z$(p,yn(r));const g=Object.assign({maxPadding:p,w:i,h:s,x:o.left,y:o.top},o),b=qz(l.concat(u),h);kc(a.fullSize,g,h,b),kc(l,g,h,b),kc(u,g,h,b)&&kc(l,g,h,b),Kz(g),hS(a.leftAndTop,g,h,b),g.x+=g.w,g.y+=g.h,hS(a.rightAndBottom,g,h,b),e.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},_t(a.chartArea,y=>{const x=y.box;Object.assign(x,e.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class j${acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,o){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,o?Math.floor(n/o):r)}}isAttached(t){return!0}updateConfig(t){}}class Qz extends j${acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Kf="$chartjs",Zz={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},pS=e=>e===null||e==="";function Jz(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Kf]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",pS(o)){const i=X_(e,"width");i!==void 0&&(e.width=i)}if(pS(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=X_(e,"height");i!==void 0&&(e.height=i)}return e}const V$=tz?{passive:!0}:!1;function ej(e,t,n){e.addEventListener(t,n,V$)}function tj(e,t,n){e.canvas.removeEventListener(t,n,V$)}function nj(e,t){const n=Zz[e.type]||e.type,{x:r,y:o}=Ts(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function yh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function rj(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||yh(a.addedNodes,r),s=s&&!yh(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function oj(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||yh(a.removedNodes,r),s=s&&!yh(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const cu=new Map;let gS=0;function H$(){const e=window.devicePixelRatio;e!==gS&&(gS=e,cu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function ij(e,t){cu.size||window.addEventListener("resize",H$),cu.set(e,t)}function sj(e){cu.delete(e),cu.size||window.removeEventListener("resize",H$)}function aj(e,t,n){const r=e.canvas,o=r&&U0(r);if(!o)return;const i=b$((a,l)=>{const u=o.clientWidth;n(a,l),u<o.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,d=l.contentRect.height;u===0&&d===0||i(u,d)});return s.observe(o),ij(e,i),s}function Mm(e,t,n){n&&n.disconnect(),t==="resize"&&sj(e)}function lj(e,t,n){const r=e.canvas,o=b$(i=>{e.ctx!==null&&n(nj(i,e))},e);return ej(r,t,o),o}class cj extends j${acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Jz(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Kf])return!1;const r=n[Kf].initial;["height","width"].forEach(i=>{const s=r[i];st(s)?n.removeAttribute(i):n.setAttribute(i,s)});const o=r.style||{};return Object.keys(o).forEach(i=>{n.style[i]=o[i]}),n.width=n.width,delete n[Kf],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:rj,detach:oj,resize:aj}[n]||lj;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:Mm,detach:Mm,resize:Mm}[n]||tj)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return ez(t,n,r,o)}isAttached(t){const n=U0(t);return!!(n&&n.isConnected)}}function uj(e){return!B0()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Qz:cj}var Hf;let si=(Hf=class{constructor(){Se(this,"x");Se(this,"y");Se(this,"active",!1);Se(this,"options");Se(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return $l(this.x)&&$l(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const o={};return t.forEach(i=>{o[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),o}},Se(Hf,"defaults",{}),Se(Hf,"defaultRoutes"),Hf);function dj(e,t){const n=e.options.ticks,r=fj(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?pj(t):[],s=i.length,a=i[0],l=i[s-1],u=[];if(s>o)return gj(t,u,i,s/o),u;const d=hj(i,t,o);if(s>0){let h,p;const g=s>1?Math.round((l-a)/(s-1)):null;for(ff(t,u,d,st(g)?0:a-g,a),h=0,p=s-1;h<p;h++)ff(t,u,d,i[h],i[h+1]);return ff(t,u,d,l,st(g)?t.length:l+g),u}return ff(t,u,d),u}function fj(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}function hj(e,t,n){const r=mj(e),o=t.length/n;if(!r)return Math.max(o,1);const i=o8(r);for(let s=0,a=i.length-1;s<a;s++){const l=i[s];if(l>o)return l}return Math.max(o,1)}function pj(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function gj(e,t,n,r){let o=0,i=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===i&&(t.push(e[s]),o++,i=n[o*r])}function ff(e,t,n,r,o){const i=Ke(r,0),s=Math.min(Ke(o,e.length),e.length);let a=0,l,u,d;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),d=i;d<0;)a++,d=Math.round(i+a*n);for(u=Math.max(i,0);u<s;u++)u===d&&(t.push(e[u]),a++,d=Math.round(i+a*n))}function mj(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const vj=e=>e==="left"?"right":e==="right"?"left":e,mS=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,vS=(e,t)=>Math.min(t||e,e);function bS(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function bj(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(o),u;if(!(n&&(r===1?u=Math.max(l-i,s-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(o-1))/2,l+=o<t?u:-u,l<i-a||l>s+a)))return l}function yj(e,t){_t(e,n=>{const r=n.gc,o=r.length/2;let i;if(o>t){for(i=0;i<o;++i)delete n.data[r[i]];r.splice(0,o)}})}function Sc(e){return e.drawTicks?e.tickLength:0}function yS(e,t){if(!e.display)return 0;const n=Qt(e.font,t),r=yn(e.padding);return(Nt(e.text)?e.text.length:1)*n.lineHeight+r.height}function xj(e,t){return Qi(e,{scale:t,type:"scale"})}function wj(e,t,n){return Qi(e,{tick:n,index:t,type:"tick"})}function _j(e,t,n){let r=F0(e);return(n&&t!=="right"||!n&&t==="right")&&(r=vj(r)),r}function Sj(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:u,scales:d}=l;let h=0,p,g,b;const y=s-o,x=a-i;if(e.isHorizontal()){if(g=Rn(r,i,a),ct(n)){const _=Object.keys(n)[0],w=n[_];b=d[_].getPixelForValue(w)+y-t}else n==="center"?b=(u.bottom+u.top)/2+y-t:b=mS(e,n,t);p=a-i}else{if(ct(n)){const _=Object.keys(n)[0],w=n[_];g=d[_].getPixelForValue(w)-x+t}else n==="center"?g=(u.left+u.right)/2-x+t:g=mS(e,n,t);b=Rn(r,s,o),h=n==="left"?-Xt:Xt}return{titleX:g,titleY:b,maxWidth:p,rotation:h}}class ma extends si{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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:o}=this;return t=or(t,Number.POSITIVE_INFINITY),n=or(n,Number.NEGATIVE_INFINITY),r=or(r,Number.POSITIVE_INFINITY),o=or(o,Number.NEGATIVE_INFINITY),{min:or(t,r),max:or(n,o),minDefined:qt(t),maxDefined:qt(n)}}getMinMax(t){let{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds(),s;if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,u=a.length;l<u;++l)s=a[l].controller.getMinMax(this,t),o||(n=Math.min(n,s.min)),i||(r=Math.max(r,s.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:or(n,or(r,n)),max:or(r,or(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const 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(){Et(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:o,grace:i,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=T8(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?bS(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=dj(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Et(this.options.afterUpdate,[this])}beforeSetDimensions(){Et(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(){Et(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Et(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Et(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,o,i;for(r=0,o=t.length;r<o;r++)i=t[r],i.label=Et(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){Et(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Et(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=vS(this.ticks.length,t.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let s=o,a,l,u;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const d=this._getLabelSizes(),h=d.widest.width,p=d.highest.height,g=un(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/r:g/(r-1),h+6>a&&(a=g/(r-(t.offset?.5:1)),l=this.maxHeight-Sc(t.grid)-n.padding-yS(t.title,this.chart.options.font),u=Math.sqrt(h*h+p*p),s=N0(Math.min(Math.asin(un((d.highest.height+6)/a,-1,1)),Math.asin(un(l/u,-1,1))-Math.asin(un(p/u,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){Et(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Et(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:o,grid:i}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=yS(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=Sc(i)+l):(t.height=this.maxHeight,t.width=Sc(i)+l),r.display&&this.ticks.length){const{first:u,last:d,widest:h,highest:p}=this._getLabelSizes(),g=r.padding*2,b=Kr(this.labelRotation),y=Math.cos(b),x=Math.sin(b);if(a){const _=r.mirror?0:x*h.width+y*p.height;t.height=Math.min(this.maxHeight,t.height+_+g)}else{const _=r.mirror?0:y*h.width+x*p.height;t.width=Math.min(this.maxWidth,t.width+_+g)}this._calculatePadding(u,d,x,y)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,o){const{ticks:{align:i,padding:s},position:a}=this.options,l=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,g=0;l?u?(p=o*t.width,g=r*n.height):(p=r*t.height,g=o*n.width):i==="start"?g=n.width:i==="end"?p=t.width:i!=="inner"&&(p=t.width/2,g=n.width/2),this.paddingLeft=Math.max((p-d+s)*this.width/(this.width-d),0),this.paddingRight=Math.max((g-h+s)*this.width/(this.width-h),0)}else{let d=n.height/2,h=t.height/2;i==="start"?(d=0,h=t.height):i==="end"&&(d=n.height,h=0),this.paddingTop=d+s,this.paddingBottom=h+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Et(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)st(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=bS(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:o,_longestTextCache:i}=this,s=[],a=[],l=Math.floor(n/vS(n,r));let u=0,d=0,h,p,g,b,y,x,_,w,C,R,E;for(h=0;h<n;h+=l){if(b=t[h].label,y=this._resolveTickFontOptions(h),o.font=x=y.string,_=i[x]=i[x]||{data:{},gc:[]},w=y.lineHeight,C=R=0,!st(b)&&!Nt(b))C=vh(o,_.data,_.gc,C,b),R=w;else if(Nt(b))for(p=0,g=b.length;p<g;++p)E=b[p],!st(E)&&!Nt(E)&&(C=vh(o,_.data,_.gc,C,E),R+=w);s.push(C),a.push(R),u=Math.max(C,u),d=Math.max(R,d)}yj(i,n);const M=s.indexOf(u),D=a.indexOf(d),A=k=>({width:s[k]||0,height:a[k]||0});return{first:A(0),last:A(n-1),widest:A(M),highest:A(D),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return a8(this._alignToPixels?$s(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=wj(this.getContext(),t,r))}return this.$context||(this.$context=xj(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Kr(this.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=this._getLabelSizes(),s=t.autoSkipPadding||0,a=i?i.widest.width+s:0,l=i?i.highest.height+s:0;return this.isHorizontal()?l*r>a*o?a/r:l/o:l*o<a*r?l/r:a/o}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:s,border:a}=o,l=i.offset,u=this.isHorizontal(),h=this.ticks.length+(l?1:0),p=Sc(i),g=[],b=a.setContext(this.getContext()),y=b.display?b.width:0,x=y/2,_=function(J){return $s(r,J,y)};let w,C,R,E,M,D,A,k,L,W,Y,ne;if(s==="top")w=_(this.bottom),D=this.bottom-p,k=w-x,W=_(t.top)+x,ne=t.bottom;else if(s==="bottom")w=_(this.top),W=t.top,ne=_(t.bottom)-x,D=w+x,k=this.top+p;else if(s==="left")w=_(this.right),M=this.right-p,A=w-x,L=_(t.left)+x,Y=t.right;else if(s==="right")w=_(this.left),L=t.left,Y=_(t.right)-x,M=w+x,A=this.left+p;else if(n==="x"){if(s==="center")w=_((t.top+t.bottom)/2+.5);else if(ct(s)){const J=Object.keys(s)[0],q=s[J];w=_(this.chart.scales[J].getPixelForValue(q))}W=t.top,ne=t.bottom,D=w+x,k=D+p}else if(n==="y"){if(s==="center")w=_((t.left+t.right)/2);else if(ct(s)){const J=Object.keys(s)[0],q=s[J];w=_(this.chart.scales[J].getPixelForValue(q))}M=w-x,A=M-p,L=t.left,Y=t.right}const Q=Ke(o.ticks.maxTicksLimit,h),F=Math.max(1,Math.ceil(h/Q));for(C=0;C<h;C+=F){const J=this.getContext(C),q=i.setContext(J),X=a.setContext(J),ae=q.lineWidth,j=q.color,V=X.dash||[],oe=X.dashOffset,ce=q.tickWidth,ue=q.tickColor,ge=q.tickBorderDash||[],ve=q.tickBorderDashOffset;R=bj(this,C,l),R!==void 0&&(E=$s(r,R,ae),u?M=A=L=Y=E:D=k=W=ne=E,g.push({tx1:M,ty1:D,tx2:A,ty2:k,x1:L,y1:W,x2:Y,y2:ne,width:ae,color:j,borderDash:V,borderDashOffset:oe,tickWidth:ce,tickColor:ue,tickBorderDash:ge,tickBorderDashOffset:ve}))}return this._ticksLength=h,this._borderValue=w,g}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:d,mirror:h}=i,p=Sc(r.grid),g=p+d,b=h?-d:g,y=-Kr(this.labelRotation),x=[];let _,w,C,R,E,M,D,A,k,L,W,Y,ne="middle";if(o==="top")M=this.bottom-b,D=this._getXAxisLabelAlignment();else if(o==="bottom")M=this.top+b,D=this._getXAxisLabelAlignment();else if(o==="left"){const F=this._getYAxisLabelAlignment(p);D=F.textAlign,E=F.x}else if(o==="right"){const F=this._getYAxisLabelAlignment(p);D=F.textAlign,E=F.x}else if(n==="x"){if(o==="center")M=(t.top+t.bottom)/2+g;else if(ct(o)){const F=Object.keys(o)[0],J=o[F];M=this.chart.scales[F].getPixelForValue(J)+g}D=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(t.left+t.right)/2-g;else if(ct(o)){const F=Object.keys(o)[0],J=o[F];E=this.chart.scales[F].getPixelForValue(J)}D=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?ne="top":l==="end"&&(ne="bottom"));const Q=this._getLabelSizes();for(_=0,w=a.length;_<w;++_){C=a[_],R=C.label;const F=i.setContext(this.getContext(_));A=this.getPixelForTick(_)+i.labelOffset,k=this._resolveTickFontOptions(_),L=k.lineHeight,W=Nt(R)?R.length:1;const J=W/2,q=F.color,X=F.textStrokeColor,ae=F.textStrokeWidth;let j=D;s?(E=A,D==="inner"&&(_===w-1?j=this.options.reverse?"left":"right":_===0?j=this.options.reverse?"right":"left":j="center"),o==="top"?u==="near"||y!==0?Y=-W*L+L/2:u==="center"?Y=-Q.highest.height/2-J*L+L:Y=-Q.highest.height+L/2:u==="near"||y!==0?Y=L/2:u==="center"?Y=Q.highest.height/2-J*L:Y=Q.highest.height-W*L,h&&(Y*=-1),y!==0&&!F.showLabelBackdrop&&(E+=L/2*Math.sin(y))):(M=A,Y=(1-W)*L/2);let V;if(F.showLabelBackdrop){const oe=yn(F.backdropPadding),ce=Q.heights[_],ue=Q.widths[_];let ge=Y-oe.top,ve=0-oe.left;switch(ne){case"middle":ge-=ce/2;break;case"bottom":ge-=ce;break}switch(D){case"center":ve-=ue/2;break;case"right":ve-=ue;break;case"inner":_===w-1?ve-=ue:_>0&&(ve-=ue/2);break}V={left:ve,top:ge,width:ue+oe.width,height:ce+oe.height,color:F.backdropColor}}x.push({label:R,font:k,textOffset:Y,options:{rotation:y,color:q,strokeColor:X,strokeWidth:ae,textAlign:j,textBaseline:ne,translation:[E,M],backdrop:V}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Kr(this.labelRotation))return t==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,s=this._getLabelSizes(),a=t+i,l=s.widest.width;let u,d;return n==="left"?o?(d=this.right+i,r==="near"?u="left":r==="center"?(u="center",d+=l/2):(u="right",d+=l)):(d=this.right-a,r==="near"?u="right":r==="center"?(u="center",d-=l/2):(u="left",d=this.left)):n==="right"?o?(d=this.left+i,r==="near"?u="right":r==="center"?(u="center",d-=l/2):(u="left",d-=l)):(d=this.left+a,r==="near"?u="left":r==="center"?(u="center",d+=l/2):(u="right",d=this.right)):u="right",{textAlign:u,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:o,width:i,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,o,i,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,s;const a=(l,u,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(i=0,s=o.length;i<s;++i){const l=o[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:o}}=this,i=r.setContext(this.getContext()),s=r.display?i.width:0;if(!s)return;const a=o.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,d,h,p;this.isHorizontal()?(u=$s(t,this.left,s)-s/2,d=$s(t,this.right,a)+a/2,h=p=l):(h=$s(t,this.top,s)-s/2,p=$s(t,this.bottom,a)+a/2,u=d=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(u,h),n.lineTo(d,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&up(r,o);const i=this.getLabelItems(t);for(const s of i){const a=s.options,l=s.font,u=s.label,d=s.textOffset;la(r,u,0,d,l,a)}o&&dp(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=Qt(r.font),s=yn(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||ct(n)?(l+=s.bottom,Nt(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:u,titleY:d,maxWidth:h,rotation:p}=Sj(this,l,n,a);la(t,r.text,0,0,i,{color:r.color,maxWidth:h,rotation:p,textAlign:_j(a,n,o),textBaseline:"middle",translation:[u,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Ke(t.grid&&t.grid.z,-1),o=Ke(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ma.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];let i,s;for(i=0,s=n.length;i<s;++i){const a=n[i];a[r]===this.id&&(!t||a.type===t)&&o.push(a)}return o}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Qt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class hf{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;Rj(n)&&(r=this.register(n));const o=this.items,i=t.id,s=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in o||(o[i]=t,Cj(t,s,r),this.override&&Wt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,o=this.scope;r in n&&delete n[r],o&&r in Wt[o]&&(delete Wt[o][r],this.override&&delete aa[r])}}function Cj(e,t,n){const r=xo(Object.create(null),[n?Wt.get(n):{},Wt.get(t),e.defaults]);Wt.set(t,r),e.defaultRoutes&&Ej(t,e.defaultRoutes),e.descriptors&&Wt.describe(t,e.descriptors)}function Ej(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");Wt.route(i,o,l,a)})}function Rj(e){return"id"in e&&"defaults"in e}class $j{constructor(){this.controllers=new hf(Xr,"datasets",!0),this.elements=new hf(si,"elements"),this.plugins=new hf(Object,"plugins"),this.scales=new hf(ma,"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,n,r){[...n].forEach(o=>{const i=r||this._getRegistryForType(o);r||i.isForType(o)||i===this.plugins&&o.id?this._exec(t,i,o):_t(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=k0(t);Et(r["before"+o],[],r),n[t](r),Et(r["after"+o],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const o=n.get(t);if(o===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return o}}var co=new $j;class Pj{constructor(){this._init=[]}notify(t,n,r,o){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=o?this._descriptors(t).filter(o):this._descriptors(t),s=this._notify(i,t,n,r);return n==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,o){o=o||{};for(const i of t){const s=i.plugin,a=s[r],l=[n,o,i.options];if(Et(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){st(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,o=Ke(r.options&&r.options.plugins,{}),i=Oj(r);return o===!1&&!n?[]:Mj(t,i,o,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,o=(i,s)=>i.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(o(n,r),t,"stop"),this._notify(o(r,n),t,"start")}}function Oj(e){const t={},n=[],r=Object.keys(co.plugins.items);for(let i=0;i<r.length;i++)n.push(co.getPlugin(r[i]));const o=e.plugins||[];for(let i=0;i<o.length;i++){const s=o[i];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function Dj(e,t){return!t&&e===!1?null:e===!0?{}:e}function Mj(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,u=Dj(r[l],o);u!==null&&i.push({plugin:a,options:Tj(e.config,{plugin:a,local:n[l]},u,s)})}return i}function Tj(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),s=e.getOptionScopes(r,i);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ob(e,t){const n=Wt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Aj(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Ij(e,t){return e===t?"_index_":"_value_"}function xS(e){if(e==="x"||e==="y"||e==="r")return e}function kj(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function ib(e,...t){if(xS(e))return e;for(const n of t){const r=n.axis||kj(n.position)||e.length>1&&xS(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function wS(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Nj(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return wS(e,"x",n[0])||wS(e,"y",n[0])}return{}}function Lj(e,t){const n=aa[e.type]||{scales:{}},r=t.scales||{},o=ob(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!ct(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=ib(s,a,Nj(s,e),Wt.scales[a.type]),u=Ij(l,o),d=n.scales||{};i[s]=Vc(Object.create(null),[{axis:l},a,d[l],d[u]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||ob(a,t),d=(aa[a]||{}).scales||{};Object.keys(d).forEach(h=>{const p=Aj(h,l),g=s[p+"AxisID"]||p;i[g]=i[g]||Object.create(null),Vc(i[g],[{axis:p},r[g],d[h]])})}),Object.keys(i).forEach(s=>{const a=i[s];Vc(a,[Wt.scales[a.type],Wt.scale])}),i}function W$(e){const t=e.options||(e.options={});t.plugins=Ke(t.plugins,{}),t.scales=Lj(e,t)}function B$(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Fj(e){return e=e||{},e.data=B$(e.data),W$(e),e}const _S=new Map,U$=new Set;function pf(e,t){let n=_S.get(e);return n||(n=t(),_S.set(e,n),U$.add(n)),n}const Cc=(e,t,n)=>{const r=Wi(t,n);r!==void 0&&e.add(r)};class zj{constructor(t){this._config=Fj(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=B$(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(),W$(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return pf(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return pf(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return pf(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return pf(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let o=r.get(t);return(!o||n)&&(o=new Map,r.set(t,o)),o}getOptionScopes(t,n,r){const{options:o,type:i}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(h=>Cc(l,t,h))),d.forEach(h=>Cc(l,o,h)),d.forEach(h=>Cc(l,aa[i]||{},h)),d.forEach(h=>Cc(l,Wt,h)),d.forEach(h=>Cc(l,tb,h))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),U$.has(n)&&s.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,aa[n]||{},Wt.datasets[n]||{},{type:n},Wt,tb]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=SS(this._resolverCache,t,o);let l=s;if(Vj(s,n)){i.$shared=!1,r=Bi(r)?r():r;const u=this.createResolver(t,r,a);l=Pl(s,r,u)}for(const u of n)i[u]=l[u];return i}createResolver(t,n,r=[""],o){const{resolver:i}=SS(this._resolverCache,t,r);return ct(n)?Pl(i,n,void 0,o):i}}function SS(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);return i||(i={resolver:V0(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const jj=e=>ct(e)&&Object.getOwnPropertyNames(e).some(t=>Bi(e[t]));function Vj(e,t){const{isScriptable:n,isIndexable:r}=C$(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(Bi(a)||jj(a))||s&&Nt(a))return!0}return!1}var Hj="4.4.1";const Wj=["top","bottom","left","right","chartArea"];function CS(e,t){return e==="top"||e==="bottom"||Wj.indexOf(e)===-1&&t==="x"}function ES(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function RS(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Et(n&&n.onComplete,[e],t)}function Bj(e){const t=e.chart,n=t.options.animation;Et(n&&n.onProgress,[e],t)}function q$(e){return B0()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Xf={},$S=e=>{const t=q$(e);return Object.values(Xf).filter(n=>n.canvas===t).pop()};function Uj(e,t,n){const r=Object.keys(e);for(const o of r){const i=+o;if(i>=t){const s=e[o];delete e[o],(n>0||i>t)&&(e[i+n]=s)}}}function qj(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function gf(e,t,n){return e.options.clip?e[n]:t[n]}function Gj(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:gf(n,t,"left"),right:gf(n,t,"right"),top:gf(r,t,"top"),bottom:gf(r,t,"bottom")}:t}class Ir{static register(...t){co.add(...t),PS()}static unregister(...t){co.remove(...t),PS()}constructor(t,n){const r=this.config=new zj(n),o=q$(t),i=$S(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||uj(o)),this.platform.updateConfig(r);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,u=l&&l.height,d=l&&l.width;if(this.id=KF(),this.ctx=a,this.canvas=l,this.width=d,this.height=u,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Pj,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=d8(h=>this.update(h),s.resizeDelay||0),this._dataChanges=[],Xf[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}qo.listen(this,"complete",RS),qo.listen(this,"progress",Bj),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return st(t)?n&&i?i:o?r/o: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 co}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():K_(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return q_(this.canvas,this.ctx),this}stop(){return qo.stop(this),this}resize(t,n){qo.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,o=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(o,t,n,i),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,K_(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Et(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};_t(n,(r,o)=>{r.id=o})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,o=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let i=[];n&&(i=i.concat(Object.keys(n).map(s=>{const a=n[s],l=ib(s,a),u=l==="r",d=l==="x";return{options:a,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),_t(i,s=>{const a=s.options,l=a.id,u=ib(l,a),d=Ke(a.type,s.dtype);(a.position===void 0||CS(a.position,u)!==CS(s.dposition))&&(a.position=s.dposition),o[l]=!0;let h=null;if(l in r&&r[l].type===d)h=r[l];else{const p=co.getScale(d);h=new p({id:l,type:d,ctx:this.ctx,chart:this}),r[h.id]=h}h.init(a,t)}),_t(o,(s,a)=>{s||delete r[a]}),_t(r,s=>{$n.configure(this,s,s.options),$n.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((o,i)=>o.index-i.index),r>n){for(let o=n;o<r;++o)this._destroyDatasetMeta(o);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(ES("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,o)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,o;for(this._removeUnreferencedMetasets(),r=0,o=n.length;r<o;r++){const i=n[r];let s=this.getDatasetMeta(r);const a=i.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=i.indexAxis||ob(a,this.options),s.order=i.order||0,s.index=r,s.label=""+i.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=co.getController(a),{datasetElementType:u,dataElementType:d}=Wt.datasets[a];Object.assign(l,{dataElementType:co.getElement(d),datasetElementType:u&&co.getElement(u)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){_t(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let u=0,d=this.data.datasets.length;u<d;u++){const{controller:h}=this.getDatasetMeta(u),p=!o&&i.indexOf(h)===-1;h.buildOrUpdateElements(p),s=Math.max(+h.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||_t(i,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ES("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){_t(this.scales,t=>{$n.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!L_(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:o,count:i}of n){const s=r==="_removeElements"?-i:i;Uj(t,o,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(t.filter(s=>s[0]===i).map((s,a)=>a+","+s.splice(1).join(","))),o=r(0);for(let i=1;i<n;i++)if(!L_(o,r(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;$n.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],_t(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Bi(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),o={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(r.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(qo.has(this)?this.attached&&!qo.running(this)&&qo.start(this):(this.draw(),RS({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resize(r,o),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let o,i;for(o=0,i=n.length;o<i;++o){const s=n[o];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,o=!r.disabled,i=Gj(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&up(n,{left:r.left===!1?0:i.left-r.left,right:r.right===!1?this.width:i.right+r.right,top:r.top===!1?0:i.top-r.top,bottom:r.bottom===!1?this.height:i.bottom+r.bottom}),t.controller.draw(),o&&dp(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Jo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=Wz.modes[n];return typeof i=="function"?i(this,t,r,o):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let o=r.filter(i=>i&&i._dataset===n).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(o)),o}getContext(){return this.$context||(this.$context=Qi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const o=r?"show":"hide",i=this.getDatasetMeta(t),s=i.controller._resolveAnimations(void 0,o);su(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(i,{visible:r}),this.update(a=>a.datasetIndex===t?o:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),qo.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),q_(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Xf[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,n=this.platform,r=(i,s)=>{n.addEventListener(this,i,s),t[i]=s},o=(i,s,a)=>{i.offsetX=s,i.offsetY=a,this._eventHandler(i)};_t(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),t[l]=u},o=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},i=(l,u)=>{this.canvas&&this.resize(l,u)};let s;const a=()=>{o("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",s)};s=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){_t(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},_t(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const o=r?"set":"remove";let i,s,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const u=s&&this.getDatasetMeta(s.datasetIndex).controller;u&&u[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:i,index:s})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[s],index:s}});!ph(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const o=this.options.hover,i=(l,u)=>l.filter(d=>!u.some(h=>d.datasetIndex===h.datasetIndex&&d.index===h.index)),s=i(n,t),a=r?t:i(t,n);s.length&&this.updateHoverStyle(s,o.mode,!1),a.length&&o.mode&&this.updateHoverStyle(a,o.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},o=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:o=[],options:i}=this,s=n,a=this._getActiveElements(t,o,r,s),l=t8(t),u=qj(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Et(i.onHover,[t,a,this],this),l&&Et(i.onClick,[t,a,this],this));const d=!ph(a,o);return(d||n)&&(this._active=a,this._updateHoverStyles(a,o,n)),this._lastEvent=u,d}_getActiveElements(t,n,r,o){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}}Se(Ir,"defaults",Wt),Se(Ir,"instances",Xf),Se(Ir,"overrides",aa),Se(Ir,"registry",co),Se(Ir,"version",Hj),Se(Ir,"getChart",$S);function PS(){return _t(Ir.instances,e=>e._plugins.invalidate())}function Yj(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:s,outerRadius:a,innerRadius:l}=t;let u=o/a;e.beginPath(),e.arc(i,s,a,r-u,n+u),l>o?(u=o/l,e.arc(i,s,l,n+u,r-u,!0)):e.arc(i,s,o,n+Xt,r-Xt),e.closePath(),e.clip()}function Kj(e){return j0(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Xj(e,t,n,r){const o=Kj(e.options.borderRadius),i=(n-t)/2,s=Math.min(i,r*t/2),a=l=>{const u=(n-Math.min(i,l))*r/2;return un(l,0,Math.min(i,u))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:un(o.innerStart,0,s),innerEnd:un(o.innerEnd,0,s)}}function Ha(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function xh(e,t,n,r,o,i){const{x:s,y:a,startAngle:l,pixelMargin:u,innerRadius:d}=t,h=Math.max(t.outerRadius+r+n-u,0),p=d>0?d+r+n+u:0;let g=0;const b=o-l;if(r){const F=d>0?d-r:0,J=h>0?h-r:0,q=(F+J)/2,X=q!==0?b*q/(q+r):b;g=(b-X)/2}const y=Math.max(.001,b*h-n/Ft)/h,x=(b-y)/2,_=l+x+g,w=o-x-g,{outerStart:C,outerEnd:R,innerStart:E,innerEnd:M}=Xj(t,p,h,w-_),D=h-C,A=h-R,k=_+C/D,L=w-R/A,W=p+E,Y=p+M,ne=_+E/W,Q=w-M/Y;if(e.beginPath(),i){const F=(k+L)/2;if(e.arc(s,a,h,k,F),e.arc(s,a,h,F,L),R>0){const ae=Ha(A,L,s,a);e.arc(ae.x,ae.y,R,L,w+Xt)}const J=Ha(Y,w,s,a);if(e.lineTo(J.x,J.y),M>0){const ae=Ha(Y,Q,s,a);e.arc(ae.x,ae.y,M,w+Xt,Q+Math.PI)}const q=(w-M/p+(_+E/p))/2;if(e.arc(s,a,p,w-M/p,q,!0),e.arc(s,a,p,q,_+E/p,!0),E>0){const ae=Ha(W,ne,s,a);e.arc(ae.x,ae.y,E,ne+Math.PI,_-Xt)}const X=Ha(D,_,s,a);if(e.lineTo(X.x,X.y),C>0){const ae=Ha(D,k,s,a);e.arc(ae.x,ae.y,C,_-Xt,k)}}else{e.moveTo(s,a);const F=Math.cos(k)*h+s,J=Math.sin(k)*h+a;e.lineTo(F,J);const q=Math.cos(L)*h+s,X=Math.sin(L)*h+a;e.lineTo(q,X)}e.closePath()}function Qj(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){xh(e,t,n,r,l,o);for(let u=0;u<i;++u)e.fill();isNaN(a)||(l=s+(a%Lt||Lt))}return xh(e,t,n,r,l,o),e.fill(),l}function Zj(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:u,borderJoinStyle:d,borderDash:h,borderDashOffset:p}=l,g=l.borderAlign==="inner";if(!u)return;e.setLineDash(h||[]),e.lineDashOffset=p,g?(e.lineWidth=u*2,e.lineJoin=d||"round"):(e.lineWidth=u,e.lineJoin=d||"bevel");let b=t.endAngle;if(i){xh(e,t,n,r,b,o);for(let y=0;y<i;++y)e.stroke();isNaN(a)||(b=s+(a%Lt||Lt))}g&&Yj(e,t,b),i||(xh(e,t,n,r,b,o),e.stroke())}class tl extends si{constructor(n){super();Se(this,"circumference");Se(this,"endAngle");Se(this,"fullCircles");Se(this,"innerRadius");Se(this,"outerRadius");Se(this,"pixelMargin");Se(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.getProps(["x","y"],o),{angle:s,distance:a}=p$(i,{x:n,y:r}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:h,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),g=(this.options.spacing+this.options.borderWidth)/2,y=Ke(p,u-l)>=Lt||au(s,l,u),x=Qo(a,d+g,h+g);return y&&x}getCenterPoint(n){const{x:r,y:o,startAngle:i,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:u,spacing:d}=this.options,h=(i+s)/2,p=(a+l+d+u)/2;return{x:r+Math.cos(h)*p,y:o+Math.sin(h)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:o}=this,i=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=o>Lt?Math.floor(o/Lt):0,o===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const u=1-Math.sin(Math.min(Ft,o||0)),d=i*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Qj(n,this,d,s,a),Zj(n,this,d,s,a),n.restore()}}Se(tl,"id","arc"),Se(tl,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Se(tl,"defaultRoutes",{backgroundColor:"backgroundColor"}),Se(tl,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function G$(e,t,n=t){e.lineCap=Ke(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ke(n.borderDash,t.borderDash)),e.lineDashOffset=Ke(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ke(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ke(n.borderWidth,t.borderWidth),e.strokeStyle=Ke(n.borderColor,t.borderColor)}function Jj(e,t,n){e.lineTo(n.x,n.y)}function eV(e){return e.stepped?S8:e.tension||e.cubicInterpolationMode==="monotone"?C8:Jj}function Y$(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:s,end:a}=t,l=Math.max(o,s),u=Math.min(i,a),d=o<s&&i<s||o>a&&i>a;return{count:r,start:l,loop:t.loop,ilen:u<l&&!d?r+u-l:u-l}}function tV(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:u}=Y$(o,n,r),d=eV(i);let{move:h=!0,reverse:p}=r||{},g,b,y;for(g=0;g<=u;++g)b=o[(a+(p?u-g:g))%s],!b.skip&&(h?(e.moveTo(b.x,b.y),h=!1):d(e,y,b,p,i.stepped),y=b);return l&&(b=o[(a+(p?u:0))%s],d(e,y,b,p,i.stepped)),!!l}function nV(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=Y$(o,n,r),{move:l=!0,reverse:u}=r||{};let d=0,h=0,p,g,b,y,x,_;const w=R=>(s+(u?a-R:R))%i,C=()=>{y!==x&&(e.lineTo(d,x),e.lineTo(d,y),e.lineTo(d,_))};for(l&&(g=o[w(0)],e.moveTo(g.x,g.y)),p=0;p<=a;++p){if(g=o[w(p)],g.skip)continue;const R=g.x,E=g.y,M=R|0;M===b?(E<y?y=E:E>x&&(x=E),d=(h*d+R)/++h):(C(),e.lineTo(R,E),b=M,h=0,y=x=E),_=E}C()}function sb(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?nV:tV}function rV(e){return e.stepped?nz:e.tension||e.cubicInterpolationMode==="monotone"?rz:As}function oV(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),G$(e,t.options),e.stroke(o)}function iV(e,t,n,r){const{segments:o,options:i}=t,s=sb(t);for(const a of o)G$(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const sV=typeof Path2D=="function";function aV(e,t,n,r){sV&&!t.options.segment?oV(e,t,n,r):iV(e,t,n,r)}class Li extends si{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,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const o=r.spanGaps?this._loop:this._fullLoop;Y8(this._points,r,t,o,n),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=cz(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,o=t[n],i=this.points,s=I$(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=rV(r);let u,d;for(u=0,d=s.length;u<d;++u){const{start:h,end:p}=s[u],g=i[h],b=i[p];if(g===b){a.push(g);continue}const y=Math.abs((o-g[n])/(b[n]-g[n])),x=l(g,b,y,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return sb(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=sb(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of o)s&=i(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,o){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),aV(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Se(Li,"id","line"),Se(Li,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Se(Li,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Se(Li,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function OS(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class qc extends si{constructor(n){super();Se(this,"parsed");Se(this,"skip");Se(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.options,{x:s,y:a}=this.getProps(["x","y"],o);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(n,r){return OS(this,n,"x",r)}inYRange(n,r){return OS(this,n,"y",r)}getCenterPoint(n){const{x:r,y:o}=this.getProps(["x","y"],n);return{x:r,y:o}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const o=r&&n.borderWidth||0;return(r+o)*2}draw(n,r){const o=this.options;this.skip||o.radius<.1||!Jo(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,nb(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Se(qc,"id","point"),Se(qc,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Se(qc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function K$(e,t){const{x:n,y:r,base:o,width:i,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,u,d,h;return e.horizontal?(h=s/2,a=Math.min(n,o),l=Math.max(n,o),u=r-h,d=r+h):(h=i/2,a=n-h,l=n+h,u=Math.min(r,o),d=Math.max(r,o)),{left:a,top:u,right:l,bottom:d}}function Fi(e,t,n,r){return e?0:un(t,n,r)}function lV(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=S$(r);return{t:Fi(o.top,i.top,0,n),r:Fi(o.right,i.right,0,t),b:Fi(o.bottom,i.bottom,0,n),l:Fi(o.left,i.left,0,t)}}function cV(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=Qs(o),s=Math.min(t,n),a=e.borderSkipped,l=r||ct(o);return{topLeft:Fi(!l||a.top||a.left,i.topLeft,0,s),topRight:Fi(!l||a.top||a.right,i.topRight,0,s),bottomLeft:Fi(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:Fi(!l||a.bottom||a.right,i.bottomRight,0,s)}}function uV(e){const t=K$(e),n=t.right-t.left,r=t.bottom-t.top,o=lV(e,n/2,r/2),i=cV(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function Tm(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&K$(e,r);return a&&(o||Qo(t,a.left,a.right))&&(i||Qo(n,a.top,a.bottom))}function dV(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function fV(e,t){e.rect(t.x,t.y,t.w,t.h)}function Am(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+s,radius:e.radius}}class Gc extends si{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:n,options:{borderColor:r,backgroundColor:o}}=this,{inner:i,outer:s}=uV(this),a=dV(s.radius)?lu:fV;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,Am(s,n,i)),t.clip(),a(t,Am(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Am(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return Tm(this,t,n,r)}inXRange(t,n){return Tm(this,t,null,n)}inYRange(t,n){return Tm(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(n+o)/2:n,y:i?r:(r+o)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Se(Gc,"id","bar"),Se(Gc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Se(Gc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var hV=Object.freeze({__proto__:null,ArcElement:tl,BarElement:Gc,LineElement:Li,PointElement:qc});const ab=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],DS=ab.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function X$(e){return ab[e%ab.length]}function Q$(e){return DS[e%DS.length]}function pV(e,t){return e.borderColor=X$(t),e.backgroundColor=Q$(t),++t}function gV(e,t){return e.backgroundColor=e.data.map(()=>X$(t++)),t}function mV(e,t){return e.backgroundColor=e.data.map(()=>Q$(t++)),t}function vV(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof js?t=gV(n,t):o instanceof Uc?t=mV(n,t):o&&(t=pV(n,t))}}function MS(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function bV(e){return e&&(e.borderColor||e.backgroundColor)}var yV={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o;if(!n.forceOverride&&(MS(r)||bV(o)||i&&MS(i)))return;const s=vV(e);r.forEach(s)}};function xV(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(i-2);let l=0;const u=t+n-1;let d=t,h,p,g,b,y;for(s[l++]=e[d],h=0;h<i-2;h++){let x=0,_=0,w;const C=Math.floor((h+1)*a)+1+t,R=Math.min(Math.floor((h+2)*a)+1,n)+t,E=R-C;for(w=C;w<R;w++)x+=e[w].x,_+=e[w].y;x/=E,_/=E;const M=Math.floor(h*a)+1+t,D=Math.min(Math.floor((h+1)*a)+1,n)+t,{x:A,y:k}=e[d];for(g=b=-1,w=M;w<D;w++)b=.5*Math.abs((A-x)*(e[w].y-k)-(A-e[w].x)*(_-k)),b>g&&(g=b,p=e[w],y=w);s[l++]=p,d=y}return s[l++]=e[u],s}function wV(e,t,n,r){let o=0,i=0,s,a,l,u,d,h,p,g,b,y;const x=[],_=t+n-1,w=e[t].x,R=e[_].x-w;for(s=t;s<t+n;++s){a=e[s],l=(a.x-w)/R*r,u=a.y;const E=l|0;if(E===d)u<b?(b=u,h=s):u>y&&(y=u,p=s),o=(i*o+a.x)/++i;else{const M=s-1;if(!st(h)&&!st(p)){const D=Math.min(h,p),A=Math.max(h,p);D!==g&&D!==M&&x.push({...e[D],x:o}),A!==g&&A!==M&&x.push({...e[A],x:o})}s>0&&M!==g&&x.push(e[M]),x.push(a),d=E,i=0,b=y=u,h=p=g=s}}return x}function Z$(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function TS(e){e.data.datasets.forEach(t=>{Z$(t)})}function _V(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:s,max:a,minDefined:l,maxDefined:u}=i.getUserBounds();return l&&(r=un(Zo(t,i.axis,s).lo,0,n-1)),u?o=un(Zo(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var SV={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){TS(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:s,indexAxis:a}=o,l=e.getDatasetMeta(i),u=s||o.data;if(kt([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:h,count:p}=_V(l,u);const g=n.threshold||4*r;if(p<=g){Z$(o);return}st(s)&&(o._data=u,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let b;switch(n.algorithm){case"lttb":b=xV(u,h,p,r,n);break;case"min-max":b=wV(u,h,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=b})},destroy(e){TS(e)}};function CV(e,t,n){const r=e.segments,o=e.points,i=t.points,s=[];for(const a of r){let{start:l,end:u}=a;u=G0(l,u,o);const d=lb(n,o[l],o[u],a.loop);if(!t.segments){s.push({source:a,target:d,start:o[l],end:o[u]});continue}const h=I$(t,d);for(const p of h){const g=lb(n,i[p.start],i[p.end],p.loop),b=A$(a,o,g);for(const y of b)s.push({source:y,target:p,start:{[n]:AS(d,g,"start",Math.max)},end:{[n]:AS(d,g,"end",Math.min)}})}}return s}function lb(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=lr(o),i=lr(i)),{property:e,start:o,end:i}}function EV(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=G0(s,a,o);const l=o[s],u=o[a];r!==null?(i.push({x:l.x,y:r}),i.push({x:u.x,y:r})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:u.y}))}),i}function G0(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function AS(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function J$(e,t){let n=[],r=!1;return Nt(e)?(r=!0,n=e):n=EV(e,t),n.length?new Li({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function IS(e){return e&&e.fill!==!1}function RV(e,t,n){let o=e[t].fill;const i=[t];let s;if(!n)return o;for(;o!==!1&&i.indexOf(o)===-1;){if(!qt(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function $V(e,t,n){const r=MV(e);if(ct(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return qt(o)&&Math.floor(o)===o?PV(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function PV(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function OV(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ct(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function DV(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:ct(e)?r=e.value:r=t.getBaseValue(),r}function MV(e){const t=e.options,n=t.fill;let r=Ke(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function TV(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=AV(t,n);a.push(J$({x:null,y:t.bottom},r));for(let l=0;l<i.length;l++){const u=i[l];for(let d=u.start;d<=u.end;d++)IV(o,s[d],a)}return new Li({points:o,options:{}})}function AV(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let o=0;o<r.length;o++){const i=r[o];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function IV(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=kV(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function kV(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],i=e.segments,s=e.points;let a=!1,l=!1;for(let u=0;u<i.length;u++){const d=i[u],h=s[d.start][n],p=s[d.end][n];if(Qo(o,h,p)){a=o===h,l=o===p;break}}return{first:a,last:l,point:r}}class eP{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:o,y:i,radius:s}=this;return n=n||{start:0,end:Lt},t.arc(o,i,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:o}=this,i=t.angle;return{x:n+Math.cos(i)*o,y:r+Math.sin(i)*o,angle:i}}}function NV(e){const{chart:t,fill:n,line:r}=e;if(qt(n))return LV(t,n);if(n==="stack")return TV(e);if(n==="shape")return!0;const o=FV(e);return o instanceof eP?o:J$(o,r)}function LV(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function FV(e){return(e.scale||{}).getPointPositionForValue?jV(e):zV(e)}function zV(e){const{scale:t={},fill:n}=e,r=OV(n,t);if(qt(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function jV(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=DV(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new eP({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<o;++l)a.push(t.getPointPositionForValue(l,s));return a}function Im(e,t,n){const r=NV(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,u=a.backgroundColor,{above:d=u,below:h=u}=l||{};r&&o.points.length&&(up(e,n),VV(e,{line:o,target:r,above:d,below:h,area:n,scale:i,axis:s}),dp(e))}function VV(e,t){const{line:n,target:r,above:o,below:i,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&i!==o&&(kS(e,r,s.top),NS(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),kS(e,r,s.bottom)),NS(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function kS(e,t,n){const{segments:r,points:o}=t;let i=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:u}=a,d=o[l],h=o[G0(l,u,o)];i?(e.moveTo(d.x,d.y),i=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function NS(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=CV(n,r,o);for(const{source:l,target:u,start:d,end:h}of a){const{style:{backgroundColor:p=i}={}}=l,g=r!==!0;e.save(),e.fillStyle=p,HV(e,s,g&&lb(o,d,h)),e.beginPath();const b=!!n.pathSegment(e,l);let y;if(g){b?e.closePath():LS(e,r,h,o);const x=!!r.pathSegment(e,u,{move:b,reverse:!0});y=b&&x,y||LS(e,r,d,o)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function HV(e,t,n){const{top:r,bottom:o}=t.chart.chartArea,{property:i,start:s,end:a}=n||{};i==="x"&&(e.beginPath(),e.rect(s,r,a-s,o-r),e.clip())}function LS(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var WV={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,o=[];let i,s,a,l;for(s=0;s<r;++s)i=e.getDatasetMeta(s),a=i.dataset,l=null,a&&a.options&&a instanceof Li&&(l={visible:e.isDatasetVisible(s),index:s,fill:$V(a,s,r),chart:e,axis:i.controller.options.indexAxis,scale:i.vScale,line:a}),i.$filler=l,o.push(l);for(s=0;s<r;++s)l=o[s],!(!l||l.fill===!1)&&(l.fill=RV(o,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",o=e.getSortedVisibleDatasetMetas(),i=e.chartArea;for(let s=o.length-1;s>=0;--s){const a=o[s].$filler;a&&(a.line.updateControlPoints(i,a.axis),r&&a.fill&&Im(e.ctx,a,i))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let o=r.length-1;o>=0;--o){const i=r[o].$filler;IS(i)&&Im(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!IS(r)||n.drawTime!=="beforeDatasetDraw"||Im(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const FS=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},BV=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class zS extends si{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,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Et(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,o)=>t.sort(r,o,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,o=Qt(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=FS(r,i);let u,d;n.font=o.string,this.isHorizontal()?(u=this.maxWidth,d=this._fitRows(s,i,a,l)+10):(d=this.maxHeight,u=this._fitCols(s,o,a,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,o){const{ctx:i,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],d=o+a;let h=t;i.textAlign="left",i.textBaseline="middle";let p=-1,g=-d;return this.legendItems.forEach((b,y)=>{const x=r+n/2+i.measureText(b.text).width;(y===0||u[u.length-1]+x+2*a>s)&&(h+=d,u[u.length-(y>0?0:1)]=0,g+=d,p++),l[y]={left:0,top:g,row:p,width:x,height:o},u[u.length-1]+=x+a}),h}_fitCols(t,n,r,o){const{ctx:i,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],d=s-t;let h=a,p=0,g=0,b=0,y=0;return this.legendItems.forEach((x,_)=>{const{itemWidth:w,itemHeight:C}=UV(r,n,i,x,o);_>0&&g+C+2*a>d&&(h+=p+a,u.push({width:p,height:g}),b+=p+a,y++,p=g=0),l[_]={left:b,top:g,col:y,width:w,height:C},p=Math.max(p,w),g+=C+a}),h+=p,u.push({width:p,height:g}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=il(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=Rn(r,this.left+o,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=Rn(r,this.left+o,this.right-this.lineWidths[a])),u.top+=this.top+t+o,u.left=s.leftForLtr(s.x(l),u.width),l+=u.width+o}else{let a=0,l=Rn(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=Rn(r,this.top+t+o,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+o,u.left=s.leftForLtr(s.x(u.left),u.width),l+=u.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;up(t,this),this._draw(),dp(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=Wt.color,l=il(t.rtl,this.left,this.width),u=Qt(s.font),{padding:d}=s,h=u.size,p=h/2;let g;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=u.string;const{boxWidth:b,boxHeight:y,itemHeight:x}=FS(s,h),_=function(M,D,A){if(isNaN(b)||b<=0||isNaN(y)||y<0)return;o.save();const k=Ke(A.lineWidth,1);if(o.fillStyle=Ke(A.fillStyle,a),o.lineCap=Ke(A.lineCap,"butt"),o.lineDashOffset=Ke(A.lineDashOffset,0),o.lineJoin=Ke(A.lineJoin,"miter"),o.lineWidth=k,o.strokeStyle=Ke(A.strokeStyle,a),o.setLineDash(Ke(A.lineDash,[])),s.usePointStyle){const L={radius:y*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:k},W=l.xPlus(M,b/2),Y=D+p;_$(o,L,W,Y,s.pointStyleWidth&&b)}else{const L=D+Math.max((h-y)/2,0),W=l.leftForLtr(M,b),Y=Qs(A.borderRadius);o.beginPath(),Object.values(Y).some(ne=>ne!==0)?lu(o,{x:W,y:L,w:b,h:y,radius:Y}):o.rect(W,L,b,y),o.fill(),k!==0&&o.stroke()}o.restore()},w=function(M,D,A){la(o,A.text,M,D+x/2,u,{strikethrough:A.hidden,textAlign:l.textAlign(A.textAlign)})},C=this.isHorizontal(),R=this._computeTitleHeight();C?g={x:Rn(i,this.left+d,this.right-r[0]),y:this.top+d+R,line:0}:g={x:this.left+d,y:Rn(i,this.top+R+d,this.bottom-n[0].height),line:0},D$(this.ctx,t.textDirection);const E=x+d;this.legendItems.forEach((M,D)=>{o.strokeStyle=M.fontColor,o.fillStyle=M.fontColor;const A=o.measureText(M.text).width,k=l.textAlign(M.textAlign||(M.textAlign=s.textAlign)),L=b+p+A;let W=g.x,Y=g.y;l.setWidth(this.width),C?D>0&&W+L+d>this.right&&(Y=g.y+=E,g.line++,W=g.x=Rn(i,this.left+d,this.right-r[g.line])):D>0&&Y+E>this.bottom&&(W=g.x=W+n[g.line].width+d,g.line++,Y=g.y=Rn(i,this.top+R+d,this.bottom-n[g.line].height));const ne=l.x(W);if(_(ne,Y,M),W=f8(k,W+b+p,C?W+L:this.right,t.rtl),w(l.x(W),Y,M),C)g.x+=L+d;else if(typeof M.text!="string"){const Q=u.lineHeight;g.y+=tP(M,Q)+d}else g.y+=E}),M$(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Qt(n.font),o=yn(n.padding);if(!n.display)return;const i=il(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,u=o.top+l;let d,h=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),d=this.top+u,h=Rn(t.align,h,this.right-p);else{const b=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);d=u+Rn(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}const g=Rn(a,h,h+p);s.textAlign=i.textAlign(F0(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,la(s,n.text,g,d,r)}_computeTitleHeight(){const t=this.options.title,n=Qt(t.font),r=yn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Qo(t,this.left,this.right)&&Qo(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Qo(t,o.left,o.left+o.width)&&Qo(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!YV(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=BV(o,r);o&&!i&&Et(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&Et(n.onHover,[t,r,this],this)}else r&&Et(n.onClick,[t,r,this],this)}}function UV(e,t,n,r,o){const i=qV(r,e,t,n),s=GV(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function qV(e,t,n,r){let o=e.text;return o&&typeof o!="string"&&(o=o.reduce((i,s)=>i.length>s.length?i:s)),t+n.size/2+r.measureText(o).width}function GV(e,t,n){let r=e;return typeof t.text!="string"&&(r=tP(t,n)),r}function tP(e,t){const n=e.text?e.text.length:0;return t*n}function YV(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var KV={id:"legend",_element:zS,start(e,t,n){const r=e.legend=new zS({ctx:e.ctx,options:n,chart:e});$n.configure(e,r,n),$n.addBox(e,r)},stop(e){$n.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;$n.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),d=yn(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:o||u.textAlign,borderRadius:s&&(a||u.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Y0 extends si{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,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const o=Nt(r.text)?r.text.length:1;this._padding=yn(r.padding);const i=o*Qt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:o,right:i,options:s}=this,a=s.align;let l=0,u,d,h;return this.isHorizontal()?(d=Rn(a,r,i),h=n+t,u=i-r):(s.position==="left"?(d=r+t,h=Rn(a,o,n),l=Ft*-.5):(d=i-t,h=Rn(a,n,o),l=Ft*.5),u=o-n),{titleX:d,titleY:h,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Qt(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(i);la(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:F0(n.align),textBaseline:"middle",translation:[s,a]})}}function XV(e,t){const n=new Y0({ctx:e.ctx,options:t,chart:e});$n.configure(e,n,t),$n.addBox(e,n),e.titleBlock=n}var QV={id:"title",_element:Y0,start(e,t,n){XV(e,n)},stop(e){const t=e.titleBlock;$n.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;$n.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const mf=new WeakMap;var ZV={id:"subtitle",start(e,t,n){const r=new Y0({ctx:e.ctx,options:n,chart:e});$n.configure(e,r,n),$n.addBox(e,r),mf.set(e,r)},stop(e){$n.removeBox(e,mf.get(e)),mf.delete(e)},beforeUpdate(e,t,n){const r=mf.get(e);$n.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Nc={average(e){if(!e.length)return!1;let t,n,r=0,o=0,i=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const a=s.tooltipPosition();r+=a.x,o+=a.y,++i}}return{x:r/i,y:o/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,o=Number.POSITIVE_INFINITY,i,s,a;for(i=0,s=e.length;i<s;++i){const l=e[i].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),d=eb(t,u);d<o&&(o=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function ao(e,t){return t&&(Nt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Go(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
125
|
-
`)>-1?e.split(`
|
|
126
|
-
`):e}function JV(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:s,value:a}=i.getLabelAndValue(o);return{chart:e,label:s,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:a,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function jS(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=Qt(t.bodyFont),u=Qt(t.titleFont),d=Qt(t.footerFont),h=i.length,p=o.length,g=r.length,b=yn(t.padding);let y=b.height,x=0,_=r.reduce((R,E)=>R+E.before.length+E.lines.length+E.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,h&&(y+=h*u.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),_){const R=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*R+(_-g)*l.lineHeight+(_-1)*t.bodySpacing}p&&(y+=t.footerMarginTop+p*d.lineHeight+(p-1)*t.footerSpacing);let w=0;const C=function(R){x=Math.max(x,n.measureText(R).width+w)};return n.save(),n.font=u.string,_t(e.title,C),n.font=l.string,_t(e.beforeBody.concat(e.afterBody),C),w=t.displayColors?s+2+t.boxPadding:0,_t(r,R=>{_t(R.before,C),_t(R.lines,C),_t(R.after,C)}),w=0,n.font=d.string,_t(e.footer,C),n.restore(),x+=b.width,{width:x,height:y}}function eH(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function tH(e,t,n,r){const{x:o,width:i}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&o+i+s>t.width||e==="right"&&o-i-s<0)return!0}function nH(e,t,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=e;let u="center";return r==="center"?u=o<=(a+l)/2?"left":"right":o<=i/2?u="left":o>=s-i/2&&(u="right"),tH(u,e,t,n)&&(u="center"),u}function VS(e,t,n){const r=n.yAlign||t.yAlign||eH(e,n);return{xAlign:n.xAlign||t.xAlign||nH(e,t,n,r),yAlign:r}}function rH(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function oH(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function HS(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,u=o+i,{topLeft:d,topRight:h,bottomLeft:p,bottomRight:g}=Qs(s);let b=rH(t,a);const y=oH(t,l,u);return l==="center"?a==="left"?b+=u:a==="right"&&(b-=u):a==="left"?b-=Math.max(d,p)+o:a==="right"&&(b+=Math.max(h,g)+o),{x:un(b,0,r.width-t.width),y:un(y,0,r.height-t.height)}}function vf(e,t,n){const r=yn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function WS(e){return ao([],Go(e))}function iH(e,t,n){return Qi(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function BS(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const nP={beforeTitle:Ho,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Ho,beforeBody:Ho,beforeLabel:Ho,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return st(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Ho,afterBody:Ho,beforeFooter:Ho,footer:Ho,afterFooter:Ho};function Hn(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?nP[t].call(n,r):o}var gv;let US=(gv=class extends si{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 n=this.chart,r=this.options.setContext(this.getContext()),o=r.enabled&&n.options.animation&&r.animations,i=new k$(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=iH(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Hn(r,"beforeTitle",this,t),i=Hn(r,"title",this,t),s=Hn(r,"afterTitle",this,t);let a=[];return a=ao(a,Go(o)),a=ao(a,Go(i)),a=ao(a,Go(s)),a}getBeforeBody(t,n){return WS(Hn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return _t(t,i=>{const s={before:[],lines:[],after:[]},a=BS(r,i);ao(s.before,Go(Hn(a,"beforeLabel",this,i))),ao(s.lines,Hn(a,"label",this,i)),ao(s.after,Go(Hn(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return WS(Hn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Hn(r,"beforeFooter",this,t),i=Hn(r,"footer",this,t),s=Hn(r,"afterFooter",this,t);let a=[];return a=ao(a,Go(o)),a=ao(a,Go(i)),a=ao(a,Go(s)),a}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(JV(this.chart,n[l]));return t.filter&&(a=a.filter((d,h,p)=>t.filter(d,h,p,r))),t.itemSort&&(a=a.sort((d,h)=>t.itemSort(d,h,r))),_t(a,d=>{const h=BS(t.callbacks,d);o.push(Hn(h,"labelColor",this,d)),i.push(Hn(h,"labelPointStyle",this,d)),s.push(Hn(h,"labelTextColor",this,d))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,s=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const a=Nc[r.position].call(this,o,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=jS(this,r),u=Object.assign({},a,l),d=VS(this.chart,r,u),h=HS(r,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,i={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:u,bottomLeft:d,bottomRight:h}=Qs(a),{x:p,y:g}=t,{width:b,height:y}=n;let x,_,w,C,R,E;return i==="center"?(R=g+y/2,o==="left"?(x=p,_=x-s,C=R+s,E=R-s):(x=p+b,_=x+s,C=R-s,E=R+s),w=x):(o==="left"?_=p+Math.max(l,d)+s:o==="right"?_=p+b-Math.max(u,h)-s:_=this.caretX,i==="top"?(C=g,R=C-s,x=_-s,w=_+s):(C=g+y,R=C+s,x=_+s,w=_-s),E=C),{x1:x,x2:_,x3:w,y1:C,y2:R,y3:E}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const u=il(r.rtl,this.x,this.width);for(t.x=vf(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",s=Qt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],u.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===i&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,o,i){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=i,d=Qt(i.bodyFont),h=vf(this,"left",i),p=o.x(h),g=l<d.lineHeight?(d.lineHeight-l)/2:0,b=n.y+g;if(i.usePointStyle){const y={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=o.leftForLtr(p,u)+u/2,_=b+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,nb(t,y,x,_),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,nb(t,y,x,_)}else{t.lineWidth=ct(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const y=o.leftForLtr(p,u),x=o.leftForLtr(o.xPlus(p,1),u-2),_=Qs(s.borderRadius);Object.values(_).some(w=>w!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,lu(t,{x:y,y:b,w:u,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),lu(t,{x,y:b+1,w:u-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(y,b,u,l),t.strokeRect(y,b,u,l),t.fillStyle=s.backgroundColor,t.fillRect(x,b+1,u-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:d}=r,h=Qt(r.bodyFont);let p=h.lineHeight,g=0;const b=il(r.rtl,this.x,this.width),y=function(A){n.fillText(A,b.x(t.x+g),t.y+p/2),t.y+=p+i},x=b.textAlign(s);let _,w,C,R,E,M,D;for(n.textAlign=s,n.textBaseline="middle",n.font=h.string,t.x=vf(this,x,r),n.fillStyle=r.bodyColor,_t(this.beforeBody,y),g=a&&x!=="right"?s==="center"?u/2+d:u+2+d:0,R=0,M=o.length;R<M;++R){for(_=o[R],w=this.labelTextColors[R],n.fillStyle=w,_t(_.before,y),C=_.lines,a&&C.length&&(this._drawColorBox(n,t,R,b,r),p=Math.max(h.lineHeight,l)),E=0,D=C.length;E<D;++E)y(C[E]),p=h.lineHeight;_t(_.after,y)}g=0,p=h.lineHeight,_t(this.afterBody,y),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=il(r.rtl,this.x,this.width);for(t.x=vf(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=Qt(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<i;++a)n.fillText(o[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,o){const{xAlign:i,yAlign:s}=this,{x:a,y:l}=t,{width:u,height:d}=r,{topLeft:h,topRight:p,bottomLeft:g,bottomRight:b}=Qs(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+h,l),s==="top"&&this.drawCaret(t,n,r,o),n.lineTo(a+u-p,l),n.quadraticCurveTo(a+u,l,a+u,l+p),s==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(a+u,l+d-b),n.quadraticCurveTo(a+u,l+d,a+u-b,l+d),s==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(a+g,l+d),n.quadraticCurveTo(a,l+d,a,l+d-g),s==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(a,l+h),n.quadraticCurveTo(a,l,a+h,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const s=Nc[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=jS(this,t),l=Object.assign({},s,this._size),u=VS(n,t,l),d=HS(t,l,u,n);(o._to!==d.x||i._to!==d.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=yn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(i,t,o,n),D$(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),M$(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=t.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),i=!ph(r,o),s=this._positionChanged(o,n);(i||s)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],s=this._getActiveElements(t,i,n,r),a=this._positionChanged(s,t),l=n||!ph(s,i)||a;return l&&(this._active=s,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:o,options:i}=this,s=Nc[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Se(gv,"positioners",Nc),gv);var sH={id:"tooltip",_element:US,positioners:Nc,afterInit(e,t,n){n&&(e.tooltip=new US({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.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:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:nP},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},aH=Object.freeze({__proto__:null,Colors:yV,Decimation:SV,Filler:WV,Legend:KV,SubTitle:ZV,Title:QV,Tooltip:sH});const lH=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function cH(e,t,n,r){const o=e.indexOf(t);if(o===-1)return lH(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const uH=(e,t)=>e===null?null:un(Math.round(e),0,t);function qS(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class cb extends ma{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:o,label:i}of n)r[o]===i&&r.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(st(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:cH(r,t,Ke(n,t),this._addedLabels),uH(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,o=[];let i=this.getLabels();i=t===0&&n===i.length-1?i:i.slice(t,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)o.push({value:s});return o}getLabelForValue(t){return qS.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Se(cb,"id","category"),Se(cb,"defaults",{ticks:{callback:qS}});function dH(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:u,maxTicks:d,maxDigits:h,includeBounds:p}=e,g=i||1,b=d-1,{min:y,max:x}=t,_=!st(s),w=!st(a),C=!st(u),R=(x-y)/(h+1);let E=z_((x-y)/b/g)*g,M,D,A,k;if(E<1e-14&&!_&&!w)return[{value:y},{value:x}];k=Math.ceil(x/E)-Math.floor(y/E),k>b&&(E=z_(k*E/b/g)*g),st(l)||(M=Math.pow(10,l),E=Math.ceil(E*M)/M),o==="ticks"?(D=Math.floor(y/E)*E,A=Math.ceil(x/E)*E):(D=y,A=x),_&&w&&i&&i8((a-s)/i,E/1e3)?(k=Math.round(Math.min((a-s)/E,d)),E=(a-s)/k,D=s,A=a):C?(D=_?s:D,A=w?a:A,k=u-1,E=(A-D)/k):(k=(A-D)/E,Hc(k,Math.round(k),E/1e3)?k=Math.round(k):k=Math.ceil(k));const L=Math.max(j_(E),j_(D));M=Math.pow(10,st(l)?L:l),D=Math.round(D*M)/M,A=Math.round(A*M)/M;let W=0;for(_&&(p&&D!==s?(n.push({value:s}),D<s&&W++,Hc(Math.round((D+W*E)*M)/M,s,GS(s,R,e))&&W++):D<s&&W++);W<k;++W){const Y=Math.round((D+W*E)*M)/M;if(w&&Y>a)break;n.push({value:Y})}return w&&p&&A!==a?n.length&&Hc(n[n.length-1].value,a,GS(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!w||A===a)&&n.push({value:A}),n}function GS(e,t,{horizontal:n,minRotation:r}){const o=Kr(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class wh extends ma{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,n){return st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:o,max:i}=this;const s=l=>o=n?o:l,a=l=>i=r?i:l;if(t){const l=vo(o),u=vo(i);l<0&&u<0?a(0):l>0&&u>0&&s(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);a(i+l),t||s(o-l)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,s=dH(o,i);return t.bounds==="ticks"&&h$(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const o=(r-n)/Math.max(t.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return qu(t,this.chart.options.locale,this.options.ticks.format)}}class ub extends wh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=qt(t)?t:0,this.max=qt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Kr(this.options.ticks.minRotation),o=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Se(ub,"id","linear"),Se(ub,"defaults",{ticks:{callback:cp.formatters.numeric}});const uu=e=>Math.floor(Ni(e)),Os=(e,t)=>Math.pow(10,uu(e)+t);function YS(e){return e/Math.pow(10,uu(e))===1}function KS(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function fH(e,t){const n=t-e;let r=uu(n);for(;KS(e,t,r)>10;)r++;for(;KS(e,t,r)<10;)r--;return Math.min(r,uu(e))}function hH(e,{min:t,max:n}){t=or(e.min,t);const r=[],o=uu(t);let i=fH(t,n),s=i<0?Math.pow(10,Math.abs(i)):1;const a=Math.pow(10,i),l=o>i?Math.pow(10,o):0,u=Math.round((t-l)*s)/s,d=Math.floor((t-l)/a/10)*a*10;let h=Math.floor((u-d)/Math.pow(10,i)),p=or(e.min,Math.round((l+d+h*Math.pow(10,i))*s)/s);for(;p<n;)r.push({value:p,major:YS(p),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(i++,h=2,s=i>=0?1:s),p=Math.round((l+d+h*Math.pow(10,i))*s)/s;const g=or(e.max,p);return r.push({value:g,major:YS(g),significand:h}),r}class db extends ma{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=wh.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return qt(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=qt(t)?Math.max(0,t):null,this.max=qt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!qt(this._userMin)&&(this.min=t===Os(this.min,0)?Os(this.min,-1):Os(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,o=this.max;const i=a=>r=t?r:a,s=a=>o=n?o:a;r===o&&(r<=0?(i(1),s(10)):(i(Os(r,-1)),s(Os(o,1)))),r<=0&&i(Os(o,-1)),o<=0&&s(Os(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=hH(n,this);return t.bounds==="ticks"&&h$(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":qu(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ni(t),this._valueRange=Ni(this.max)-Ni(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ni(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Se(db,"id","logarithmic"),Se(db,"defaults",{ticks:{callback:cp.formatters.logarithmic,major:{enabled:!0}}});function fb(e){const t=e.ticks;if(t.display&&e.display){const n=yn(t.backdropPadding);return Ke(t.font&&t.font.size,Wt.font.size)+n.height}return 0}function pH(e,t,n){return n=Nt(n)?n:[n],{w:_8(e,t.string,n),h:n.length*t.lineHeight}}function XS(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function gH(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],i=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Ft/i:0;for(let l=0;l<i;l++){const u=s.setContext(e.getPointLabelContext(l));o[l]=u.padding;const d=e.getPointPosition(l,e.drawingArea+o[l],a),h=Qt(u.font),p=pH(e.ctx,h,e._pointLabels[l]);r[l]=p;const g=lr(e.getIndexAngle(l)+a),b=Math.round(N0(g)),y=XS(b,d.x,p.w,0,180),x=XS(b,d.y,p.h,90,270);mH(n,t,g,y,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=yH(e,r,o)}function mH(e,t,n,r,o){const i=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+a)),o.start<t.t?(l=(t.t-o.start)/s,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function vH(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:s,size:a}=n,l=e.getPointPosition(t,r+o+s,i),u=Math.round(N0(lr(l.angle+Xt))),d=_H(l.y,a.h,u),h=xH(u),p=wH(l.x,a.w,h);return{visible:!0,x:l.x,y:d,textAlign:h,left:p,top:d,right:p+a.w,bottom:d+a.h}}function bH(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Jo({x:n,y:r},t)||Jo({x:n,y:i},t)||Jo({x:o,y:r},t)||Jo({x:o,y:i},t))}function yH(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:fb(i)/2,additionalAngle:s?Ft/o:0};let u;for(let d=0;d<o;d++){l.padding=n[d],l.size=t[d];const h=vH(e,d,l);r.push(h),a==="auto"&&(h.visible=bH(h,u),h.visible&&(u=h))}return r}function xH(e){return e===0||e===180?"center":e<180?"left":"right"}function wH(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function _H(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function SH(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!st(a)){const l=Qs(t.borderRadius),u=yn(t.backdropPadding);e.fillStyle=a;const d=r-u.left,h=o-u.top,p=i-r+u.width,g=s-o+u.height;Object.values(l).some(b=>b!==0)?(e.beginPath(),lu(e,{x:d,y:h,w:p,h:g,radius:l}),e.fill()):e.fillRect(d,h,p,g)}}function CH(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const i=e._pointLabelItems[o];if(!i.visible)continue;const s=r.setContext(e.getPointLabelContext(o));SH(n,s,i);const a=Qt(s.font),{x:l,y:u,textAlign:d}=i;la(n,e._pointLabels[o],l,u+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function rP(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Lt);else{let i=e.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let s=1;s<r;s++)i=e.getPointPosition(s,t),o.lineTo(i.x,i.y)}}function EH(e,t,n,r,o){const i=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(i.save(),i.strokeStyle=a,i.lineWidth=l,i.setLineDash(o.dash),i.lineDashOffset=o.dashOffset,i.beginPath(),rP(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function RH(e,t,n){return Qi(e,{label:n,index:t,type:"pointLabel"})}class Lc extends wh{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=yn(fb(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=qt(t)&&!isNaN(t)?t:0,this.max=qt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fb(this.options))}generateTickLabels(t){wh.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=Et(this.options.pointLabels.callback,[n,r],this);return o||o===0?o:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?gH(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,o){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,o))}getIndexAngle(t){const n=Lt/(this._pointLabels.length||1),r=this.options.startAngle||0;return lr(t*n+Kr(r))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(st(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return RH(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-Xt+r;return{x:Math.cos(o)*n+this.xCenter,y:Math.sin(o)*n+this.yCenter,angle:o}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:o,bottom:i}=this._pointLabelItems[t];return{left:n,top:r,right:o,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),rP(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:o,border:i}=n,s=this._pointLabels.length;let a,l,u;if(n.pointLabels.display&&CH(this,s),o.display&&this.ticks.forEach((d,h)=>{if(h!==0){l=this.getDistanceFromCenterForValue(d.value);const p=this.getContext(h),g=o.setContext(p),b=i.setContext(p);EH(this,g,l,s,b)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const d=r.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:p}=d;!p||!h||(t.lineWidth=p,t.strokeStyle=h,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),u=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const o=this.getIndexAngle(0);let i,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const u=r.setContext(this.getContext(l)),d=Qt(u.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=d.string,s=t.measureText(a.label).width,t.fillStyle=u.backdropColor;const h=yn(u.backdropPadding);t.fillRect(-s/2-h.left,-i-d.size/2-h.top,s+h.width,d.size+h.height)}la(t,a.label,0,-i,d,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}Se(Lc,"id","radialLinear"),Se(Lc,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:cp.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Se(Lc,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Se(Lc,"descriptors",{angleLines:{_fallback:"grid"}});const hp={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},qn=Object.keys(hp);function QS(e,t){return e-t}function ZS(e,t){if(st(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),qt(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&($l(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function JS(e,t,n,r){const o=qn.length;for(let i=qn.indexOf(e);i<o-1;++i){const s=hp[qn[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return qn[i]}return qn[o-1]}function $H(e,t,n,r,o){for(let i=qn.length-1;i>=qn.indexOf(n);i--){const s=qn[i];if(hp[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return qn[n?qn.indexOf(n):0]}function PH(e){for(let t=qn.indexOf(e)+1,n=qn.length;t<n;++t)if(hp[qn[t]].common)return qn[t]}function eC(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=L0(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function OH(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=i;a<=s;a=+o.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function tC(e,t,n){const r=[],o={},i=t.length;let s,a;for(s=0;s<i;++s)a=t[s],o[a]=s,r.push({value:a,major:!1});return i===0||!n?r:OH(e,r,o,n)}class du extends ma{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),o=this._adapter=new Fz._date(t.adapters.date);o.init(n),Vc(r.displayFormats,o.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:ZS(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:o,max:i,minDefined:s,maxDefined:a}=this.getUserBounds();function l(u){!s&&!isNaN(u.min)&&(o=Math.min(o,u.min)),!a&&!isNaN(u.max)&&(i=Math.max(i,u.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=qt(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=qt(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,o=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,s=this.max,a=c8(o,i,s);return this._unit=n.unit||(r.autoSkip?JS(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):$H(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:PH(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),tC(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=un(n,0,s),r=un(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,s=i.unit||JS(i.minUnit,n,r,this._getLabelCapacity(n)),a=Ke(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,u=$l(l)||l===!0,d={};let h=n,p,g;if(u&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,u?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const b=o.ticks.source==="data"&&this.getDataTimestamps();for(p=h,g=0;p<r;p=+t.add(p,a,s),g++)eC(d,p,b);return(p===r||o.bounds==="ticks"||g===1)&&eC(d,p,b),Object.keys(d).sort(QS).map(y=>+y)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const o=this.options.time.displayFormats,i=this._unit,s=n||o[i];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,o){const i=this.options,s=i.ticks.callback;if(s)return Et(s,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,u=this._majorUnit,d=l&&a[l],h=u&&a[u],p=r[n],g=u&&h&&p&&p.major;return this._adapter.format(t,o||(g?h:d))}generateTickLabels(t){let n,r,o;for(n=0,r=t.length;n<r;++n)o=t[n],o.label=this._tickFormatFunction(o.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,o=Kr(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),s=Math.sin(o),a=this._resolveTickFontOptions(0).size;return{w:r*i+a*s,h:r*s+a*i}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,o=r[n.unit]||r.millisecond,i=this._tickFormatFunction(t,0,tC(this,[t],this._majorUnit),o),s=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n<r;++n)t=t.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const o=this.getLabels();for(n=0,r=o.length;n<r;++n)t.push(ZS(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return m$(t.sort(QS))}}Se(du,"id","time"),Se(du,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function bf(e,t,n){let r=0,o=e.length-1,i,s,a,l;n?(t>=e[r].pos&&t<=e[o].pos&&({lo:r,hi:o}=Zo(e,"pos",t)),{pos:i,time:a}=e[r],{pos:s,time:l}=e[o]):(t>=e[r].time&&t<=e[o].time&&({lo:r,hi:o}=Zo(e,"time",t)),{time:i,pos:a}=e[r],{time:s,pos:l}=e[o]);const u=s-i;return u?a+(l-a)*(t-i)/u:a}class hb extends du{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=bf(n,this.min),this._tableRange=bf(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let s,a,l,u,d;for(s=0,a=t.length;s<a;++s)u=t[s],u>=n&&u<=r&&o.push(u);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=o.length;s<a;++s)d=o[s+1],l=o[s-1],u=o[s],Math.round((d+l)/2)!==u&&i.push({time:u,pos:s/(a-1)});return i}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((o,i)=>o-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(bf(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return bf(this._table,r*this._tableRange+this._minPos,!0)}}Se(hb,"id","timeseries"),Se(hb,"defaults",du.defaults);var DH=Object.freeze({__proto__:null,CategoryScale:cb,LinearScale:ub,LogarithmicScale:db,RadialLinearScale:Lc,TimeScale:du,TimeSeriesScale:hb});const MH=[Lz,hV,aH,DH];/*!
|
|
127
|
-
* chartjs-plugin-datalabels v2.2.0
|
|
128
|
-
* https://chartjs-plugin-datalabels.netlify.app
|
|
129
|
-
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
130
|
-
* Released under the MIT license
|
|
131
|
-
*/var nC=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),Yc={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
|
|
132
|
-
`)):Array.isArray(n)?e.push.apply(e,n):st(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),o=r.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<o;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=i,{height:o*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],o,i,s,a;for(o=0,s=t.length;o<s;++o)a=t[o],i=n.indexOf(a),i===-1?r.push([a,1]):n.splice(i,1);for(o=0,s=n.length;o<s;++o)r.push([n[o],-1]);return r},rasterize:function(e){return Math.round(e*nC)/nC}};function km(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var o=e.x-n,i=e.y-r,s=Math.sqrt(o*o+i*i);return{x:s?o/s:0,y:s?i/s:-1}}function TH(e,t,n,r,o){switch(o){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:o*=Math.PI/180,n=Math.cos(o),r=Math.sin(o);break}return{x:e,y:t,vx:n,vy:r}}var AH=0,oP=1,iP=2,sP=4,aP=8;function yf(e,t,n){var r=AH;return e<n.left?r|=oP:e>n.right&&(r|=iP),t<n.top?r|=aP:t>n.bottom&&(r|=sP),r}function IH(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=yf(n,r,t),a=yf(o,i,t),l,u,d;!(!(s|a)||s&a);)l=s||a,l&aP?(u=n+(o-n)*(t.top-r)/(i-r),d=t.top):l&sP?(u=n+(o-n)*(t.bottom-r)/(i-r),d=t.bottom):l&iP?(d=r+(i-r)*(t.right-n)/(o-n),u=t.right):l&oP&&(d=r+(i-r)*(t.left-n)/(o-n),u=t.left),l===s?(n=u,r=d,s=yf(n,r,t)):(o=u,i=d,a=yf(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function xf(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=IH(r,t.area)),n==="start"?(o=r.x0,i=r.y0):n==="end"?(o=r.x1,i=r.y1):(o=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),TH(o,i,e.vx,e.vy,t.align)}var wf={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),o=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return xf({x0:e.x+r*i,y0:e.y+o*i,x1:e.x+r*s,y1:e.y+o*s,vx:r,vy:o},t)},point:function(e,t){var n=km(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return xf({x0:e.x-r,y0:e.y-o,x1:e.x+r,y1:e.y+o,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=km(e,t.origin),r=e.x,o=e.y,i=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),xf({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=km(e,t.origin);return xf({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},ei=Yc.rasterize;function kH(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,o=e.size.width,i=-o/2,s=-r/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:o+n.width+t*2,h:r+n.height+t*2},text:{x:i,y:s,w:o,h:r}}}function NH(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function LH(e){return e instanceof tl?wf.arc:e instanceof qc?wf.point:e instanceof Gc?wf.bar:wf.fallback}function FH(e,t,n,r,o,i){var s=Math.PI/2;if(i){var a=Math.min(i,o/2,r/2),l=t+a,u=n+a,d=t+r-a,h=n+o-a;e.moveTo(t,u),l<d&&u<h?(e.arc(l,u,a,-Math.PI,-s),e.arc(d,u,a,-s,0),e.arc(d,h,a,0,s),e.arc(l,h,a,s,Math.PI)):l<d?(e.moveTo(l,n),e.arc(d,u,a,-s,s),e.arc(l,u,a,s,Math.PI+s)):u<h?(e.arc(l,u,a,-Math.PI,0),e.arc(l,h,a,0,Math.PI)):e.arc(l,u,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function zH(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),FH(e,ei(t.x)+i/2,ei(t.y)+i/2,ei(t.w)-i,ei(t.h)-i,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),o&&i&&(e.strokeStyle=o,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function jH(e,t,n){var r=n.lineHeight,o=e.w,i=e.x,s=e.y+r/2;return t==="center"?i+=o/2:(t==="end"||t==="right")&&(i+=o),{h:r,w:o,x:i,y:s}}function VH(e,t,n){var r=e.shadowBlur,o=n.stroked,i=ei(n.x),s=ei(n.y),a=ei(n.w);o&&e.strokeText(t,i,s,a),n.filled&&(r&&o&&(e.shadowBlur=0),e.fillText(t,i,s,a),r&&o&&(e.shadowBlur=r))}function HH(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,u=r.textStrokeColor,d=r.textStrokeWidth,h=u&&d,p;if(!(!l||!s&&!h))for(n=jH(n,o,a),e.font=a.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=i),h&&(e.lineJoin="round",e.lineWidth=d,e.strokeStyle=u),p=0,l=t.length;p<l;++p)VH(e,t[p],{stroked:h,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var lP=function(e,t,n,r){var o=this;o._config=e,o._index=r,o._model=null,o._rects=null,o._ctx=t,o._el=n};xo(lP.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=Qt(kt([n.font,{}],r,i)),a=kt([n.color,Wt.color],r,i);return{align:kt([n.align,"center"],r,i),anchor:kt([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:kt([n.backgroundColor,null],r,i),borderColor:kt([n.borderColor,null],r,i),borderRadius:kt([n.borderRadius,0],r,i),borderWidth:kt([n.borderWidth,0],r,i),clamp:kt([n.clamp,!1],r,i),clip:kt([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:kt([n.offset,4],r,i),opacity:kt([n.opacity,1],r,i),origin:NH(o._el,r),padding:yn(kt([n.padding,4],r,i)),positioner:LH(o._el),rotation:kt([n.rotation,0],r,i)*(Math.PI/180),size:Yc.textSize(o._ctx,t,s),textAlign:kt([n.textAlign,"start"],r,i),textShadowBlur:kt([n.textShadowBlur,0],r,i),textShadowColor:kt([n.textShadowColor,a],r,i),textStrokeColor:kt([n.textStrokeColor,a],r,i),textStrokeWidth:kt([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,u=kt([i.display,!0],e,o);u&&(s=e.dataset.data[o],a=Ke(Et(i.formatter,[s,e]),s),l=st(a)?[]:Yc.toTextLines(a),l.length&&(n=t._modelize(u,l,i,e),r=kH(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,o=n._model,i=n._rects,s;this.visible()&&(r.save(),o.clip&&(s=o.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=Yc.bound(0,o.opacity,1),r.translate(ei(t.x),ei(t.y)),r.rotate(o.rotation),zH(r,i.frame,o),HH(r,o.lines,i.text,o),r.restore())}});var WH=Number.MIN_SAFE_INTEGER||-9007199254740991,BH=Number.MAX_SAFE_INTEGER||9007199254740991;function Ec(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t.x,s=t.y;return{x:i+r*(e.x-i)-o*(e.y-s),y:s+o*(e.x-i)+r*(e.y-s)}}function rC(e,t){var n=BH,r=WH,o=t.origin,i,s,a,l,u;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,u=t.vx*a+t.vy*l,n=Math.min(n,u),r=Math.max(r,u);return{min:n,max:r}}function _f(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var cP=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};xo(cP.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=Ec(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[_f(t[0],t[1]),_f(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(_f(n[0],n[1]),_f(n[0],n[3])),o=0;o<r.length;++o)if(i=rC(t,r[o]),s=rC(n,r[o]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Ec({x:t.x,y:t.y},r,n),Ec({x:t.x+t.w,y:t.y},r,n),Ec({x:t.x+t.w,y:t.y+t.h},r,n),Ec({x:t.x,y:t.y+t.h},r,n)]}});function uP(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,u=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),d=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),h=1/Math.max(Math.abs(o),Math.abs(i));return u*=o*h,d*=i*h,u+=t.offset*o,d+=t.offset*i,{x:r.x+u,y:r.y+d}}function UH(e,t){var n,r,o,i;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,r=n-1;r>=0&&o._visible;--r)i=e[r].$layout,i._visible&&o._box.intersects(i._box)&&t(o,i);return e}function qH(e){var t,n,r,o,i,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(a=new Proxy(r._el,{get:(l,u)=>l.getProps([u],!0)[u]}),i=r.geometry(),s=uP(a,r.model(),i),o._box.update(s,i,r.rotation()));return UH(e,function(l,u){var d=l._hidable,h=u._hidable;d&&h||h?u._visible=!1:d&&(l._visible=!1)})}var Kc={prepare:function(e){var t=[],n,r,o,i,s;for(n=0,o=e.length;n<o;++n)for(r=0,i=e[n].length;r<i;++r)s=e[n][r],t.push(s),s.$layout={_box:new cP,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var u=a.$layout,d=l.$layout;return u._idx===d._idx?d._set-u._set:d._idx-u._idx}),this.update(t),t},update:function(e){var t=!1,n,r,o,i,s;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),s=o.$layout,s._hidable=i&&i.display==="auto",s._visible=o.visible(),t|=s._hidable;t&&qH(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,o,i,s,a;for(n=0,r=t.length;n<r;++n)o=t[n],i=o.$layout,i._visible&&(s=o.geometry(),a=uP(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},GH=function(e){if(st(e))return null;var t=e,n,r,o;if(ct(e))if(!st(e.label))t=e.label;else if(!st(e.r))t=e.r;else for(t="",n=Object.keys(e),o=0,r=n.length;o<r;++o)t+=(o!==0?", ":"")+n[o]+": "+e[n[o]];return""+t},YH={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:GH,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},Wn="$datalabels",dP="$default";function KH(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=xo({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(xo({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return _t(l.listeners||{},function(u,d){a[d]=a[d]||{},a[d][l._key||dP]=u}),delete l.listeners,a},{}),{labels:o,listeners:r})}function pb(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&Et(s,[o,r])===!0&&(e[Wn]._dirty=!0,n.update(o)))}}function XH(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&pb(e,t.leave,n,o),i&&pb(e,t.enter,r,o))}function QH(e,t){var n=e[Wn],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=Kc.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,XH(e,r,o,i,t)}}function ZH(e,t){var n=e[Wn],r=n._listeners.click,o=r&&Kc.lookup(n._labels,t);o&&pb(e,r,o,t)}var JH={id:"datalabels",defaults:YH,beforeInit:function(e){e[Wn]={_actives:[]}},beforeUpdate:function(e){var t=e[Wn];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Wn],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=KH(a,n),u=t.meta.data||[],d=e.ctx,h,p,g,b,y,x,_,w;for(d.save(),h=0,g=u.length;h<g;++h)if(_=u[h],_[Wn]=[],s&&_&&e.getDataVisibility(h)&&!_.skip)for(p=0,b=l.labels.length;p<b;++p)y=l.labels[p],x=y._key,w=new lP(y,d,_,h),w.$groups={_set:r,_key:x||dP},w.$context={active:!1,chart:e,dataIndex:h,dataset:a,datasetIndex:r},w.update(w.$context),_[Wn].push(w),i.push(w);d.restore(),xo(o._listeners,l.listeners,{merger:function(C,R,E){R[C]=R[C]||{},R[C][t.index]=E[C],o._listened=!0}})},afterUpdate:function(e){e[Wn]._labels=Kc.prepare(e[Wn]._datasets)},afterDatasetsDraw:function(e){Kc.draw(e,e[Wn]._labels)},beforeEvent:function(e,t){if(e[Wn]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":QH(e,n);break;case"click":ZH(e,n);break}}},afterEvent:function(e){var t=e[Wn],n=t._actives,r=t._actives=e.getActiveElements(),o=Yc.arrayDiff(n,r),i,s,a,l,u,d,h;for(i=0,s=o.length;i<s;++i)if(u=o[i],u[1])for(h=u[0].element[Wn]||[],a=0,l=h.length;a<l;++a)d=h[a],d.$context.active=u[1]===1,d.update(d.$context);(t._dirty||o.length)&&(Kc.update(t._labels),e.render()),delete t._dirty}};Ir.register(...MH);Ir.register(JH);function fP({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=Ce(l=>l.themeStyle);m.useEffect(()=>{var d,h,p,g;(h=(d=i==null?void 0:i.chart)==null?void 0:d.font)!=null&&h.family&&(Ir.defaults.font={...Ir.defaults.font,...(p=i==null?void 0:i.chart)==null?void 0:p.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(g=n==null?void 0:n.current)==null?void 0:g.getContext("2d");if(!l)return;let u;try{u=new Ir(l,e),o(u)}catch(b){console.log("error creating chart",b)}return()=>{u&&u.destroy()}},[(a=i==null?void 0:i.chart)==null?void 0:a.font]);function s(l){var d,h;if(!r)return;const u=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(u&&u.length>0){const p=u[0].datasetIndex,g=u[0].index,b=(h=(d=u[0].element)==null?void 0:d.$context)==null?void 0:h.raw;t==null||t(r,p,g,b)}}return I.jsx("div",{onClick:s,className:"relative h-[99%]",children:I.jsx("canvas",{ref:n})})}function Fr(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var eW=["color"],hP=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,eW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),tW=["color"],nW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,tW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),rW=["color"],oW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,rW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),iW=["color"],pP=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,iW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),sW=["color"],aW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,sW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),lW=["color"],cW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,lW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),uW=["color"],dW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,uW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),fW=["color"],hW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,fW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),pW=["color"],gW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,pW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),mW=["color"],vW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,mW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),bW=["color"],K0=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,bW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),yW=["color"],X0=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,yW);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Sf;const xW=new Uint8Array(16);function wW(){if(!Sf&&(Sf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sf(xW)}const mn=[];for(let e=0;e<256;++e)mn.push((e+256).toString(16).slice(1));function _W(e,t=0){return mn[e[t+0]]+mn[e[t+1]]+mn[e[t+2]]+mn[e[t+3]]+"-"+mn[e[t+4]]+mn[e[t+5]]+"-"+mn[e[t+6]]+mn[e[t+7]]+"-"+mn[e[t+8]]+mn[e[t+9]]+"-"+mn[e[t+10]]+mn[e[t+11]]+mn[e[t+12]]+mn[e[t+13]]+mn[e[t+14]]+mn[e[t+15]]}const SW=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),oC={randomUUID:SW};function fu(e,t,n){if(oC.randomUUID&&!t&&!e)return oC.randomUUID();e=e||{};const r=e.random||(e.rng||wW)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return _W(r)}const Ar=AE()(jE((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:fu(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:fu(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,o,i)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),gP=()=>Ar(e=>e.actions);function CW(e,t,n){var l,u,d,h;const r=n==null?void 0:n.datasetOptions,o=Ce.getState().themeStyle,i=(u=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:u.backgroundColor,s=(h=(d=o==null?void 0:o.chart)==null?void 0:d.dataset)==null?void 0:h.borderColor;return e.map((p,g)=>{var w;const b=r==null?void 0:r.find(C=>C.idx===g),y=i==null?void 0:i[g%i.length],x=s==null?void 0:s[g%s.length];return{label:p.charAt(0).toUpperCase()+p.slice(1),data:t.map(C=>C[p]),...b,datalabels:{...b==null?void 0:b.datalabels,color:EW((w=b==null?void 0:b.datalabels)==null?void 0:w.align,y)},backgroundColor:y,borderColor:x}})}function EW(e,t){return ih(e==="end"||e==="start"?oh():t)}function RW(e){var a,l,u,d;const{metricKeys:t,dimensionKeys:n}=Nr(e);let r=[];const o=Ce.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(d=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:d.borderColor;if((n==null?void 0:n.length)===1){const h=e.map(p=>({x:p[t[0]],y:p[t[1]],r:p[t[2]],label:p[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:h}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(p=>p[n==null?void 0:n[1]]))].map((p,g)=>{const b=e.filter(y=>y[n==null?void 0:n[1]]===p);return{label:p,data:b.map(y=>({x:y[t[0]],y:y[t[1]],r:y[t[2]],label:y[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[g%i.length],borderColor:s==null?void 0:s[g%s.length]}})),r}function $W(e,t){var s,a,l,u;const n=Ce.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(u=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:u.borderColor;return e.map(d=>({label:d.charAt(0).toUpperCase()+d.slice(1),data:t.map(h=>h[d]),backgroundColor:t.map((h,p)=>r==null?void 0:r[p%r.length]),borderColor:t.map((h,p)=>o==null?void 0:o[p%o.length])}))}function PW(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function Nr(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=PW(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,u,d,h,p,g;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((u=e==null?void 0:e[0])==null?void 0:u[i])=="string"||typeof((d=e==null?void 0:e[1])==null?void 0:d[i])&&typeof((h=e==null?void 0:e[1])==null?void 0:h[i])=="string"||typeof((p=e==null?void 0:e[2])==null?void 0:p[i])&&typeof((g=e==null?void 0:e[2])==null?void 0:g[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function gb(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,s)=>({...i,...n[s],data:i.data,label:i.label})):e}function Q0({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const o=e.reduce((i,s)=>{const a=s[t],l=s[n],u=s[r];return i[a]||(i[a]={[t]:a}),i[a][l]=u,i},{});return Object.values(o)}function mb(e,t){var s;const n=Ce.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=ia.cloneDeep(r);return ia.merge(o,e,t)}function mP(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}function OW({frame:e}){const t=Ce(w=>w.isDashboardEditing),n=Ce(w=>w.filterValues),r=Ce(w=>w.isVisualEditing),o=Ce(w=>w.selectedSheetId);Ce(w=>w.currentBreakpoint);const{removeFrame:i}=Ce(w=>w.actions),s=Ce(w=>w.actions.setIsVisualEditing),a=Ar(w=>w.actions.setFilterValues),l=Ar(w=>w.actions.setApplyFilters),{setCard:u,setFrame:d,setQueryResultColumns:h}=Ar(w=>w.actions),p=Ar(w=>w.actions.setSelectedConnectionId),g=Ar(w=>w.actions.setSelectedDatabaseName),b=Ar(w=>w.actions.setSelectedSchemaName),y=Ar(w=>w.actions.setSelectedTableName),x=e.cards.find(w=>w.id===e.activeCardId);function _(){s(!r),u(x);const{dimensionKeys:w}=Nr((x==null?void 0:x.data)||[]);h(w),d(e),x!=null&&x.connectionId&&p(x==null?void 0:x.connectionId),x!=null&&x.lastSelectedDatabase&&g(x==null?void 0:x.lastSelectedDatabase),x!=null&&x.lastSelectedSchema&&b(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&y(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return I.jsx("section",{className:"absolute right-2 top-2 z-10",children:t&&I.jsxs("div",{className:"flex items-center gap-2",children:[r?I.jsx(aW,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):I.jsx(cW,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),I.jsx(pP,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function DW(e,t=globalThis==null?void 0:globalThis.document){const n=on(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const vb="dismissableLayer.update",MW="dismissableLayer.pointerDownOutside",TW="dismissableLayer.focusOutside";let iC;const AW=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jl=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...u}=e,d=m.useContext(AW),[h,p]=m.useState(null),g=(n=h==null?void 0:h.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=m.useState({}),y=Xe(t,A=>p(A)),x=Array.from(d.layers),[_]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=x.indexOf(_),C=h?x.indexOf(h):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,E=C>=w,M=IW(A=>{const k=A.target,L=[...d.branches].some(W=>W.contains(k));!E||L||(i==null||i(A),a==null||a(A),A.defaultPrevented||l==null||l())},g),D=kW(A=>{const k=A.target;[...d.branches].some(W=>W.contains(k))||(s==null||s(A),a==null||a(A),A.defaultPrevented||l==null||l())},g);return DW(A=>{C===d.layers.size-1&&(o==null||o(A),!A.defaultPrevented&&l&&(A.preventDefault(),l()))},g),m.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(iC=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),sC(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=iC)}},[h,g,r,d]),m.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),sC())},[h,d]),m.useEffect(()=>{const A=()=>b({});return document.addEventListener(vb,A),()=>document.removeEventListener(vb,A)},[]),m.createElement(ke.div,te({},u,{ref:y,style:{pointerEvents:R?E?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,D.onFocusCapture),onBlurCapture:we(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,M.onPointerDownCapture)}))});function IW(e,t=globalThis==null?void 0:globalThis.document){const n=on(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let u=function(){vP(MW,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kW(e,t=globalThis==null?void 0:globalThis.document){const n=on(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&vP(TW,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function sC(){const e=new CustomEvent(vb);document.dispatchEvent(e)}function vP(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?sR(o,i):o.dispatchEvent(i)}const NW=["top","right","bottom","left"],Ui=Math.min,ur=Math.max,_h=Math.round,Cf=Math.floor,qi=e=>({x:e,y:e}),LW={left:"right",right:"left",bottom:"top",top:"bottom"},FW={start:"end",end:"start"};function bb(e,t,n){return ur(e,Ui(t,n))}function ri(e,t){return typeof e=="function"?e(t):e}function oi(e){return e.split("-")[0]}function Vl(e){return e.split("-")[1]}function Z0(e){return e==="x"?"y":"x"}function J0(e){return e==="y"?"height":"width"}function Hl(e){return["top","bottom"].includes(oi(e))?"y":"x"}function ey(e){return Z0(Hl(e))}function zW(e,t,n){n===void 0&&(n=!1);const r=Vl(e),o=ey(e),i=J0(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Sh(s)),[s,Sh(s)]}function jW(e){const t=Sh(e);return[yb(e),t,yb(t)]}function yb(e){return e.replace(/start|end/g,t=>FW[t])}function VW(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function HW(e,t,n,r){const o=Vl(e);let i=VW(oi(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(yb)))),i}function Sh(e){return e.replace(/left|right|bottom|top/g,t=>LW[t])}function WW(e){return{top:0,right:0,bottom:0,left:0,...e}}function bP(e){return typeof e!="number"?WW(e):{top:e,right:e,bottom:e,left:e}}function Ch(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function aC(e,t,n){let{reference:r,floating:o}=e;const i=Hl(t),s=ey(t),a=J0(s),l=oi(t),u=i==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}switch(Vl(t)){case"start":g[s]-=p*(n&&u?-1:1);break;case"end":g[s]+=p*(n&&u?-1:1);break}return g}const BW=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=aC(u,r,l),p=r,g={},b=0;for(let y=0;y<a.length;y++){const{name:x,fn:_}=a[y],{x:w,y:C,data:R,reset:E}=await _({x:d,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:u,platform:s,elements:{reference:e,floating:t}});if(d=w??d,h=C??h,g={...g,[x]:{...g[x],...R}},E&&b<=50){b++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(u=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:d,y:h}=aC(u,p,l)),y=-1;continue}}return{x:d,y:h,placement:p,strategy:o,middlewareData:g}};async function hu(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:g=0}=ri(t,e),b=bP(g),x=a[p?h==="floating"?"reference":"floating":h],_=Ch(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),w=h==="floating"?{...s.floating,x:r,y:o}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),R=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},E=Ch(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:C,strategy:l}):w);return{top:(_.top-E.top+b.top)/R.y,bottom:(E.bottom-_.bottom+b.bottom)/R.y,left:(_.left-E.left+b.left)/R.x,right:(E.right-_.right+b.right)/R.x}}const lC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=ri(e,t)||{};if(u==null)return{};const h=bP(d),p={x:n,y:r},g=ey(o),b=J0(g),y=await s.getDimensions(u),x=g==="y",_=x?"top":"left",w=x?"bottom":"right",C=x?"clientHeight":"clientWidth",R=i.reference[b]+i.reference[g]-p[g]-i.floating[b],E=p[g]-i.reference[g],M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let D=M?M[C]:0;(!D||!await(s.isElement==null?void 0:s.isElement(M)))&&(D=a.floating[C]||i.floating[b]);const A=R/2-E/2,k=D/2-y[b]/2-1,L=Ui(h[_],k),W=Ui(h[w],k),Y=L,ne=D-y[b]-W,Q=D/2-y[b]/2+A,F=bb(Y,Q,ne),J=!l.arrow&&Vl(o)!=null&&Q!=F&&i.reference[b]/2-(Q<Y?L:W)-y[b]/2<0,q=J?Q<Y?Q-Y:Q-ne:0;return{[g]:p[g]+q,data:{[g]:F,centerOffset:Q-F-q,...J&&{alignmentOffset:q}},reset:J}}}),UW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...x}=ri(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=oi(o),w=oi(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),R=p||(w||!y?[Sh(a)]:jW(a));!p&&b!=="none"&&R.push(...HW(a,y,b,C));const E=[a,...R],M=await hu(t,x),D=[];let A=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&D.push(M[_]),h){const Y=zW(o,s,C);D.push(M[Y[0]],M[Y[1]])}if(A=[...A,{placement:o,overflows:D}],!D.every(Y=>Y<=0)){var k,L;const Y=(((k=i.flip)==null?void 0:k.index)||0)+1,ne=E[Y];if(ne)return{data:{index:Y,overflows:A},reset:{placement:ne}};let Q=(L=A.filter(F=>F.overflows[0]<=0).sort((F,J)=>F.overflows[1]-J.overflows[1])[0])==null?void 0:L.placement;if(!Q)switch(g){case"bestFit":{var W;const F=(W=A.map(J=>[J.placement,J.overflows.filter(q=>q>0).reduce((q,X)=>q+X,0)]).sort((J,q)=>J[1]-q[1])[0])==null?void 0:W[0];F&&(Q=F);break}case"initialPlacement":Q=a;break}if(o!==Q)return{reset:{placement:Q}}}return{}}}};function cC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uC(e){return NW.some(t=>e[t]>=0)}const qW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ri(e,t);switch(r){case"referenceHidden":{const i=await hu(t,{...o,elementContext:"reference"}),s=cC(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:uC(s)}}}case"escaped":{const i=await hu(t,{...o,altBoundary:!0}),s=cC(i,n.floating);return{data:{escapedOffsets:s,escaped:uC(s)}}}default:return{}}}}};async function GW(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=oi(n),a=Vl(n),l=Hl(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,h=ri(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&typeof b=="number"&&(g=a==="end"?b*-1:b),l?{x:g*d,y:p*u}:{x:p*u,y:g*d}}const YW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await GW(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},KW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:_,y:w}=x;return{x:_,y:w}}},...l}=ri(e,t),u={x:n,y:r},d=await hu(t,l),h=Hl(oi(o)),p=Z0(h);let g=u[p],b=u[h];if(i){const x=p==="y"?"top":"left",_=p==="y"?"bottom":"right",w=g+d[x],C=g-d[_];g=bb(w,g,C)}if(s){const x=h==="y"?"top":"left",_=h==="y"?"bottom":"right",w=b+d[x],C=b-d[_];b=bb(w,b,C)}const y=a.fn({...t,[p]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-r}}}}},XW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=ri(e,t),d={x:n,y:r},h=Hl(o),p=Z0(h);let g=d[p],b=d[h];const y=ri(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const C=p==="y"?"height":"width",R=i.reference[p]-i.floating[C]+x.mainAxis,E=i.reference[p]+i.reference[C]-x.mainAxis;g<R?g=R:g>E&&(g=E)}if(u){var _,w;const C=p==="y"?"width":"height",R=["top","left"].includes(oi(o)),E=i.reference[h]-i.floating[C]+(R&&((_=s.offset)==null?void 0:_[h])||0)+(R?0:x.crossAxis),M=i.reference[h]+i.reference[C]+(R?0:((w=s.offset)==null?void 0:w[h])||0)-(R?x.crossAxis:0);b<E?b=E:b>M&&(b=M)}return{[p]:g,[h]:b}}}},QW=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=ri(e,t),l=await hu(t,a),u=oi(n),d=Vl(n),h=Hl(n)==="y",{width:p,height:g}=r.floating;let b,y;u==="top"||u==="bottom"?(b=u,y=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(y=u,b=d==="end"?"top":"bottom");const x=g-l[b],_=p-l[y],w=!t.middlewareData.shift;let C=x,R=_;if(h){const M=p-l.left-l.right;R=d||w?Ui(_,M):M}else{const M=g-l.top-l.bottom;C=d||w?Ui(x,M):M}if(w&&!d){const M=ur(l.left,0),D=ur(l.right,0),A=ur(l.top,0),k=ur(l.bottom,0);h?R=p-2*(M!==0||D!==0?M+D:ur(l.left,l.right)):C=g-2*(A!==0||k!==0?A+k:ur(l.top,l.bottom))}await s({...t,availableWidth:R,availableHeight:C});const E=await o.getDimensions(i.floating);return p!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function Gi(e){return yP(e)?(e.nodeName||"").toLowerCase():"#document"}function hr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ai(e){var t;return(t=(yP(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yP(e){return e instanceof Node||e instanceof hr(e).Node}function ii(e){return e instanceof Element||e instanceof hr(e).Element}function wo(e){return e instanceof HTMLElement||e instanceof hr(e).HTMLElement}function dC(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof hr(e).ShadowRoot}function Yu(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Lr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ZW(e){return["table","td","th"].includes(Gi(e))}function ty(e){const t=ny(),n=Lr(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function JW(e){let t=Dl(e);for(;wo(t)&&!pp(t);){if(ty(t))return t;t=Dl(t)}return null}function ny(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pp(e){return["html","body","#document"].includes(Gi(e))}function Lr(e){return hr(e).getComputedStyle(e)}function gp(e){return ii(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Dl(e){if(Gi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dC(e)&&e.host||ai(e);return dC(t)?t.host:t}function xP(e){const t=Dl(e);return pp(t)?e.ownerDocument?e.ownerDocument.body:e.body:wo(t)&&Yu(t)?t:xP(t)}function pu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=xP(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=hr(o);return i?t.concat(s,s.visualViewport||[],Yu(o)?o:[],s.frameElement&&n?pu(s.frameElement):[]):t.concat(o,pu(o,[],n))}function wP(e){const t=Lr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=wo(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=_h(n)!==i||_h(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ry(e){return ii(e)?e:e.contextElement}function sl(e){const t=ry(e);if(!wo(t))return qi(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=wP(t);let s=(i?_h(n.width):n.width)/r,a=(i?_h(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const eB=qi(0);function _P(e){const t=hr(e);return!ny()||!t.visualViewport?eB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==hr(e)?!1:t}function ca(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ry(e);let s=qi(1);t&&(r?ii(r)&&(s=sl(r)):s=sl(e));const a=tB(i,n,r)?_P(i):qi(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,d=o.width/s.x,h=o.height/s.y;if(i){const p=hr(i),g=r&&ii(r)?hr(r):r;let b=p.frameElement;for(;b&&r&&g!==p;){const y=sl(b),x=b.getBoundingClientRect(),_=Lr(b),w=x.left+(b.clientLeft+parseFloat(_.paddingLeft))*y.x,C=x.top+(b.clientTop+parseFloat(_.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,h*=y.y,l+=w,u+=C,b=hr(b).frameElement}}return Ch({width:d,height:h,x:l,y:u})}function nB(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=wo(n),i=ai(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=qi(1);const l=qi(0);if((o||!o&&r!=="fixed")&&((Gi(n)!=="body"||Yu(i))&&(s=gp(n)),wo(n))){const u=ca(n);a=sl(n),l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function rB(e){return Array.from(e.getClientRects())}function SP(e){return ca(ai(e)).left+gp(e).scrollLeft}function oB(e){const t=ai(e),n=gp(e),r=e.ownerDocument.body,o=ur(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ur(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+SP(e);const a=-n.scrollTop;return Lr(r).direction==="rtl"&&(s+=ur(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function iB(e,t){const n=hr(e),r=ai(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=ny();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function sB(e,t){const n=ca(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=wo(e)?sl(e):qi(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function fC(e,t,n){let r;if(t==="viewport")r=iB(e,n);else if(t==="document")r=oB(ai(e));else if(ii(t))r=sB(t,n);else{const o=_P(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Ch(r)}function CP(e,t){const n=Dl(e);return n===t||!ii(n)||pp(n)?!1:Lr(n).position==="fixed"||CP(n,t)}function aB(e,t){const n=t.get(e);if(n)return n;let r=pu(e,[],!1).filter(a=>ii(a)&&Gi(a)!=="body"),o=null;const i=Lr(e).position==="fixed";let s=i?Dl(e):e;for(;ii(s)&&!pp(s);){const a=Lr(s),l=ty(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Yu(s)&&!l&&CP(e,s))?r=r.filter(d=>d!==s):o=a,s=Dl(s)}return t.set(e,r),r}function lB(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?aB(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const h=fC(t,d,o);return u.top=ur(h.top,u.top),u.right=Ui(h.right,u.right),u.bottom=Ui(h.bottom,u.bottom),u.left=ur(h.left,u.left),u},fC(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function cB(e){return wP(e)}function uB(e,t,n){const r=wo(t),o=ai(t),i=n==="fixed",s=ca(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=qi(0);if(r||!r&&!i)if((Gi(t)!=="body"||Yu(o))&&(a=gp(t)),r){const u=ca(t,!0,i,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else o&&(l.x=SP(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function hC(e,t){return!wo(e)||Lr(e).position==="fixed"?null:t?t(e):e.offsetParent}function EP(e,t){const n=hr(e);if(!wo(e))return n;let r=hC(e,t);for(;r&&ZW(r)&&Lr(r).position==="static";)r=hC(r,t);return r&&(Gi(r)==="html"||Gi(r)==="body"&&Lr(r).position==="static"&&!ty(r))?n:r||JW(e)||n}const dB=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||EP,i=this.getDimensions;return{reference:uB(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function fB(e){return Lr(e).direction==="rtl"}const hB={convertOffsetParentRelativeRectToViewportRelativeRect:nB,getDocumentElement:ai,getClippingRect:lB,getOffsetParent:EP,getElementRects:dB,getClientRects:rB,getDimensions:cB,getScale:sl,isElement:ii,isRTL:fB};function pB(e,t){let n=null,r;const o=ai(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:u,top:d,width:h,height:p}=e.getBoundingClientRect();if(a||t(),!h||!p)return;const g=Cf(d),b=Cf(o.clientWidth-(u+h)),y=Cf(o.clientHeight-(d+p)),x=Cf(u),w={rootMargin:-g+"px "+-b+"px "+-y+"px "+-x+"px",threshold:ur(0,Ui(1,l))||1};let C=!0;function R(E){const M=E[0].intersectionRatio;if(M!==l){if(!C)return s();M?s(!1,M):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(R,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,w)}n.observe(e)}return s(!0),i}function gB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ry(e),d=o||i?[...u?pu(u):[],...pu(t)]:[];d.forEach(_=>{o&&_.addEventListener("scroll",n,{passive:!0}),i&&_.addEventListener("resize",n)});const h=u&&a?pB(u,n):null;let p=-1,g=null;s&&(g=new ResizeObserver(_=>{let[w]=_;w&&w.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let b,y=l?ca(e):null;l&&x();function x(){const _=ca(e);y&&(_.x!==y.x||_.y!==y.y||_.width!==y.width||_.height!==y.height)&&n(),y=_,b=requestAnimationFrame(x)}return n(),()=>{d.forEach(_=>{o&&_.removeEventListener("scroll",n),i&&_.removeEventListener("resize",n)}),h&&h(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(b)}}const mB=(e,t,n)=>{const r=new Map,o={platform:hB,...n},i={...o.platform,_c:r};return BW(e,t,{...o,platform:i})},vB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?lC({element:r.current,padding:o}).fn(n):{}:r?lC({element:r,padding:o}).fn(n):{}}}};var Qf=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Eh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Eh(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Eh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function RP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pC(e,t){const n=RP(e);return Math.round(t*n)/n}function gC(e){const t=le.useRef(e);return Qf(()=>{t.current=e}),t}function bB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,h]=le.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=le.useState(r);Eh(p,r)||g(r);const[b,y]=le.useState(null),[x,_]=le.useState(null),w=le.useCallback(J=>{J!=M.current&&(M.current=J,y(J))},[y]),C=le.useCallback(J=>{J!==D.current&&(D.current=J,_(J))},[_]),R=i||b,E=s||x,M=le.useRef(null),D=le.useRef(null),A=le.useRef(d),k=gC(l),L=gC(o),W=le.useCallback(()=>{if(!M.current||!D.current)return;const J={placement:t,strategy:n,middleware:p};L.current&&(J.platform=L.current),mB(M.current,D.current,J).then(q=>{const X={...q,isPositioned:!0};Y.current&&!Eh(A.current,X)&&(A.current=X,sN.flushSync(()=>{h(X)}))})},[p,t,n,L]);Qf(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,h(J=>({...J,isPositioned:!1})))},[u]);const Y=le.useRef(!1);Qf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Qf(()=>{if(R&&(M.current=R),E&&(D.current=E),R&&E){if(k.current)return k.current(R,E,W);W()}},[R,E,W,k]);const ne=le.useMemo(()=>({reference:M,floating:D,setReference:w,setFloating:C}),[w,C]),Q=le.useMemo(()=>({reference:R,floating:E}),[R,E]),F=le.useMemo(()=>{const J={position:n,left:0,top:0};if(!Q.floating)return J;const q=pC(Q.floating,d.x),X=pC(Q.floating,d.y);return a?{...J,transform:"translate("+q+"px, "+X+"px)",...RP(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:X}},[n,a,Q.floating,d.x,d.y]);return le.useMemo(()=>({...d,update:W,refs:ne,elements:Q,floatingStyles:F}),[d,W,ne,Q,F])}function mp(e){const[t,n]=m.useState(void 0);return Pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const $P="Popper",[PP,$o]=dn($P),[yB,OP]=PP($P),xB=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(yB,{scope:t,anchor:r,onAnchorChange:o},n)},wB="PopperAnchor",_B=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=OP(wB,n),s=m.useRef(null),a=Xe(t,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(ke.div,te({},o,{ref:a}))}),DP="PopperContent",[SB,noe]=PP(DP),CB=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,u;const{__scopePopper:d,side:h="bottom",sideOffset:p=0,align:g="center",alignOffset:b=0,arrowPadding:y=0,avoidCollisions:x=!0,collisionBoundary:_=[],collisionPadding:w=0,sticky:C="partial",hideWhenDetached:R=!1,updatePositionStrategy:E="optimized",onPlaced:M,...D}=e,A=OP(DP,d),[k,L]=m.useState(null),W=Xe(t,Ve=>L(Ve)),[Y,ne]=m.useState(null),Q=mp(Y),F=(n=Q==null?void 0:Q.width)!==null&&n!==void 0?n:0,J=(r=Q==null?void 0:Q.height)!==null&&r!==void 0?r:0,q=h+(g!=="center"?"-"+g:""),X=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},ae=Array.isArray(_)?_:[_],j=ae.length>0,V={padding:X,boundary:ae.filter(EB),altBoundary:j},{refs:oe,floatingStyles:ce,placement:ue,isPositioned:ge,middlewareData:ve}=bB({strategy:"fixed",placement:q,whileElementsMounted:(...Ve)=>gB(...Ve,{animationFrame:E==="always"}),elements:{reference:A.anchor},middleware:[YW({mainAxis:p+J,alignmentAxis:b}),x&&KW({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?XW():void 0,...V}),x&&UW({...V}),QW({...V,apply:({elements:Ve,rects:qe,availableWidth:pt,availableHeight:dt})=>{const{width:ft,height:Bt}=qe.reference,Vt=Ve.floating.style;Vt.setProperty("--radix-popper-available-width",`${pt}px`),Vt.setProperty("--radix-popper-available-height",`${dt}px`),Vt.setProperty("--radix-popper-anchor-width",`${ft}px`),Vt.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),Y&&vB({element:Y,padding:y}),RB({arrowWidth:F,arrowHeight:J}),R&&qW({strategy:"referenceHidden",...V})]}),[fe,ee]=MP(ue),K=on(M);Pn(()=>{ge&&(K==null||K())},[ge,K]);const ie=(o=ve.arrow)===null||o===void 0?void 0:o.x,ye=(i=ve.arrow)===null||i===void 0?void 0:i.y,Z=((s=ve.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[De,Ne]=m.useState();return Pn(()=>{k&&Ne(window.getComputedStyle(k).zIndex)},[k]),m.createElement("div",{ref:oe.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:ge?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:De,"--radix-popper-transform-origin":[(a=ve.transformOrigin)===null||a===void 0?void 0:a.x,(l=ve.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(SB,{scope:d,placedSide:fe,onArrowChange:ne,arrowX:ie,arrowY:ye,shouldHideArrow:Z},m.createElement(ke.div,te({"data-side":fe,"data-align":ee},D,{ref:W,style:{...D.style,animation:ge?void 0:"none",opacity:(u=ve.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function EB(e){return e!==null}const RB=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:u}=t,h=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=h?0:e.arrowWidth,g=h?0:e.arrowHeight,[b,y]=MP(a),x={start:"0%",center:"50%",end:"100%"}[y],_=((r=(o=u.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+p/2,w=((i=(s=u.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+g/2;let C="",R="";return b==="bottom"?(C=h?x:`${_}px`,R=`${-g}px`):b==="top"?(C=h?x:`${_}px`,R=`${l.floating.height+g}px`):b==="right"?(C=`${-g}px`,R=h?x:`${w}px`):b==="left"&&(C=`${l.floating.width+g}px`,R=h?x:`${w}px`),{data:{x:C,y:R}}}});function MP(e){const[t,n="center"]=e.split("-");return[t,n]}const Ku=xB,Xu=_B,Qu=CB,vp=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?So.createPortal(m.createElement(ke.div,te({},o,{ref:t})),r):null}),TP=m.forwardRef((e,t)=>m.createElement(ke.span,te({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),$B=TP,[bp,roe]=dn("Tooltip",[$o]),oy=$o(),PB="TooltipProvider",OB=700,xb="tooltip.open",[DB,iy]=bp(PB),MB=e=>{const{__scopeTooltip:t,delayDuration:n=OB,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=m.useState(!0),l=m.useRef(!1),u=m.useRef(0);return m.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),m.createElement(DB,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:o},i)},sy="Tooltip",[TB,yp]=bp(sy),AB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=iy(sy,e.__scopeTooltip),u=oy(t),[d,h]=m.useState(null),p=Yn(),g=m.useRef(0),b=s??l.disableHoverableContent,y=a??l.delayDuration,x=m.useRef(!1),[_=!1,w]=On({prop:r,defaultProp:o,onChange:D=>{D?(l.onOpen(),document.dispatchEvent(new CustomEvent(xb))):l.onClose(),i==null||i(D)}}),C=m.useMemo(()=>_?x.current?"delayed-open":"instant-open":"closed",[_]),R=m.useCallback(()=>{window.clearTimeout(g.current),x.current=!1,w(!0)},[w]),E=m.useCallback(()=>{window.clearTimeout(g.current),w(!1)},[w]),M=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,w(!0)},y)},[y,w]);return m.useEffect(()=>()=>window.clearTimeout(g.current),[]),m.createElement(Ku,u,m.createElement(TB,{scope:t,contentId:p,open:_,stateAttribute:C,trigger:d,onTriggerChange:h,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?M():R()},[l.isOpenDelayed,M,R]),onTriggerLeave:m.useCallback(()=>{b?E():window.clearTimeout(g.current)},[E,b]),onOpen:R,onClose:E,disableHoverableContent:b},n))},mC="TooltipTrigger",AP=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=yp(mC,n),i=iy(mC,n),s=oy(n),a=m.useRef(null),l=Xe(t,a,o.onTriggerChange),u=m.useRef(!1),d=m.useRef(!1),h=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),m.createElement(Xu,te({asChild:!0},s),m.createElement(ke.button,te({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:we(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:we(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:we(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:we(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:we(e.onBlur,o.onClose),onClick:we(e.onClick,o.onClose)})))}),IB="TooltipPortal",[ooe,kB]=bp(IB,{forceMount:void 0}),gu="TooltipContent",NB=m.forwardRef((e,t)=>{const n=kB(gu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=yp(gu,e.__scopeTooltip);return m.createElement(Zt,{present:r||s.open},s.disableHoverableContent?m.createElement(IP,te({side:o},i,{ref:t})):m.createElement(LB,te({side:o},i,{ref:t})))}),LB=m.forwardRef((e,t)=>{const n=yp(gu,e.__scopeTooltip),r=iy(gu,e.__scopeTooltip),o=m.useRef(null),i=Xe(t,o),[s,a]=m.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:h}=r,p=m.useCallback(()=>{a(null),h(!1)},[h]),g=m.useCallback((b,y)=>{const x=b.currentTarget,_={x:b.clientX,y:b.clientY},w=zB(_,x.getBoundingClientRect()),C=jB(_,w),R=VB(y.getBoundingClientRect()),E=WB([...C,...R]);a(E),h(!0)},[h]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(l&&d){const b=x=>g(x,d),y=x=>g(x,l);return l.addEventListener("pointerleave",b),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",y)}}},[l,d,g,p]),m.useEffect(()=>{if(s){const b=y=>{const x=y.target,_={x:y.clientX,y:y.clientY},w=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),C=!HB(_,s);w?p():C&&(p(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,d,s,u,p]),m.createElement(IP,te({},e,{ref:i}))}),[FB,ioe]=bp(sy,{isInside:!1}),IP=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=yp(gu,n),u=oy(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(xb,d),()=>document.removeEventListener(xb,d)),[d]),m.useEffect(()=>{if(l.trigger){const h=p=>{const g=p.target;g!=null&&g.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),m.createElement(jl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:d},m.createElement(Qu,te({"data-state":l.stateAttribute},u,a,{ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),m.createElement(iR,null,r),m.createElement(FB,{scope:n,isInside:!0},m.createElement($B,{id:l.contentId,role:"tooltip"},o||r))))});function zB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function jB(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function VB(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function HB(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,u=t[s].x,d=t[s].y;l>r!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function WB(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),BB(t)}function BB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const UB=MB,qB=AB,GB=AP,kP=NB,YB=UB,NP=qB,LP=GB,ay=le.forwardRef(({className:e,sideOffset:t=4,...n},r)=>I.jsx(kP,{ref:r,sideOffset:t,className:_e("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));ay.displayName=kP.displayName;/**
|
|
133
|
-
* @license lucide-react v0.379.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const KB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),FP=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
|
|
138
|
-
* @license lucide-react v0.379.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/var XB={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"};/**
|
|
143
|
-
* @license lucide-react v0.379.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const QB=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>m.createElement("svg",{ref:l,...XB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:FP("lucide",o),...a},[...s.map(([u,d])=>m.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
|
|
148
|
-
* @license lucide-react v0.379.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const br=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(QB,{ref:i,iconNode:t,className:FP(`lucide-${KB(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
153
|
-
* @license lucide-react v0.379.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const zP=br("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
158
|
-
* @license lucide-react v0.379.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const Zu=br("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
163
|
-
* @license lucide-react v0.379.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const xp=br("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
168
|
-
* @license lucide-react v0.379.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const ZB=br("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
173
|
-
* @license lucide-react v0.379.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const jP=br("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
178
|
-
* @license lucide-react v0.379.0 - ISC
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the ISC license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const JB=br("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
183
|
-
* @license lucide-react v0.379.0 - ISC
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the ISC license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const VP=br("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
188
|
-
* @license lucide-react v0.379.0 - ISC
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the ISC license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const eU=br("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
193
|
-
* @license lucide-react v0.379.0 - ISC
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the ISC license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/const ly=br("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
198
|
-
* @license lucide-react v0.379.0 - ISC
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the ISC license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/const HP=br("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
203
|
-
* @license lucide-react v0.379.0 - ISC
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the ISC license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/const tU=br("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
|
|
208
|
-
* @license lucide-react v0.379.0 - ISC
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the ISC license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/const WP=br("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function vC({number:e,format:t,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const u=t.includes(".")?t.split(".")[1].length:0;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&i==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&i==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const d=e/s,h={maximumFractionDigits:u,minimumFractionDigits:u};if(o){h.style="currency",h.currency=o;try{new Intl.NumberFormat("en-US",h).format(0)}catch{h.currency="USD"}}try{new Intl.NumberFormat(i,h).format(0)}catch{l="en-US"}let g=new Intl.NumberFormat(l,h).format(d);return n&&(g+=a),g}function BP({card:e,isLoading:t}){var x,_,w,C,R,E,M,D,A,k,L,W,Y,ne,Q,F,J,q;const n=Ce(X=>X.actions.setCardTitle),r=Ce(X=>X.actions.setCardDescription),o=Ce(X=>X.isVisualEditing),i=Ar(X=>X.card),s=Ar(X=>X.actions.setCard);Ar(X=>X.actions.setNumberFormat);const a=Ce(X=>X.selectedSheetId),l=e.data,{metricKeys:u}=Nr(l||[]),d=(x=l==null?void 0:l[0])==null?void 0:x[u==null?void 0:u[0]],h=(_=l==null?void 0:l[0])==null?void 0:_[u==null?void 0:u[1]],p=!!e.data&&e.data.length>0;function g(X){o?s({...i,title:X}):n(a,e.id,X)}function b(X){o?s({...i,description:X}):r(a,e.id,X)}const y=h&&h-d!==0?(d-h)/h:null;return I.jsxs("div",{className:"kpi-card flex grow flex-col overflow-scroll",children:[I.jsxs(Gh,{className:"grow pb-3",children:[I.jsx(sa,{text:o?i.title:e.title,onSave:g,children:I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx(Vu,{className:"text-base font-medium text-muted-foreground",children:e.title}),!e.refreshInterval&&t&&I.jsx(ly,{className:"h-4 w-4 animate-spin text-muted-foreground"})]})}),p&&I.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[I.jsx("p",{className:"text-3xl font-semibold",children:vC({number:d,format:((C=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:C.format)||"",useSuffix:!!((E=(R=e.preferences)==null?void 0:R.formatNumber)!=null&&E.suffix),customSuffix:"",locale:((D=(M=e.preferences)==null?void 0:M.formatNumber)==null?void 0:D.locale)||"",currency:((k=(A=e.preferences)==null?void 0:A.formatNumber)==null?void 0:k.currency)||""})}),h&&I.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",vC({number:h,format:((W=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:W.format)||"",useSuffix:!!((ne=(Y=e.preferences)==null?void 0:Y.formatNumber)!=null&&ne.suffix),customSuffix:"",locale:((F=(Q=e.preferences)==null?void 0:Q.formatNumber)==null?void 0:F.locale)||"",currency:((q=(J=e.preferences)==null?void 0:J.formatNumber)==null?void 0:q.currency)||""})]})]})]}),y&&I.jsxs(Yh,{className:"grow items-start gap-1 pb-4 text-sm",children:[I.jsx(nU,{children:y}),I.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[y>0?"up ":"down ",I.jsx(sa,{text:e.description||"",onSave:b,children:e.description})]})]})]})}function nU({children:e}){const t=e>0?I.jsx(X0,{className:"h-4 w-4"}):I.jsx(K0,{className:"h-4 w-4"}),n=`${Math.abs(e*100).toFixed(0)}%`;return I.jsxs("div",{className:_e("flex items-center",{"text-green-600":e>0,"text-destructive":e<0}),children:[t,I.jsx("span",{className:"ml-[1px]",children:n})]})}var Ml=1e3,Tl=Ml*60,Al=Tl*60,ua=Al*24,rU=ua*7,oU=ua*365.25,iU=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return sU(e);if(n==="number"&&isFinite(e))return t.long?lU(e):aU(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function sU(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*oU;case"weeks":case"week":case"w":return n*rU;case"days":case"day":case"d":return n*ua;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Al;case"minutes":case"minute":case"mins":case"min":case"m":return n*Tl;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ml;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function aU(e){var t=Math.abs(e);return t>=ua?Math.round(e/ua)+"d":t>=Al?Math.round(e/Al)+"h":t>=Tl?Math.round(e/Tl)+"m":t>=Ml?Math.round(e/Ml)+"s":e+"ms"}function lU(e){var t=Math.abs(e);return t>=ua?Ef(e,t,ua,"day"):t>=Al?Ef(e,t,Al,"hour"):t>=Tl?Ef(e,t,Tl,"minute"):t>=Ml?Ef(e,t,Ml,"second"):e+" ms"}function Ef(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const cU=Lu(iU);function UP({children:e}){const{setIsSessionExpired:t}=Ki(),n=new V6({queryCache:new QE({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return I.jsx(q6,{client:n,children:e})}const uU={id:"",authToken:void 0},qP=m.createContext(uU),GP=({children:e,dashboardProps:t})=>I.jsx(UP,{children:I.jsx(qP.Provider,{value:t,children:e})});function Wl(){const e=m.useContext(qP);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function dU(e){Ce(u=>u.bookmarkKey);const t=Ce(u=>u.dashboard.baseQueries),{authToken:n}=Wl(),r=Ce(u=>u.authToken),o=Ce(u=>u.filterValues),i=Ce(u=>u.isDashboardEditing),s=cU((e==null?void 0:e.refreshInterval)||"0"),a=DE(e.sql,t);return ju({queryKey:[e.id,a],queryFn:()=>jh("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===BE?"":e.python,active_filters:o}),refetchInterval:s,enabled:!!e.connectionId&&!i})}function Wa({data:e,cfg:t,customCfg:n,preferences:r}){const{dimensionKeys:o,metricKeys:i}=Nr(e),s=CW(i,e,r),a=gb(s,n),l=o[0],u=mP(e,l);ia.merge((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions);const d=mb((t==null?void 0:t.options)||{},(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:u,datasets:a},options:d}}function fU(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function hU(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function pU(e){var n,r,o,i;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{...(r=(n=e==null?void 0:e.options)==null?void 0:n.scales)==null?void 0:r.x,display:!0,stacked:!0},y:{...(i=(o=e==null?void 0:e.options)==null?void 0:o.scales)==null?void 0:i.y,display:!0,stacked:!0}}}}}function gU(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function mU(e,t){return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}}}}}function vU(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function YP({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){if(t==="bar"){const a=hU(n);return Wa({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const a=fU(n);return Wa({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="stackedBar"){const a=pU(n),{dimensionKeys:l,metricKeys:u}=Nr(e),d=Q0({dataArray:e,groupKey:l[0],pivotKey:l[1],valueKey:u[0]});return Wa({data:d,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const a=gU(n);return Wa({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pie"||t==="doughnut"||t==="polarArea"){const a=mU(t,n),{dimensionKeys:l,metricKeys:u}=Nr(e),d=$W(u,e),h=gb(d,r),p=l[0],g=mP(e,p),b=mb((a==null?void 0:a.options)||{},(r==null?void 0:r.options)||{});return{type:t,data:{labels:g,datasets:h},options:b}}if(t==="radar"){const a=vU(n);return Wa({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:a}=Nr(e);if(a.length<3){console.log("Bubble charts require 3 numeric columns");return}const l=RW(e),u=gb(l,r),d={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:a[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:a[1]},beginAtZero:!0,ticks:{precision:0}}}},h=mb(d,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:u},options:h}}return Wa({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function bU({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=Ce.getState().theme;if(!o)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&xU(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&wU(e,t,o,i,a),r==="stackedBar"&&yU({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function yU(e){var a,l,u,d;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:s}=e;i?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((h,p)=>{var g,b;typeof h.backgroundColor=="string"&&(h.backgroundColor=new Array(h.data.length).fill(h.backgroundColor),h.borderColor=new Array(h.data.length).fill(h.borderColor)),h.backgroundColor=(g=h==null?void 0:h.backgroundColor)==null?void 0:g.map((y,x)=>x===n&&p===r?y:s),h.borderColor=(b=h==null?void 0:h.borderColor)==null?void 0:b.map((y,x)=>x===n&&p===r?y:s)}):(d=(u=t==null?void 0:t.data)==null?void 0:u.datasets)==null||d.forEach((h,p)=>{var g,b,y,x,_,w;h.backgroundColor=new Array(h.data.length).fill((y=(b=(g=o==null?void 0:o.data)==null?void 0:g.datasets)==null?void 0:b[p])==null?void 0:y.backgroundColor),h.borderColor=new Array(h.data.length).fill((w=(_=(x=o==null?void 0:o.data)==null?void 0:x.datasets)==null?void 0:_[p])==null?void 0:w.borderColor)}),t==null||t.update()}function xU(e,t,n,r,o){var i,s,a,l;console.log("clicked index",t),r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(u=>{var d,h;typeof u.backgroundColor=="string"&&(u.backgroundColor=new Array(u.data.length).fill(u.backgroundColor),u.borderColor=new Array(u.data.length).fill(u.borderColor)),u.backgroundColor=(d=u==null?void 0:u.backgroundColor)==null?void 0:d.map((p,g)=>g===t?p:o),u.borderColor=(h=u==null?void 0:u.borderColor)==null?void 0:h.map((p,g)=>g===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((u,d)=>{var h,p,g,b,y,x;u.backgroundColor=new Array(u.data.length).fill((g=(p=(h=n==null?void 0:n.data)==null?void 0:h.datasets)==null?void 0:p[d])==null?void 0:g.backgroundColor),u.borderColor=new Array(u.data.length).fill((x=(y=(b=n==null?void 0:n.data)==null?void 0:b.datasets)==null?void 0:y[d])==null?void 0:x.borderColor)}),e==null||e.update()}function wU(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(u=>{var d,h;u.backgroundColor=(d=u==null?void 0:u.backgroundColor)==null?void 0:d.map((p,g)=>g===t?p:o),u.borderColor=(h=u==null?void 0:u.borderColor)==null?void 0:h.map((p,g)=>g===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((u,d)=>{var h,p,g,b,y,x,_,w;typeof u.backgroundColor=="string"&&(u.backgroundColor=(g=(p=(h=n==null?void 0:n.data)==null?void 0:h.datasets)==null?void 0:p[d])==null?void 0:g.backgroundColor,u.borderColor=(x=(y=(b=n==null?void 0:n.data)==null?void 0:b.datasets)==null?void 0:y[d])==null?void 0:x.borderColor),u.backgroundColor=(_=u==null?void 0:u.backgroundColor)==null?void 0:_.map((C,R)=>{var E;return(E=n.data.datasets[d].backgroundColor)==null?void 0:E[R]}),u.borderColor=(w=u==null?void 0:u.borderColor)==null?void 0:w.map((C,R)=>{var E;return(E=n.data.datasets[d].borderColor)==null?void 0:E[R]})}),e==null||e.update()}function _U(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=Nr(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],u=(o=e.data[n])==null?void 0:o[l];return[{columnName:l,columnValue:u,metric:a[t],value:r}]}if(e.type==="stackedBar"){const l=Q0({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),u=s[0],d=(i=l[n])==null?void 0:i[u],h=s[1],{metricKeys:p}=Nr(l),g=p[t];return[{columnName:u,columnValue:d,metric:a[0],value:r},{columnName:h,columnValue:g,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],u=r.label;return[{columnName:l,columnValue:u,metric1:a[0],value1:r.x,metric2:a[1],value2:r.y,metric3:a==null?void 0:a[2],value3:r==null?void 0:r.r}]}}catch(s){console.error("Error in getAdhocFilter",s)}}function SU(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=Ki(),r=n(e),o=cy(r||t),i={...r,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[]};return{...o,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[],card:i}}function cy(e){var W,Y,ne;const{onChartElementClicked:t}=Wl(),[n,r]=m.useState(0),o=((W=e==null?void 0:e.preferences)==null?void 0:W.filterOnClickColumnIndex)===void 0?0:(Y=e.preferences)==null?void 0:Y.filterOnClickColumnIndex,i=Ce(Q=>Q.bookmarkKey);Ce(Q=>Q.isVisualEditing);const s=Ce(Q=>Q.filteringCards),a=Ce(Q=>Q.selectedSheetId);Ce(Q=>Q.selectedCardId),Ce(Q=>Q.isDashboardEditing);const l=Ce(Q=>Q.themeStyle),u=Ce(Q=>Q.filterValues),d=(ne=e==null?void 0:e.preferences)==null?void 0:ne.onClickFilter,{addFrame:h,addFilteringCard:p,setFrameCardData:g,getSelectedFrame:b,addOrUpdateFilterValue:y,addOrUpdateFilterValues:x,removeFilterValue:_,removeFilteringCard:w}=Ki(),{data:C,isLoading:R,isFetching:E,isError:M,refetch:D}=dU(e),A=s==null?void 0:s.find(Q=>Q.id===e.id);let k;e.data&&e.data.length>0&&(k=YP({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences})),m.useEffect(()=>{!C||!C.records||g(a,e.id,(C==null?void 0:C.records)||[])},[C,a,e.id,g,u]),m.useEffect(()=>{e.data&&r(n+1)},[e.data,e.type,e.cfg,e.customCfg,e.preferences,l]),m.useEffect(()=>{e.connectionId&&!A&&D()},[u,i]);function L(Q,F,J,q){var j,V;let X=!1;if(!e.data)return;const ae=_U(e,F,J,q);if(t==null||t(e,ae),!!(((j=e==null?void 0:e.preferences)==null?void 0:j.onClickFilter)??[]).length){if(A){const oe=e.id;_(oe),w(e)}else{if(X=!0,!ae)return;const oe=[];ae.forEach((ce,ue)=>{const ge=d==null?void 0:d.find(fe=>fe.columnIndex===ue);if(!ge)return;const ve={filterId:e.id+"-"+ce.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:ce.columnName,expression:ge.expression,valueType:nu(ae[ge.columnIndex].columnValue),operation:"=",values:[ae[ge.columnIndex].columnValue]};oe.push(ve)}),e.id,e==null||e.connectionId,e.lastSelectedTable,ae[o].columnName,(V=e.preferences)==null||V.filterOnClickField,nu(ae[o].columnValue),ae[o].columnValue,x(oe),p(e)}bU({chart:Q,elementIndex:J,datasetIndex:F,cardType:e.type,cfg:k,apply:X})}}return{isError:M,isLoading:R,isFetching:E,data:C,visualKey:n,handleDatapointClick:L,cfg:k}}function CU(e,t){const n=Ce(d=>d.selectedSheetId),r=Ce(d=>d.selectedFrameId),o=Ce(d=>d.isDashboardEditing),i=Ce(d=>d.isVisualEditing),{addFrame:s,getSelectedFrame:a,setSelectedFrameId:l}=Ce(d=>d.actions);m.useEffect(()=>{const d=p=>{if(o&&((p.metaKey||p.ctrlKey)&&p.key==="c"&&navigator.clipboard.writeText(JSON.stringify(a())),(p.ctrlKey||p.metaKey)&&p.key==="v"))try{navigator.clipboard.readText().then(g=>{try{const b=JSON.parse(g);if(b&&b.id){b.id=fu();const y=b.activeCardId;b.cards.forEach(x=>{const _=x.id;x.id=fu(),_===y&&(b.activeCardId=x.id,x.title=`${x.title} (Copy)`)}),s(n,b),l(b.id)}}catch(b){console.error("Failed to parse clipboard contents: ",b)}})}catch(g){console.error("Failed to read clipboard contents: ",g)}},h=t==null?void 0:t.current;return h==null||h.addEventListener("keydown",d),()=>{h==null||h.removeEventListener("keydown",d)}},[o,n,a,s,t,l]),m.useEffect(()=>{r===e.id&&o&&!i&&u()},[r,e.id,o,i]);function u(){const d=t==null?void 0:t.current;d==null||d.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}let Nm;const KP="HoverCard",[XP,soe]=dn(KP,[$o]),uy=$o(),[EU,dy]=XP(KP),RU=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=uy(t),u=m.useRef(0),d=m.useRef(0),h=m.useRef(!1),p=m.useRef(!1),[g=!1,b]=On({prop:r,defaultProp:o,onChange:i}),y=m.useCallback(()=>{clearTimeout(d.current),u.current=window.setTimeout(()=>b(!0),s)},[s,b]),x=m.useCallback(()=>{clearTimeout(u.current),!h.current&&!p.current&&(d.current=window.setTimeout(()=>b(!1),a))},[a,b]),_=m.useCallback(()=>b(!1),[b]);return m.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(d.current)},[]),m.createElement(EU,{scope:t,open:g,onOpenChange:b,onOpen:y,onClose:x,onDismiss:_,hasSelectionRef:h,isPointerDownOnContentRef:p},m.createElement(Ku,l,n))},$U="HoverCardTrigger",PU=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=dy($U,n),i=uy(n);return m.createElement(Xu,te({asChild:!0},i),m.createElement(ke.a,te({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:we(e.onPointerEnter,Rh(o.onOpen)),onPointerLeave:we(e.onPointerLeave,Rh(o.onClose)),onFocus:we(e.onFocus,o.onOpen),onBlur:we(e.onBlur,o.onClose),onTouchStart:we(e.onTouchStart,s=>s.preventDefault())})))}),OU="HoverCardPortal",[aoe,DU]=XP(OU,{forceMount:void 0}),wb="HoverCardContent",MU=m.forwardRef((e,t)=>{const n=DU(wb,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=dy(wb,e.__scopeHoverCard);return m.createElement(Zt,{present:r||i.open},m.createElement(TU,te({"data-state":i.open?"open":"closed"},o,{onPointerEnter:we(e.onPointerEnter,Rh(i.onOpen)),onPointerLeave:we(e.onPointerLeave,Rh(i.onClose)),ref:t})))}),TU=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=dy(wb,n),u=uy(n),d=m.useRef(null),h=Xe(t,d),[p,g]=m.useState(!1);return m.useEffect(()=>{if(p){const b=document.body;return Nm=b.style.userSelect||b.style.webkitUserSelect,b.style.userSelect="none",b.style.webkitUserSelect="none",()=>{b.style.userSelect=Nm,b.style.webkitUserSelect=Nm}}},[p]),m.useEffect(()=>{if(d.current){const b=()=>{g(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())===null||y===void 0?void 0:y.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",b),()=>{document.removeEventListener("pointerup",b),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{d.current&&AU(d.current).forEach(y=>y.setAttribute("tabindex","-1"))}),m.createElement(jl,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:we(i,b=>{b.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Qu,te({},u,a,{onPointerDown:we(a.onPointerDown,b=>{b.currentTarget.contains(b.target)&&g(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:h,style:{...a.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function Rh(e){return t=>t.pointerType==="touch"?void 0:e()}function AU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const IU=RU,kU=PU,QP=MU,ZP=IU,JP=kU,fy=le.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>I.jsx(QP,{ref:o,align:t,sideOffset:n,className:_e("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));fy.displayName=QP.displayName;function NU({card:e}){const{setCardInfo:t}=Ki();return I.jsxs(ZP,{openDelay:0,children:[I.jsx(JP,{children:I.jsx(eU,{className:"size-4 text-muted-foreground/40"})}),I.jsx(fy,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:I.jsx(sa,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:I.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Add Info"})})})]})}const hy=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{className:"relative w-full overflow-auto",children:I.jsx("table",{ref:n,className:_e("w-full caption-bottom text-sm",e),...t})}));hy.displayName="Table";const py=le.forwardRef(({className:e,...t},n)=>I.jsx("thead",{ref:n,className:_e("[&_tr]:border-b",e),...t}));py.displayName="TableHeader";const gy=le.forwardRef(({className:e,...t},n)=>I.jsx("tbody",{ref:n,className:_e("[&_tr:last-child]:border-0",e),...t}));gy.displayName="TableBody";const LU=le.forwardRef(({className:e,...t},n)=>I.jsx("tfoot",{ref:n,className:_e("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));LU.displayName="TableFooter";const Xc=le.forwardRef(({className:e,...t},n)=>I.jsx("tr",{ref:n,className:_e("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Xc.displayName="TableRow";const my=le.forwardRef(({className:e,...t},n)=>I.jsx("th",{ref:n,className:_e("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));my.displayName="TableHead";const $h=le.forwardRef(({className:e,...t},n)=>I.jsx("td",{ref:n,className:_e("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));$h.displayName="TableCell";const FU=le.forwardRef(({className:e,...t},n)=>I.jsx("caption",{ref:n,className:_e("mt-4 text-sm text-muted-foreground",e),...t}));FU.displayName="TableCaption";/**
|
|
213
|
-
* table-core
|
|
214
|
-
*
|
|
215
|
-
* Copyright (c) TanStack
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the MIT license found in the
|
|
218
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
219
|
-
*
|
|
220
|
-
* @license MIT
|
|
221
|
-
*/function zi(e,t){return typeof e=="function"?e(t):e}function mr(e,t){return n=>{t.setState(r=>({...r,[e]:zi(n,r[e])}))}}function Ph(e){return e instanceof Function}function zU(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function jU(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function Be(e,t,n){let r=[],o;return()=>{let i;n.key&&n.debug&&(i=Date.now());const s=e();if(!(s.length!==r.length||s.some((u,d)=>r[d]!==u)))return o;r=s;let l;if(n.key&&n.debug&&(l=Date.now()),o=t(...s),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-i)*100)/100,d=Math.round((Date.now()-l)*100)/100,h=d/16,p=(g,b)=>{for(g=String(g);g.length<b;)g=" "+g;return g};console.info(`%c⏱ ${p(d,5)} /${p(u,5)} ms`,`
|
|
222
|
-
font-size: .6rem;
|
|
223
|
-
font-weight: bold;
|
|
224
|
-
color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function VU(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let u=(o=(i=a.id)!=null?i:l?l.replace(".","_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:l&&(l.includes(".")?d=p=>{let g=p;for(const y of l.split(".")){var b;g=(b=g)==null?void 0:b[y],process.env.NODE_ENV!=="production"&&g===void 0&&console.warn(`"${y}" in deeply nested key "${l}" returned undefined.`)}return g}:d=p=>p[a.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let h={id:`${String(u)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Be(()=>[!0],()=>{var p;return[h,...(p=h.columns)==null?void 0:p.flatMap(g=>g.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var p;return(p=e.options.debugAll)!=null?p:e.options.debugColumns}}),getLeafColumns:Be(()=>[e._getOrderColumnsFn()],p=>{var g;if((g=h.columns)!=null&&g.length){let b=h.columns.flatMap(y=>y.getLeafColumns());return p(b)}return[h]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var p;return(p=e.options.debugAll)!=null?p:e.options.debugColumns}})};for(const p of e._features)p.createColumn==null||p.createColumn(h,e);return h}function bC(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const HU={createTable:e=>{e.getHeaderGroups=Be(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(h=>n.find(p=>p.id===h)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(h=>n.find(p=>p.id===h)).filter(Boolean))!=null?s:[],u=n.filter(h=>!(r!=null&&r.includes(h.id))&&!(o!=null&&o.includes(h.id)));return Rf(t,[...a,...u,...l],e)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=Be(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Rf(t,n,e,"center")),{key:process.env.NODE_ENV==="development"&&"getCenterHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftHeaderGroups=Be(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Rf(t,i,e,"left")},{key:process.env.NODE_ENV==="development"&&"getLeftHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightHeaderGroups=Be(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Rf(t,i,e,"right")},{key:process.env.NODE_ENV==="development"&&"getRightHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFooterGroups=Be(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFooterGroups=Be(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getLeftFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFooterGroups=Be(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getCenterFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFooterGroups=Be(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getRightFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFlatHeaders=Be(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFlatHeaders=Be(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getLeftFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFlatHeaders=Be(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getCenterFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFlatHeaders=Be(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getRightFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterLeafHeaders=Be(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getCenterLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftLeafHeaders=Be(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getLeftLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightLeafHeaders=Be(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getRightLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeafHeaders=Be(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,u;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(u=r[0])==null?void 0:u.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})}};function Rf(e,t,n,r){var o,i;let s=0;const a=function(p,g){g===void 0&&(g=1),s=Math.max(s,g),p.filter(b=>b.getIsVisible()).forEach(b=>{var y;(y=b.columns)!=null&&y.length&&a(b.columns,g+1)},0)};a(e);let l=[];const u=(p,g)=>{const b={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},y=[];p.forEach(x=>{const _=[...y].reverse()[0],w=x.column.depth===b.depth;let C,R=!1;if(w&&x.column.parent?C=x.column.parent:(C=x.column,R=!0),_&&(_==null?void 0:_.column)===C)_.subHeaders.push(x);else{const E=bC(n,C,{id:[r,g,C.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${y.filter(M=>M.column===C).length}`:void 0,depth:g,index:y.length});E.subHeaders.push(x),y.push(E)}b.headers.push(x),x.headerGroup=b}),l.push(b),g>0&&u(y,g-1)},d=t.map((p,g)=>bC(n,p,{depth:s,index:g}));u(d,s-1),l.reverse();const h=p=>p.filter(b=>b.column.getIsVisible()).map(b=>{let y=0,x=0,_=[0];b.subHeaders&&b.subHeaders.length?(_=[],h(b.subHeaders).forEach(C=>{let{colSpan:R,rowSpan:E}=C;y+=R,_.push(E)})):y=1;const w=Math.min(..._);return x=x+w,b.colSpan=y,b.rowSpan=x,{colSpan:y,rowSpan:x}});return h((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const $f={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Lm=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),WU={getDefaultColumnDef:()=>$f,getInitialState:e=>({columnSizing:{},columnSizingInfo:Lm(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:mr("columnSizing",e),onColumnSizingInfoChange:mr("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:$f.minSize,(r=i??e.columnDef.size)!=null?r:$f.size),(o=e.columnDef.maxSize)!=null?o:$f.maxSize)},e.getStart=n=>{const r=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),o=r.findIndex(i=>i.id===e.id);if(o>0){const i=r[o-1];return i.getStart(n)+i.getSize()}return 0},e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Fm(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(_=>[_.column.id,_.column.getSize()]):[[r.id,r.getSize()]],l=Fm(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(_,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(C=>{var R,E;const M=t.options.columnResizeDirection==="rtl"?-1:1,D=(w-((R=C==null?void 0:C.startOffset)!=null?R:0))*M,A=Math.max(D/((E=C==null?void 0:C.startSize)!=null?E:0),-.999999);return C.columnSizingStart.forEach(k=>{let[L,W]=k;u[L]=Math.round(Math.max(W+W*A,0)*100)/100}),{...C,deltaOffset:D,deltaPercentage:A}}),(t.options.columnResizeMode==="onChange"||_==="end")&&t.setColumnSizing(C=>({...C,...u})))},h=_=>d("move",_),p=_=>{d("end",_),t.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,b={moveHandler:_=>h(_.clientX),upHandler:_=>{g==null||g.removeEventListener("mousemove",b.moveHandler),g==null||g.removeEventListener("mouseup",b.upHandler),p(_.clientX)}},y={moveHandler:_=>(_.cancelable&&(_.preventDefault(),_.stopPropagation()),h(_.touches[0].clientX),!1),upHandler:_=>{var w;g==null||g.removeEventListener("touchmove",y.moveHandler),g==null||g.removeEventListener("touchend",y.upHandler),_.cancelable&&(_.preventDefault(),_.stopPropagation()),p((w=_.touches[0])==null?void 0:w.clientX)}},x=BU()?{passive:!1}:!1;Fm(i)?(g==null||g.addEventListener("touchmove",y.moveHandler,x),g==null||g.addEventListener("touchend",y.upHandler,x)):(g==null||g.addEventListener("mousemove",b.moveHandler,x),g==null||g.addEventListener("mouseup",b.upHandler,x)),t.setColumnSizingInfo(_=>({..._,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Lm():(n=e.initialState.columnSizingInfo)!=null?n:Lm())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Pf=null;function BU(){if(typeof Pf=="boolean")return Pf;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Pf=e,Pf}function Fm(e){return e.type==="touchstart"}const UU={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:mr("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},eO=(e,t,n)=>{var r;const o=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(o))};eO.autoRemove=e=>Qr(e);const tO=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};tO.autoRemove=e=>Qr(e);const nO=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};nO.autoRemove=e=>Qr(e);const rO=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};rO.autoRemove=e=>Qr(e)||!(e!=null&&e.length);const oO=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});oO.autoRemove=e=>Qr(e)||!(e!=null&&e.length);const iO=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});iO.autoRemove=e=>Qr(e)||!(e!=null&&e.length);const sO=(e,t,n)=>e.getValue(t)===n;sO.autoRemove=e=>Qr(e);const aO=(e,t,n)=>e.getValue(t)==n;aO.autoRemove=e=>Qr(e);const vy=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};vy.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};vy.autoRemove=e=>Qr(e)||Qr(e[0])&&Qr(e[1]);const Wo={includesString:eO,includesStringSensitive:tO,equalsString:nO,arrIncludes:rO,arrIncludesAll:oO,arrIncludesSome:iO,equals:sO,weakEquals:aO,inNumberRange:vy};function Qr(e){return e==null||e===""}const qU={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:mr("columnFilters",e),onGlobalFilterChange:mr("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Wo.includesString:typeof r=="number"?Wo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Wo.equals:Array.isArray(r)?Wo.arrIncludes:Wo.weakEquals},e.getFilterFn=()=>{var n,r;return Ph(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Wo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(d=>d.id===e.id),s=zi(n,i?i.value:void 0);if(yC(o,s,e)){var a;return(a=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var u;return(u=r==null?void 0:r.map(d=>d.id===e.id?l:d))!=null?u:[]}return r!=null&&r.length?[...r,l]:[l]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Ph(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Wo[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=zi(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(yC(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function yC(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const GU=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),YU=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},KU=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},XU=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},QU=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},ZU=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!zU(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},JU=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),eq=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,tq=(e,t)=>t.length,zm={sum:GU,min:YU,max:KU,extent:XU,mean:QU,median:ZU,unique:JU,uniqueCount:eq,count:tq},nq={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:mr("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,o,i;return(n=(r=(o=(i=e.columnDef.enableGrouping)!=null?i:!0)!=null?o:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return zm.sum;if(Object.prototype.toString.call(r)==="[object Date]")return zm.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Ph(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:zm[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function rq(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const oq={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:mr("columnOrder",e)}),createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Be(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),u=a.findIndex(d=>d.id===l);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return rq(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},_b=0,Sb=10,jm=()=>({pageIndex:_b,pageSize:Sb}),iq={getInitialState:e=>({...e,pagination:{...jm(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:mr("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>zi(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?jm():(o=e.initialState.pagination)!=null?o:jm())},e.setPageIndex=r=>{e.setPagination(o=>{let i=zi(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?_b:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:_b)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Sb:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Sb)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,zi(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=zi(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=Be(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},{key:process.env.NODE_ENV==="development"&&"getPageOptions",debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},Vm=()=>({left:[],right:[]}),Hm=()=>({top:[],bottom:[]}),sq={getInitialState:e=>({columnPinning:Vm(),rowPinning:Hm(),...e}),getDefaultOptions:e=>({onColumnPinningChange:mr("columnPinning",e),onRowPinningChange:mr("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(h=>!(r!=null&&r.includes(h))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(h=>!(r!=null&&r.includes(h))),...r]}}if(n==="left"){var u,d;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(h=>!(r!=null&&r.includes(h))),...r],right:((d=o==null?void 0:o.right)!=null?d:[]).filter(h=>!(r!=null&&r.includes(h)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(h=>!(r!=null&&r.includes(h))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(h=>!(r!=null&&r.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:u}=l;return u}):[],s=o?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var u,d;if(n==="bottom"){var h,p;return{top:((h=l==null?void 0:l.top)!=null?h:[]).filter(y=>!(a!=null&&a.has(y))),bottom:[...((p=l==null?void 0:l.bottom)!=null?p:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)]}}if(n==="top"){var g,b;return{top:[...((g=l==null?void 0:l.top)!=null?g:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)],bottom:((b=l==null?void 0:l.bottom)!=null?b:[]).filter(y=>!(a!=null&&a.has(y)))}}return{top:((u=l==null?void 0:l.top)!=null?u:[]).filter(y=>!(a!=null&&a.has(y))),bottom:((d=l==null?void 0:l.bottom)!=null?d:[]).filter(y=>!(a!=null&&a.has(y)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=t._getPinnedRows(o))==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=Be(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getLeftVisibleCells=Be(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),{key:process.env.NODE_ENV==="development"&&"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getRightVisibleCells=Be(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),{key:process.env.NODE_ENV==="development"&&"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Vm():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Vm())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Be(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getLeftLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getRightLeafColumns=Be(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getRightLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getCenterLeafColumns=Be(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},{key:process.env.NODE_ENV==="development"&&"getCenterLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Hm():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Hm())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=t=>Be(()=>[e.getRowModel().rows,e.getState().rowPinning[t]],(n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(r??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(r??[]).map(s=>n.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:t}))},{key:process.env.NODE_ENV==="development"&&`row.get${t==="top"?"Top":"Bottom"}Rows`,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=Be(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterRows",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugRows}})}},aq={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:mr("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{Cb(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Be(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Wm(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="development"&&"getSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getFilteredSelectedRowModel=Be(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Wm(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getGroupedSelectedRowModel=Be(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Wm(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return Cb(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return by(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Eb(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Eb(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Cb=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>Cb(e,a.id,n,r,o))};function Wm(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var u;const d=by(l,n);if(d&&(r.push(l),o[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:i(l.subRows)}),d)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function by(e,t){var n;return(n=t[e.id])!=null?n:!1}function Eb(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(by(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Eb(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Rb=/([0-9]+)/gm,lq=(e,t,n)=>lO(Yi(e.getValue(n)).toLowerCase(),Yi(t.getValue(n)).toLowerCase()),cq=(e,t,n)=>lO(Yi(e.getValue(n)),Yi(t.getValue(n))),uq=(e,t,n)=>yy(Yi(e.getValue(n)).toLowerCase(),Yi(t.getValue(n)).toLowerCase()),dq=(e,t,n)=>yy(Yi(e.getValue(n)),Yi(t.getValue(n))),fq=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},hq=(e,t,n)=>yy(e.getValue(n),t.getValue(n));function yy(e,t){return e===t?0:e>t?1:-1}function Yi(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function lO(e,t){const n=e.split(Rb).filter(Boolean),r=t.split(Rb).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Rc={alphanumeric:lq,alphanumericCaseSensitive:cq,text:uq,textCaseSensitive:dq,datetime:fq,basic:hq},pq={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:mr("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Rc.datetime;if(typeof i=="string"&&(r=!0,i.split(Rb).length>1))return Rc.alphanumeric}return r?Rc.text:Rc.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Ph(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Rc[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(g=>g.id===e.id),l=s==null?void 0:s.findIndex(g=>g.id===e.id);let u=[],d,h=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?d="toggle":d="add":s!=null&&s.length&&l!==s.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(i||o||(d="remove")),d==="add"){var p;u=[...s,{id:e.id,desc:h}],u.splice(0,u.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else d==="toggle"?u=s.map(g=>g.id===e.id?{...g,desc:h}:g):d==="remove"?u=s.filter(g=>g.id!==e.id):u=[{id:e.id,desc:h}];return u})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},gq={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:mr("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;return(n=(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Be(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),{key:process.env.NODE_ENV==="production"&&"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getVisibleCells=Be(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],{key:process.env.NODE_ENV==="development"&&"row.getVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{const t=(n,r)=>Be(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),{key:n,debug:()=>{var o;return(o=e.options.debugAll)!=null?o:e.options.debugColumns}});e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}},xC=[HU,gq,oq,sq,qU,pq,nq,UU,iq,aq,WU];function mq(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:xC};const r=n._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(n)),{}),o=d=>n.options.mergeOptions?n.options.mergeOptions(r,d):{...r,...d};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(d=>{var h;s=(h=d.getInitialState==null?void 0:d.getInitialState(s))!=null?h:s});const a=[];let l=!1;const u={_features:xC,options:{...r,...e},initialState:s,_queue:d=>{a.push(d),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{n.setState(n.initialState)},setOptions:d=>{const h=zi(d,n.options);n.options=o(h)},getState:()=>n.options.state,setState:d=>{n.options.onStateChange==null||n.options.onStateChange(d)},_getRowId:(d,h,p)=>{var g;return(g=n.options.getRowId==null?void 0:n.options.getRowId(d,h,p))!=null?g:`${p?[p.id,h].join("."):h}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(d,h)=>{let p=(h?n.getPrePaginationRowModel():n.getRowModel()).rowsById[d];if(!p&&(p=n.getCoreRowModel().rowsById[d],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return p},_getDefaultColumnDef:Be(()=>[n.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,b;return(g=(b=p.renderValue())==null||b.toString==null?void 0:b.toString())!=null?g:null},...n._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...d}},{debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:Be(()=>[n._getColumnDefs()],d=>{const h=function(p,g,b){return b===void 0&&(b=0),p.map(y=>{const x=VU(n,y,b,g),_=y;return x.columns=_.columns?h(_.columns,x,b+1):[],x})};return h(d)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getAllFlatColumns:Be(()=>[n.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),_getAllFlatColumnsById:Be(()=>[n.getAllFlatColumns()],d=>d.reduce((h,p)=>(h[p.id]=p,h),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getAllLeafColumns:Be(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(d,h)=>{let p=d.flatMap(g=>g.getLeafColumns());return h(p)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getColumn:d=>{const h=n._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${d}' does not exist.`),h}};Object.assign(n,u);for(let d=0;d<n._features.length;d++){const h=n._features[d];h==null||h.createTable==null||h.createTable(n)}return n}function vq(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:Be(()=>[e,n,t,i],(s,a,l,u)=>({table:s,column:a,row:l,cell:u,getValue:u.getValue,renderValue:u.renderValue}),{key:process.env.NODE_ENV==="development"&&"cell.getContext",debug:()=>e.options.debugAll})};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}const bq=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return a._valuesCache[l]=u.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=a.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>jU(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],u=a;for(;;){const d=u.getParentRow();if(!d)break;l.push(d),u=d}return l.reverse()},getAllCells:Be(()=>[e.getAllLeafColumns()],l=>l.map(u=>vq(e,a,u,u.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:Be(()=>[a.getAllCells()],l=>l.reduce((u,d)=>(u[d.column.id]=d,u),{}),{key:process.env.NODE_ENV==="production"&&"row.getAllCellsByColumnId",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}})};for(let l=0;l<e._features.length;l++){const u=e._features[l];u==null||u.createRow==null||u.createRow(a,e)}return a};function cO(){return e=>Be(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let u=0;u<o.length;u++){const d=bq(e,e._getRowId(o[u],u,s),o[u],u,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(d),n.rowsById[d.id]=d,a.push(d),e.options.getSubRows){var l;d.originalSubRows=e.options.getSubRows(o[u],u),(l=d.originalSubRows)!=null&&l.length&&(d.subRows=r(d.originalSubRows,i+1,d))}}return a};return n.rows=r(t),n},{key:process.env.NODE_ENV==="development"&&"getRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function uO(){return e=>Be(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var u;return(u=e.getColumn(l.id))==null?void 0:u.getCanSort()}),s={};i.forEach(l=>{const u=e.getColumn(l.id);u&&(s[l.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=l=>{const u=l.map(d=>({...d}));return u.sort((d,h)=>{for(let g=0;g<i.length;g+=1){var p;const b=i[g],y=s[b.id],x=(p=b==null?void 0:b.desc)!=null?p:!1;let _=0;if(y.sortUndefined){const w=d.getValue(b.id),C=h.getValue(b.id),R=w===void 0,E=C===void 0;(R||E)&&(_=R&&E?0:R?y.sortUndefined:-y.sortUndefined)}if(_===0&&(_=y.sortingFn(d,h,b.id)),_!==0)return x&&(_*=-1),y.invertSorting&&(_*=-1),_}return d.index-h.index}),u.forEach(d=>{var h;o.push(d),(h=d.subRows)!=null&&h.length&&(d.subRows=a(d.subRows))}),u};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},{key:process.env.NODE_ENV==="development"&&"getSortedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function yq(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function dO(e){return t=>Be(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const u=o*i,d=u+o;s=s.slice(u,d);let h;t.options.paginateExpandedRows?h={rows:s,flatRows:a,rowsById:l}:h=yq({rows:s,flatRows:a,rowsById:l}),h.flatRows=[];const p=g=>{h.flatRows.push(g),g.subRows.length&&g.subRows.forEach(p)};return h.rows.forEach(p),h},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
|
|
225
|
-
* react-table
|
|
226
|
-
*
|
|
227
|
-
* Copyright (c) TanStack
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the MIT license found in the
|
|
230
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
231
|
-
*
|
|
232
|
-
* @license MIT
|
|
233
|
-
*/function $b(e,t){return e?xq(e)?le.createElement(e,t):e:null}function xq(e){return wq(e)||typeof e=="function"||_q(e)}function wq(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function _q(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function fO(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=le.useState(()=>({current:mq(t)})),[r,o]=le.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function hO({data:e,card:t}){var x,_;const[n,r]=m.useState([]),{keys:o}=Nr(e),i=Ce(w=>w.filteringCards),s=i==null?void 0:i.find(w=>w.id===t.id),a=(x=t==null?void 0:t.preferences)==null?void 0:x.onClickFilter,{addOrUpdateFilterValues:l,addFilteringCard:u,removeFilterValue:d,removeFilteringCard:h}=Ki(),p=o.map(w=>({accessorKey:w,header:({column:C})=>{const R=C.getIsSorted();return I.jsx("div",{className:"flex gap-2",children:I.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>C.toggleSorting(C.getIsSorted()==="asc"),children:[w,R==="asc"?I.jsx(X0,{className:"ml-2 h-5 w-5"}):R==="desc"?I.jsx(K0,{className:"ml-2 h-5 w-5"}):null]})})}})),g=fO({data:e,columns:p,getCoreRowModel:cO(),getPaginationRowModel:dO(),onSortingChange:r,getSortedRowModel:uO(),manualPagination:!0,state:{sorting:n}}),b=g.getSelectedRowModel().rows;m.useEffect(()=>{if(b.length===0){if(s){const w=t.id;d(w),h(t)}return}if(a){const{dimensionKeys:w}=Nr(e),C=a.map(R=>{const E=w==null?void 0:w[R.columnIndex],M=b.map(A=>A.getValue(E));return{filterId:t.id+"-"+E,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:E,expression:R.expression,valueType:nu(M[0]===void 0?"":M[0]),operation:"in",values:M}});l(C),u(t)}},[u,l,t,e,s,a,d,h,b]);function y(w){w.toggleSelected()}return I.jsxs(hy,{onMouseDown:w=>w.stopPropagation(),children:[I.jsx(py,{children:g.getHeaderGroups().map(w=>I.jsx(Xc,{children:w.headers.map(C=>I.jsx(my,{className:"sticky top-0 h-8 border-x bg-muted-foreground px-2 py-1 text-background",children:C.isPlaceholder?null:$b(C.column.columnDef.header,C.getContext())},C.id))},w.id))}),I.jsx(gy,{children:(_=g.getRowModel().rows)!=null&&_.length?g.getRowModel().rows.map(w=>I.jsx(Xc,{onClick:()=>y(w),className:_e("whitespace-nowrap p-1",{"cursor-pointer":a&&(a==null?void 0:a.length)>0}),"data-state":w.getIsSelected()&&"selected",children:w.getVisibleCells().map(C=>I.jsx($h,{className:"border px-2 py-1",children:$b(C.column.columnDef.cell,C.getContext())},C.id))},w.id)):I.jsx(Xc,{children:I.jsx($h,{colSpan:p.length,className:"p-1 text-center",children:"No results."})})})]})}function Sq({frame:e,footer:t,className:n,...r}){const{customCards:o}=Wl(),i=m.useRef(null),s=Ce(ne=>ne.themeStyle),a=Ce(ne=>ne.selectedSheetId),l=Ce(ne=>ne.selectedFrameId),u=Ce(ne=>ne.isDashboardEditing),d=e.cards.find(ne=>ne.id===e.activeCardId);CU(e,i);const{isError:h,isLoading:p,isFetching:g,cfg:b,visualKey:y,handleDatapointClick:x}=cy(d),{setCardTitle:_,setCardDescription:w,setSelectedFrameId:C}=Ki(),{setSelectedConnectionId:R,setSelectedDatabaseName:E,setSelectedSchemaName:M,setSelectedTableName:D}=gP();function A(ne){ne.stopPropagation(),C(e.id),d!=null&&d.connectionId&&R(d==null?void 0:d.connectionId),d!=null&&d.lastSelectedDatabase&&E(d==null?void 0:d.lastSelectedDatabase),d!=null&&d.lastSelectedSchema&&M(d==null?void 0:d.lastSelectedSchema),d!=null&&d.lastSelectedTable&&D(d==null?void 0:d.lastSelectedTable)}function k(){if(o&&o.length>0){const ne=o.find(Q=>Q.cardId===d.id);if(ne&&ne.replaceDefault){const Q=ne.content;if(Q)return I.jsx(Q,{card:d})}}return d.type==="kpi"?I.jsx(BP,{isLoading:p||g,card:d}):Y}function L(){if(h)return I.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(d.type==="table"&&d.data&&d.data.length>0)return I.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:I.jsx(hO,{card:d,data:d.data})});if(o&&o.length>0){const ne=o.find(Q=>Q.cardId===d.id);if(ne&&ne.content){const Q=ne.content;return I.jsx(Q,{card:d})}}if(b)return I.jsx(fP,{cfg:b,onDatapointClick:x},y)}function W(){if(o&&o.length>0){const ne=o.find(Q=>Q.cardId===d.id);if(ne&&ne.footer){const Q=ne.footer;if(Q)return I.jsx(Q,{card:d})}}return t||null}if(!d.id)return null;const Y=I.jsxs(I.Fragment,{children:[I.jsxs(Gh,{className:"pb-4",children:[I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx(sa,{text:d.title,onSave:ne=>_(a,d.id,ne),children:I.jsx(Vu,{className:"text-base",children:d.title})}),(u||d.info)&&I.jsx(NU,{card:d}),d.refreshInterval&&I.jsxs(NP,{children:[I.jsx(LP,{className:"pr-1",children:I.jsx("div",{className:_e("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":p||g})})}),I.jsx(ay,{side:"right",align:"center",children:I.jsx("p",{className:"text-xs",children:`Realtime (${d==null?void 0:d.refreshInterval})`})})]}),!d.refreshInterval&&(p||g)&&I.jsx(ly,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),I.jsx(sa,{text:(d==null?void 0:d.description)||"",onSave:ne=>w(a,d.id,ne),children:I.jsxs(t0,{children:[" ",d.description]})})]}),I.jsx(Yh,{className:"relative flex grow flex-col",children:L()}),I.jsx(n0,{children:W()})]});return I.jsxs(e0,{tabIndex:-1,ref:i,role:"card-frame",onClick:A,className:_e("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":l===e.id&&u},s==null?void 0:s.dashboardCard,n,"semaphor-card-frame"),...r,children:[I.jsx(OW,{frame:e}),k()]})}const Cq=M_.WidthProvider(M_.Responsive);function Eq(){var x,_,w,C;const e=Ce(R=>R.isDashboardEditing);Ce(R=>R.currentBreakpoint);const t=Ce(R=>R.themeStyle),n=Ce(R=>R.selectedSheetId);(x=Ce(R=>{var E,M;return(M=(E=R.dashboard)==null?void 0:E.sheets)==null?void 0:M.filter(D=>D.id===n)}))==null||x[0].layout;const r=(_=Ce(R=>{var E,M;return(M=(E=R.dashboard)==null?void 0:E.sheets)==null?void 0:M.filter(D=>D.id===n)}))==null?void 0:_[0].layouts,o=Ce(R=>{var E,M,D;return(D=(M=(E=R.dashboard)==null?void 0:E.sheets)==null?void 0:M.find(A=>A.id===n))==null?void 0:D.frames}),{getSelectedSheet:i,getSelectedSheetLayout:s,getSelectedSheetLayouts:a,setSheetLayout:l,setSheetLayouts:u,setCurrentBreakpoint:d}=Ce(R=>R.actions),h=i(),p=m.useCallback(R=>{d(R)},[]),g=m.useCallback((R,E)=>{h!=null&&h.id&&u(h.id,E)},[h==null?void 0:h.id,u]);if(!n)return null;const b=(R,E)=>I.jsx(pO,{className:"after:content-none",ref:E,handleAxis:R});function y(){return o==null?void 0:o.map(R=>I.jsx("div",{role:"dashboard-frame-container",className:_e("group",t==null?void 0:t.dashboardCardContainer),children:I.jsx(Sq,{frame:R})},R.id))}return I.jsx(I.Fragment,{children:I.jsx(Cq,{margin:((w=t==null?void 0:t.gridLayout)==null?void 0:w.margin)||[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],className:_e((C=t==null?void 0:t.gridLayout)==null?void 0:C.className),layouts:r,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:48,onBreakpointChange:p,onLayoutChange:g,resizeHandle:b,children:y()})})}const pO=m.forwardRef(({className:e,handleAxis:t,...n},r)=>I.jsx("div",{ref:r,className:_e(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne","border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw","border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n}));pO.displayName="ResizeHandle";/**
|
|
234
|
-
* react-virtual
|
|
235
|
-
*
|
|
236
|
-
* Copyright (c) TanStack
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the MIT license found in the
|
|
239
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
240
|
-
*
|
|
241
|
-
* @license MIT
|
|
242
|
-
*/function Oh(){return Oh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oh.apply(this,arguments)}/**
|
|
243
|
-
* virtual-core
|
|
244
|
-
*
|
|
245
|
-
* Copyright (c) TanStack
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the MIT license found in the
|
|
248
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
249
|
-
*
|
|
250
|
-
* @license MIT
|
|
251
|
-
*/function Dh(){return Dh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dh.apply(this,arguments)}/**
|
|
252
|
-
* virtual-core
|
|
253
|
-
*
|
|
254
|
-
* Copyright (c) TanStack
|
|
255
|
-
*
|
|
256
|
-
* This source code is licensed under the MIT license found in the
|
|
257
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
258
|
-
*
|
|
259
|
-
* @license MIT
|
|
260
|
-
*/function Ba(e,t,n){var r,o=(r=n.initialDeps)!=null?r:[],i;return function(){var s;n.key&&n.debug!=null&&n.debug()&&(s=Date.now());var a=e(),l=a.length!==o.length||a.some(function(b,y){return o[y]!==b});if(!l)return i;o=a;var u;if(n.key&&n.debug!=null&&n.debug()&&(u=Date.now()),i=t.apply(void 0,a),n.key&&n.debug!=null&&n.debug()){var d=Math.round((Date.now()-s)*100)/100,h=Math.round((Date.now()-u)*100)/100,p=h/16,g=function(y,x){for(y=String(y);y.length<x;)y=" "+y;return y};console.info("%c⏱ "+g(h,5)+" /"+g(d,5)+" ms",`
|
|
261
|
-
font-size: .6rem;
|
|
262
|
-
font-weight: bold;
|
|
263
|
-
color: hsl(`+Math.max(0,Math.min(120-120*p,120))+"deg 100% 31%);",n==null?void 0:n.key)}return n==null||n.onChange==null||n.onChange(i),i}}function Bm(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var Rq=function(t,n){return Math.abs(t-n)<1};/**
|
|
264
|
-
* virtual-core
|
|
265
|
-
*
|
|
266
|
-
* Copyright (c) TanStack
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the MIT license found in the
|
|
269
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
270
|
-
*
|
|
271
|
-
* @license MIT
|
|
272
|
-
*/var $q=function(t){return t},Pq=function(t){for(var n=Math.max(t.startIndex-t.overscan,0),r=Math.min(t.endIndex+t.overscan,t.count-1),o=[],i=n;i<=r;i++)o.push(i);return o},Oq=function(t,n){var r=t.scrollElement;if(r){var o=function(a){var l=a.width,u=a.height;n({width:Math.round(l),height:Math.round(u)})};o(r.getBoundingClientRect());var i=new ResizeObserver(function(s){var a=s[0];if(a!=null&&a.borderBoxSize){var l=a.borderBoxSize[0];if(l){o({width:l.inlineSize,height:l.blockSize});return}}o(r.getBoundingClientRect())});return i.observe(r,{box:"border-box"}),function(){i.unobserve(r)}}},Dq=function(t,n){var r=t.scrollElement;if(r){var o=function(){n(r[t.options.horizontal?"scrollLeft":"scrollTop"])};return o(),r.addEventListener("scroll",o,{passive:!0}),function(){r.removeEventListener("scroll",o)}}},Mq=function(t,n,r){if(n!=null&&n.borderBoxSize){var o=n.borderBoxSize[0];if(o){var i=Math.round(o[r.options.horizontal?"inlineSize":"blockSize"]);return i}}return Math.round(t.getBoundingClientRect()[r.options.horizontal?"width":"height"])},Tq=function(t,n,r){var o,i,s=n.adjustments,a=s===void 0?0:s,l=n.behavior,u=t+a;(o=r.scrollElement)==null||o.scrollTo==null||o.scrollTo((i={},i[r.options.horizontal?"left":"top"]=u,i.behavior=l,i))},Aq=function(t){var n=this;this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=function(){var r=null,o=function(){return r||(typeof ResizeObserver<"u"?r=new ResizeObserver(function(s){s.forEach(function(a){n._measureElement(a.target,a)})}):null)};return{disconnect:function(){var s;return(s=o())==null?void 0:s.disconnect()},observe:function(s){var a;return(a=o())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:function(s){var a;return(a=o())==null?void 0:a.unobserve(s)}}}(),this.range=null,this.setOptions=function(r){Object.entries(r).forEach(function(o){var i=o[0],s=o[1];typeof s>"u"&&delete r[i]}),n.options=Dh({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:$q,rangeExtractor:Pq,onChange:function(){},measureElement:Mq,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},r)},this.notify=function(r){n.options.onChange==null||n.options.onChange(n,r)},this.maybeNotify=Ba(function(){return n.calculateRange(),[n.isScrolling,n.range?n.range.startIndex:null,n.range?n.range.endIndex:null]},function(r){n.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:function(){return n.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){n.unsubs.filter(Boolean).forEach(function(r){return r()}),n.unsubs=[],n.scrollElement=null},this._didMount=function(){return n.measureElementCache.forEach(n.observer.observe),function(){n.observer.disconnect(),n.cleanup()}},this._willUpdate=function(){var r=n.options.getScrollElement();n.scrollElement!==r&&(n.cleanup(),n.scrollElement=r,n._scrollToOffset(n.scrollOffset,{adjustments:void 0,behavior:void 0}),n.unsubs.push(n.options.observeElementRect(n,function(o){n.scrollRect=o,n.maybeNotify()})),n.unsubs.push(n.options.observeElementOffset(n,function(o){n.scrollAdjustments=0,n.scrollOffset!==o&&(n.isScrollingTimeoutId!==null&&(clearTimeout(n.isScrollingTimeoutId),n.isScrollingTimeoutId=null),n.isScrolling=!0,n.scrollDirection=n.scrollOffset<o?"forward":"backward",n.scrollOffset=o,n.maybeNotify(),n.isScrollingTimeoutId=setTimeout(function(){n.isScrollingTimeoutId=null,n.isScrolling=!1,n.scrollDirection=null,n.maybeNotify()},n.options.scrollingDelay))})))},this.getSize=function(){return n.scrollRect[n.options.horizontal?"width":"height"]},this.memoOptions=Ba(function(){return[n.options.count,n.options.paddingStart,n.options.scrollMargin,n.options.getItemKey]},function(r,o,i,s){return n.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:o,scrollMargin:i,getItemKey:s}},{key:!1}),this.getFurthestMeasurement=function(r,o){for(var i=new Map,s=new Map,a=o-1;a>=0;a--){var l=r[a];if(!i.has(l.lane)){var u=s.get(l.lane);if(u==null||l.end>u.end?s.set(l.lane,l):l.end<u.end&&i.set(l.lane,!0),i.size===n.options.lanes)break}}return s.size===n.options.lanes?Array.from(s.values()).sort(function(d,h){return d.end-h.end})[0]:void 0},this.getMeasurements=Ba(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,o){var i=r.count,s=r.paddingStart,a=r.scrollMargin,l=r.getItemKey,u=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var d=n.measurementsCache.slice(0,u),h=u;h<i;h++){var p=l(h),g=n.options.lanes===1?d[h-1]:n.getFurthestMeasurement(d,h),b=g?g.end:s+a,y=o.get(p),x=typeof y=="number"?y:n.options.estimateSize(h),_=b+x,w=g?g.lane:h%n.options.lanes;d[h]={index:h,start:b,size:x,end:_,key:p,lane:w}}return n.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return n.options.debug}}),this.calculateRange=Ba(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,o,i){return n.range=r.length>0&&o>0?Iq({measurements:r,outerSize:o,scrollOffset:i}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=Ba(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,o,i,s){return o===null?[]:r(Dh({},o,{overscan:i,count:s}))},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.indexFromElement=function(r){var o=n.options.indexAttribute,i=r.getAttribute(o);return i?parseInt(i,10):(console.warn("Missing attribute name '"+o+"={index}' on measured element."),-1)},this._measureElement=function(r,o){var i=n.measurementsCache[n.indexFromElement(r)];if(!i||!r.isConnected){n.measureElementCache.forEach(function(l,u){l===r&&(n.observer.unobserve(r),n.measureElementCache.delete(u))});return}var s=n.measureElementCache.get(i.key);s!==r&&(s&&n.observer.unobserve(s),n.observer.observe(r),n.measureElementCache.set(i.key,r));var a=n.options.measureElement(r,o,n);n.resizeItem(i,a)},this.resizeItem=function(r,o){var i,s=(i=n.itemSizeCache.get(r.key))!=null?i:r.size,a=o-s;a!==0&&(r.start<n.scrollOffset&&(process.env.NODE_ENV!=="production"&&n.options.debug&&console.info("correction",a),n._scrollToOffset(n.scrollOffset,{adjustments:n.scrollAdjustments+=a,behavior:void 0})),n.pendingMeasuredCacheIndexes.push(r.index),n.itemSizeCache=new Map(n.itemSizeCache.set(r.key,o)),n.notify(!1))},this.measureElement=function(r){r&&n._measureElement(r,void 0)},this.getVirtualItems=Ba(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,o){for(var i=[],s=0,a=r.length;s<a;s++){var l=r[s],u=o[l];i.push(u)}return i},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.getVirtualItemForOffset=function(r){var o=n.getMeasurements();return Bm(o[gO(0,o.length-1,function(i){return Bm(o[i]).start},r)])},this.getOffsetForAlignment=function(r,o){var i=n.getSize();o==="auto"&&(r<=n.scrollOffset?o="start":r>=n.scrollOffset+i?o="end":o="start"),o==="start"?r=r:o==="end"?r=r-i:o==="center"&&(r=r-i/2);var s=n.options.horizontal?"scrollWidth":"scrollHeight",a=n.scrollElement?"document"in n.scrollElement?n.scrollElement.document.documentElement[s]:n.scrollElement[s]:0,l=a-n.getSize();return Math.max(Math.min(l,r),0)},this.getOffsetForIndex=function(r,o){o===void 0&&(o="auto"),r=Math.max(0,Math.min(r,n.options.count-1));var i=Bm(n.getMeasurements()[r]);if(o==="auto")if(i.end>=n.scrollOffset+n.getSize()-n.options.scrollPaddingEnd)o="end";else if(i.start<=n.scrollOffset+n.options.scrollPaddingStart)o="start";else return[n.scrollOffset,o];var s=o==="end"?i.end+n.options.scrollPaddingEnd:i.start-n.options.scrollPaddingStart;return[n.getOffsetForAlignment(s,o),o]},this.isDynamicMode=function(){return n.measureElementCache.size>0},this.cancelScrollToIndex=function(){n.scrollToIndexTimeoutId!==null&&(clearTimeout(n.scrollToIndexTimeoutId),n.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(r,o){var i=o===void 0?{}:o,s=i.align,a=s===void 0?"start":s,l=i.behavior;n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.getOffsetForAlignment(r,a),{adjustments:void 0,behavior:l})},this.scrollToIndex=function(r,o){var i=o===void 0?{}:o,s=i.align,a=s===void 0?"auto":s,l=i.behavior;r=Math.max(0,Math.min(r,n.options.count-1)),n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var u=n.getOffsetForIndex(r,a),d=u[0],h=u[1];n._scrollToOffset(d,{adjustments:void 0,behavior:l}),l!=="smooth"&&n.isDynamicMode()&&(n.scrollToIndexTimeoutId=setTimeout(function(){n.scrollToIndexTimeoutId=null;var p=n.measureElementCache.has(n.options.getItemKey(r));if(p){var g=n.getOffsetForIndex(r,h),b=g[0];Rq(b,n.scrollOffset)||n.scrollToIndex(r,{align:h,behavior:l})}else n.scrollToIndex(r,{align:h,behavior:l})}))},this.scrollBy=function(r,o){var i=o===void 0?{}:o,s=i.behavior;n.cancelScrollToIndex(),s==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.scrollOffset+r,{adjustments:void 0,behavior:s})},this.getTotalSize=function(){var r;return(((r=n.getMeasurements()[n.options.count-1])==null?void 0:r.end)||n.options.paddingStart)-n.options.scrollMargin+n.options.paddingEnd},this._scrollToOffset=function(r,o){var i=o.adjustments,s=o.behavior;n.options.scrollToFn(r,{behavior:s,adjustments:i},n)},this.measure=function(){n.itemSizeCache=new Map,n.notify(!1)},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(r){n.itemSizeCache.set(r.key,r.size)}),this.maybeNotify()},gO=function(t,n,r,o){for(;t<=n;){var i=(t+n)/2|0,s=r(i);if(s<o)t=i+1;else if(s>o)n=i-1;else return i}return t>0?t-1:0};function Iq(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,o=t.length-1,i=function(u){return t[u].start},s=gO(0,o,i,r),a=s;a<o&&t[a].end<r+n;)a++;return{startIndex:s,endIndex:a}}/**
|
|
273
|
-
* react-virtual
|
|
274
|
-
*
|
|
275
|
-
* Copyright (c) TanStack
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the MIT license found in the
|
|
278
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
279
|
-
*
|
|
280
|
-
* @license MIT
|
|
281
|
-
*/var kq=typeof document<"u"?le.useLayoutEffect:le.useEffect;function Nq(e){var t=le.useReducer(function(){return{}},{})[1],n=Oh({},e,{onChange:function(s,a){a?So.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=le.useState(function(){return new Aq(n)}),o=r[0];return o.setOptions(n),le.useEffect(function(){return o._didMount()},[]),kq(function(){return o._willUpdate()}),o}function Lq(e){return Nq(Oh({observeElementRect:Oq,observeElementOffset:Dq,scrollToFn:Tq},e))}var Fq=Object.defineProperty,zq=(e,t,n)=>t in e?Fq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Um=(e,t,n)=>(zq(e,typeof t!="symbol"?t+"":t,n),n);let jq=class{constructor(){Um(this,"current",this.detect()),Um(this,"handoffState","pending"),Um(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Js=new jq,sn=(e,t)=>{Js.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function bo(e){let t=m.useRef(e);return sn(()=>{t.current=e},[e]),t}function xy(e,t){let[n,r]=m.useState(e),o=bo(e);return sn(()=>r(o.current),[o,r,...t]),n}let it=function(e){let t=bo(e);return m.useCallback((...n)=>t.current(...n),[t])};function Vq(e,t,n){let[r,o]=m.useState(n),i=e!==void 0,s=m.useRef(i),a=m.useRef(!1),l=m.useRef(!1);return i&&!s.current&&!a.current?(a.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&s.current&&!l.current&&(l.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,it(u=>(i||o(u),t==null?void 0:t(u)))]}function Hq(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function da(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Hq(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=da();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Ju(){let[e]=m.useState(da);return m.useEffect(()=>()=>e.dispose(),[e]),e}function Wq(){let e=typeof document>"u";return"useSyncExternalStore"in le?(t=>t.useSyncExternalStore)(le)(()=>()=>{},()=>!1,()=>!e):!1}function wy(){let e=Wq(),[t,n]=le.useState(Js.isHandoffComplete);return t&&Js.isHandoffComplete===!1&&n(!1),le.useEffect(()=>{t!==!0&&n(!0)},[t]),le.useEffect(()=>Js.handoff(),[]),e?!1:t}var wC;let ed=(wC=m.useId)!=null?wC:function(){let e=wy(),[t,n]=m.useState(e?()=>Js.nextId():null);return sn(()=>{t===null&&n(Js.nextId())},[t]),t!=null?""+t:void 0};function bn(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,bn),r}function _y(e){return Js.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let _C=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Bq=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Bq||{}),Uq=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Uq||{}),qq=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(qq||{}),mO=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(mO||{});function Gq(e,t=0){var n;return e===((n=_y(e))==null?void 0:n.body)?!1:bn(t,{0(){return e.matches(_C)},1(){let r=e;for(;r!==null;){if(r.matches(_C))return!0;r=r.parentElement}return!1}})}var Yq=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Yq||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Kq(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Xq(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Qq(){return/Android/gi.test(window.navigator.userAgent)}function vO(){return Xq()||Qq()}function Of(e,t,n){let r=bo(t);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function Zq(e,t,n){let r=bo(t);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function Jq(e,t,n=!0){let r=m.useRef(!1);m.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function o(s,a){if(!r.current||s.defaultPrevented)return;let l=a(s);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let u=function d(h){return typeof h=="function"?d(h()):Array.isArray(h)||h instanceof Set?h:[h]}(e);for(let d of u){if(d===null)continue;let h=d instanceof HTMLElement?d:d.current;if(h!=null&&h.contains(l)||s.composed&&s.composedPath().includes(h))return}return!Gq(l,mO.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let i=m.useRef(null);Of("pointerdown",s=>{var a,l;r.current&&(i.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Of("mousedown",s=>{var a,l;r.current&&(i.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Of("click",s=>{vO()||i.current&&(o(s,()=>i.current),i.current=null)},!0),Of("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),Zq("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function eG(...e){return m.useMemo(()=>_y(...e),[...e])}function SC(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function tG(e,t){let[n,r]=m.useState(()=>SC(e));return sn(()=>{r(SC(e))},[e.type,e.as]),sn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let nG=Symbol();function va(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=it(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[nG]))?void 0:n}function CC(e){return[e.screenX,e.screenY]}function rG(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=CC(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=CC(t)}}}function oG({container:e,accept:t,walk:n,enabled:r=!0}){let o=m.useRef(t),i=m.useRef(n);m.useEffect(()=>{o.current=t,i.current=n},[t,n]),sn(()=>{if(!e||!r)return;let s=_y(e);if(!s)return;let a=o.current,l=i.current,u=Object.assign(h=>a(h),{acceptNode:a}),d=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,u,!1);for(;d.nextNode();)l(d.currentNode)},[e,r,o,i])}function EC(e,t){let n=m.useRef([]),r=it(e);m.useEffect(()=>{let o=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}function Mh(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Th=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Th||{}),ji=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ji||{});function li({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??iG;let l=bO(t,e);if(i)return Df(l,n,r,s,a);let u=o??0;if(u&2){let{static:d=!1,...h}=l;if(d)return Df(h,n,r,s,a)}if(u&1){let{unmount:d=!0,...h}=l;return bn(d?0:1,{0(){return null},1(){return Df({...h,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Df(l,n,r,s,a)}function Df(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=qm(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},d=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let h={};if(t){let p=!1,g=[];for(let[b,y]of Object.entries(t))typeof y=="boolean"&&(p=!0),y===!0&&g.push(b);p&&(h["data-headlessui-state"]=g.join(" "))}if(i===m.Fragment&&Object.keys(Pb(l)).length>0){if(!m.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(y=>` - ${y}`).join(`
|
|
282
|
-
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(y=>` - ${y}`).join(`
|
|
283
|
-
`)].join(`
|
|
284
|
-
`));let p=d.props,g=typeof(p==null?void 0:p.className)=="function"?(...y)=>Mh(p==null?void 0:p.className(...y),l.className):Mh(p==null?void 0:p.className,l.className),b=g?{className:g}:{};return m.cloneElement(d,Object.assign({},bO(d.props,Pb(qm(l,["ref"]))),h,u,{ref:o(d.ref,u.ref)},b))}return m.createElement(i,Object.assign({},qm(l,["ref"]),i!==m.Fragment&&u,i!==m.Fragment&&h),d)}function iG(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function bO(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function Po(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Pb(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function qm(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let sG="div";var yO=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(yO||{});function aG(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return li({ourProps:i,theirProps:o,slot:{},defaultTag:sG,name:"Hidden"})}let lG=Po(aG),Sy=m.createContext(null);Sy.displayName="OpenClosedContext";var dr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(dr||{});function Cy(){return m.useContext(Sy)}function xO({value:e,children:t}){return m.createElement(Sy.Provider,{value:e},t)}function cG(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Ns=[];cG(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Ns[0]!==t.target&&(Ns.unshift(t.target),Ns=Ns.filter(n=>n!=null&&n.isConnected),Ns.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function uG(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&dG(n)?!1:r}function dG(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function fG(e){throw new Error("Unexpected object: "+e)}var rn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(rn||{});function RC(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:fG(e)}}function wO(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))SO(n,_O(t,r),o);return n}function _O(e,t){return e?e+"["+t+"]":t}function SO(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())SO(e,_O(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):wO(n,t,e)}var sr=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(sr||{}),hG=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(hG||{}),pG=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(pG||{}),gG=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(gG||{}),mG=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(mG||{});function Gm(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):Kq(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let vG={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,r,o,i,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=t.focus===rn.Specific?t.idx:RC(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var p,g;return(g=(p=e.activeOptionIndex)!=null?p:e.virtual.options.findIndex(b=>!e.virtual.disabled(b)))!=null?g:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),h=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===d&&e.activationTrigger===h?e:{...e,activeOptionIndex:d,activationTrigger:h}}let a=Gm(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(h=>!h.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===rn.Specific?t.idx:RC(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),u=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===u?e:{...e,...a,activeOptionIndex:l,activationTrigger:u}},3:(e,t)=>{var n,r,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,s=Gm(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let a={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let r=Gm(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},Ey=m.createContext(null);Ey.displayName="ComboboxActionsContext";function td(e){let t=m.useContext(Ey);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,td),n}return t}let CO=m.createContext(null);function bG(e){var t;let n=ba("VirtualProvider"),[r,o]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let u=window.getComputedStyle(l);return[parseFloat(u.paddingBlockStart||u.paddingTop),parseFloat(u.paddingBlockEnd||u.paddingBottom)]},[n.optionsRef.current]),i=Lq({scrollPaddingStart:r,scrollPaddingEnd:o,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=m.useState(0);return sn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(CO.Provider,{value:i},m.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&i.scrollToIndex(n.activeOptionIndex)}}},i.getVirtualItems().map(l=>{var u;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((u=e.children)==null?void 0:u.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let Ry=m.createContext(null);Ry.displayName="ComboboxDataContext";function ba(e){let t=m.useContext(Ry);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ba),n}return t}function yG(e,t){return bn(t.type,vG,e,t)}let xG=m.Fragment;function wG(e,t){let{value:n,defaultValue:r,onChange:o,form:i,name:s,by:a=null,disabled:l=!1,__demoMode:u=!1,nullable:d=!1,multiple:h=!1,immediate:p=!1,virtual:g=null,...b}=e,y=!1,x=null,[_=h?[]:void 0,w]=Vq(n,o,r),[C,R]=m.useReducer(yG,{dataRef:m.createRef(),comboboxState:u?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=m.useRef(!1),M=m.useRef({static:!1,hold:!1}),D=m.useRef(null),A=m.useRef(null),k=m.useRef(null),L=m.useRef(null),W=it(typeof a=="string"?(K,ie)=>{let ye=a;return(K==null?void 0:K[ye])===(ie==null?void 0:ie[ye])}:a??((K,ie)=>K===ie)),Y=it(K=>C.options.findIndex(ie=>W(ie.dataRef.current.value,K))),ne=m.useCallback(K=>bn(F.mode,{1:()=>_.some(ie=>W(ie,K)),0:()=>W(_,K)}),[_]),Q=it(K=>C.activeOptionIndex===Y(K)),F=m.useMemo(()=>({...C,immediate:y,optionsPropsRef:M,labelRef:D,inputRef:A,buttonRef:k,optionsRef:L,value:_,defaultValue:r,disabled:l,mode:h?1:0,virtual:C.virtual,get activeOptionIndex(){if(E.current&&C.activeOptionIndex===null&&C.options.length>0){let K=C.options.findIndex(ie=>!ie.dataRef.current.disabled);if(K!==-1)return K}return C.activeOptionIndex},calculateIndex:Y,compare:W,isSelected:ne,isActive:Q,nullable:d,__demoMode:u}),[_,r,l,h,d,u,C,x]);sn(()=>{},[x,void 0]),sn(()=>{C.dataRef.current=F},[F]),Jq([F.buttonRef,F.inputRef,F.optionsRef],()=>ge.closeCombobox(),F.comboboxState===0);let J=m.useMemo(()=>{var K,ie,ye;return{open:F.comboboxState===0,disabled:l,activeIndex:F.activeOptionIndex,activeOption:F.activeOptionIndex===null?null:F.virtual?F.virtual.options[(K=F.activeOptionIndex)!=null?K:0]:(ye=(ie=F.options[F.activeOptionIndex])==null?void 0:ie.dataRef.current.value)!=null?ye:null,value:_}},[F,l,_]),q=it(()=>{if(F.activeOptionIndex!==null){if(F.virtual)ce(F.virtual.options[F.activeOptionIndex]);else{let{dataRef:K}=F.options[F.activeOptionIndex];ce(K.current.value)}ge.goToOption(rn.Specific,F.activeOptionIndex)}}),X=it(()=>{R({type:0}),E.current=!0}),ae=it(()=>{R({type:1}),E.current=!1}),j=it((K,ie,ye)=>(E.current=!1,K===rn.Specific?R({type:2,focus:rn.Specific,idx:ie,trigger:ye}):R({type:2,focus:K,trigger:ye}))),V=it((K,ie)=>(R({type:3,payload:{id:K,dataRef:ie}}),()=>{F.isActive(ie.current.value)&&(E.current=!0),R({type:4,id:K})})),oe=it(K=>(R({type:5,id:K}),()=>R({type:5,id:null}))),ce=it(K=>bn(F.mode,{0(){return w==null?void 0:w(K)},1(){let ie=F.value.slice(),ye=ie.findIndex(Z=>W(Z,K));return ye===-1?ie.push(K):ie.splice(ye,1),w==null?void 0:w(ie)}})),ue=it(K=>{R({type:6,trigger:K})}),ge=m.useMemo(()=>({onChange:ce,registerOption:V,registerLabel:oe,goToOption:j,closeCombobox:ae,openCombobox:X,setActivationTrigger:ue,selectActiveOption:q}),[]),ve=t===null?{}:{ref:t},fe=m.useRef(null),ee=Ju();return m.useEffect(()=>{fe.current&&r!==void 0&&ee.addEventListener(fe.current,"reset",()=>{w==null||w(r)})},[fe,w]),m.createElement(Ey.Provider,{value:ge},m.createElement(Ry.Provider,{value:F},m.createElement(xO,{value:bn(F.comboboxState,{0:dr.Open,1:dr.Closed})},s!=null&&_!=null&&wO({[s]:_}).map(([K,ie],ye)=>m.createElement(lG,{features:yO.Hidden,ref:ye===0?Z=>{var De;fe.current=(De=Z==null?void 0:Z.closest("form"))!=null?De:null}:void 0,...Pb({key:K,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:K,value:ie})})),li({ourProps:ve,theirProps:b,slot:J,defaultTag:xG,name:"Combobox"}))))}let _G="input";function SG(e,t){var n,r,o,i,s;let a=ed(),{id:l=`headlessui-combobox-input-${a}`,onChange:u,displayValue:d,type:h="text",...p}=e,g=ba("Combobox.Input"),b=td("Combobox.Input"),y=va(g.inputRef,t),x=eG(g.inputRef),_=m.useRef(!1),w=Ju(),C=it(()=>{b.onChange(null),g.optionsRef.current&&(g.optionsRef.current.scrollTop=0),b.goToOption(rn.Nothing)}),R=function(){var F;return typeof d=="function"&&g.value!==void 0?(F=d(g.value))!=null?F:"":typeof g.value=="string"?g.value:""}();EC(([F,J],[q,X])=>{if(_.current)return;let ae=g.inputRef.current;ae&&((X===0&&J===1||F!==q)&&(ae.value=F),requestAnimationFrame(()=>{if(_.current||!ae||(x==null?void 0:x.activeElement)!==ae)return;let{selectionStart:j,selectionEnd:V}=ae;Math.abs((V??0)-(j??0))===0&&j===0&&ae.setSelectionRange(ae.value.length,ae.value.length)}))},[R,g.comboboxState,x]),EC(([F],[J])=>{if(F===0&&J===1){if(_.current)return;let q=g.inputRef.current;if(!q)return;let X=q.value,{selectionStart:ae,selectionEnd:j,selectionDirection:V}=q;q.value="",q.value=X,V!==null?q.setSelectionRange(ae,j,V):q.setSelectionRange(ae,j)}},[g.comboboxState]);let E=m.useRef(!1),M=it(()=>{E.current=!0}),D=it(()=>{w.nextFrame(()=>{E.current=!1})}),A=it(F=>{switch(_.current=!0,F.key){case sr.Enter:if(_.current=!1,g.comboboxState!==0||E.current)return;if(F.preventDefault(),F.stopPropagation(),g.activeOptionIndex===null){b.closeCombobox();return}b.selectActiveOption(),g.mode===0&&b.closeCombobox();break;case sr.ArrowDown:return _.current=!1,F.preventDefault(),F.stopPropagation(),bn(g.comboboxState,{0:()=>b.goToOption(rn.Next),1:()=>b.openCombobox()});case sr.ArrowUp:return _.current=!1,F.preventDefault(),F.stopPropagation(),bn(g.comboboxState,{0:()=>b.goToOption(rn.Previous),1:()=>{b.openCombobox(),w.nextFrame(()=>{g.value||b.goToOption(rn.Last)})}});case sr.Home:if(F.shiftKey)break;return _.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(rn.First);case sr.PageUp:return _.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(rn.First);case sr.End:if(F.shiftKey)break;return _.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(rn.Last);case sr.PageDown:return _.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(rn.Last);case sr.Escape:return _.current=!1,g.comboboxState!==0?void 0:(F.preventDefault(),g.optionsRef.current&&!g.optionsPropsRef.current.static&&F.stopPropagation(),g.nullable&&g.mode===0&&g.value===null&&C(),b.closeCombobox());case sr.Tab:if(_.current=!1,g.comboboxState!==0)return;g.mode===0&&g.activationTrigger!==1&&b.selectActiveOption(),b.closeCombobox();break}}),k=it(F=>{u==null||u(F),g.nullable&&g.mode===0&&F.target.value===""&&C(),b.openCombobox()}),L=it(F=>{var J,q,X;let ae=(J=F.relatedTarget)!=null?J:Ns.find(j=>j!==F.currentTarget);if(_.current=!1,!((q=g.optionsRef.current)!=null&&q.contains(ae))&&!((X=g.buttonRef.current)!=null&&X.contains(ae))&&g.comboboxState===0)return F.preventDefault(),g.mode===0&&(g.nullable&&g.value===null?C():g.activationTrigger!==1&&b.selectActiveOption()),b.closeCombobox()}),W=it(F=>{var J,q,X;let ae=(J=F.relatedTarget)!=null?J:Ns.find(j=>j!==F.currentTarget);(q=g.buttonRef.current)!=null&&q.contains(ae)||(X=g.optionsRef.current)!=null&&X.contains(ae)||g.disabled||g.immediate&&g.comboboxState!==0&&(b.openCombobox(),w.nextFrame(()=>{b.setActivationTrigger(1)}))}),Y=xy(()=>{if(g.labelId)return[g.labelId].join(" ")},[g.labelId]),ne=m.useMemo(()=>({open:g.comboboxState===0,disabled:g.disabled}),[g]),Q={ref:y,id:l,role:"combobox",type:h,"aria-controls":(n=g.optionsRef.current)==null?void 0:n.id,"aria-expanded":g.comboboxState===0,"aria-activedescendant":g.activeOptionIndex===null?void 0:g.virtual?(r=g.options.find(F=>{var J;return!((J=g.virtual)!=null&&J.disabled(F.dataRef.current.value))&&g.compare(F.dataRef.current.value,g.virtual.options[g.activeOptionIndex])}))==null?void 0:r.id:(o=g.options[g.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":Y,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:g.defaultValue!==void 0?d==null?void 0:d(g.defaultValue):null)!=null?s:g.defaultValue,disabled:g.disabled,onCompositionStart:M,onCompositionEnd:D,onKeyDown:A,onChange:k,onFocus:W,onBlur:L};return li({ourProps:Q,theirProps:p,slot:ne,defaultTag:_G,name:"Combobox.Input"})}let CG="button";function EG(e,t){var n;let r=ba("Combobox.Button"),o=td("Combobox.Button"),i=va(r.buttonRef,t),s=ed(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,u=Ju(),d=it(y=>{switch(y.key){case sr.ArrowDown:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&o.openCombobox(),u.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case sr.ArrowUp:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),u.nextFrame(()=>{r.value||o.goToOption(rn.Last)})),u.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case sr.Escape:return r.comboboxState!==0?void 0:(y.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&y.stopPropagation(),o.closeCombobox(),u.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),h=it(y=>{if(uG(y.currentTarget))return y.preventDefault();r.comboboxState===0?o.closeCombobox():(y.preventDefault(),o.openCombobox()),u.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),p=xy(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),g=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),b={ref:i,id:a,type:tG(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsRef.current)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":p,disabled:r.disabled,onClick:h,onKeyDown:d};return li({ourProps:b,theirProps:l,slot:g,defaultTag:CG,name:"Combobox.Button"})}let RG="label";function $G(e,t){let n=ed(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=ba("Combobox.Label"),s=td("Combobox.Label"),a=va(i.labelRef,t);sn(()=>s.registerLabel(r),[r]);let l=it(()=>{var d;return(d=i.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),u=m.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return li({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:u,defaultTag:RG,name:"Combobox.Label"})}let PG="ul",OG=Th.RenderStrategy|Th.Static;function DG(e,t){let n=ed(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=ba("Combobox.Options"),a=va(s.optionsRef,t),l=Cy(),u=l!==null?(l&dr.Open)===dr.Open:s.comboboxState===0;sn(()=>{var g;s.optionsPropsRef.current.static=(g=e.static)!=null?g:!1},[s.optionsPropsRef,e.static]),sn(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),oG({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(g){return g.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:g.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(g){g.setAttribute("role","none")}});let d=xy(()=>{var g,b;return(b=s.labelId)!=null?b:(g=s.buttonRef.current)==null?void 0:g.id},[s.labelId,s.buttonRef.current]),h=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),p={"aria-labelledby":d,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(i,{children:m.createElement(bG,null,i.children)}),li({ourProps:p,theirProps:i,slot:h,defaultTag:PG,features:OG,visible:u,name:"Combobox.Options"})}let MG="li";function TG(e,t){var n;let r=ed(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,u=ba("Combobox.Option"),d=td("Combobox.Option"),h=u.virtual?u.activeOptionIndex===u.calculateIndex(s):u.activeOptionIndex===null?!1:((n=u.options[u.activeOptionIndex])==null?void 0:n.id)===o,p=u.isSelected(s),g=m.useRef(null),b=bo({disabled:i,value:s,domRef:g,order:a}),y=m.useContext(CO),x=va(t,g,y?y.measureElement:null),_=it(()=>d.onChange(s));sn(()=>d.registerOption(o,b),[b,o]);let w=m.useRef(!(u.virtual||u.__demoMode));sn(()=>{if(!u.virtual||!u.__demoMode)return;let L=da();return L.requestAnimationFrame(()=>{w.current=!0}),L.dispose},[u.virtual,u.__demoMode]),sn(()=>{if(!w.current||u.comboboxState!==0||!h||u.activationTrigger===0)return;let L=da();return L.requestAnimationFrame(()=>{var W,Y;(Y=(W=g.current)==null?void 0:W.scrollIntoView)==null||Y.call(W,{block:"nearest"})}),L.dispose},[g,h,u.comboboxState,u.activationTrigger,u.activeOptionIndex]);let C=it(L=>{var W;if(i||(W=u.virtual)!=null&&W.disabled(s))return L.preventDefault();_(),vO()||requestAnimationFrame(()=>{var Y;return(Y=u.inputRef.current)==null?void 0:Y.focus({preventScroll:!0})}),u.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),R=it(()=>{var L;if(i||(L=u.virtual)!=null&&L.disabled(s))return d.goToOption(rn.Nothing);let W=u.calculateIndex(s);d.goToOption(rn.Specific,W)}),E=rG(),M=it(L=>E.update(L)),D=it(L=>{var W;if(!E.wasMoved(L)||i||(W=u.virtual)!=null&&W.disabled(s)||h)return;let Y=u.calculateIndex(s);d.goToOption(rn.Specific,Y,0)}),A=it(L=>{var W;E.wasMoved(L)&&(i||(W=u.virtual)!=null&&W.disabled(s)||h&&(u.optionsPropsRef.current.hold||d.goToOption(rn.Nothing)))}),k=m.useMemo(()=>({active:h,selected:p,disabled:i}),[h,p,i]);return li({ourProps:{id:o,ref:x,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":p,disabled:void 0,onClick:C,onFocus:R,onPointerEnter:M,onMouseEnter:M,onPointerMove:D,onMouseMove:D,onPointerLeave:A,onMouseLeave:A},theirProps:l,slot:k,defaultTag:MG,name:"Combobox.Option"})}let AG=Po(wG),IG=Po(EG),kG=Po(SG),NG=Po($G),LG=Po(DG),FG=Po(TG),Ua=Object.assign(AG,{Input:kG,Button:IG,Label:NG,Options:LG,Option:FG});function $y(){let e=m.useRef(!1);return sn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function zG(e=0){let[t,n]=m.useState(e),r=$y(),o=m.useCallback(l=>{r.current&&n(u=>u|l)},[t,r]),i=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(u=>u&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(u=>u^l)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}function jG(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Ym(e,...t){e&&t.length>0&&e.classList.add(...t)}function Km(e,...t){e&&t.length>0&&e.classList.remove(...t)}function VG(e,t){let n=da();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,s]=[r,o].map(l=>{let[u=0]=l.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,h)=>h-d);return u}),a=i+s;if(a!==0){n.group(u=>{u.setTimeout(()=>{t(),u.dispose()},a),u.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&u.dispose()})});let l=n.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function HG(e,t,n,r){let o=n?"enter":"leave",i=da(),s=r!==void 0?jG(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=bn(o,{enter:()=>t.enter,leave:()=>t.leave}),l=bn(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),u=bn(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Km(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Ym(e,...t.base,...a,...u),i.nextFrame(()=>{Km(e,...t.base,...a,...u),Ym(e,...t.base,...a,...l),VG(e,()=>(Km(e,...t.base,...a),Ym(e,...t.base,...t.entered),s()))}),i.dispose}function WG({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=$y(),a=Ju(),l=bo(n);sn(()=>{e&&(l.current="enter")},[e]),sn(()=>{let u=da();a.add(u.dispose);let d=t.current;if(d&&l.current!=="idle"&&s.current)return u.dispose(),o.current(l.current),u.add(HG(d,r.current,l.current==="enter",()=>{u.dispose(),i.current(l.current)})),u.dispose},[n])}function Si(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let wp=m.createContext(null);wp.displayName="TransitionContext";var BG=(e=>(e.Visible="visible",e.Hidden="hidden",e))(BG||{});function UG(){let e=m.useContext(wp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function qG(){let e=m.useContext(_p);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let _p=m.createContext(null);_p.displayName="NestingContext";function Sp(e){return"children"in e?Sp(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function EO(e,t){let n=bo(e),r=m.useRef([]),o=$y(),i=Ju(),s=it((g,b=ji.Hidden)=>{let y=r.current.findIndex(({el:x})=>x===g);y!==-1&&(bn(b,{[ji.Unmount](){r.current.splice(y,1)},[ji.Hidden](){r.current[y].state="hidden"}}),i.microTask(()=>{var x;!Sp(r)&&o.current&&((x=n.current)==null||x.call(n))}))}),a=it(g=>{let b=r.current.find(({el:y})=>y===g);return b?b.state!=="visible"&&(b.state="visible"):r.current.push({el:g,state:"visible"}),()=>s(g,ji.Unmount)}),l=m.useRef([]),u=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[],idle:[]}),h=it((g,b,y)=>{l.current.splice(0),t&&(t.chains.current[b]=t.chains.current[b].filter(([x])=>x!==g)),t==null||t.chains.current[b].push([g,new Promise(x=>{l.current.push(x)})]),t==null||t.chains.current[b].push([g,new Promise(x=>{Promise.all(d.current[b].map(([_,w])=>w)).then(()=>x())})]),b==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(b)):y(b)}),p=it((g,b,y)=>{Promise.all(d.current[b].splice(0).map(([x,_])=>_)).then(()=>{var x;(x=l.current.shift())==null||x()}).then(()=>y(b))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:h,onStop:p,wait:u,chains:d}),[a,s,r,h,p,d,u])}function GG(){}let YG=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function $C(e){var t;let n={};for(let r of YG)n[r]=(t=e[r])!=null?t:GG;return n}function KG(e){let t=m.useRef($C(e));return m.useEffect(()=>{t.current=$C(e)},[e]),t}let XG="div",RO=Th.RenderStrategy;function QG(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:u,enterTo:d,entered:h,leave:p,leaveFrom:g,leaveTo:b,...y}=e,x=m.useRef(null),_=va(x,t),w=(n=y.unmount)==null||n?ji.Unmount:ji.Hidden,{show:C,appear:R,initial:E}=UG(),[M,D]=m.useState(C?"visible":"hidden"),A=qG(),{register:k,unregister:L}=A;m.useEffect(()=>k(x),[k,x]),m.useEffect(()=>{if(w===ji.Hidden&&x.current){if(C&&M!=="visible"){D("visible");return}return bn(M,{hidden:()=>L(x),visible:()=>k(x)})}},[M,x,k,L,C,w]);let W=bo({base:Si(y.className),enter:Si(l),enterFrom:Si(u),enterTo:Si(d),entered:Si(h),leave:Si(p),leaveFrom:Si(g),leaveTo:Si(b)}),Y=KG({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),ne=wy();m.useEffect(()=>{if(ne&&M==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,M,ne]);let Q=E&&!R,F=R&&C&&E,J=!ne||Q?"idle":C?"enter":"leave",q=zG(0),X=it(ue=>bn(ue,{enter:()=>{q.addFlag(dr.Opening),Y.current.beforeEnter()},leave:()=>{q.addFlag(dr.Closing),Y.current.beforeLeave()},idle:()=>{}})),ae=it(ue=>bn(ue,{enter:()=>{q.removeFlag(dr.Opening),Y.current.afterEnter()},leave:()=>{q.removeFlag(dr.Closing),Y.current.afterLeave()},idle:()=>{}})),j=EO(()=>{D("hidden"),L(x)},A),V=m.useRef(!1);WG({immediate:F,container:x,classes:W,direction:J,onStart:bo(ue=>{V.current=!0,j.onStart(x,ue,X)}),onStop:bo(ue=>{V.current=!1,j.onStop(x,ue,ae),ue==="leave"&&!Sp(j)&&(D("hidden"),L(x))})});let oe=y,ce={ref:_};return F?oe={...oe,className:Mh(y.className,...W.current.enter,...W.current.enterFrom)}:V.current&&(oe.className=Mh(y.className,(r=x.current)==null?void 0:r.className),oe.className===""&&delete oe.className),m.createElement(_p.Provider,{value:j},m.createElement(xO,{value:bn(M,{visible:dr.Open,hidden:dr.Closed})|q.flags},li({ourProps:ce,theirProps:oe,defaultTag:XG,features:RO,visible:M==="visible",name:"Transition.Child"})))}function ZG(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=va(s,t);wy();let l=Cy();if(n===void 0&&l!==null&&(n=(l&dr.Open)===dr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=m.useState(n?"visible":"hidden"),h=EO(()=>{d("hidden")}),[p,g]=m.useState(!0),b=m.useRef([n]);sn(()=>{p!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),g(!1))},[b,n]);let y=m.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);m.useEffect(()=>{if(n)d("visible");else if(!Sp(h))d("hidden");else{let C=s.current;if(!C)return;let R=C.getBoundingClientRect();R.x===0&&R.y===0&&R.width===0&&R.height===0&&d("hidden")}},[n,h]);let x={unmount:o},_=it(()=>{var C;p&&g(!1),(C=e.beforeEnter)==null||C.call(e)}),w=it(()=>{var C;p&&g(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(_p.Provider,{value:h},m.createElement(wp.Provider,{value:y},li({ourProps:{...x,as:m.Fragment,children:m.createElement($O,{ref:a,...x,...i,beforeEnter:_,beforeLeave:w})},theirProps:{},defaultTag:m.Fragment,features:RO,visible:u==="visible",name:"Transition"})))}function JG(e,t){let n=m.useContext(wp)!==null,r=Cy()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Ob,{ref:t,...e}):m.createElement($O,{ref:t,...e}))}let Ob=Po(ZG),$O=Po(QG),eY=Po(JG),tY=Object.assign(Ob,{Child:eY,Root:Ob});function nY(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[o,i]=e.split(r);return{operation:r,value:i.trim()}}else return null}function rY(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return Fu.includes(e)?o:r}const PC=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,OC=th,Py=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return OC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],h=i==null?void 0:i[u];if(d===null)return null;const p=PC(d)||PC(h);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[h,p]=d;return p===void 0||(u[h]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:p,...g}=d;return Object.entries(g).every(b=>{let[y,x]=b;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...u,h,p]:u},[]);return OC(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Db=Py("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ea=le.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?ni:"button";return I.jsx(s,{className:_e(Db({variant:t,size:n,className:e})),ref:i,...o})});ea.displayName="Button";function oY({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null),{authToken:l}=Wl(),u=Ce(A=>A.filterValues),d=Ce(A=>A.actions.addOrUpdateFilterValue),h=Ce(A=>A.actions.removeFilterValue),p=C(u),{data:g,isLoading:b,isFetching:y,isError:x,refetch:_}=ju({queryKey:["filter",e.id,e.sql,JSON.stringify(p)],queryFn:()=>jh("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:p}),enabled:!!e.sql&&!!e.connectionId&&!!e.database}),w=m.useMemo(()=>{var A;return(A=g==null?void 0:g.records)==null?void 0:A.map(k=>{let L=e.column.split(".").slice(-1)[0].replace(/"/g,"");return k[L]===void 0&&(L=L.toLowerCase()),{id:k[L],value:k[L]}})},[g,e.column]);m.useEffect(()=>{if(u){const A=u.find(k=>k.filterId===e.id);if(!A){n([]);return}if(A.operation==="in"){const k=w==null?void 0:w.filter(L=>A.values.includes(L.value));k&&n(k)}else o(`${A.operation} ${A.values[0]}`)}},[g]),m.useEffect(()=>{if(u&&!u.find(k=>k.filterId===e.id)){n([]);return}},[u,e.id]);function C(A){return A?A.filter(k=>{const W=k.name.split(".");if(W.slice(0,W.length-1).join(".")===e.table&&k.name!==e.column)return!0}):[]}function R(A){const k=nY(A[0].toString());if(!(k!=null&&k.value)||!(k!=null&&k.operation))return;const L={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:sh(e),name:e.column,operation:k.operation,values:[Number(k.value)]};d(L)}function E(A){if(console.log("onComboBoxChange",A),A.length===1&&w.find(L=>L.value===A[0].value)===void 0){R(A);return}if(n(A),A.length===0){h(e.id);return}const k={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:sh(e),operation:e.operation,values:A.map(L=>L.value)};d(k)}function M(){var A;o(""),h(e.id),console.log(e.id),(A=a.current)==null||A.click()}if(b)return I.jsx("div",{children:I.jsx(Jb,{className:"h-8 w-[250px] bg-foreground/10"})});if(x)return I.jsx("div",{className:"flex h-8 w-[250px] items-center bg-muted px-2 text-sm",children:"Error"});if(!g)return null;let D=[];return Cl.includes(e.dataType)?D=w:D=i===""?w:w.filter(A=>A.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,""))),I.jsx("div",{className:"w-[250px]",children:I.jsx(Ua,{value:t,onChange:E,multiple:!0,children:I.jsxs("div",{className:"relative",children:[I.jsxs("div",{className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[I.jsx(Ua.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:A=>A.map(L=>L.value).join(", ")||r,onChange:A=>{o(A.target.value),s(A.target.value)}}),I.jsx(Ua.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:I.jsx(nW,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),I.jsx(tY,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:I.jsxs(Ua.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm",children:[Cl.includes(e.dataType)&&I.jsxs(Ua.Option,{value:r,className:"flex items-center justify-between gap-2 px-3 py-2",children:[I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("span",{className:"font-thin",children:"#"}),I.jsx("span",{children:r})]}),r&&I.jsx(ea,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:A=>{A.stopPropagation(),M()},children:"Clear"})]},"custom"),D.length===0&&i!==""?I.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):D.map(A=>I.jsx(Ua.Option,{className:({active:k})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${k?"bg-muted":"text-foreground-900"}`,value:A,children:({selected:k,active:L})=>(k&&console.log("record",A,k),I.jsxs("div",{className:"",children:[I.jsx("span",{className:`block ${k?"font-medium":"font-normal"}`,children:typeof A.value=="boolean"?A.value?"True":"False":A.value}),k?I.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:I.jsx(hP,{className:"h-5 w-5","aria-hidden":"true"})}):null]}))},A.value))]})})]})})})}const iY=m.forwardRef((e,t)=>m.createElement(ke.label,te({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),PO=iY,sY=Py("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Xo=le.forwardRef(({className:e,...t},n)=>I.jsx(PO,{ref:n,className:_e(sY(),e),...t}));Xo.displayName=PO.displayName;function mt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function vr(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function kn(e,t){const n=mt(e);return isNaN(t)?vr(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Jr(e,t){const n=mt(e);if(isNaN(t))return vr(e,NaN);if(!t)return n;const r=n.getDate(),o=vr(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const Oy=6048e5,aY=864e5;let lY={};function nd(){return lY}function _o(e,t){var a,l,u,d;const n=nd(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,o=mt(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function fa(e){return _o(e,{weekStartsOn:1})}function OO(e){const t=mt(e),n=t.getFullYear(),r=vr(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=fa(r),i=vr(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=fa(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Il(e){const t=mt(e);return t.setHours(0,0,0,0),t}function Ah(e){const t=mt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function mo(e,t){const n=Il(e),r=Il(t),o=+n-Ah(n),i=+r-Ah(r);return Math.round((o-i)/aY)}function cY(e){const t=OO(e),n=vr(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),fa(n)}function Mb(e,t){const n=t*7;return kn(e,n)}function uY(e,t){return Jr(e,t*12)}function dY(e){let t;return e.forEach(function(n){const r=mt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function fY(e){let t;return e.forEach(n=>{const r=mt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Gn(e,t){const n=Il(e),r=Il(t);return+n==+r}function Dy(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function hY(e){if(!Dy(e)&&typeof e!="number")return!1;const t=mt(e);return!isNaN(Number(t))}function mu(e,t){const n=mt(e),r=mt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function pY(e,t,n){const r=_o(e,n),o=_o(t,n),i=+r-Ah(r),s=+o-Ah(o);return Math.round((i-s)/Oy)}function My(e){const t=mt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Kn(e){const t=mt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function DO(e){const t=mt(e),n=vr(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ty(e,t){var a,l,u,d;const n=nd(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,o=mt(e),i=o.getDay(),s=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function MO(e){return Ty(e,{weekStartsOn:1})}const gY={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"}},mY=(e,t,n)=>{let r;const o=gY[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Xm(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const vY={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bY={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},yY={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xY={date:Xm({formats:vY,defaultWidth:"full"}),time:Xm({formats:bY,defaultWidth:"full"}),dateTime:Xm({formats:yY,defaultWidth:"full"})},wY={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_Y=(e,t,n,r)=>wY[e];function $c(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;o=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const SY={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},CY={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},EY={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"]},RY={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"]},$Y={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"}},PY={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"}},OY=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},DY={ordinalNumber:OY,era:$c({values:SY,defaultWidth:"wide"}),quarter:$c({values:CY,defaultWidth:"wide",argumentCallback:e=>e-1}),month:$c({values:EY,defaultWidth:"wide"}),day:$c({values:RY,defaultWidth:"wide"}),dayPeriod:$c({values:$Y,defaultWidth:"wide",formattingValues:PY,defaultFormattingWidth:"wide"})};function Pc(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?TY(a,h=>h.test(s)):MY(a,h=>h.test(s));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(s.length);return{value:u,rest:d}}}function MY(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function TY(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function AY(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(o.length);return{value:s,rest:a}}}const IY=/^(\d+)(th|st|nd|rd)?/i,kY=/\d+/i,NY={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},LY={any:[/^b/i,/^(a|c)/i]},FY={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zY={any:[/1/i,/2/i,/3/i,/4/i]},jY={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},VY={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]},HY={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},WY={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]},BY={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},UY={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}},qY={ordinalNumber:AY({matchPattern:IY,parsePattern:kY,valueCallback:e=>parseInt(e,10)}),era:Pc({matchPatterns:NY,defaultMatchWidth:"wide",parsePatterns:LY,defaultParseWidth:"any"}),quarter:Pc({matchPatterns:FY,defaultMatchWidth:"wide",parsePatterns:zY,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Pc({matchPatterns:jY,defaultMatchWidth:"wide",parsePatterns:VY,defaultParseWidth:"any"}),day:Pc({matchPatterns:HY,defaultMatchWidth:"wide",parsePatterns:WY,defaultParseWidth:"any"}),dayPeriod:Pc({matchPatterns:BY,defaultMatchWidth:"any",parsePatterns:UY,defaultParseWidth:"any"})},TO={code:"en-US",formatDistance:mY,formatLong:xY,formatRelative:_Y,localize:DY,match:qY,options:{weekStartsOn:0,firstWeekContainsDate:1}};function GY(e){const t=mt(e);return mo(t,DO(t))+1}function AO(e){const t=mt(e),n=+fa(t)-+cY(t);return Math.round(n/Oy)+1}function IO(e,t){var d,h,p,g;const n=mt(e),r=n.getFullYear(),o=nd(),i=(t==null?void 0:t.firstWeekContainsDate)??((h=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??o.firstWeekContainsDate??((g=(p=o.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??1,s=vr(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=_o(s,t),l=vr(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const u=_o(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function YY(e,t){var a,l,u,d;const n=nd(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,o=IO(e,t),i=vr(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),_o(i,t)}function kO(e,t){const n=mt(e),r=+_o(n,t)-+YY(n,t);return Math.round(r/Oy)+1}function Ct(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ci={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ct(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ct(n+1,2)},d(e,t){return Ct(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ct(e.getHours()%12||12,t.length)},H(e,t){return Ct(e.getHours(),t.length)},m(e,t){return Ct(e.getMinutes(),t.length)},s(e,t){return Ct(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Ct(o,t.length)}},qa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},DC={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Ci.y(e,t)},Y:function(e,t,n,r){const o=IO(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return Ct(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Ct(i,t.length)},R:function(e,t){const n=OO(e);return Ct(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ct(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ct(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ct(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Ci.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ct(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=kO(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Ct(o,t.length)},I:function(e,t,n){const r=AO(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ct(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ci.d(e,t)},D:function(e,t,n){const r=GY(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ct(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":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"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Ct(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Ct(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Ct(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=qa.noon:r===0?o=qa.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=qa.evening:r>=12?o=qa.afternoon:r>=4?o=qa.morning:o=qa.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ci.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ci.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ct(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ct(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ci.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ci.s(e,t)},S:function(e,t){return Ci.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return TC(r);case"XXXX":case"XX":return Is(r);case"XXXXX":case"XXX":default:return Is(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return TC(r);case"xxxx":case"xx":return Is(r);case"xxxxx":case"xxx":default:return Is(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+MC(r,":");case"OOOO":default:return"GMT"+Is(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+MC(r,":");case"zzzz":default:return"GMT"+Is(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Ct(r,t.length)},T:function(e,t,n){const r=e.getTime();return Ct(r,t.length)}};function MC(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+Ct(i,2)}function TC(e,t){return e%60===0?(e>0?"-":"+")+Ct(Math.abs(e)/60,2):Is(e,t)}function Is(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ct(Math.trunc(r/60),2),i=Ct(r%60,2);return n+o+t+i}const AC=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},NO=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},KY=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return AC(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",AC(r,t)).replace("{{time}}",NO(o,t))},XY={p:NO,P:KY},QY=/^D+$/,ZY=/^Y+$/,JY=["D","DD","YY","YYYY"];function eK(e){return QY.test(e)}function tK(e){return ZY.test(e)}function nK(e,t,n){const r=rK(e,t,n);if(console.warn(r),JY.includes(e))throw new RangeError(r)}function rK(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const oK=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,iK=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sK=/^'([^]*?)'?$/,aK=/''/g,lK=/[a-zA-Z]/;function yo(e,t,n){var d,h,p,g,b,y,x,_;const r=nd(),o=(n==null?void 0:n.locale)??r.locale??TO,i=(n==null?void 0:n.firstWeekContainsDate)??((h=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((g=(p=r.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((y=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:y.weekStartsOn)??r.weekStartsOn??((_=(x=r.locale)==null?void 0:x.options)==null?void 0:_.weekStartsOn)??0,a=mt(e);if(!hY(a))throw new RangeError("Invalid time value");let l=t.match(iK).map(w=>{const C=w[0];if(C==="p"||C==="P"){const R=XY[C];return R(w,o.formatLong)}return w}).join("").match(oK).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const C=w[0];if(C==="'")return{isToken:!1,value:cK(w)};if(DC[C])return{isToken:!0,value:w};if(C.match(lK))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:w}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(w=>{if(!w.isToken)return w.value;const C=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&tK(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&eK(C))&&nK(C,t,String(e));const R=DC[C[0]];return R(a,C,o.localize,u)}).join("")}function cK(e){const t=e.match(sK);return t?t[1].replace(aK,"'"):e}function uK(e){const t=mt(e),n=t.getFullYear(),r=t.getMonth(),o=vr(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function dK(e){return Math.trunc(+mt(e)/1e3)}function fK(e){const t=mt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function hK(e,t){return pY(fK(e),Kn(e),t)+1}function Tb(e,t){const n=mt(e),r=mt(t);return n.getTime()>r.getTime()}function LO(e,t){const n=mt(e),r=mt(t);return+n<+r}function Ay(e,t){const n=mt(e),r=mt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function pK(e,t){const n=mt(e),r=mt(t);return n.getFullYear()===r.getFullYear()}function Qm(e,t){return kn(e,-t)}function Zm(e,t){const n=mt(e),r=n.getFullYear(),o=n.getDate(),i=vr(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=uK(i);return n.setMonth(t,Math.min(o,s)),n}function IC(e,t){const n=mt(e);return isNaN(+n)?vr(e,NaN):(n.setFullYear(t),n)}var je=function(){return je=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},je.apply(this,arguments)};function gK(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function FO(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ab={exports:{}},Oc={};/**
|
|
285
|
-
* @license React
|
|
286
|
-
* react-jsx-runtime.development.js
|
|
287
|
-
*
|
|
288
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the MIT license found in the
|
|
291
|
-
* LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/var kC;function mK(){return kC||(kC=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),b=Symbol.iterator,y="@@iterator";function x($){if($===null||typeof $!="object")return null;var H=b&&$[b]||$[y];return typeof H=="function"?H:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w($){{for(var H=arguments.length,re=new Array(H>1?H-1:0),xe=1;xe<H;xe++)re[xe-1]=arguments[xe];C("error",$,re)}}function C($,H,re){{var xe=_.ReactDebugCurrentFrame,Me=xe.getStackAddendum();Me!==""&&(H+="%s",re=re.concat([Me]));var Ae=re.map(function($e){return String($e)});Ae.unshift("Warning: "+H),Function.prototype.apply.call(console[$],console,Ae)}}var R=!1,E=!1,M=!1,D=!1,A=!1,k;k=Symbol.for("react.module.reference");function L($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===i||A||$===o||$===u||$===d||D||$===g||R||E||M||typeof $=="object"&&$!==null&&($.$$typeof===p||$.$$typeof===h||$.$$typeof===s||$.$$typeof===a||$.$$typeof===l||$.$$typeof===k||$.getModuleId!==void 0))}function W($,H,re){var xe=$.displayName;if(xe)return xe;var Me=H.displayName||H.name||"";return Me!==""?re+"("+Me+")":re}function Y($){return $.displayName||"Context"}function ne($){if($==null)return null;if(typeof $.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof $=="object")switch($.$$typeof){case a:var H=$;return Y(H)+".Consumer";case s:var re=$;return Y(re._context)+".Provider";case l:return W($,$.render,"ForwardRef");case h:var xe=$.displayName||null;return xe!==null?xe:ne($.type)||"Memo";case p:{var Me=$,Ae=Me._payload,$e=Me._init;try{return ne($e(Ae))}catch{return null}}}return null}var Q=Object.assign,F=0,J,q,X,ae,j,V,oe;function ce(){}ce.__reactDisabledLog=!0;function ue(){{if(F===0){J=console.log,q=console.info,X=console.warn,ae=console.error,j=console.group,V=console.groupCollapsed,oe=console.groupEnd;var $={configurable:!0,enumerable:!0,value:ce,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}F++}}function ge(){{if(F--,F===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Q({},$,{value:J}),info:Q({},$,{value:q}),warn:Q({},$,{value:X}),error:Q({},$,{value:ae}),group:Q({},$,{value:j}),groupCollapsed:Q({},$,{value:V}),groupEnd:Q({},$,{value:oe})})}F<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ve=_.ReactCurrentDispatcher,fe;function ee($,H,re){{if(fe===void 0)try{throw Error()}catch(Me){var xe=Me.stack.trim().match(/\n( *(at )?)/);fe=xe&&xe[1]||""}return`
|
|
293
|
-
`+fe+$}}var K=!1,ie;{var ye=typeof WeakMap=="function"?WeakMap:Map;ie=new ye}function Z($,H){if(!$||K)return"";{var re=ie.get($);if(re!==void 0)return re}var xe;K=!0;var Me=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ae;Ae=ve.current,ve.current=null,ue();try{if(H){var $e=function(){throw Error()};if(Object.defineProperty($e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($e,[])}catch(zt){xe=zt}Reflect.construct($,[],$e)}else{try{$e.call()}catch(zt){xe=zt}$.call($e.prototype)}}else{try{throw Error()}catch(zt){xe=zt}$()}}catch(zt){if(zt&&xe&&typeof zt.stack=="string"){for(var Ee=zt.stack.split(`
|
|
294
|
-
`),gt=xe.stack.split(`
|
|
295
|
-
`),We=Ee.length-1,Ge=gt.length-1;We>=1&&Ge>=0&&Ee[We]!==gt[Ge];)Ge--;for(;We>=1&&Ge>=0;We--,Ge--)if(Ee[We]!==gt[Ge]){if(We!==1||Ge!==1)do if(We--,Ge--,Ge<0||Ee[We]!==gt[Ge]){var Rt=`
|
|
296
|
-
`+Ee[We].replace(" at new "," at ");return $.displayName&&Rt.includes("<anonymous>")&&(Rt=Rt.replace("<anonymous>",$.displayName)),typeof $=="function"&&ie.set($,Rt),Rt}while(We>=1&&Ge>=0);break}}}finally{K=!1,ve.current=Ae,ge(),Error.prepareStackTrace=Me}var an=$?$.displayName||$.name:"",ps=an?ee(an):"";return typeof $=="function"&&ie.set($,ps),ps}function De($,H,re){return Z($,!1)}function Ne($){var H=$.prototype;return!!(H&&H.isReactComponent)}function Ve($,H,re){if($==null)return"";if(typeof $=="function")return Z($,Ne($));if(typeof $=="string")return ee($);switch($){case u:return ee("Suspense");case d:return ee("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return De($.render);case h:return Ve($.type,H,re);case p:{var xe=$,Me=xe._payload,Ae=xe._init;try{return Ve(Ae(Me),H,re)}catch{}}}return""}var qe=Object.prototype.hasOwnProperty,pt={},dt=_.ReactDebugCurrentFrame;function ft($){if($){var H=$._owner,re=Ve($.type,$._source,H?H.type:null);dt.setExtraStackFrame(re)}else dt.setExtraStackFrame(null)}function Bt($,H,re,xe,Me){{var Ae=Function.call.bind(qe);for(var $e in $)if(Ae($,$e)){var Ee=void 0;try{if(typeof $[$e]!="function"){var gt=Error((xe||"React class")+": "+re+" type `"+$e+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[$e]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw gt.name="Invariant Violation",gt}Ee=$[$e](H,$e,xe,re,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(We){Ee=We}Ee&&!(Ee instanceof Error)&&(ft(Me),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",xe||"React class",re,$e,typeof Ee),ft(null)),Ee instanceof Error&&!(Ee.message in pt)&&(pt[Ee.message]=!0,ft(Me),w("Failed %s type: %s",re,Ee.message),ft(null))}}}var Vt=Array.isArray;function xn($){return Vt($)}function Jt($){{var H=typeof Symbol=="function"&&Symbol.toStringTag,re=H&&$[Symbol.toStringTag]||$.constructor.name||"Object";return re}}function ql($){try{return jr($),!1}catch{return!0}}function jr($){return""+$}function Ji($){if(ql($))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Jt($)),jr($)}var fn=_.ReactCurrentOwner,no={key:!0,ref:!0,__self:!0,__source:!0},Oo,Do,Vr;Vr={};function es($){if(qe.call($,"ref")){var H=Object.getOwnPropertyDescriptor($,"ref").get;if(H&&H.isReactWarning)return!1}return $.ref!==void 0}function ts($){if(qe.call($,"key")){var H=Object.getOwnPropertyDescriptor($,"key").get;if(H&&H.isReactWarning)return!1}return $.key!==void 0}function ns($,H){if(typeof $.ref=="string"&&fn.current&&H&&fn.current.stateNode!==H){var re=ne(fn.current.type);Vr[re]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ne(fn.current.type),$.ref),Vr[re]=!0)}}function rs($,H){{var re=function(){Oo||(Oo=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",H))};re.isReactWarning=!0,Object.defineProperty($,"key",{get:re,configurable:!0})}}function os($,H){{var re=function(){Do||(Do=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",H))};re.isReactWarning=!0,Object.defineProperty($,"ref",{get:re,configurable:!0})}}var is=function($,H,re,xe,Me,Ae,$e){var Ee={$$typeof:t,type:$,key:H,ref:re,props:$e,_owner:Ae};return Ee._store={},Object.defineProperty(Ee._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ee,"_self",{configurable:!1,enumerable:!1,writable:!1,value:xe}),Object.defineProperty(Ee,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Me}),Object.freeze&&(Object.freeze(Ee.props),Object.freeze(Ee)),Ee};function Gl($,H,re,xe,Me){{var Ae,$e={},Ee=null,gt=null;re!==void 0&&(Ji(re),Ee=""+re),ts(H)&&(Ji(H.key),Ee=""+H.key),es(H)&&(gt=H.ref,ns(H,Me));for(Ae in H)qe.call(H,Ae)&&!no.hasOwnProperty(Ae)&&($e[Ae]=H[Ae]);if($&&$.defaultProps){var We=$.defaultProps;for(Ae in We)$e[Ae]===void 0&&($e[Ae]=We[Ae])}if(Ee||gt){var Ge=typeof $=="function"?$.displayName||$.name||"Unknown":$;Ee&&rs($e,Ge),gt&&os($e,Ge)}return is($,Ee,gt,Me,xe,fn.current,$e)}}var Mo=_.ReactCurrentOwner,ss=_.ReactDebugCurrentFrame;function wn($){if($){var H=$._owner,re=Ve($.type,$._source,H?H.type:null);ss.setExtraStackFrame(re)}else ss.setExtraStackFrame(null)}var ro;ro=!1;function To($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function as(){{if(Mo.current){var $=ne(Mo.current.type);if($)return`
|
|
297
|
-
|
|
298
|
-
Check the render method of \``+$+"`."}return""}}function Yl($){{if($!==void 0){var H=$.fileName.replace(/^.*[\\\/]/,""),re=$.lineNumber;return`
|
|
299
|
-
|
|
300
|
-
Check your code at `+H+":"+re+"."}return""}}var ls={};function Sa($){{var H=as();if(!H){var re=typeof $=="string"?$:$.displayName||$.name;re&&(H=`
|
|
301
|
-
|
|
302
|
-
Check the top-level render call using <`+re+">.")}return H}}function cs($,H){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var re=Sa(H);if(ls[re])return;ls[re]=!0;var xe="";$&&$._owner&&$._owner!==Mo.current&&(xe=" It was passed a child from "+ne($._owner.type)+"."),wn($),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',re,xe),wn(null)}}function us($,H){{if(typeof $!="object")return;if(xn($))for(var re=0;re<$.length;re++){var xe=$[re];To(xe)&&cs(xe,H)}else if(To($))$._store&&($._store.validated=!0);else if($){var Me=x($);if(typeof Me=="function"&&Me!==$.entries)for(var Ae=Me.call($),$e;!($e=Ae.next()).done;)To($e.value)&&cs($e.value,H)}}}function Kl($){{var H=$.type;if(H==null||typeof H=="string")return;var re;if(typeof H=="function")re=H.propTypes;else if(typeof H=="object"&&(H.$$typeof===l||H.$$typeof===h))re=H.propTypes;else return;if(re){var xe=ne(H);Bt(re,$.props,"prop",xe,$)}else if(H.PropTypes!==void 0&&!ro){ro=!0;var Me=ne(H);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Me||"Unknown")}typeof H.getDefaultProps=="function"&&!H.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ds($){{for(var H=Object.keys($.props),re=0;re<H.length;re++){var xe=H[re];if(xe!=="children"&&xe!=="key"){wn($),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",xe),wn(null);break}}$.ref!==null&&(wn($),w("Invalid attribute `ref` supplied to `React.Fragment`."),wn(null))}}function fs($,H,re,xe,Me,Ae){{var $e=L($);if(!$e){var Ee="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(Ee+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var gt=Yl(Me);gt?Ee+=gt:Ee+=as();var We;$===null?We="null":xn($)?We="array":$!==void 0&&$.$$typeof===t?(We="<"+(ne($.type)||"Unknown")+" />",Ee=" Did you accidentally export a JSX literal instead of a component?"):We=typeof $,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",We,Ee)}var Ge=Gl($,H,re,Me,Ae);if(Ge==null)return Ge;if($e){var Rt=H.children;if(Rt!==void 0)if(xe)if(xn(Rt)){for(var an=0;an<Rt.length;an++)us(Rt[an],$);Object.freeze&&Object.freeze(Rt)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else us(Rt,$)}return $===r?ds(Ge):Kl(Ge),Ge}}function hs($,H,re){return fs($,H,re,!0)}function Xl($,H,re){return fs($,H,re,!1)}var Ql=Xl,Zl=hs;Oc.Fragment=r,Oc.jsx=Ql,Oc.jsxs=Zl}()),Oc}var Dc={};/**
|
|
303
|
-
* @license React
|
|
304
|
-
* react-jsx-runtime.production.min.js
|
|
305
|
-
*
|
|
306
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the MIT license found in the
|
|
309
|
-
* LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/var NC;function vK(){if(NC)return Dc;NC=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,u){var d,h={},p=null,g=null;u!==void 0&&(p=""+u),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(g=l.ref);for(d in l)r.call(l,d)&&!i.hasOwnProperty(d)&&(h[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)h[d]===void 0&&(h[d]=l[d]);return{$$typeof:t,type:a,key:p,ref:g,props:h,_owner:o.current}}return Dc.Fragment=n,Dc.jsx=s,Dc.jsxs=s,Dc}process.env.NODE_ENV==="production"?Ab.exports=vK():Ab.exports=mK();var me=Ab.exports;function rd(e){return e.mode==="multiple"}function od(e){return e.mode==="range"}function Cp(e){return e.mode==="single"}var bK={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function yK(e,t){return yo(e,"LLLL y",t)}function xK(e,t){return yo(e,"d",t)}function wK(e,t){return yo(e,"LLLL",t)}function _K(e){return"".concat(e)}function SK(e,t){return yo(e,"cccccc",t)}function CK(e,t){return yo(e,"yyyy",t)}var EK=Object.freeze({__proto__:null,formatCaption:yK,formatDay:xK,formatMonthCaption:wK,formatWeekNumber:_K,formatWeekdayName:SK,formatYearCaption:CK}),RK=function(e,t,n){return yo(e,"do MMMM (EEEE)",n)},$K=function(){return"Month: "},PK=function(){return"Go to next month"},OK=function(){return"Go to previous month"},DK=function(e,t){return yo(e,"cccc",t)},MK=function(e){return"Week n. ".concat(e)},TK=function(){return"Year: "},AK=Object.freeze({__proto__:null,labelDay:RK,labelMonthDropdown:$K,labelNext:PK,labelPrevious:OK,labelWeekNumber:MK,labelWeekday:DK,labelYearDropdown:TK});function IK(){var e="buttons",t=bK,n=TO,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:EK,labels:AK,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function kK(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=Kn(r):t&&(i=new Date(t,0,1)),o?s=My(o):n&&(s=new Date(n,11,31)),{fromDate:i?Il(i):void 0,toDate:s?Il(s):void 0}}var zO=m.createContext(void 0);function NK(e){var t,n=e.initialProps,r=IK(),o=kK(n),i=o.fromDate,s=o.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;(Cp(n)||rd(n)||od(n))&&(l=n.onSelect);var u=je(je(je({},r),n),{captionLayout:a,classNames:je(je({},r.classNames),n.classNames),components:je({},n.components),formatters:je(je({},r.formatters),n.formatters),fromDate:i,labels:je(je({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:je(je({},r.modifiers),n.modifiers),modifiersClassNames:je(je({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:je(je({},r.styles),n.styles),toDate:s});return me.jsx(zO.Provider,{value:u,children:e.children})}function Dt(){var e=m.useContext(zO);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function jO(e){var t=Dt(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return me.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function LK(e){return me.jsx("svg",je({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:me.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function VO(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,u=Dt(),d=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:LK;return me.jsxs("div",{className:a,style:l,children:[me.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),me.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:o,onChange:r,children:i}),me.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[s,me.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function FK(e){var t,n=Dt(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!r)return me.jsx(me.Fragment,{});if(!o)return me.jsx(me.Fragment,{});var h=[];if(pK(r,o))for(var p=Kn(r),g=r.getMonth();g<=o.getMonth();g++)h.push(Zm(p,g));else for(var p=Kn(new Date),g=0;g<=11;g++)h.push(Zm(p,g));var b=function(x){var _=Number(x.target.value),w=Zm(Kn(e.displayMonth),_);e.onChange(w)},y=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:VO;return me.jsx(y,{name:"months","aria-label":d(),className:l.dropdown_month,style:i.dropdown_month,onChange:b,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:h.map(function(x){return me.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function zK(e){var t,n=e.displayMonth,r=Dt(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,u=r.components,d=r.formatters.formatYearCaption,h=r.labels.labelYearDropdown,p=[];if(!o)return me.jsx(me.Fragment,{});if(!i)return me.jsx(me.Fragment,{});for(var g=o.getFullYear(),b=i.getFullYear(),y=g;y<=b;y++)p.push(IC(DO(new Date),y));var x=function(w){var C=IC(Kn(n),Number(w.target.value));e.onChange(C)},_=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:VO;return me.jsx(_,{name:"years","aria-label":h(),className:l.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:d(n,{locale:s}),children:p.map(function(w){return me.jsx("option",{value:w.getFullYear(),children:d(w,{locale:s})},w.getFullYear())})})}function jK(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function VK(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(i&&mu(i,o)<0){var u=-1*(l-1);o=Jr(i,u)}return s&&mu(o,s)<0&&(o=s),Kn(o)}function HK(){var e=Dt(),t=VK(e),n=jK(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=Kn(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function WK(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=Kn(e),i=Kn(Jr(o,r)),s=mu(i,o),a=[],l=0;l<s;l++){var u=Jr(o,l);a.push(u)}return n&&(a=a.reverse()),a}function BK(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=Kn(e);if(!n)return Jr(a,s);var l=mu(n,e);if(!(l<i))return Jr(a,s)}}function UK(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=Kn(e);if(!n)return Jr(a,-s);var l=mu(a,n);if(!(l<=0))return Jr(a,-s)}}var HO=m.createContext(void 0);function qK(e){var t=Dt(),n=HK(),r=n[0],o=n[1],i=WK(r,t),s=BK(r,t),a=UK(r,t),l=function(h){return i.some(function(p){return Ay(h,p)})},u=function(h,p){l(h)||(p&&LO(h,p)?o(Jr(h,1+t.numberOfMonths*-1)):o(h))},d={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:u,previousMonth:a,nextMonth:s,isDateDisplayed:l};return me.jsx(HO.Provider,{value:d,children:e.children})}function id(){var e=m.useContext(HO);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function LC(e){var t,n=Dt(),r=n.classNames,o=n.styles,i=n.components,s=id().goToMonth,a=function(d){s(Jr(d,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:jO,u=me.jsx(l,{id:e.id,displayMonth:e.displayMonth});return me.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[me.jsx("div",{className:r.vhidden,children:u}),me.jsx(FK,{onChange:a,displayMonth:e.displayMonth}),me.jsx(zK,{onChange:a,displayMonth:e.displayMonth})]})}function GK(e){return me.jsx("svg",je({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:me.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function YK(e){return me.jsx("svg",je({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:me.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Ih=m.forwardRef(function(e,t){var n=Dt(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=je(je({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),me.jsx("button",je({},e,{ref:t,type:"button",className:s,style:a}))});function KK(e){var t,n,r=Dt(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,u=l.labelPrevious,d=l.labelNext,h=r.components;if(!e.nextMonth&&!e.previousMonth)return me.jsx(me.Fragment,{});var p=u(e.previousMonth,{locale:i}),g=[s.nav_button,s.nav_button_previous].join(" "),b=d(e.nextMonth,{locale:i}),y=[s.nav_button,s.nav_button_next].join(" "),x=(t=h==null?void 0:h.IconRight)!==null&&t!==void 0?t:YK,_=(n=h==null?void 0:h.IconLeft)!==null&&n!==void 0?n:GK;return me.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&me.jsx(Ih,{name:"previous-month","aria-label":p,className:g,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?me.jsx(x,{className:s.nav_icon,style:a.nav_icon}):me.jsx(_,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&me.jsx(Ih,{name:"next-month","aria-label":b,className:y,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?me.jsx(_,{className:s.nav_icon,style:a.nav_icon}):me.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function FC(e){var t=Dt().numberOfMonths,n=id(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(b){return Ay(e.displayMonth,b)}),l=a===0,u=a===s.length-1,d=t>1&&(l||!u),h=t>1&&(u||!l),p=function(){r&&i(r)},g=function(){o&&i(o)};return me.jsx(KK,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:h,nextMonth:o,previousMonth:r,onPreviousClick:p,onNextClick:g})}function XK(e){var t,n=Dt(),r=n.classNames,o=n.disableNavigation,i=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:jO,u;return o?u=me.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?u=me.jsx(LC,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?u=me.jsxs(me.Fragment,{children:[me.jsx(LC,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),me.jsx(FC,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=me.jsxs(me.Fragment,{children:[me.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),me.jsx(FC,{displayMonth:e.displayMonth,id:e.id})]}),me.jsx("div",{className:r.caption,style:i.caption,children:u})}function QK(e){var t=Dt(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?me.jsx("tfoot",{className:o,style:r.tfoot,children:me.jsx("tr",{children:me.jsx("td",{colSpan:8,children:n})})}):me.jsx(me.Fragment,{})}function ZK(e,t,n){for(var r=n?fa(new Date):_o(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=kn(r,i);o.push(s)}return o}function JK(){var e=Dt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,u=ZK(o,i,s);return me.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&me.jsx("td",{style:n.head_cell,className:t.head_cell}),u.map(function(d,h){return me.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(d,{locale:o}),children:a(d,{locale:o})},h)})]})}function eX(){var e,t=Dt(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:JK;return me.jsx("thead",{style:r.head,className:n.head,children:me.jsx(i,{})})}function tX(e){var t=Dt(),n=t.locale,r=t.formatters.formatDay;return me.jsx(me.Fragment,{children:r(e.date,{locale:n})})}var Iy=m.createContext(void 0);function nX(e){if(!rd(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return me.jsx(Iy.Provider,{value:t,children:e.children})}return me.jsx(rX,{initialProps:e.initialProps,children:e.children})}function rX(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(u,d,h){var p,g;(p=t.onDayClick)===null||p===void 0||p.call(t,u,d,h);var b=!!(d.selected&&o&&(r==null?void 0:r.length)===o);if(!b){var y=!!(!d.selected&&i&&(r==null?void 0:r.length)===i);if(!y){var x=r?FO([],r,!0):[];if(d.selected){var _=x.findIndex(function(w){return Gn(u,w)});x.splice(_,1)}else x.push(u);(g=t.onSelect)===null||g===void 0||g.call(t,x,u,d,h)}}},a={disabled:[]};r&&a.disabled.push(function(u){var d=i&&r.length>i-1,h=r.some(function(p){return Gn(p,u)});return!!(d&&!h)});var l={selected:r,onDayClick:s,modifiers:a};return me.jsx(Iy.Provider,{value:l,children:n})}function ky(){var e=m.useContext(Iy);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function oX(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?Gn(o,e)&&Gn(r,e)?void 0:Gn(o,e)?{from:o,to:void 0}:Gn(r,e)?void 0:Tb(r,e)?{from:e,to:o}:{from:r,to:e}:o?Tb(e,o)?{from:o,to:e}:{from:e,to:o}:r?LO(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Ny=m.createContext(void 0);function iX(e){if(!od(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return me.jsx(Ny.Provider,{value:t,children:e.children})}return me.jsx(sX,{initialProps:e.initialProps,children:e.children})}function sX(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,s=o.to,a=t.min,l=t.max,u=function(g,b,y){var x,_;(x=t.onDayClick)===null||x===void 0||x.call(t,g,b,y);var w=oX(g,r);(_=t.onSelect)===null||_===void 0||_.call(t,w,g,b,y)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(d.range_start=[i],s?(d.range_end=[s],Gn(i,s)||(d.range_middle=[{after:i,before:s}])):d.range_end=[i]):s&&(d.range_start=[s],d.range_end=[s]),a&&(i&&!s&&d.disabled.push({after:Qm(i,a-1),before:kn(i,a-1)}),i&&s&&d.disabled.push({after:i,before:kn(i,a-1)}),!i&&s&&d.disabled.push({after:Qm(s,a-1),before:kn(s,a-1)})),l){if(i&&!s&&(d.disabled.push({before:kn(i,-l+1)}),d.disabled.push({after:kn(i,l-1)})),i&&s){var h=mo(s,i)+1,p=l-h;d.disabled.push({before:Qm(i,p)}),d.disabled.push({after:kn(s,p)})}!i&&s&&(d.disabled.push({before:kn(s,-l+1)}),d.disabled.push({after:kn(s,l-1)}))}return me.jsx(Ny.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function Ly(){var e=m.useContext(Ny);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Zf(e){return Array.isArray(e)?FO([],e,!0):e!==void 0?[e]:[]}function aX(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=Zf(o)}),t}var eo;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(eo||(eo={}));var lX=eo.Selected,Bo=eo.Disabled,cX=eo.Hidden,uX=eo.Today,Jm=eo.RangeEnd,ev=eo.RangeMiddle,tv=eo.RangeStart,dX=eo.Outside;function fX(e,t,n){var r,o=(r={},r[lX]=Zf(e.selected),r[Bo]=Zf(e.disabled),r[cX]=Zf(e.hidden),r[uX]=[e.today],r[Jm]=[],r[ev]=[],r[tv]=[],r[dX]=[],r);return e.fromDate&&o[Bo].push({before:e.fromDate}),e.toDate&&o[Bo].push({after:e.toDate}),rd(e)?o[Bo]=o[Bo].concat(t.modifiers[Bo]):od(e)&&(o[Bo]=o[Bo].concat(n.modifiers[Bo]),o[tv]=n.modifiers[tv],o[ev]=n.modifiers[ev],o[Jm]=n.modifiers[Jm]),o}var WO=m.createContext(void 0);function hX(e){var t=Dt(),n=ky(),r=Ly(),o=fX(t,n,r),i=aX(t.modifiers),s=je(je({},o),i);return me.jsx(WO.Provider,{value:s,children:e.children})}function BO(){var e=m.useContext(WO);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function pX(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function gX(e){return!!(e&&typeof e=="object"&&"from"in e)}function mX(e){return!!(e&&typeof e=="object"&&"after"in e)}function vX(e){return!!(e&&typeof e=="object"&&"before"in e)}function bX(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function yX(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=mo(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=mo(e,r)>=0&&mo(o,e)>=0;return s}return o?Gn(o,e):r?Gn(r,e):!1}function xX(e){return Dy(e)}function wX(e){return Array.isArray(e)&&e.every(Dy)}function _X(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(xX(n))return Gn(e,n);if(wX(n))return n.includes(e);if(gX(n))return yX(e,n);if(bX(n))return n.dayOfWeek.includes(e.getDay());if(pX(n)){var r=mo(n.before,e),o=mo(n.after,e),i=r>0,s=o<0,a=Tb(n.before,n.after);return a?s&&i:i||s}return mX(n)?mo(e,n.after)>0:vX(n)?mo(n.before,e)>0:typeof n=="function"?n(e):!1})}function Fy(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return _X(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!Ay(e,n)&&(o.outside=!0),o}function SX(e,t){for(var n=Kn(e[0]),r=My(e[e.length-1]),o,i,s=n;s<=r;){var a=Fy(s,t),l=!a.disabled&&!a.hidden;if(!l){s=kn(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=kn(s,1)}return i||o}var CX=365;function UO(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=o.weekStartsOn,u=o.fromDate,d=o.toDate,h=o.locale,p={day:kn,week:Mb,month:Jr,year:uY,startOfWeek:function(x){return o.ISOWeek?fa(x):_o(x,{locale:h,weekStartsOn:l})},endOfWeek:function(x){return o.ISOWeek?MO(x):Ty(x,{locale:h,weekStartsOn:l})}},g=p[n](e,r==="after"?1:-1);r==="before"&&u?g=dY([u,g]):r==="after"&&d&&(g=fY([d,g]));var b=!0;if(i){var y=Fy(g,i);b=!y.disabled&&!y.hidden}return b?g:a.count>CX?a.lastFocused:UO(g,{moveBy:n,direction:r,context:o,modifiers:i,retry:je(je({},a),{count:a.count+1})})}var qO=m.createContext(void 0);function EX(e){var t=id(),n=BO(),r=m.useState(),o=r[0],i=r[1],s=m.useState(),a=s[0],l=s[1],u=SX(t.displayMonths,n),d=o??(a&&t.isDateDisplayed(a))?a:u,h=function(){l(o),i(void 0)},p=function(x){i(x)},g=Dt(),b=function(x,_){if(o){var w=UO(o,{moveBy:x,direction:_,context:g,modifiers:n});Gn(o,w)||(t.goToDate(w,o),p(w))}},y={focusedDay:o,focusTarget:d,blur:h,focus:p,focusDayAfter:function(){return b("day","after")},focusDayBefore:function(){return b("day","before")},focusWeekAfter:function(){return b("week","after")},focusWeekBefore:function(){return b("week","before")},focusMonthBefore:function(){return b("month","before")},focusMonthAfter:function(){return b("month","after")},focusYearBefore:function(){return b("year","before")},focusYearAfter:function(){return b("year","after")},focusStartOfWeek:function(){return b("startOfWeek","before")},focusEndOfWeek:function(){return b("endOfWeek","after")}};return me.jsx(qO.Provider,{value:y,children:e.children})}function zy(){var e=m.useContext(qO);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function RX(e,t){var n=BO(),r=Fy(e,n,t);return r}var jy=m.createContext(void 0);function $X(e){if(!Cp(e.initialProps)){var t={selected:void 0};return me.jsx(jy.Provider,{value:t,children:e.children})}return me.jsx(PX,{initialProps:e.initialProps,children:e.children})}function PX(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,u,d;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,i,s,a);return}(d=t.onSelect)===null||d===void 0||d.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return me.jsx(jy.Provider,{value:o,children:n})}function GO(){var e=m.useContext(jy);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function OX(e,t){var n=Dt(),r=GO(),o=ky(),i=Ly(),s=zy(),a=s.focusDayAfter,l=s.focusDayBefore,u=s.focusWeekAfter,d=s.focusWeekBefore,h=s.blur,p=s.focus,g=s.focusMonthBefore,b=s.focusMonthAfter,y=s.focusYearBefore,x=s.focusYearAfter,_=s.focusStartOfWeek,w=s.focusEndOfWeek,C=function(q){var X,ae,j,V;Cp(n)?(X=r.onDayClick)===null||X===void 0||X.call(r,e,t,q):rd(n)?(ae=o.onDayClick)===null||ae===void 0||ae.call(o,e,t,q):od(n)?(j=i.onDayClick)===null||j===void 0||j.call(i,e,t,q):(V=n.onDayClick)===null||V===void 0||V.call(n,e,t,q)},R=function(q){var X;p(e),(X=n.onDayFocus)===null||X===void 0||X.call(n,e,t,q)},E=function(q){var X;h(),(X=n.onDayBlur)===null||X===void 0||X.call(n,e,t,q)},M=function(q){var X;(X=n.onDayMouseEnter)===null||X===void 0||X.call(n,e,t,q)},D=function(q){var X;(X=n.onDayMouseLeave)===null||X===void 0||X.call(n,e,t,q)},A=function(q){var X;(X=n.onDayPointerEnter)===null||X===void 0||X.call(n,e,t,q)},k=function(q){var X;(X=n.onDayPointerLeave)===null||X===void 0||X.call(n,e,t,q)},L=function(q){var X;(X=n.onDayTouchCancel)===null||X===void 0||X.call(n,e,t,q)},W=function(q){var X;(X=n.onDayTouchEnd)===null||X===void 0||X.call(n,e,t,q)},Y=function(q){var X;(X=n.onDayTouchMove)===null||X===void 0||X.call(n,e,t,q)},ne=function(q){var X;(X=n.onDayTouchStart)===null||X===void 0||X.call(n,e,t,q)},Q=function(q){var X;(X=n.onDayKeyUp)===null||X===void 0||X.call(n,e,t,q)},F=function(q){var X;switch(q.key){case"ArrowLeft":q.preventDefault(),q.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":q.preventDefault(),q.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":q.preventDefault(),q.stopPropagation(),u();break;case"ArrowUp":q.preventDefault(),q.stopPropagation(),d();break;case"PageUp":q.preventDefault(),q.stopPropagation(),q.shiftKey?y():g();break;case"PageDown":q.preventDefault(),q.stopPropagation(),q.shiftKey?x():b();break;case"Home":q.preventDefault(),q.stopPropagation(),_();break;case"End":q.preventDefault(),q.stopPropagation(),w();break}(X=n.onDayKeyDown)===null||X===void 0||X.call(n,e,t,q)},J={onClick:C,onFocus:R,onBlur:E,onKeyDown:F,onKeyUp:Q,onMouseEnter:M,onMouseLeave:D,onPointerEnter:A,onPointerLeave:k,onTouchCancel:L,onTouchEnd:W,onTouchMove:Y,onTouchStart:ne};return J}function DX(){var e=Dt(),t=GO(),n=ky(),r=Ly(),o=Cp(e)?t.selected:rd(e)?n.selected:od(e)?r.selected:void 0;return o}function MX(e){return Object.values(eo).includes(e)}function TX(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(MX(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function AX(e,t){var n=je({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=je(je({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function IX(e,t,n){var r,o,i,s=Dt(),a=zy(),l=RX(e,t),u=OX(e,l),d=DX(),h=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var M;l.outside||a.focusedDay&&h&&Gn(a.focusedDay,e)&&((M=n.current)===null||M===void 0||M.focus())},[a.focusedDay,e,n,h,l.outside]);var p=TX(s,l).join(" "),g=AX(s,l),b=!!(l.outside&&!s.showOutsideDays||l.hidden),y=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:tX,x=me.jsx(y,{date:e,displayMonth:t,activeModifiers:l}),_={style:g,className:p,children:x,role:"gridcell"},w=a.focusTarget&&Gn(a.focusTarget,e)&&!l.outside,C=a.focusedDay&&Gn(a.focusedDay,e),R=je(je(je({},_),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=C||w?0:-1,r)),u),E={isButton:h,isHidden:b,activeModifiers:l,selectedDays:d,buttonProps:R,divProps:_};return E}function kX(e){var t=m.useRef(null),n=IX(e.date,e.displayMonth,t);return n.isHidden?me.jsx("div",{role:"gridcell"}):n.isButton?me.jsx(Ih,je({name:"day",ref:t},n.buttonProps)):me.jsx("div",je({},n.divProps))}function NX(e){var t=e.number,n=e.dates,r=Dt(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,d=u(Number(t),{locale:a});if(!o)return me.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:d});var h=l(Number(t),{locale:a}),p=function(g){o(t,n,g)};return me.jsx(Ih,{name:"week-number","aria-label":h,className:s.weeknumber,style:i.weeknumber,onClick:p,children:d})}function LX(e){var t,n,r=Dt(),o=r.styles,i=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:kX,u=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:NX,d;return s&&(d=me.jsx("td",{className:i.cell,style:o.cell,children:me.jsx(u,{number:e.weekNumber,dates:e.dates})})),me.jsxs("tr",{className:i.row,style:o.row,children:[d,e.dates.map(function(h){return me.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:me.jsx(l,{displayMonth:e.displayMonth,date:h})},dK(h))})]})}function zC(e,t,n){for(var r=n!=null&&n.ISOWeek?MO(t):Ty(t,n),o=n!=null&&n.ISOWeek?fa(e):_o(e,n),i=mo(r,o),s=[],a=0;a<=i;a++)s.push(kn(o,a));var l=s.reduce(function(u,d){var h=n!=null&&n.ISOWeek?AO(d):kO(d,n),p=u.find(function(g){return g.weekNumber===h});return p?(p.dates.push(d),u):(u.push({weekNumber:h,dates:[d]}),u)},[]);return l}function FX(e,t){var n=zC(Kn(e),My(e),t);if(t!=null&&t.useFixedWeeks){var r=hK(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=Mb(i,6-r),a=zC(Mb(i,1),s,t);n.push.apply(n,a)}}return n}function zX(e){var t,n,r,o=Dt(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,u=o.fixedWeeks,d=o.components,h=o.weekStartsOn,p=o.firstWeekContainsDate,g=o.ISOWeek,b=FX(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:g,locale:i,weekStartsOn:h,firstWeekContainsDate:p}),y=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:eX,x=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:LX,_=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:QK;return me.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&me.jsx(y,{}),me.jsx("tbody",{className:s.tbody,style:a.tbody,children:b.map(function(w){return me.jsx(x,{displayMonth:e.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),me.jsx(_,{displayMonth:e.displayMonth})]})}function jX(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var VX=jX()?m.useLayoutEffect:m.useEffect,nv=!1,HX=0;function jC(){return"react-day-picker-".concat(++HX)}function WX(e){var t,n=e??(nv?jC():null),r=m.useState(n),o=r[0],i=r[1];return VX(function(){o===null&&i(jC())},[]),m.useEffect(function(){nv===!1&&(nv=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function BX(e){var t,n,r=Dt(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=id().displayMonths,u=WX(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,h=[i.month],p=s.month,g=e.displayIndex===0,b=e.displayIndex===l.length-1,y=!g&&!b;o==="rtl"&&(t=[g,b],b=t[0],g=t[1]),g&&(h.push(i.caption_start),p=je(je({},p),s.caption_start)),b&&(h.push(i.caption_end),p=je(je({},p),s.caption_end)),y&&(h.push(i.caption_between),p=je(je({},p),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:XK;return me.jsxs("div",{className:h.join(" "),style:p,children:[me.jsx(x,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),me.jsx(zX,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function UX(e){var t=Dt(),n=t.classNames,r=t.styles;return me.jsx("div",{className:n.months,style:r.months,children:e.children})}function qX(e){var t,n,r=e.initialProps,o=Dt(),i=zy(),s=id(),a=m.useState(!1),l=a[0],u=a[1];m.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),u(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var d=[o.classNames.root,o.className];o.numberOfMonths>1&&d.push(o.classNames.multiple_months),o.showWeekNumber&&d.push(o.classNames.with_weeknumber);var h=je(je({},o.styles.root),o.style),p=Object.keys(r).filter(function(b){return b.startsWith("data-")}).reduce(function(b,y){var x;return je(je({},b),(x={},x[y]=r[y],x))},{}),g=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:UX;return me.jsx("div",je({className:d.join(" "),style:h,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:me.jsx(g,{children:s.displayMonths.map(function(b,y){return me.jsx(BX,{displayIndex:y,displayMonth:b},y)})})}))}function GX(e){var t=e.children,n=gK(e,["children"]);return me.jsx(NK,{initialProps:n,children:me.jsx(qK,{children:me.jsx($X,{initialProps:n,children:me.jsx(nX,{initialProps:n,children:me.jsx(iX,{initialProps:n,children:me.jsx(hX,{children:me.jsx(EX,{children:t})})})})})})})}function YX(e){return me.jsx(GX,je({},e,{children:me.jsx(qX,{initialProps:e})}))}function YO({className:e,classNames:t,showOutsideDays:n=!0,...r}){return I.jsx(YX,{showOutsideDays:n,className:_e("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:_e(Db({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:_e(Db({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...o})=>I.jsx(ZB,{...o,className:"h-4 w-4"}),IconRight:({...o})=>I.jsx(jP,{...o,className:"h-4 w-4"})},...r})}YO.displayName="Calendar";let rv=0;function Ep(){m.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:VC()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:VC()),rv++,()=>{rv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),rv--}},[])}function VC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const ov="focusScope.autoFocusOnMount",iv="focusScope.autoFocusOnUnmount",HC={bubbles:!1,cancelable:!0},Rp=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=m.useState(null),u=on(o),d=on(i),h=m.useRef(null),p=Xe(t,y=>l(y)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(C){if(g.paused||!a)return;const R=C.target;a.contains(R)?h.current=R:$i(h.current,{select:!0})},x=function(C){if(g.paused||!a)return;const R=C.relatedTarget;R!==null&&(a.contains(R)||$i(h.current,{select:!0}))},_=function(C){if(document.activeElement===document.body)for(const E of C)E.removedNodes.length>0&&$i(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const w=new MutationObserver(_);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),w.disconnect()}}},[r,a,g.paused]),m.useEffect(()=>{if(a){BC.add(g);const y=document.activeElement;if(!a.contains(y)){const _=new CustomEvent(ov,HC);a.addEventListener(ov,u),a.dispatchEvent(_),_.defaultPrevented||(KX(eQ(KO(a)),{select:!0}),document.activeElement===y&&$i(a))}return()=>{a.removeEventListener(ov,u),setTimeout(()=>{const _=new CustomEvent(iv,HC);a.addEventListener(iv,d),a.dispatchEvent(_),_.defaultPrevented||$i(y??document.body,{select:!0}),a.removeEventListener(iv,d),BC.remove(g)},0)}}},[a,u,d,g]);const b=m.useCallback(y=>{if(!n&&!r||g.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,_=document.activeElement;if(x&&_){const w=y.currentTarget,[C,R]=XX(w);C&&R?!y.shiftKey&&_===R?(y.preventDefault(),n&&$i(C,{select:!0})):y.shiftKey&&_===C&&(y.preventDefault(),n&&$i(R,{select:!0})):_===w&&y.preventDefault()}},[n,r,g.paused]);return m.createElement(ke.div,te({tabIndex:-1},s,{ref:p,onKeyDown:b}))});function KX(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if($i(r,{select:t}),document.activeElement!==n)return}function XX(e){const t=KO(e),n=WC(t,e),r=WC(t.reverse(),e);return[n,r]}function KO(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function WC(e,t){for(const n of e)if(!QX(n,{upTo:t}))return n}function QX(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ZX(e){return e instanceof HTMLInputElement&&"select"in e}function $i(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ZX(e)&&t&&e.select()}}const BC=JX();function JX(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=UC(e,t),e.unshift(t)},remove(t){var n;e=UC(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function UC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function eQ(e){return e.filter(t=>t.tagName!=="A")}var tQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ga=new WeakMap,Mf=new WeakMap,Tf={},sv=0,XO=function(e){return e&&(e.host||XO(e.parentNode))},nQ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=XO(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},rQ=function(e,t,n,r){var o=nQ(t,Array.isArray(e)?e:[e]);Tf[n]||(Tf[n]=new WeakMap);var i=Tf[n],s=[],a=new Set,l=new Set(o),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};o.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))d(p);else{var g=p.getAttribute(r),b=g!==null&&g!=="false",y=(Ga.get(p)||0)+1,x=(i.get(p)||0)+1;Ga.set(p,y),i.set(p,x),s.push(p),y===1&&b&&Mf.set(p,!0),x===1&&p.setAttribute(n,"true"),b||p.setAttribute(r,"true")}})};return d(t),a.clear(),sv++,function(){s.forEach(function(h){var p=Ga.get(h)-1,g=i.get(h)-1;Ga.set(h,p),i.set(h,g),p||(Mf.has(h)||h.removeAttribute(r),Mf.delete(h)),g||h.removeAttribute(n)}),sv--,sv||(Ga=new WeakMap,Ga=new WeakMap,Mf=new WeakMap,Tf={})}},$p=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||tQ(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),rQ(r,o,n,"aria-hidden")):function(){return null}},go=function(){return go=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},go.apply(this,arguments)};function QO(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function oQ(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Jf="right-scroll-bar-position",eh="width-before-scroll-bar",iQ="with-scroll-bars-hidden",sQ="--removed-body-scroll-bar-size";function aQ(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lQ(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function cQ(e,t){return lQ(t||null,function(n){return e.forEach(function(r){return aQ(r,n)})})}function uQ(e){return e}function dQ(e,t){t===void 0&&(t=uQ);var n=[],r=!1,o={read:function(){if(r)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]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return o}function fQ(e){e===void 0&&(e={});var t=dQ(null);return t.options=go({async:!0,ssr:!1},e),t}var ZO=function(e){var t=e.sideCar,n=QO(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return le.createElement(r,go({},n))};ZO.isSideCarExport=!0;function hQ(e,t){return e.useMedium(t),ZO}var JO=fQ(),av=function(){},Pp=le.forwardRef(function(e,t){var n=le.useRef(null),r=le.useState({onScrollCapture:av,onWheelCapture:av,onTouchMoveCapture:av}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,p=e.sideCar,g=e.noIsolation,b=e.inert,y=e.allowPinchZoom,x=e.as,_=x===void 0?"div":x,w=QO(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=p,R=cQ([n,t]),E=go(go({},w),o);return le.createElement(le.Fragment,null,d&&le.createElement(C,{sideCar:JO,removeScrollBar:u,shards:h,noIsolation:g,inert:b,setCallbacks:i,allowPinchZoom:!!y,lockRef:n}),s?le.cloneElement(le.Children.only(a),go(go({},E),{ref:R})):le.createElement(_,go({},E,{className:l,ref:R}),a))});Pp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Pp.classNames={fullWidth:eh,zeroRight:Jf};var qC,pQ=function(){if(qC)return qC;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pQ();return t&&e.setAttribute("nonce",t),e}function mQ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var bQ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=gQ())&&(mQ(t,n),vQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yQ=function(){var e=bQ();return function(t,n){le.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},e2=function(){var e=yQ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},xQ={left:0,top:0,right:0,gap:0},lv=function(e){return parseInt(e||"",10)||0},wQ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[lv(n),lv(r),lv(o)]},_Q=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xQ;var t=wQ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},SQ=e2(),CQ=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
311
|
-
.`.concat(iQ,` {
|
|
312
|
-
overflow: hidden `).concat(r,`;
|
|
313
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
314
|
-
}
|
|
315
|
-
body {
|
|
316
|
-
overflow: hidden `).concat(r,`;
|
|
317
|
-
overscroll-behavior: contain;
|
|
318
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
319
|
-
padding-left: `.concat(o,`px;
|
|
320
|
-
padding-top: `).concat(i,`px;
|
|
321
|
-
padding-right: `).concat(s,`px;
|
|
322
|
-
margin-left:0;
|
|
323
|
-
margin-top:0;
|
|
324
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
325
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.`).concat(Jf,` {
|
|
329
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.`).concat(eh,` {
|
|
333
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.`).concat(Jf," .").concat(Jf,` {
|
|
337
|
-
right: 0 `).concat(r,`;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.`).concat(eh," .").concat(eh,` {
|
|
341
|
-
margin-right: 0 `).concat(r,`;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
body {
|
|
345
|
-
`).concat(sQ,": ").concat(a,`px;
|
|
346
|
-
}
|
|
347
|
-
`)},EQ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=le.useMemo(function(){return _Q(o)},[o]);return le.createElement(SQ,{styles:CQ(i,!t,o,n?"":"!important")})},Ib=!1;if(typeof window<"u")try{var Af=Object.defineProperty({},"passive",{get:function(){return Ib=!0,!0}});window.addEventListener("test",Af,Af),window.removeEventListener("test",Af,Af)}catch{Ib=!1}var Ya=Ib?{passive:!1}:!1,RQ=function(e){return e.tagName==="TEXTAREA"},t2=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!RQ(e)&&n[t]==="visible")},$Q=function(e){return t2(e,"overflowY")},PQ=function(e){return t2(e,"overflowX")},GC=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=n2(e,n);if(r){var o=r2(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},OQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},DQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},n2=function(e,t){return e==="v"?$Q(t):PQ(t)},r2=function(e,t){return e==="v"?OQ(t):DQ(t)},MQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},TQ=function(e,t,n,r,o){var i=MQ(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,d=s>0,h=0,p=0;do{var g=r2(e,a),b=g[0],y=g[1],x=g[2],_=y-x-i*b;(b||_)&&n2(e,a)&&(h+=_,p+=b),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(o&&h===0||!o&&s>h)||!d&&(o&&p===0||!o&&-s>p))&&(u=!0),u},If=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},YC=function(e){return[e.deltaX,e.deltaY]},KC=function(e){return e&&"current"in e?e.current:e},AQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},IQ=function(e){return`
|
|
348
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
349
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
350
|
-
`)},kQ=0,Ka=[];function NQ(e){var t=le.useRef([]),n=le.useRef([0,0]),r=le.useRef(),o=le.useState(kQ++)[0],i=le.useState(function(){return e2()})[0],s=le.useRef(e);le.useEffect(function(){s.current=e},[e]),le.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=oQ([e.lockRef.current],(e.shards||[]).map(KC),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=le.useCallback(function(y,x){if("touches"in y&&y.touches.length===2)return!s.current.allowPinchZoom;var _=If(y),w=n.current,C="deltaX"in y?y.deltaX:w[0]-_[0],R="deltaY"in y?y.deltaY:w[1]-_[1],E,M=y.target,D=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in y&&D==="h"&&M.type==="range")return!1;var A=GC(D,M);if(!A)return!0;if(A?E=D:(E=D==="v"?"h":"v",A=GC(D,M)),!A)return!1;if(!r.current&&"changedTouches"in y&&(C||R)&&(r.current=E),!E)return!0;var k=r.current||E;return TQ(k,x,y,k==="h"?C:R,!0)},[]),l=le.useCallback(function(y){var x=y;if(!(!Ka.length||Ka[Ka.length-1]!==i)){var _="deltaY"in x?YC(x):If(x),w=t.current.filter(function(E){return E.name===x.type&&E.target===x.target&&AQ(E.delta,_)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var C=(s.current.shards||[]).map(KC).filter(Boolean).filter(function(E){return E.contains(x.target)}),R=C.length>0?a(x,C[0]):!s.current.noIsolation;R&&x.cancelable&&x.preventDefault()}}},[]),u=le.useCallback(function(y,x,_,w){var C={name:y,delta:x,target:_,should:w};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),d=le.useCallback(function(y){n.current=If(y),r.current=void 0},[]),h=le.useCallback(function(y){u(y.type,YC(y),y.target,a(y,e.lockRef.current))},[]),p=le.useCallback(function(y){u(y.type,If(y),y.target,a(y,e.lockRef.current))},[]);le.useEffect(function(){return Ka.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Ya),document.addEventListener("touchmove",l,Ya),document.addEventListener("touchstart",d,Ya),function(){Ka=Ka.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,Ya),document.removeEventListener("touchmove",l,Ya),document.removeEventListener("touchstart",d,Ya)}},[]);var g=e.removeScrollBar,b=e.inert;return le.createElement(le.Fragment,null,b?le.createElement(i,{styles:IQ(o)}):null,g?le.createElement(EQ,{gapMode:"margin"}):null)}const LQ=hQ(JO,NQ);var o2=le.forwardRef(function(e,t){return le.createElement(Pp,go({},e,{ref:t,sideCar:LQ}))});o2.classNames=Pp.classNames;const Op=o2,i2="Popover",[s2,coe]=dn(i2,[$o]),Vy=$o(),[FQ,Bl]=s2(i2),zQ=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Vy(t),l=m.useRef(null),[u,d]=m.useState(!1),[h=!1,p]=On({prop:r,defaultProp:o,onChange:i});return m.createElement(Ku,a,m.createElement(FQ,{scope:t,contentId:Yn(),triggerRef:l,open:h,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(g=>!g),[p]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:s},n))},jQ="PopoverTrigger",VQ=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Bl(jQ,n),i=Vy(n),s=Xe(t,o.triggerRef),a=m.createElement(ke.button,te({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":c2(o.open)},r,{ref:s,onClick:we(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(Xu,te({asChild:!0},i),a)}),a2="PopoverPortal",[HQ,WQ]=s2(a2,{forceMount:void 0}),BQ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Bl(a2,t);return m.createElement(HQ,{scope:t,forceMount:n},m.createElement(Zt,{present:n||i.open},m.createElement(vp,{asChild:!0,container:o},r)))},vu="PopoverContent",UQ=m.forwardRef((e,t)=>{const n=WQ(vu,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Bl(vu,e.__scopePopover);return m.createElement(Zt,{present:r||i.open},i.modal?m.createElement(qQ,te({},o,{ref:t})):m.createElement(GQ,te({},o,{ref:t})))}),qQ=m.forwardRef((e,t)=>{const n=Bl(vu,e.__scopePopover),r=m.useRef(null),o=Xe(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return $p(s)},[]),m.createElement(Op,{as:ni,allowPinchZoom:!0},m.createElement(l2,te({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:we(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),GQ=m.forwardRef((e,t)=>{const n=Bl(vu,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(l2,te({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),l2=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...h}=e,p=Bl(vu,n),g=Vy(n);return Ep(),m.createElement(Rp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(jl,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1)},m.createElement(Qu,te({"data-state":c2(p.open),role:"dialog",id:p.contentId},g,h,{ref:t,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)"}}))))});function c2(e){return e?"open":"closed"}const YQ=zQ,KQ=VQ,XQ=BQ,u2=UQ,Hy=YQ,Wy=KQ,Dp=le.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>I.jsx(XQ,{children:I.jsx(u2,{ref:o,align:t,sideOffset:n,className:_e("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Dp.displayName=u2.displayName;function QQ({filter:e,className:t}){const[n,r]=m.useState(!1),[o,i]=m.useState(),[s,a]=m.useState(),l=Ce(C=>C.filterValues),{authToken:u}=Wl(),d=Ce(C=>C.actions.addOrUpdateFilterValue),h=Ce(C=>C.actions.removeFilterValue),{data:p,isLoading:g,isFetching:b,isError:y,refetch:x}=ju({queryKey:[e.sql],queryFn:()=>jh("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database});m.useEffect(()=>{var C;if(((C=p==null?void 0:p.records)==null?void 0:C.length)>0){const R=p.records[0];if(!R.min||!R.max)return;i({from:new Date(R.min),to:new Date(R.max)}),a({from:new Date(R.min),to:new Date(R.max)})}},[p]),m.useEffect(()=>{if(l&&!l.find(R=>R.filterId===e.id)){i(s);return}},[l,e.id,s]);function _(){h(e.id),i(s),r(!1)}function w(){if(!o)return;console.log(o);const C=[o==null?void 0:o.from,o==null?void 0:o.to];console.log(C);const R={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:sh(e),name:e.column,operation:"between",values:C};d(R),r(!1)}return g?I.jsx("div",{children:I.jsx(Jb,{className:"h-8 w-[250px] bg-foreground/10"})}):y?I.jsx("div",{className:"h-8 w-[250px] bg-muted px-2",children:"Error"}):p?I.jsx("div",{className:_e("grid gap-2",t),children:I.jsxs(Hy,{open:n,onOpenChange:r,children:[I.jsx(Wy,{asChild:!0,children:I.jsxs(ea,{size:"sm",id:"date",variant:"outline",className:_e("h-[34px] w-[250px] justify-start rounded-sm text-left font-normal",!o&&"text-muted-foreground"),children:[I.jsx(zP,{className:"mr-2 h-4 w-4"}),o!=null&&o.from?o.to?I.jsxs(I.Fragment,{children:[yo(o.from,"LLL dd, y")," -"," ",yo(o.to,"LLL dd, y")]}):yo(o.from,"LLL dd, y"):I.jsx("span",{children:"Pick a date"})]})}),I.jsxs(Dp,{className:"w-auto p-0",align:"start",children:[I.jsx(YO,{initialFocus:!0,mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:i,numberOfMonths:2}),I.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[I.jsx(ea,{size:"sm",variant:"outline",onClick:w,children:"Apply"}),I.jsx(ea,{size:"sm",variant:"outline",onClick:_,children:"Clear"})]})]})]})}):null}const By=le.forwardRef(({className:e,...t},n)=>I.jsx("textarea",{className:_e("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));By.displayName="Textarea";const kb="horizontal",ZQ=["horizontal","vertical"],d2=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=kb,...o}=e,i=f2(r)?r:kb,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(ke.div,te({"data-orientation":i},a,o,{ref:t}))});d2.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!f2(r)?new Error(JQ(o,n)):null}};function JQ(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
|
|
351
|
-
- horizontal
|
|
352
|
-
- vertical
|
|
353
|
-
|
|
354
|
-
Defaulting to \`${kb}\`.`}function f2(e){return ZQ.includes(e)}const h2=d2,Uy=le.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>I.jsx(h2,{ref:o,decorative:n,orientation:t,className:_e("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Uy.displayName=h2.displayName;function Nb(e,[t,n]){return Math.min(n,Math.max(t,e))}function Mp(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const eZ=[" ","Enter","ArrowUp","ArrowDown"],tZ=[" ","Enter"],Tp="Select",[Ap,Ip,nZ]=Xh(Tp),[Ul,uoe]=dn(Tp,[nZ,$o]),qy=$o(),[rZ,ya]=Ul(Tp),[oZ,iZ]=Ul(Tp),sZ=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:h,disabled:p,required:g}=e,b=qy(t),[y,x]=m.useState(null),[_,w]=m.useState(null),[C,R]=m.useState(!1),E=ha(u),[M=!1,D]=On({prop:r,defaultProp:o,onChange:i}),[A,k]=On({prop:s,defaultProp:a,onChange:l}),L=m.useRef(null),W=y?!!y.closest("form"):!0,[Y,ne]=m.useState(new Set),Q=Array.from(Y).map(F=>F.props.value).join(";");return m.createElement(Ku,b,m.createElement(rZ,{required:g,scope:t,trigger:y,onTriggerChange:x,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:C,onValueNodeHasChildrenChange:R,contentId:Yn(),value:A,onValueChange:k,open:M,onOpenChange:D,dir:E,triggerPointerDownPosRef:L,disabled:p},m.createElement(Ap.Provider,{scope:t},m.createElement(oZ,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(F=>{ne(J=>new Set(J).add(F))},[]),onNativeOptionRemove:m.useCallback(F=>{ne(J=>{const q=new Set(J);return q.delete(F),q})},[])},n)),W?m.createElement(b2,{key:Q,"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:h,value:A,onChange:F=>k(F.target.value),disabled:p},A===void 0?m.createElement("option",{value:""}):null,Array.from(Y)):null))},aZ="SelectTrigger",lZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=qy(n),s=ya(aZ,n),a=s.disabled||r,l=Xe(t,s.onTriggerChange),u=Ip(n),[d,h,p]=y2(b=>{const y=u().filter(w=>!w.disabled),x=y.find(w=>w.value===s.value),_=x2(y,b,x);_!==void 0&&s.onValueChange(_.value)}),g=()=>{a||(s.onOpenChange(!0),p())};return m.createElement(Xu,te({asChild:!0},i),m.createElement(ke.button,te({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":v2(s.value)?"":void 0},o,{ref:l,onClick:we(o.onClick,b=>{b.currentTarget.focus()}),onPointerDown:we(o.onPointerDown,b=>{const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&(g(),s.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)},b.preventDefault())}),onKeyDown:we(o.onKeyDown,b=>{const y=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&h(b.key),!(y&&b.key===" ")&&eZ.includes(b.key)&&(g(),b.preventDefault())})})))}),cZ="SelectValue",uZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=ya(cZ,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,h=Xe(t,l.onValueNodeChange);return Pn(()=>{u(d)},[u,d]),m.createElement(ke.span,te({},a,{ref:h,style:{pointerEvents:"none"}}),v2(l.value)?m.createElement(m.Fragment,null,s):i)}),dZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(ke.span,te({"aria-hidden":!0},o,{ref:t}),r||"▼")}),fZ=e=>m.createElement(vp,te({asChild:!0},e)),kl="SelectContent",hZ=m.forwardRef((e,t)=>{const n=ya(kl,e.__scopeSelect),[r,o]=m.useState();if(Pn(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?So.createPortal(m.createElement(p2,{scope:e.__scopeSelect},m.createElement(Ap.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(pZ,te({},e,{ref:t}))}),Yo=10,[p2,xa]=Ul(kl),pZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:x,..._}=e,w=ya(kl,n),[C,R]=m.useState(null),[E,M]=m.useState(null),D=Xe(t,fe=>R(fe)),[A,k]=m.useState(null),[L,W]=m.useState(null),Y=Ip(n),[ne,Q]=m.useState(!1),F=m.useRef(!1);m.useEffect(()=>{if(C)return $p(C)},[C]),Ep();const J=m.useCallback(fe=>{const[ee,...K]=Y().map(Z=>Z.ref.current),[ie]=K.slice(-1),ye=document.activeElement;for(const Z of fe)if(Z===ye||(Z==null||Z.scrollIntoView({block:"nearest"}),Z===ee&&E&&(E.scrollTop=0),Z===ie&&E&&(E.scrollTop=E.scrollHeight),Z==null||Z.focus(),document.activeElement!==ye))return},[Y,E]),q=m.useCallback(()=>J([A,C]),[J,A,C]);m.useEffect(()=>{ne&&q()},[ne,q]);const{onOpenChange:X,triggerPointerDownPosRef:ae}=w;m.useEffect(()=>{if(C){let fe={x:0,y:0};const ee=ie=>{var ye,Z,De,Ne;fe={x:Math.abs(Math.round(ie.pageX)-((ye=(Z=ae.current)===null||Z===void 0?void 0:Z.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(ie.pageY)-((De=(Ne=ae.current)===null||Ne===void 0?void 0:Ne.y)!==null&&De!==void 0?De:0))}},K=ie=>{fe.x<=10&&fe.y<=10?ie.preventDefault():C.contains(ie.target)||X(!1),document.removeEventListener("pointermove",ee),ae.current=null};return ae.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",K,{capture:!0})}}},[C,X,ae]),m.useEffect(()=>{const fe=()=>X(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[X]);const[j,V]=y2(fe=>{const ee=Y().filter(ye=>!ye.disabled),K=ee.find(ye=>ye.ref.current===document.activeElement),ie=x2(ee,fe,K);ie&&setTimeout(()=>ie.ref.current.focus())}),oe=m.useCallback((fe,ee,K)=>{const ie=!F.current&&!K;(w.value!==void 0&&w.value===ee||ie)&&(k(fe),ie&&(F.current=!0))},[w.value]),ce=m.useCallback(()=>C==null?void 0:C.focus(),[C]),ue=m.useCallback((fe,ee,K)=>{const ie=!F.current&&!K;(w.value!==void 0&&w.value===ee||ie)&&W(fe)},[w.value]),ge=r==="popper"?XC:gZ,ve=ge===XC?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:x}:{};return m.createElement(p2,{scope:n,content:C,viewport:E,onViewportChange:M,itemRefCallback:oe,selectedItem:A,onItemLeave:ce,itemTextRefCallback:ue,focusSelectedItem:q,selectedItemText:L,position:r,isPositioned:ne,searchRef:j},m.createElement(Op,{as:ni,allowPinchZoom:!0},m.createElement(Rp,{asChild:!0,trapped:w.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:we(o,fe=>{var ee;(ee=w.trigger)===null||ee===void 0||ee.focus({preventScroll:!0}),fe.preventDefault()})},m.createElement(jl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>w.onOpenChange(!1)},m.createElement(ge,te({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:fe=>fe.preventDefault()},_,ve,{onPlaced:()=>Q(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:we(_.onKeyDown,fe=>{const ee=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ee&&fe.key.length===1&&V(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let ie=Y().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const ye=fe.target,Z=ie.indexOf(ye);ie=ie.slice(Z+1)}setTimeout(()=>J(ie)),fe.preventDefault()}})}))))))}),gZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=ya(kl,n),s=xa(kl,n),[a,l]=m.useState(null),[u,d]=m.useState(null),h=Xe(t,D=>d(D)),p=Ip(n),g=m.useRef(!1),b=m.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:_,focusSelectedItem:w}=s,C=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&y&&x&&_){const D=i.trigger.getBoundingClientRect(),A=u.getBoundingClientRect(),k=i.valueNode.getBoundingClientRect(),L=_.getBoundingClientRect();if(i.dir!=="rtl"){const ye=L.left-A.left,Z=k.left-ye,De=D.left-Z,Ne=D.width+De,Ve=Math.max(Ne,A.width),qe=window.innerWidth-Yo,pt=Nb(Z,[Yo,qe-Ve]);a.style.minWidth=Ne+"px",a.style.left=pt+"px"}else{const ye=A.right-L.right,Z=window.innerWidth-k.right-ye,De=window.innerWidth-D.right-Z,Ne=D.width+De,Ve=Math.max(Ne,A.width),qe=window.innerWidth-Yo,pt=Nb(Z,[Yo,qe-Ve]);a.style.minWidth=Ne+"px",a.style.right=pt+"px"}const W=p(),Y=window.innerHeight-Yo*2,ne=y.scrollHeight,Q=window.getComputedStyle(u),F=parseInt(Q.borderTopWidth,10),J=parseInt(Q.paddingTop,10),q=parseInt(Q.borderBottomWidth,10),X=parseInt(Q.paddingBottom,10),ae=F+J+ne+X+q,j=Math.min(x.offsetHeight*5,ae),V=window.getComputedStyle(y),oe=parseInt(V.paddingTop,10),ce=parseInt(V.paddingBottom,10),ue=D.top+D.height/2-Yo,ge=Y-ue,ve=x.offsetHeight/2,fe=x.offsetTop+ve,ee=F+J+fe,K=ae-ee;if(ee<=ue){const ye=x===W[W.length-1].ref.current;a.style.bottom="0px";const Z=u.clientHeight-y.offsetTop-y.offsetHeight,De=Math.max(ge,ve+(ye?ce:0)+Z+q),Ne=ee+De;a.style.height=Ne+"px"}else{const ye=x===W[0].ref.current;a.style.top="0px";const De=Math.max(ue,F+y.offsetTop+(ye?oe:0)+ve)+K;a.style.height=De+"px",y.scrollTop=ee-ue+y.offsetTop}a.style.margin=`${Yo}px 0`,a.style.minHeight=j+"px",a.style.maxHeight=Y+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[p,i.trigger,i.valueNode,a,u,y,x,_,i.dir,r]);Pn(()=>C(),[C]);const[R,E]=m.useState();Pn(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const M=m.useCallback(D=>{D&&b.current===!0&&(C(),w==null||w(),b.current=!1)},[C,w]);return m.createElement(mZ,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:M},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R}},m.createElement(ke.div,te({},o,{ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),XC=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Yo,...i}=e,s=qy(n);return m.createElement(Qu,te({},s,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}}))}),[mZ,Gy]=Ul(kl,{}),QC="SelectViewport",vZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xa(QC,n),i=Gy(QC,n),s=Xe(t,o.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("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}"}}),m.createElement(Ap.Slot,{scope:n},m.createElement(ke.div,te({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:we(r.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&d){const p=Math.abs(a.current-u.scrollTop);if(p>0){const g=window.innerHeight-Yo*2,b=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),x=Math.max(b,y);if(x<g){const _=x+p,w=Math.min(g,_),C=_-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}a.current=u.scrollTop})}))))}),bZ="SelectGroup",[yZ,xZ]=Ul(bZ),wZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Yn();return m.createElement(yZ,{scope:n,id:o},m.createElement(ke.div,te({role:"group","aria-labelledby":o},r,{ref:t})))}),_Z="SelectLabel",SZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xZ(_Z,n);return m.createElement(ke.div,te({id:o.id},r,{ref:t}))}),Lb="SelectItem",[CZ,g2]=Ul(Lb),EZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=ya(Lb,n),l=xa(Lb,n),u=a.value===r,[d,h]=m.useState(i??""),[p,g]=m.useState(!1),b=Xe(t,_=>{var w;return(w=l.itemRefCallback)===null||w===void 0?void 0:w.call(l,_,r,o)}),y=Yn(),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 m.createElement(CZ,{scope:n,value:r,disabled:o,textId:y,isSelected:u,onItemTextChange:m.useCallback(_=>{h(w=>{var C;return w||((C=_==null?void 0:_.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(Ap.ItemSlot,{scope:n,value:r,disabled:o,textValue:d},m.createElement(ke.div,te({role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:b,onFocus:we(s.onFocus,()=>g(!0)),onBlur:we(s.onBlur,()=>g(!1)),onPointerUp:we(s.onPointerUp,x),onPointerMove:we(s.onPointerMove,_=>{if(o){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}else _.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(s.onPointerLeave,_=>{if(_.currentTarget===document.activeElement){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}}),onKeyDown:we(s.onKeyDown,_=>{var w;((w=l.searchRef)===null||w===void 0?void 0:w.current)!==""&&_.key===" "||(tZ.includes(_.key)&&x(),_.key===" "&&_.preventDefault())})}))))}),kf="SelectItemText",RZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=ya(kf,n),a=xa(kf,n),l=g2(kf,n),u=iZ(kf,n),[d,h]=m.useState(null),p=Xe(t,_=>h(_),l.onItemTextChange,_=>{var w;return(w=a.itemTextRefCallback)===null||w===void 0?void 0:w.call(a,_,l.value,l.disabled)}),g=d==null?void 0:d.textContent,b=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=u;return Pn(()=>(y(b),()=>x(b)),[y,x,b]),m.createElement(m.Fragment,null,m.createElement(ke.span,te({id:l.textId},i,{ref:p})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?So.createPortal(i.children,s.valueNode):null)}),$Z="SelectItemIndicator",PZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g2($Z,n).isSelected?m.createElement(ke.span,te({"aria-hidden":!0},r,{ref:t})):null}),ZC="SelectScrollUpButton",OZ=m.forwardRef((e,t)=>{const n=xa(ZC,e.__scopeSelect),r=Gy(ZC,e.__scopeSelect),[o,i]=m.useState(!1),s=Xe(t,r.onScrollButtonChange);return Pn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(m2,te({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),JC="SelectScrollDownButton",DZ=m.forwardRef((e,t)=>{const n=xa(JC,e.__scopeSelect),r=Gy(JC,e.__scopeSelect),[o,i]=m.useState(!1),s=Xe(t,r.onScrollButtonChange);return Pn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<u;i(d)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(m2,te({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),m2=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=xa("SelectScrollButton",n),s=m.useRef(null),a=Ip(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Pn(()=>{var u;const d=a().find(h=>h.ref.current===document.activeElement);d==null||(u=d.ref.current)===null||u===void 0||u.scrollIntoView({block:"nearest"})},[a]),m.createElement(ke.div,te({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:we(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:we(o.onPointerMove,()=>{var u;(u=i.onItemLeave)===null||u===void 0||u.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:we(o.onPointerLeave,()=>{l()})}))}),MZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(ke.div,te({"aria-hidden":!0},r,{ref:t}))});function v2(e){return e===""||e===void 0}const b2=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=Xe(t,o),s=Mp(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const h=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(h)}},[s,n]),m.createElement(TP,{asChild:!0},m.createElement("select",te({},r,{ref:i,defaultValue:n})))});b2.displayName="BubbleSelect";function y2(e){const t=on(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(s=>{const a=n.current+s;t(a),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function x2(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=TZ(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function TZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const AZ=sZ,w2=lZ,IZ=uZ,kZ=dZ,NZ=fZ,_2=hZ,LZ=vZ,FZ=wZ,S2=SZ,C2=EZ,zZ=RZ,jZ=PZ,E2=OZ,R2=DZ,$2=MZ,P2=AZ,VZ=FZ,O2=IZ,Yy=le.forwardRef(({className:e,children:t,...n},r)=>I.jsxs(w2,{ref:r,className:_e("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,I.jsx(kZ,{asChild:!0,children:I.jsx(xp,{className:"h-4 w-4 opacity-50"})})]}));Yy.displayName=w2.displayName;const D2=le.forwardRef(({className:e,...t},n)=>I.jsx(E2,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:I.jsx(JB,{className:"h-4 w-4"})}));D2.displayName=E2.displayName;const M2=le.forwardRef(({className:e,...t},n)=>I.jsx(R2,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:I.jsx(xp,{className:"h-4 w-4"})}));M2.displayName=R2.displayName;const Ky=le.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>I.jsx(NZ,{children:I.jsxs(_2,{ref:o,className:_e("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[I.jsx(D2,{}),I.jsx(LZ,{className:_e("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),I.jsx(M2,{})]})}));Ky.displayName=_2.displayName;const T2=le.forwardRef(({className:e,...t},n)=>I.jsx(S2,{ref:n,className:_e("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));T2.displayName=S2.displayName;const Qc=le.forwardRef(({className:e,children:t,...n},r)=>I.jsxs(C2,{ref:r,className:_e("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(jZ,{children:I.jsx(Zu,{className:"h-4 w-4"})})}),I.jsx(zZ,{children:t})]}));Qc.displayName=C2.displayName;const A2=le.forwardRef(({className:e,...t},n)=>I.jsx($2,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));A2.displayName=$2.displayName;function HZ({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),{updateFilter:i}=Ki();function s(){const l={...e,sql:t};i(l),o(!1)}function a(l){console.log("operation",l);const u={...e,operation:l};i(u)}return I.jsxs(Hy,{open:r,onOpenChange:o,children:[I.jsx(Wy,{children:I.jsx(HP,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),I.jsxs(Dp,{onDoubleClick:l=>l.stopPropagation(),className:"m-2 w-full min-w-[350px] space-y-4",children:[I.jsxs("div",{className:"space-y-2",children:[I.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),I.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),I.jsx(Uy,{}),I.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[I.jsxs("div",{className:"col-span-2 space-y-1",children:[I.jsx(Xo,{children:"Table Column"}),I.jsx(Xo,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),I.jsxs("div",{className:"col-span-2 space-y-1",children:[I.jsx(Xo,{children:"Data Type"}),I.jsx(Xo,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),I.jsxs("div",{className:"col-span-2 space-y-1",children:[I.jsx(Xo,{className:"text-sm",children:"Filter Operation"}),I.jsx(WZ,{updateFilterOperation:a,value:e.operation})]})]}),I.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[I.jsx(Xo,{className:"text-sm",children:"Values SQL"}),I.jsx(By,{value:t,onChange:l=>n(l.target.value),className:`min-w-full grow resize font-mono text-xs ${qN}`})]}),I.jsx("div",{className:"flex justify-end gap-2",children:I.jsxs(ea,{onClick:s,size:"sm",variant:"outline",children:[I.jsx(Zu,{className:"mr-2 size-4"}),"Apply"]})})]})]})}function WZ({value:e,updateFilterOperation:t}){return I.jsxs(P2,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[I.jsx(Yy,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:I.jsx(O2,{placeholder:"Operation"})}),I.jsxs(Ky,{children:[I.jsx(Qc,{value:"=",children:"Equals"}),I.jsx(Qc,{value:"in",children:"Contains"}),I.jsx(Qc,{value:"like",children:"Like"})]})]})}function BZ(){const e=Ce(s=>s.dashboard.filters),t=Ce(s=>s.isDashboardEditing),n=Ce(s=>s.actions.removeFilter),r=Ce(s=>s.actions.updateFilter),o=Ce(s=>s.actions.removeFilterValue);if(!e)return null;const i=s=>Fu.includes(s.dataType)?I.jsx(QQ,{filter:s}):I.jsx(oY,{filter:s});return I.jsx("section",{role:"dashboard-filters",className:"flex w-full grow flex-wrap items-center gap-2 px-[10px] pt-2",children:e.map(s=>I.jsxs("div",{className:"flex flex-col",children:[I.jsx(sa,{className:"my-1",text:s.title||s.column,onSave:a=>r({...s,title:a}),children:I.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[I.jsxs("div",{className:"flex grow items-center gap-2",children:[I.jsx(Xo,{className:"inline-block text-sm",children:s.title}),t&&I.jsx(HZ,{filter:s})]}),I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("div",{onClick:()=>o(s.id),className:"invisible cursor-pointer text-xs text-muted-foreground hover:text-foreground hover:underline group-hover:visible",children:"Clear"}),t&&I.jsx(tU,{onClick:()=>{o(s.id),n(s.id)},className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})]})]})}),i(s)]},s.id))})}function I2(){const e=Ce(o=>{var i;return(i=o.dashboard)==null?void 0:i.sheets});Ce(o=>o.isDashboardEditing);const t=Ce(o=>o.themeStyle);Ce(o=>o.isVisualEditing);const n=Ce(o=>o.selectedSheetId),r=Ce(o=>o.actions.setSelectedSheetId);return e?I.jsxs(mR,{role:"dashboard-tabs-container",className:_e("grow",t==null?void 0:t.dashboardTabsContainer),onValueChange:o=>{r(o)},value:n||e[0].id,children:[I.jsx(BZ,{}),e==null?void 0:e.map(o=>I.jsx(a0,{className:"mt-0",value:o.id,children:I.jsx(Eq,{})},o.id))]}):null}function k2({children:e}){return I.jsx(s9,{defaultTheme:"system",storageKey:"vite-ui-theme",children:I.jsx(YB,{delayDuration:0,children:e})})}function N2(e){return I.jsx(GP,{dashboardProps:e,children:I.jsx(k2,{children:I.jsx(oR,{...e,children:I.jsx(I2,{})})})})}const Fb=["Enter"," "],UZ=["ArrowDown","PageUp","Home"],L2=["ArrowUp","PageDown","End"],qZ=[...UZ,...L2],GZ={ltr:[...Fb,"ArrowRight"],rtl:[...Fb,"ArrowLeft"]},YZ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kp="Menu",[bu,KZ,XZ]=Xh(kp),[wa,F2]=dn(kp,[XZ,$o,zl]),Xy=$o(),z2=zl(),[QZ,_a]=wa(kp),[ZZ,sd]=wa(kp),JZ=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=Xy(t),[l,u]=m.useState(null),d=m.useRef(!1),h=on(i),p=ha(o);return m.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),m.createElement(Ku,a,m.createElement(QZ,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u},m.createElement(ZZ,{scope:t,onClose:m.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:p,modal:s},r)))},j2=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Xy(n);return m.createElement(Xu,te({},o,r,{ref:t}))}),V2="MenuPortal",[eJ,H2]=wa(V2,{forceMount:void 0}),tJ=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=_a(V2,t);return m.createElement(eJ,{scope:t,forceMount:n},m.createElement(Zt,{present:n||i.open},m.createElement(vp,{asChild:!0,container:o},r)))},Zr="MenuContent",[nJ,Qy]=wa(Zr),rJ=m.forwardRef((e,t)=>{const n=H2(Zr,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=_a(Zr,e.__scopeMenu),s=sd(Zr,e.__scopeMenu);return m.createElement(bu.Provider,{scope:e.__scopeMenu},m.createElement(Zt,{present:r||i.open},m.createElement(bu.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(oJ,te({},o,{ref:t})):m.createElement(iJ,te({},o,{ref:t})))))}),oJ=m.forwardRef((e,t)=>{const n=_a(Zr,e.__scopeMenu),r=m.useRef(null),o=Xe(t,r);return m.useEffect(()=>{const i=r.current;if(i)return $p(i)},[]),m.createElement(Zy,te({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:we(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),iJ=m.forwardRef((e,t)=>{const n=_a(Zr,e.__scopeMenu);return m.createElement(Zy,te({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),Zy=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,onDismiss:g,disableOutsideScroll:b,...y}=e,x=_a(Zr,n),_=sd(Zr,n),w=Xy(n),C=z2(n),R=KZ(n),[E,M]=m.useState(null),D=m.useRef(null),A=Xe(t,D,x.onContentChange),k=m.useRef(0),L=m.useRef(""),W=m.useRef(0),Y=m.useRef(null),ne=m.useRef("right"),Q=m.useRef(0),F=b?Op:m.Fragment,J=b?{as:ni,allowPinchZoom:!0}:void 0,q=ae=>{var j,V;const oe=L.current+ae,ce=R().filter(K=>!K.disabled),ue=document.activeElement,ge=(j=ce.find(K=>K.ref.current===ue))===null||j===void 0?void 0:j.textValue,ve=ce.map(K=>K.textValue),fe=CJ(ve,oe,ge),ee=(V=ce.find(K=>K.textValue===fe))===null||V===void 0?void 0:V.ref.current;(function K(ie){L.current=ie,window.clearTimeout(k.current),ie!==""&&(k.current=window.setTimeout(()=>K(""),1e3))})(oe),ee&&setTimeout(()=>ee.focus())};m.useEffect(()=>()=>window.clearTimeout(k.current),[]),Ep();const X=m.useCallback(ae=>{var j,V;return ne.current===((j=Y.current)===null||j===void 0?void 0:j.side)&&RJ(ae,(V=Y.current)===null||V===void 0?void 0:V.area)},[]);return m.createElement(nJ,{scope:n,searchRef:L,onItemEnter:m.useCallback(ae=>{X(ae)&&ae.preventDefault()},[X]),onItemLeave:m.useCallback(ae=>{var j;X(ae)||((j=D.current)===null||j===void 0||j.focus(),M(null))},[X]),onTriggerLeave:m.useCallback(ae=>{X(ae)&&ae.preventDefault()},[X]),pointerGraceTimerRef:W,onPointerGraceIntentChange:m.useCallback(ae=>{Y.current=ae},[])},m.createElement(F,J,m.createElement(Rp,{asChild:!0,trapped:o,onMountAutoFocus:we(i,ae=>{var j;ae.preventDefault(),(j=D.current)===null||j===void 0||j.focus()}),onUnmountAutoFocus:s},m.createElement(jl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,onDismiss:g},m.createElement(o0,te({asChild:!0},C,{dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:M,onEntryFocus:we(l,ae=>{_.isUsingKeyboardRef.current||ae.preventDefault()})}),m.createElement(Qu,te({role:"menu","aria-orientation":"vertical","data-state":G2(x.open),"data-radix-menu-content":"",dir:_.dir},w,y,{ref:A,style:{outline:"none",...y.style},onKeyDown:we(y.onKeyDown,ae=>{const V=ae.target.closest("[data-radix-menu-content]")===ae.currentTarget,oe=ae.ctrlKey||ae.altKey||ae.metaKey,ce=ae.key.length===1;V&&(ae.key==="Tab"&&ae.preventDefault(),!oe&&ce&&q(ae.key));const ue=D.current;if(ae.target!==ue||!qZ.includes(ae.key))return;ae.preventDefault();const ve=R().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);L2.includes(ae.key)&&ve.reverse(),_J(ve)}),onBlur:we(e.onBlur,ae=>{ae.currentTarget.contains(ae.target)||(window.clearTimeout(k.current),L.current="")}),onPointerMove:we(e.onPointerMove,yu(ae=>{const j=ae.target,V=Q.current!==ae.clientX;if(ae.currentTarget.contains(j)&&V){const oe=ae.clientX>Q.current?"right":"left";ne.current=oe,Q.current=ae.clientX}}))})))))))}),sJ=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(ke.div,te({role:"group"},r,{ref:t}))}),aJ=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(ke.div,te({},r,{ref:t}))}),zb="MenuItem",eE="menu.itemSelect",Jy=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=sd(zb,e.__scopeMenu),a=Qy(zb,e.__scopeMenu),l=Xe(t,i),u=m.useRef(!1),d=()=>{const h=i.current;if(!n&&h){const p=new CustomEvent(eE,{bubbles:!0,cancelable:!0});h.addEventListener(eE,g=>r==null?void 0:r(g),{once:!0}),sR(h,p),p.defaultPrevented?u.current=!1:s.onClose()}};return m.createElement(W2,te({},o,{ref:l,disabled:n,onClick:we(e.onClick,d),onPointerDown:h=>{var p;(p=e.onPointerDown)===null||p===void 0||p.call(e,h),u.current=!0},onPointerUp:we(e.onPointerUp,h=>{var p;u.current||(p=h.currentTarget)===null||p===void 0||p.click()}),onKeyDown:we(e.onKeyDown,h=>{const p=a.searchRef.current!=="";n||p&&h.key===" "||Fb.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}))}),W2=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Qy(zb,n),a=z2(n),l=m.useRef(null),u=Xe(t,l),[d,h]=m.useState(!1),[p,g]=m.useState("");return m.useEffect(()=>{const b=l.current;if(b){var y;g(((y=b.textContent)!==null&&y!==void 0?y:"").trim())}},[i.children]),m.createElement(bu.ItemSlot,{scope:n,disabled:r,textValue:o??p},m.createElement(i0,te({asChild:!0},a,{focusable:!r}),m.createElement(ke.div,te({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:u,onPointerMove:we(e.onPointerMove,yu(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:we(e.onPointerLeave,yu(b=>s.onItemLeave(b))),onFocus:we(e.onFocus,()=>h(!0)),onBlur:we(e.onBlur,()=>h(!1))}))))}),lJ=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(U2,{scope:e.__scopeMenu,checked:n},m.createElement(Jy,te({role:"menuitemcheckbox","aria-checked":kh(n)?"mixed":n},o,{ref:t,"data-state":ex(n),onSelect:we(o.onSelect,()=>r==null?void 0:r(kh(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),cJ="MenuRadioGroup",[uJ,dJ]=wa(cJ,{value:void 0,onValueChange:()=>{}}),fJ=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=on(r);return m.createElement(uJ,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(sJ,te({},o,{ref:t})))}),hJ="MenuRadioItem",pJ=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=dJ(hJ,e.__scopeMenu),i=n===o.value;return m.createElement(U2,{scope:e.__scopeMenu,checked:i},m.createElement(Jy,te({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":ex(i),onSelect:we(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),B2="MenuItemIndicator",[U2,gJ]=wa(B2,{checked:!1}),mJ=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=gJ(B2,n);return m.createElement(Zt,{present:r||kh(i.checked)||i.checked===!0},m.createElement(ke.span,te({},o,{ref:t,"data-state":ex(i.checked)})))}),vJ=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(ke.div,te({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),bJ="MenuSub",[doe,q2]=wa(bJ),Nf="MenuSubTrigger",yJ=m.forwardRef((e,t)=>{const n=_a(Nf,e.__scopeMenu),r=sd(Nf,e.__scopeMenu),o=q2(Nf,e.__scopeMenu),i=Qy(Nf,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),m.createElement(j2,te({asChild:!0},u),m.createElement(W2,te({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":G2(n.open)},e,{ref:Kh(t,o.onTriggerChange),onClick:h=>{var p;(p=e.onClick)===null||p===void 0||p.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:we(e.onPointerMove,yu(h=>{i.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:we(e.onPointerLeave,yu(h=>{var p;d();const g=(p=n.content)===null||p===void 0?void 0:p.getBoundingClientRect();if(g){var b;const y=(b=n.content)===null||b===void 0?void 0:b.dataset.side,x=y==="right",_=x?-5:5,w=g[x?"left":"right"],C=g[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+_,y:h.clientY},{x:w,y:g.top},{x:C,y:g.top},{x:C,y:g.bottom},{x:w,y:g.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:we(e.onKeyDown,h=>{const p=i.searchRef.current!=="";if(!(e.disabled||p&&h.key===" ")&&GZ[r.dir].includes(h.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),h.preventDefault()}})})))}),xJ="MenuSubContent",wJ=m.forwardRef((e,t)=>{const n=H2(Zr,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=_a(Zr,e.__scopeMenu),s=sd(Zr,e.__scopeMenu),a=q2(xJ,e.__scopeMenu),l=m.useRef(null),u=Xe(t,l);return m.createElement(bu.Provider,{scope:e.__scopeMenu},m.createElement(Zt,{present:r||i.open},m.createElement(bu.Slot,{scope:e.__scopeMenu},m.createElement(Zy,te({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var h;s.isUsingKeyboardRef.current&&((h=l.current)===null||h===void 0||h.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:we(e.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:we(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:we(e.onKeyDown,d=>{const h=d.currentTarget.contains(d.target),p=YZ[s.dir].includes(d.key);if(h&&p){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),d.preventDefault()}})})))))});function G2(e){return e?"open":"closed"}function kh(e){return e==="indeterminate"}function ex(e){return kh(e)?"indeterminate":e?"checked":"unchecked"}function _J(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function SJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function CJ(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=SJ(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function EJ(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,u=t[s].x,d=t[s].y;l>r!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function RJ(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return EJ(n,t)}function yu(e){return t=>t.pointerType==="mouse"?e(t):void 0}const $J=JZ,PJ=j2,OJ=tJ,DJ=rJ,MJ=aJ,TJ=Jy,AJ=lJ,IJ=fJ,kJ=pJ,NJ=mJ,LJ=vJ,FJ=yJ,zJ=wJ,Y2="DropdownMenu",[jJ,foe]=dn(Y2,[F2]),yr=F2(),[VJ,K2]=jJ(Y2),HJ=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=yr(t),u=m.useRef(null),[d=!1,h]=On({prop:o,defaultProp:i,onChange:s});return m.createElement(VJ,{scope:t,triggerId:Yn(),triggerRef:u,contentId:Yn(),open:d,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),modal:a},m.createElement($J,te({},l,{open:d,onOpenChange:h,dir:r,modal:a}),n))},WJ="DropdownMenuTrigger",BJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=K2(WJ,n),s=yr(n);return m.createElement(PJ,te({asChild:!0},s),m.createElement(ke.button,te({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:Kh(t,i.triggerRef),onPointerDown:we(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:we(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),UJ=e=>{const{__scopeDropdownMenu:t,...n}=e,r=yr(t);return m.createElement(OJ,te({},r,n))},qJ="DropdownMenuContent",GJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=K2(qJ,n),i=yr(n),s=m.useRef(!1);return m.createElement(DJ,te({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:we(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:we(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!o.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),YJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=yr(n);return m.createElement(MJ,te({},o,r,{ref:t}))}),KJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=yr(n);return m.createElement(TJ,te({},o,r,{ref:t}))}),XJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=yr(n);return m.createElement(AJ,te({},o,r,{ref:t}))}),QJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=yr(n);return m.createElement(IJ,te({},o,r,{ref:t}))}),ZJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=yr(n);return m.createElement(kJ,te({},o,r,{ref:t}))}),JJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=yr(n);return m.createElement(NJ,te({},o,r,{ref:t}))}),eee=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=yr(n);return m.createElement(LJ,te({},o,r,{ref:t}))}),tee=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=yr(n);return m.createElement(FJ,te({},o,r,{ref:t}))}),nee=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=yr(n);return m.createElement(zJ,te({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),ree=HJ,oee=BJ,iee=UJ,X2=GJ,Q2=YJ,Z2=KJ,J2=XJ,see=QJ,eD=ZJ,tD=JJ,nD=eee,rD=tee,oD=nee,aee=ree,lee=oee,cee=see,uee=le.forwardRef(({className:e,inset:t,children:n,...r},o)=>I.jsxs(rD,{ref:o,className:_e("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,I.jsx(jP,{className:"ml-auto h-4 w-4"})]}));uee.displayName=rD.displayName;const dee=le.forwardRef(({className:e,...t},n)=>I.jsx(oD,{ref:n,className:_e("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));dee.displayName=oD.displayName;const iD=le.forwardRef(({className:e,sideOffset:t=4,...n},r)=>I.jsx(iee,{children:I.jsx(X2,{ref:r,sideOffset:t,className:_e("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));iD.displayName=X2.displayName;const fee=le.forwardRef(({className:e,inset:t,...n},r)=>I.jsx(Z2,{ref:r,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));fee.displayName=Z2.displayName;const hee=le.forwardRef(({className:e,children:t,checked:n,...r},o)=>I.jsxs(J2,{ref:o,className:_e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(tD,{children:I.jsx(Zu,{className:"h-4 w-4"})})}),t]}));hee.displayName=J2.displayName;const sD=le.forwardRef(({className:e,children:t,...n},r)=>I.jsxs(eD,{ref:r,className:_e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(tD,{children:I.jsx(VP,{className:"h-2 w-2 fill-current"})})}),t]}));sD.displayName=eD.displayName;const aD=le.forwardRef(({className:e,inset:t,...n},r)=>I.jsx(Q2,{ref:r,className:_e("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));aD.displayName=Q2.displayName;const lD=le.forwardRef(({className:e,...t},n)=>I.jsx(nD,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));lD.displayName=nD.displayName;function pee(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,frames:(r=n.frames)==null?void 0:r.map(o=>{var i;return{...o,cards:(i=o.cards)==null?void 0:i.map(s=>cD(s))}})}})}}function cD(e){var t,n,r,o;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(o=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:o.map(i=>({...i,data:[]}))}},customCfg:gee(e.customCfg),data:[]}}function gee(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function uD(e){return`semaphor:bookmark:${e}`}const dD="Dialog",[fD,hoe]=dn(dD),[mee,to]=fD(dD),vee=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[u=!1,d]=On({prop:r,defaultProp:o,onChange:i});return m.createElement(mee,{scope:t,triggerRef:a,contentRef:l,contentId:Yn(),titleId:Yn(),descriptionId:Yn(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(h=>!h),[d]),modal:s},n)},bee="DialogTrigger",yee=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=to(bee,n),i=Xe(t,o.triggerRef);return m.createElement(ke.button,te({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":tx(o.open)},r,{ref:i,onClick:we(e.onClick,o.onOpenToggle)}))}),hD="DialogPortal",[xee,pD]=fD(hD,{forceMount:void 0}),wee=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=to(hD,t);return m.createElement(xee,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(Zt,{present:n||i.open},m.createElement(vp,{asChild:!0,container:o},s))))},jb="DialogOverlay",_ee=m.forwardRef((e,t)=>{const n=pD(jb,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=to(jb,e.__scopeDialog);return i.modal?m.createElement(Zt,{present:r||i.open},m.createElement(See,te({},o,{ref:t}))):null}),See=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=to(jb,n);return m.createElement(Op,{as:ni,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(ke.div,te({"data-state":tx(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),xu="DialogContent",Cee=m.forwardRef((e,t)=>{const n=pD(xu,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=to(xu,e.__scopeDialog);return m.createElement(Zt,{present:r||i.open},i.modal?m.createElement(Eee,te({},o,{ref:t})):m.createElement(Ree,te({},o,{ref:t})))}),Eee=m.forwardRef((e,t)=>{const n=to(xu,e.__scopeDialog),r=m.useRef(null),o=Xe(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return $p(i)},[]),m.createElement(gD,te({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:we(e.onFocusOutside,i=>i.preventDefault())}))}),Ree=m.forwardRef((e,t)=>{const n=to(xu,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(gD,te({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),gD=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=to(xu,n),l=m.useRef(null),u=Xe(t,l);return Ep(),m.createElement(m.Fragment,null,m.createElement(Rp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(jl,te({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":tx(a.open)},s,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),$ee="DialogTitle",Pee=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=to($ee,n);return m.createElement(ke.h2,te({id:o.titleId},r,{ref:t}))}),Oee="DialogDescription",Dee=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=to(Oee,n);return m.createElement(ke.p,te({id:o.descriptionId},r,{ref:t}))}),Mee="DialogClose",Tee=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=to(Mee,n);return m.createElement(ke.button,te({type:"button"},r,{ref:t,onClick:we(e.onClick,()=>o.onOpenChange(!1))}))});function tx(e){return e?"open":"closed"}const Aee=vee,Iee=yee,kee=wee,mD=_ee,vD=Cee,bD=Pee,yD=Dee,Nee=Tee,Lee=Aee,Fee=Iee,zee=kee,xD=le.forwardRef(({className:e,...t},n)=>I.jsx(mD,{ref:n,className:_e("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));xD.displayName=mD.displayName;const wD=le.forwardRef(({className:e,children:t,...n},r)=>I.jsxs(zee,{children:[I.jsx(xD,{}),I.jsxs(vD,{ref:r,className:_e("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,I.jsxs(Nee,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[I.jsx(WP,{className:"h-4 w-4"}),I.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wD.displayName=vD.displayName;const _D=({className:e,...t})=>I.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_D.displayName="DialogHeader";const SD=({className:e,...t})=>I.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});SD.displayName="DialogFooter";const CD=le.forwardRef(({className:e,...t},n)=>I.jsx(bD,{ref:n,className:_e("text-lg font-semibold leading-none tracking-tight",e),...t}));CD.displayName=bD.displayName;const ED=le.forwardRef(({className:e,...t},n)=>I.jsx(yD,{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));ED.displayName=yD.displayName;const RD=le.forwardRef(({className:e,type:t,...n},r)=>I.jsx("input",{type:t,className:_e("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));RD.displayName="Input";const $D="Checkbox",[jee,poe]=dn($D),[Vee,Hee]=jee($D),Wee=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:u,...d}=e,[h,p]=m.useState(null),g=Xe(t,C=>p(C)),b=m.useRef(!1),y=h?!!h.closest("form"):!0,[x=!1,_]=On({prop:o,defaultProp:i,onChange:u}),w=m.useRef(x);return m.useEffect(()=>{const C=h==null?void 0:h.form;if(C){const R=()=>_(w.current);return C.addEventListener("reset",R),()=>C.removeEventListener("reset",R)}},[h,_]),m.createElement(Vee,{scope:n,state:x,disabled:a},m.createElement(ke.button,te({type:"button",role:"checkbox","aria-checked":ta(x)?"mixed":x,"aria-required":s,"data-state":PD(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:g,onKeyDown:we(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:we(e.onClick,C=>{_(R=>ta(R)?!0:!R),y&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})})),y&&m.createElement(qee,{control:h,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Bee="CheckboxIndicator",Uee=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Hee(Bee,n);return m.createElement(Zt,{present:r||ta(i.state)||i.state===!0},m.createElement(ke.span,te({"data-state":PD(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),qee=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Mp(n),a=mp(t);return m.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});l.indeterminate=ta(n),h.call(l,ta(n)?!1:n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",te({type:"checkbox","aria-hidden":!0,defaultChecked:ta(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ta(e){return e==="indeterminate"}function PD(e){return ta(e)?"indeterminate":e?"checked":"unchecked"}const OD=Wee,Gee=Uee,DD=le.forwardRef(({className:e,...t},n)=>I.jsx(OD,{ref:n,className:_e("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:I.jsx(Gee,{className:_e("flex items-center justify-center text-current"),children:I.jsx(Zu,{className:"h-4 w-4"})})}));DD.displayName=OD.displayName;const MD=m.forwardRef(({className:e,...t},n)=>I.jsx("div",{role:"editor-panel",ref:n,className:_e("flex grow h-full",e),...t}));MD.displayName="EditorPanel";const TD=m.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e(" flex flex-col space-y-2 w-[270px]",e),...t}));TD.displayName="EditorAside";const AD=m.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e(" grow",e),...t}));AD.displayName="EditorMain";function Yee(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const ID="ScrollArea",[kD,goe]=dn(ID),[Kee,zr]=kD(ID),ND=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=m.useState(null),[u,d]=m.useState(null),[h,p]=m.useState(null),[g,b]=m.useState(null),[y,x]=m.useState(null),[_,w]=m.useState(0),[C,R]=m.useState(0),[E,M]=m.useState(!1),[D,A]=m.useState(!1),k=Xe(t,W=>l(W)),L=ha(o);return m.createElement(Kee,{scope:n,type:r,dir:L,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:h,onContentChange:p,scrollbarX:g,onScrollbarXChange:b,scrollbarXEnabled:E,onScrollbarXEnabledChange:M,scrollbarY:y,onScrollbarYChange:x,scrollbarYEnabled:D,onScrollbarYEnabledChange:A,onCornerWidthChange:w,onCornerHeightChange:R},m.createElement(ke.div,te({dir:L},s,{ref:k,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})))}),Xee="ScrollAreaViewport",Qee=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=zr(Xee,n),s=m.useRef(null),a=Xe(t,s,i.onViewportChange);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(ke.div,te({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),m.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),ci="ScrollAreaScrollbar",LD=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zr(ci,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return m.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?m.createElement(Zee,te({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(Jee,te({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(FD,te({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(nx,te({},r,{ref:t})):null}),Zee=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zr(ci,e.__scopeScrollArea),[i,s]=m.useState(!1);return m.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),m.createElement(Zt,{present:n||i},m.createElement(FD,te({"data-state":i?"visible":"hidden"},r,{ref:t})))}),Jee=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zr(ci,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Lp(()=>l("SCROLL_END"),100),[a,l]=Yee("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,l]),m.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let h=u[d];const p=()=>{const g=u[d];h!==g&&(l("SCROLL"),s()),h=g};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),m.createElement(Zt,{present:n||a!=="hidden"},m.createElement(nx,te({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:we(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:we(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),FD=m.forwardRef((e,t)=>{const n=zr(ci,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=m.useState(!1),a=e.orientation==="horizontal",l=Lp(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?u:d)}},10);return Nl(n.viewport,l),Nl(n.content,l),m.createElement(Zt,{present:r||i},m.createElement(nx,te({"data-state":i?"visible":"hidden"},o,{ref:t})))}),nx=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=zr(ci,e.__scopeScrollArea),i=m.useRef(null),s=m.useRef(0),[a,l]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=HD(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function h(p,g){return ate(p,s.current,a,g)}return n==="horizontal"?m.createElement(ete,te({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,g=tE(p,a,o.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=h(p,o.dir))}})):n==="vertical"?m.createElement(tte,te({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,g=tE(p,a);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=h(p))}})):null}),ete=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=zr(ci,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),u=Xe(t,l,i.onScrollbarXChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(jD,te({"data-orientation":"horizontal"},o,{ref:u,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Np(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(i.viewport){const p=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),BD(p,h)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Nh(s.paddingLeft),paddingEnd:Nh(s.paddingRight)}})}}))}),tte=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=zr(ci,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),u=Xe(t,l,i.onScrollbarYChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(jD,te({"data-orientation":"vertical"},o,{ref:u,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Np(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(i.viewport){const p=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),BD(p,h)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Nh(s.paddingTop),paddingEnd:Nh(s.paddingBottom)}})}}))}),[nte,zD]=kD(ci),jD=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:h,...p}=e,g=zr(ci,n),[b,y]=m.useState(null),x=Xe(t,k=>y(k)),_=m.useRef(null),w=m.useRef(""),C=g.viewport,R=r.content-r.viewport,E=on(d),M=on(l),D=Lp(h,10);function A(k){if(_.current){const L=k.clientX-_.current.left,W=k.clientY-_.current.top;u({x:L,y:W})}}return m.useEffect(()=>{const k=L=>{const W=L.target;(b==null?void 0:b.contains(W))&&E(L,R)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[C,b,R,E]),m.useEffect(M,[r,M]),Nl(b,D),Nl(g.content,D),m.createElement(nte,{scope:n,scrollbar:b,hasThumb:o,onThumbChange:on(i),onThumbPointerUp:on(s),onThumbPositionChange:M,onThumbPointerDown:on(a)},m.createElement(ke.div,te({},p,{ref:x,style:{position:"absolute",...p.style},onPointerDown:we(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),_.current=b.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),A(k))}),onPointerMove:we(e.onPointerMove,A),onPointerUp:we(e.onPointerUp,k=>{const L=k.target;L.hasPointerCapture(k.pointerId)&&L.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=w.current,g.viewport&&(g.viewport.style.scrollBehavior=""),_.current=null})})))}),Vb="ScrollAreaThumb",rte=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zD(Vb,e.__scopeScrollArea);return m.createElement(Zt,{present:n||o.hasThumb},m.createElement(ote,te({ref:t},r)))}),ote=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=zr(Vb,n),s=zD(Vb,n),{onThumbPositionChange:a}=s,l=Xe(t,h=>s.onThumbChange(h)),u=m.useRef(),d=Lp(()=>{u.current&&(u.current(),u.current=void 0)},100);return m.useEffect(()=>{const h=i.viewport;if(h){const p=()=>{if(d(),!u.current){const g=lte(h,a);u.current=g,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,d,a]),m.createElement(ke.div,te({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:we(e.onPointerDownCapture,h=>{const g=h.target.getBoundingClientRect(),b=h.clientX-g.left,y=h.clientY-g.top;s.onThumbPointerDown({x:b,y})}),onPointerUp:we(e.onPointerUp,s.onThumbPointerUp)}))}),VD="ScrollAreaCorner",ite=m.forwardRef((e,t)=>{const n=zr(VD,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(ste,te({},e,{ref:t})):null}),ste=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=zr(VD,n),[i,s]=m.useState(0),[a,l]=m.useState(0),u=!!(i&&a);return Nl(o.scrollbarX,()=>{var d;const h=((d=o.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;o.onCornerHeightChange(h),l(h)}),Nl(o.scrollbarY,()=>{var d;const h=((d=o.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;o.onCornerWidthChange(h),s(h)}),u?m.createElement(ke.div,te({},r,{ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Nh(e){return e?parseInt(e,10):0}function HD(e,t){const n=e/t;return isNaN(n)?0:n}function Np(e){const t=HD(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ate(e,t,n,r="ltr"){const o=Np(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return WD([l,u],h)(e)}function tE(e,t,n="ltr"){const r=Np(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],u=Nb(e,l);return WD([0,s],[0,a])(u)}function WD(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function BD(e,t){return e>0&&e<t}const lte=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Lp(e,t){const n=on(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Nl(e,t){const n=on(t);Pn(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const UD=ND,cte=Qee,ute=ite,qD=le.forwardRef(({className:e,children:t,...n},r)=>I.jsxs(UD,{ref:r,className:_e("relative overflow-hidden",e),...n,children:[I.jsx(cte,{className:"h-full w-full rounded-[inherit]",children:t}),I.jsx(rx,{}),I.jsx(ute,{})]}));qD.displayName=UD.displayName;const rx=le.forwardRef(({className:e,orientation:t="vertical",...n},r)=>I.jsx(LD,{ref:r,orientation:t,className:_e("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:I.jsx(rte,{className:"relative flex-1 rounded-full bg-border"})}));rx.displayName=LD.displayName;const{createElement:Ll,createContext:dte,createRef:moe,forwardRef:GD,useCallback:rr,useContext:YD,useEffect:na,useImperativeHandle:KD,useLayoutEffect:fte,useMemo:hte,useRef:kr,useState:Lh}=le,nE=le.useId,Fp=dte(null);Fp.displayName="PanelGroupContext";const wu=fte,pte=typeof nE=="function"?nE:()=>null;let gte=0;function ox(e=null){const t=pte(),n=kr(e||t||null);return n.current===null&&(n.current=""+gte++),e??n.current}function XD({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:u,onExpand:d,onResize:h,order:p,style:g,tagName:b="div",...y}){const x=YD(Fp);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:_,expandPanel:w,getPanelSize:C,getPanelStyle:R,groupId:E,isPanelCollapsed:M,registerPanel:D,resizePanel:A,unregisterPanel:k}=x,L=ox(s),W=kr({callbacks:{onCollapse:u,onExpand:d,onResize:h},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:L,idIsFromProps:s!==void 0,order:p});kr({didLogMissingDefaultSizeWarning:!1}),wu(()=>{const{callbacks:ne,constraints:Q}=W.current;W.current.id=L,W.current.idIsFromProps=s!==void 0,W.current.order=p,ne.onCollapse=u,ne.onExpand=d,ne.onResize=h,Q.collapsedSize=n,Q.collapsible=r,Q.defaultSize=o,Q.maxSize=a,Q.minSize=l}),wu(()=>{const ne=W.current;return D(ne),()=>{k(ne)}},[p,L,D,k]),KD(i,()=>({collapse:()=>{_(W.current)},expand:()=>{w(W.current)},getId(){return L},getSize(){return C(W.current)},isCollapsed(){return M(W.current)},isExpanded(){return!M(W.current)},resize:ne=>{A(W.current,ne)}}),[_,w,C,M,L,A]);const Y=R(W.current,o);return Ll(b,{...y,children:e,className:t,style:{...Y,...g},"data-panel":"","data-panel-id":L,"data-panel-group-id":E,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const QD=GD((e,t)=>Ll(XD,{...e,forwardedRef:t}));XD.displayName="Panel";QD.displayName="forwardRef(Panel)";function Je(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const ZD=10;function _u(e,t,n=ZD){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function ar(e,t,n){return _u(e,t,n)===0}function nl({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Je(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(_u(n,a)<0)if(i){const l=(o+a)/2;_u(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(ZD)),n}function Fc({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(ar(e,0))return t;const i=[...t],[s,a]=r;Je(s!=null),Je(a!=null);let l=0;if(o==="keyboard"){{const d=e<0?a:s,h=n[d];if(Je(h),h.collapsible){const p=t[d];Je(p!=null);const g=n[d];Je(g);const{collapsedSize:b=0,minSize:y=0}=g;if(ar(p,b)){const x=y-p;_u(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?s:a,h=n[d];Je(h);const{collapsible:p}=h;if(p){const g=t[d];Je(g!=null);const b=n[d];Je(b);const{collapsedSize:y=0,minSize:x=0}=b;if(ar(g,x)){const _=g-y;_u(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}}{const d=e<0?1:-1;let h=e<0?a:s,p=0;for(;;){const b=t[h];Je(b!=null);const x=nl({panelConstraints:n,panelIndex:h,size:100})-b;if(p+=x,h+=d,h<0||h>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-g:g}{let h=e<0?s:a;for(;h>=0&&h<n.length;){const p=Math.abs(e)-Math.abs(l),g=t[h];Je(g!=null);const b=g-p,y=nl({panelConstraints:n,panelIndex:h,size:b});if(!ar(g,y)&&(l+=g-y,i[h]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?h--:h++}}if(ar(l,0))return t;{const d=e<0?a:s,h=t[d];Je(h!=null);const p=h+l,g=nl({panelConstraints:n,panelIndex:d,size:p});if(i[d]=g,!ar(g,p)){let b=p-g,x=e<0?a:s;for(;x>=0&&x<n.length;){const _=i[x];Je(_!=null);const w=_+b,C=nl({panelConstraints:n,panelIndex:x,size:w});if(ar(_,C)||(b-=C-_,i[x]=C),ar(b,0))break;e>0?x--:x++}}}const u=i.reduce((d,h)=>h+d,0);return ar(u,100)?i:t}function mte({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];Je(a!=null),t.forEach((h,p)=>{const{constraints:g}=h,{maxSize:b=100,minSize:y=0}=g;p===a?(r=y,o=b):(i+=y,s+=b)});const l=Math.min(o,100-i),u=Math.max(r,100-s),d=e[a];return{valueMax:l,valueMin:u,valueNow:d}}function Su(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function JD(e,t){const r=Su(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function eM(e,t){const n=JD(e,t);return n!=null?[n,n+1]:[-1,-1]}function tM(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function zp(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function vte(e,t,n){var r,o,i,s;const a=zp(t),l=Su(e),u=a?l.indexOf(a):-1,d=(r=(o=n[u])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,h=(i=(s=n[u+1])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null;return[d,h]}function bte({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){kr({didWarnAboutMissingResizeHandle:!1}),wu(()=>{const s=Su(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:u,valueNow:d}=mte({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),h=s[a];if(h!=null){const p=o[a];Je(p),h.setAttribute("aria-controls",p.id),h.setAttribute("aria-valuemax",""+Math.round(l)),h.setAttribute("aria-valuemin",""+Math.round(u)),h.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,o]),na(()=>{const s=t.current;Je(s);const{panelDataArray:a}=s,l=tM(n);Je(l!=null,`No group found for id "${n}"`);const u=Su(n);Je(u);const d=u.map(h=>{const p=h.getAttribute("data-panel-resize-handle-id");Je(p);const[g,b]=vte(n,p,a);if(g==null||b==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const _=a.findIndex(w=>w.id===g);if(_>=0){const w=a[_];Je(w);const C=r[_],{collapsedSize:R=0,collapsible:E,minSize:M=0}=w.constraints;if(C!=null&&E){const D=Fc({delta:ar(C,R)?M-R:R-C,layout:r,panelConstraints:a.map(A=>A.constraints),pivotIndices:eM(n,p),trigger:"keyboard"});r!==D&&i(D)}}break}}};return h.addEventListener("keydown",y),()=>{h.removeEventListener("keydown",y)}});return()=>{d.forEach(h=>h())}},[e,t,n,r,o,i])}function rE(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function nM(e){return e.type==="keydown"}function rM(e){return e.type.startsWith("mouse")}function oM(e){return e.type.startsWith("touch")}function iM(e,t){const n=e==="horizontal";if(rM(t))return n?t.clientX:t.clientY;if(oM(t)){const r=t.touches[0];return Je(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function yte(e,t,n,r){const o=n==="horizontal",i=zp(t);Je(i);const s=i.getAttribute("data-panel-group-id");Je(s);let{initialCursorPosition:a}=r;const l=iM(n,e),u=tM(s);Je(u);const d=u.getBoundingClientRect(),h=o?d.width:d.height;return(l-a)/h*100}function xte(e,t,n,r,o){if(nM(e)){const i=n==="horizontal";let s=0;e.shiftKey?s=100:o!=null?s=o:s=10;let a=0;switch(e.key){case"ArrowDown":a=i?0:s;break;case"ArrowLeft":a=i?-s:0;break;case"ArrowRight":a=i?s:0;break;case"ArrowUp":a=i?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:yte(e,t,n,r)}function wte({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const s=n[i];Je(s);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];Je(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,u=o/l;r++,t[i]=u,o-=u}return t}function Xa(e,t,n){t.forEach((r,o)=>{const i=e[o];Je(i);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:u=0,collapsible:d}=a,h=n[l];if(h==null||r!==h){n[l]=r;const{onCollapse:p,onExpand:g,onResize:b}=s;b&&b(r,h),d&&(p||g)&&(g&&(h==null||h===u)&&r!==u&&g(),p&&(h==null||h!==u)&&r===u&&p())}})}function Lf(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function _te({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let Hb=null,Vs=null;function sM(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function Ste(){Vs!==null&&(document.head.removeChild(Vs),Hb=null,Vs=null)}function cv(e){if(Hb===e)return;Hb=e;const t=sM(e);Vs===null&&(Vs=document.createElement("style"),document.head.appendChild(Vs)),Vs.innerHTML=`*{cursor: ${t}!important;}`}function Cte(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function oE(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function aM(e){return`react-resizable-panels:${e}`}function lM(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function cM(e,t){try{const n=aM(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Ete(e,t,n){var r,o;const i=(r=cM(e,n))!==null&&r!==void 0?r:{},s=lM(t);return(o=i[s])!==null&&o!==void 0?o:null}function Rte(e,t,n,r,o){var i;const s=aM(e),a=lM(t),l=(i=cM(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(u){console.error(u)}}function iE({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,s)=>i+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!ar(r,100))for(let i=0;i<t.length;i++){const s=n[i];Je(s!=null);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];Je(s!=null);const a=nl({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!ar(o,0))for(let i=0;i<t.length;i++){const s=n[i];Je(s!=null);const a=s+o,l=nl({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,ar(o,0)))break}return n}const $te=100,zc={getItem:e=>(oE(zc),zc.getItem(e)),setItem:(e,t)=>{oE(zc),zc.setItem(e,t)}},sE={};function uM({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=zc,style:u,tagName:d="div",...h}){const p=ox(i),[g,b]=Lh(null),[y,x]=Lh([]),_=kr({}),w=kr(new Map),C=kr(0),R=kr({autoSaveId:e,direction:r,dragState:g,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),E=kr({layout:y,panelDataArray:[],panelDataArrayChanged:!1});kr({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),KD(o,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:j}=E.current;return j},setLayout:j=>{const{onLayout:V}=R.current,{layout:oe,panelDataArray:ce}=E.current,ue=iE({layout:j,panelConstraints:ce.map(ge=>ge.constraints)});rE(oe,ue)||(x(ue),E.current.layout=ue,V&&V(ue),Xa(ce,ue,_.current))}}),[]),wu(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=g,R.current.id=p,R.current.onLayout=s,R.current.storage=l}),bte({committedValuesRef:R,eagerValuesRef:E,groupId:p,layout:y,panelDataArray:E.current.panelDataArray,setLayout:x}),na(()=>{const{panelDataArray:j}=E.current;if(e){if(y.length===0||y.length!==j.length)return;let V=sE[e];V==null&&(V=Cte(Rte,$te),sE[e]=V);const oe=[...j],ce=new Map(w.current);V(e,oe,ce,y,l)}},[e,y,l]),na(()=>{});const M=rr(j=>{const{onLayout:V}=R.current,{layout:oe,panelDataArray:ce}=E.current;if(j.constraints.collapsible){const ue=ce.map(ee=>ee.constraints),{collapsedSize:ge=0,panelSize:ve,pivotIndices:fe}=Qa(ce,j,oe);if(Je(ve!=null),ve!==ge){w.current.set(j.id,ve);const K=Ja(ce,j)===ce.length-1?ve-ge:ge-ve,ie=Fc({delta:K,layout:oe,panelConstraints:ue,pivotIndices:fe,trigger:"imperative-api"});Lf(oe,ie)||(x(ie),E.current.layout=ie,V&&V(ie),Xa(ce,ie,_.current))}}},[]),D=rr(j=>{const{onLayout:V}=R.current,{layout:oe,panelDataArray:ce}=E.current;if(j.constraints.collapsible){const ue=ce.map(K=>K.constraints),{collapsedSize:ge=0,panelSize:ve,minSize:fe=0,pivotIndices:ee}=Qa(ce,j,oe);if(ve===ge){const K=w.current.get(j.id),ie=K!=null&&K>=fe?K:fe,Z=Ja(ce,j)===ce.length-1?ve-ie:ie-ve,De=Fc({delta:Z,layout:oe,panelConstraints:ue,pivotIndices:ee,trigger:"imperative-api"});Lf(oe,De)||(x(De),E.current.layout=De,V&&V(De),Xa(ce,De,_.current))}}},[]),A=rr(j=>{const{layout:V,panelDataArray:oe}=E.current,{panelSize:ce}=Qa(oe,j,V);return Je(ce!=null),ce},[]),k=rr((j,V)=>{const{panelDataArray:oe}=E.current,ce=Ja(oe,j);return _te({defaultSize:V,dragState:g,layout:y,panelData:oe,panelIndex:ce})},[g,y]),L=rr(j=>{const{layout:V,panelDataArray:oe}=E.current,{collapsedSize:ce=0,collapsible:ue,panelSize:ge}=Qa(oe,j,V);return ue===!0&&ge===ce},[]),W=rr(j=>{const{layout:V,panelDataArray:oe}=E.current,{collapsedSize:ce=0,collapsible:ue,panelSize:ge}=Qa(oe,j,V);return Je(ge!=null),!ue||ge>ce},[]),Y=rr(j=>{const{panelDataArray:V}=E.current;V.push(j),V.sort((oe,ce)=>{const ue=oe.order,ge=ce.order;return ue==null&&ge==null?0:ue==null?-1:ge==null?1:ue-ge}),E.current.panelDataArrayChanged=!0},[]);wu(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:j,onLayout:V,storage:oe}=R.current,{layout:ce,panelDataArray:ue}=E.current;let ge=null;if(j){const fe=Ete(j,ue,oe);fe&&(w.current=new Map(Object.entries(fe.expandToSizes)),ge=fe.layout)}ge==null&&(ge=wte({panelDataArray:ue}));const ve=iE({layout:ge,panelConstraints:ue.map(fe=>fe.constraints)});rE(ce,ve)||(x(ve),E.current.layout=ve,V&&V(ve),Xa(ue,ve,_.current))}});const ne=rr(j=>function(oe){oe.preventDefault();const{direction:ce,dragState:ue,id:ge,keyboardResizeBy:ve,onLayout:fe}=R.current,{layout:ee,panelDataArray:K}=E.current,{initialLayout:ie}=ue??{},ye=eM(ge,j);let Z=xte(oe,j,ce,ue,ve);if(Z===0)return;const De=ce==="horizontal";document.dir==="rtl"&&De&&(Z=-Z);const Ne=K.map(pt=>pt.constraints),Ve=Fc({delta:Z,layout:ie??ee,panelConstraints:Ne,pivotIndices:ye,trigger:nM(oe)?"keyboard":"mouse-or-touch"}),qe=!Lf(ee,Ve);(rM(oe)||oM(oe))&&C.current!=Z&&(C.current=Z,cv(qe?De?"horizontal":"vertical":De?Z<0?"horizontal-min":"horizontal-max":Z<0?"vertical-min":"vertical-max")),qe&&(x(Ve),E.current.layout=Ve,fe&&fe(Ve),Xa(K,Ve,_.current))},[]),Q=rr((j,V)=>{const{onLayout:oe}=R.current,{layout:ce,panelDataArray:ue}=E.current,ge=ue.map(ye=>ye.constraints),{panelSize:ve,pivotIndices:fe}=Qa(ue,j,ce);Je(ve!=null);const K=Ja(ue,j)===ue.length-1?ve-V:V-ve,ie=Fc({delta:K,layout:ce,panelConstraints:ge,pivotIndices:fe,trigger:"imperative-api"});Lf(ce,ie)||(x(ie),E.current.layout=ie,oe&&oe(ie),Xa(ue,ie,_.current))},[]),F=rr((j,V)=>{const{direction:oe}=R.current,{layout:ce}=E.current,ue=zp(j);Je(ue);const ge=iM(oe,V);b({dragHandleId:j,dragHandleRect:ue.getBoundingClientRect(),initialCursorPosition:ge,initialLayout:ce})},[]),J=rr(()=>{Ste(),b(null)},[]),q=rr(j=>{const{panelDataArray:V}=E.current,oe=Ja(V,j);oe>=0&&(V.splice(oe,1),delete _.current[j.id],E.current.panelDataArrayChanged=!0)},[]),X=hte(()=>({collapsePanel:M,direction:r,dragState:g,expandPanel:D,getPanelSize:A,getPanelStyle:k,groupId:p,isPanelCollapsed:L,isPanelExpanded:W,registerPanel:Y,registerResizeHandle:ne,resizePanel:Q,startDragging:F,stopDragging:J,unregisterPanel:q}),[M,g,r,D,A,k,p,L,W,Y,ne,Q,F,J,q]),ae={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Ll(Fp.Provider,{value:X},Ll(d,{...h,children:t,className:n,style:{...ae,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const dM=GD((e,t)=>Ll(uM,{...e,forwardedRef:t}));uM.displayName="PanelGroup";dM.displayName="forwardRef(PanelGroup)";function Ja(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Qa(e,t,n){const r=e.map(u=>u.constraints),o=Ja(e,t),i=r[o],a=o===e.length-1?[o-1,o]:[o,o+1],l=n[o];return{...i,panelSize:l,pivotIndices:a}}function Pte({disabled:e,handleId:t,resizeHandler:n}){na(()=>{if(e||n==null)return;const r=zp(t);if(r==null)return;const o=i=>{if(!i.defaultPrevented)switch(i.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{i.preventDefault(),n(i);break}case"F6":{i.preventDefault();const s=r.getAttribute("data-panel-group-id");Je(s);const a=Su(s),l=JD(s,t);Je(l!==null);const u=i.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[u].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function fM({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const u=kr(null),d=kr({onDragging:o});na(()=>{d.current.onDragging=o});const h=YD(Fp);if(h===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:p,dragState:g,groupId:b,registerResizeHandle:y,startDragging:x,stopDragging:_}=h,w=ox(r),C=(g==null?void 0:g.dragHandleId)===w,[R,E]=Lh(!1),[M,D]=Lh(null),A=rr(()=>{const L=u.current;Je(L),L.blur(),_();const{onDragging:W}=d.current;W&&W(!1)},[_]);na(()=>{if(n)D(null);else{const L=y(w);D(()=>L)}},[n,w,y]),na(()=>{if(n||M==null||!C)return;const L=Q=>{M(Q)},W=Q=>{M(Q)},Y=u.current;Je(Y);const ne=Y.ownerDocument;return ne.body.addEventListener("contextmenu",A),ne.body.addEventListener("mousemove",L),ne.body.addEventListener("touchmove",L),ne.body.addEventListener("mouseleave",W),window.addEventListener("mouseup",A),window.addEventListener("touchend",A),()=>{ne.body.removeEventListener("contextmenu",A),ne.body.removeEventListener("mousemove",L),ne.body.removeEventListener("touchmove",L),ne.body.removeEventListener("mouseleave",W),window.removeEventListener("mouseup",A),window.removeEventListener("touchend",A)}},[p,n,C,M,A]),Pte({disabled:n,handleId:w,resizeHandler:M});const k={cursor:sM(p),touchAction:"none",userSelect:"none"};return Ll(a,{...l,children:e,className:t,onBlur:()=>E(!1),onFocus:()=>E(!0),onMouseDown:L=>{x(w,L.nativeEvent);const W=d.current;Je(W);const{onDragging:Y}=W;Y&&Y(!0)},onMouseUp:A,onTouchCancel:A,onTouchEnd:A,onTouchStart:L=>{x(w,L.nativeEvent);const W=d.current;Je(W);const{onDragging:Y}=W;Y&&Y(!0)},ref:u,role:"separator",style:{...k,...i},tabIndex:s,"data-panel-group-direction":p,"data-panel-group-id":b,"data-resize-handle":"","data-resize-handle-active":C?"pointer":R?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":w})}fM.displayName="PanelResizeHandle";function Ote(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function lE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aE(Object(n),!0).forEach(function(r){Ote(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dte(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Mte(e,t){if(e==null)return{};var n=Dte(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Tte(e,t){return Ate(e)||Ite(e,t)||kte(e,t)||Nte()}function Ate(e){if(Array.isArray(e))return e}function Ite(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function kte(e,t){if(e){if(typeof e=="string")return cE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cE(e,t)}}function cE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
355
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lte(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function dE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uE(Object(n),!0).forEach(function(r){Lte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function jc(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function Fh(e){return{}.toString.call(e).includes("Object")}function zte(e){return!Object.keys(e).length}function Cu(e){return typeof e=="function"}function jte(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Vte(e,t){return Fh(t)||Hi("changeType"),Object.keys(t).some(function(n){return!jte(e,n)})&&Hi("changeField"),t}function Hte(e){Cu(e)||Hi("selectorType")}function Wte(e){Cu(e)||Fh(e)||Hi("handlerType"),Fh(e)&&Object.values(e).some(function(t){return!Cu(t)})&&Hi("handlersType")}function Bte(e){e||Hi("initialIsRequired"),Fh(e)||Hi("initialType"),zte(e)&&Hi("initialContent")}function Ute(e,t){throw new Error(e[t]||e.default)}var qte={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Hi=jc(Ute)(qte),Ff={changes:Vte,selector:Hte,handler:Wte,initial:Bte};function Gte(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ff.initial(e),Ff.handler(t);var n={current:e},r=jc(Xte)(n,t),o=jc(Kte)(n),i=jc(Ff.changes)(e),s=jc(Yte)(n);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return Ff.selector(u),u(n.current)}function l(u){Fte(r,o,i,s)(u)}return[a,l]}function Yte(e,t){return Cu(t)?t(e.current):t}function Kte(e,t){return e.current=dE(dE({},e.current),t),t}function Xte(e,t,n){return Cu(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var Qte={create:Gte},Zte={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function Jte(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function ene(e){return{}.toString.call(e).includes("Object")}function tne(e){return e||fE("configIsRequired"),ene(e)||fE("configType"),e.urls?(nne(),{paths:{vs:e.urls.monacoBase}}):e}function nne(){console.warn(hM.deprecation)}function rne(e,t){throw new Error(e[t]||e.default)}var hM={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
356
|
-
You are using deprecated way of configuration.
|
|
357
|
-
|
|
358
|
-
Instead of using
|
|
359
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
360
|
-
use
|
|
361
|
-
monaco.config({ paths: { vs: '...' } })
|
|
362
|
-
|
|
363
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
364
|
-
`},fE=Jte(rne)(hM),one={config:tne},ine=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,s){return s(i)},o)}};function pM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],pM(e[n],t[n]))}),lE(lE({},e),t)}var sne={type:"cancelation",msg:"operation is manually canceled"};function uv(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(sne):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var ane=Qte.create({config:Zte,isInitialized:!1,resolve:null,reject:null,monaco:null}),gM=Tte(ane,2),ad=gM[0],jp=gM[1];function lne(e){var t=one.config(e),n=t.monaco,r=Mte(t,["monaco"]);jp(function(o){return{config:pM(o.config,r),monaco:n}})}function cne(){var e=ad(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(jp({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),uv(dv);if(window.monaco&&window.monaco.editor)return mM(window.monaco),e.resolve(window.monaco),uv(dv);ine(une,fne)(hne)}return uv(dv)}function une(e){return document.body.appendChild(e)}function dne(e){var t=document.createElement("script");return e&&(t.src=e),t}function fne(e){var t=ad(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=dne("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function hne(){var e=ad(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){mM(n),e.resolve(n)},function(n){e.reject(n)})}function mM(e){ad().monaco||jp({monaco:e})}function pne(){return ad(function(e){var t=e.monaco;return t})}var dv=new Promise(function(e,t){return jp({resolve:e,reject:t})}),vM={config:lne,init:cne,__getMonacoInstance:pne},gne={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},fv=gne,mne={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},vne=mne;function bne({children:e}){return m.createElement("div",{style:vne.container},e)}var yne=bne,xne=yne;function wne({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...fv.wrapper,width:e,height:t},...s},!n&&m.createElement(xne,null,r),m.createElement("div",{ref:o,style:{...fv.fullWidth,...!n&&fv.hide},className:i}))}var _ne=wne,bM=m.memo(_ne);function Sne(e){m.useEffect(e,[])}var yM=Sne;function Cne(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var cr=Cne;function Zc(){}function rl(e,t,n,r){return Ene(e,r)||Rne(e,t,n,r)}function Ene(e,t){return e.editor.getModel(xM(e,t))}function Rne(e,t,n,r){return e.editor.createModel(t,n,r?xM(e,r):void 0)}function xM(e,t){return e.Uri.parse(t)}function $ne({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:u="light",loading:d="Loading...",options:h={},height:p="100%",width:g="100%",className:b,wrapperProps:y={},beforeMount:x=Zc,onMount:_=Zc}){let[w,C]=m.useState(!1),[R,E]=m.useState(!0),M=m.useRef(null),D=m.useRef(null),A=m.useRef(null),k=m.useRef(_),L=m.useRef(x),W=m.useRef(!1);yM(()=>{let F=vM.init();return F.then(J=>(D.current=J)&&E(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>M.current?Q():F.cancel()}),cr(()=>{if(M.current&&D.current){let F=M.current.getOriginalEditor(),J=rl(D.current,e||"",r||n||"text",i||"");J!==F.getModel()&&F.setModel(J)}},[i],w),cr(()=>{if(M.current&&D.current){let F=M.current.getModifiedEditor(),J=rl(D.current,t||"",o||n||"text",s||"");J!==F.getModel()&&F.setModel(J)}},[s],w),cr(()=>{let F=M.current.getModifiedEditor();F.getOption(D.current.editor.EditorOption.readOnly)?F.setValue(t||""):t!==F.getValue()&&(F.executeEdits("",[{range:F.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),F.pushUndoStop())},[t],w),cr(()=>{var F,J;(J=(F=M.current)==null?void 0:F.getModel())==null||J.original.setValue(e||"")},[e],w),cr(()=>{let{original:F,modified:J}=M.current.getModel();D.current.editor.setModelLanguage(F,r||n||"text"),D.current.editor.setModelLanguage(J,o||n||"text")},[n,r,o],w),cr(()=>{var F;(F=D.current)==null||F.editor.setTheme(u)},[u],w),cr(()=>{var F;(F=M.current)==null||F.updateOptions(h)},[h],w);let Y=m.useCallback(()=>{var q;if(!D.current)return;L.current(D.current);let F=rl(D.current,e||"",r||n||"text",i||""),J=rl(D.current,t||"",o||n||"text",s||"");(q=M.current)==null||q.setModel({original:F,modified:J})},[n,t,o,e,r,i,s]),ne=m.useCallback(()=>{var F;!W.current&&A.current&&(M.current=D.current.editor.createDiffEditor(A.current,{automaticLayout:!0,...h}),Y(),(F=D.current)==null||F.editor.setTheme(u),C(!0),W.current=!0)},[h,u,Y]);m.useEffect(()=>{w&&k.current(M.current,D.current)},[w]),m.useEffect(()=>{!R&&!w&&ne()},[R,w,ne]);function Q(){var J,q,X,ae;let F=(J=M.current)==null?void 0:J.getModel();a||((q=F==null?void 0:F.original)==null||q.dispose()),l||((X=F==null?void 0:F.modified)==null||X.dispose()),(ae=M.current)==null||ae.dispose()}return m.createElement(bM,{width:g,height:p,isEditorReady:w,loading:d,_ref:A,className:b,wrapperProps:y})}var Pne=$ne;m.memo(Pne);function One(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var Dne=One,zf=new Map;function Mne({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:u={},overrideServices:d={},saveViewState:h=!0,keepCurrentModel:p=!1,width:g="100%",height:b="100%",className:y,wrapperProps:x={},beforeMount:_=Zc,onMount:w=Zc,onChange:C,onValidate:R=Zc}){let[E,M]=m.useState(!1),[D,A]=m.useState(!0),k=m.useRef(null),L=m.useRef(null),W=m.useRef(null),Y=m.useRef(w),ne=m.useRef(_),Q=m.useRef(),F=m.useRef(r),J=Dne(i),q=m.useRef(!1),X=m.useRef(!1);yM(()=>{let V=vM.init();return V.then(oe=>(k.current=oe)&&A(!1)).catch(oe=>(oe==null?void 0:oe.type)!=="cancelation"&&console.error("Monaco initialization: error:",oe)),()=>L.current?j():V.cancel()}),cr(()=>{var oe,ce,ue,ge;let V=rl(k.current,e||r||"",t||o||"",i||n||"");V!==((oe=L.current)==null?void 0:oe.getModel())&&(h&&zf.set(J,(ce=L.current)==null?void 0:ce.saveViewState()),(ue=L.current)==null||ue.setModel(V),h&&((ge=L.current)==null||ge.restoreViewState(zf.get(i))))},[i],E),cr(()=>{var V;(V=L.current)==null||V.updateOptions(u)},[u],E),cr(()=>{!L.current||r===void 0||(L.current.getOption(k.current.editor.EditorOption.readOnly)?L.current.setValue(r):r!==L.current.getValue()&&(X.current=!0,L.current.executeEdits("",[{range:L.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),L.current.pushUndoStop(),X.current=!1))},[r],E),cr(()=>{var oe,ce;let V=(oe=L.current)==null?void 0:oe.getModel();V&&o&&((ce=k.current)==null||ce.editor.setModelLanguage(V,o))},[o],E),cr(()=>{var V;a!==void 0&&((V=L.current)==null||V.revealLine(a))},[a],E),cr(()=>{var V;(V=k.current)==null||V.editor.setTheme(s)},[s],E);let ae=m.useCallback(()=>{var V;if(!(!W.current||!k.current)&&!q.current){ne.current(k.current);let oe=i||n,ce=rl(k.current,r||e||"",t||o||"",oe||"");L.current=(V=k.current)==null?void 0:V.editor.create(W.current,{model:ce,automaticLayout:!0,...u},d),h&&L.current.restoreViewState(zf.get(oe)),k.current.editor.setTheme(s),a!==void 0&&L.current.revealLine(a),M(!0),q.current=!0}},[e,t,n,r,o,i,u,d,h,s,a]);m.useEffect(()=>{E&&Y.current(L.current,k.current)},[E]),m.useEffect(()=>{!D&&!E&&ae()},[D,E,ae]),F.current=r,m.useEffect(()=>{var V,oe;E&&C&&((V=Q.current)==null||V.dispose(),Q.current=(oe=L.current)==null?void 0:oe.onDidChangeModelContent(ce=>{X.current||C(L.current.getValue(),ce)}))},[E,C]),m.useEffect(()=>{if(E){let V=k.current.editor.onDidChangeMarkers(oe=>{var ue;let ce=(ue=L.current.getModel())==null?void 0:ue.uri;if(ce&&oe.find(ge=>ge.path===ce.path)){let ge=k.current.editor.getModelMarkers({resource:ce});R==null||R(ge)}});return()=>{V==null||V.dispose()}}return()=>{}},[E,R]);function j(){var V,oe;(V=Q.current)==null||V.dispose(),p?h&&zf.set(i,L.current.saveViewState()):(oe=L.current.getModel())==null||oe.dispose(),L.current.dispose()}return m.createElement(bM,{width:g,height:b,isEditorReady:E,loading:l,_ref:W,className:y,wrapperProps:x})}var Tne=Mne,wM=m.memo(Tne),Ane=wM;const Ine=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=On({prop:n,onChange:o,defaultProp:r});return m.createElement(ke.button,te({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:we(e.onClick,()=>{e.disabled||a(!s)})}))}),_M=Ine,kne=Py("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),SM=le.forwardRef(({className:e,variant:t,size:n,...r},o)=>I.jsx(_M,{ref:o,className:_e(kne({variant:t,size:n,className:e})),...r}));SM.displayName=_M.displayName;const CM="Switch",[Nne,voe]=dn(CM),[Lne,Fne]=Nne(CM),zne=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:u,...d}=e,[h,p]=m.useState(null),g=Xe(t,w=>p(w)),b=m.useRef(!1),y=h?!!h.closest("form"):!0,[x=!1,_]=On({prop:o,defaultProp:i,onChange:u});return m.createElement(Lne,{scope:n,checked:x,disabled:a},m.createElement(ke.button,te({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":EM(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:g,onClick:we(e.onClick,w=>{_(C=>!C),y&&(b.current=w.isPropagationStopped(),b.current||w.stopPropagation())})})),y&&m.createElement(Hne,{control:h,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),jne="SwitchThumb",Vne=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Fne(jne,n);return m.createElement(ke.span,te({"data-state":EM(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),Hne=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Mp(n),a=mp(t);return m.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});h.call(l,n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",te({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function EM(e){return e?"checked":"unchecked"}const Vp=zne,RM=Vne,$M=le.forwardRef(({className:e,...t},n)=>I.jsx(Vp,{className:_e("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:I.jsx(RM,{className:_e("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));$M.displayName=Vp.displayName;const Wne=le.forwardRef(({className:e,...t},n)=>I.jsx(Vp,{className:_e("peer inline-flex h-4 w-8 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:I.jsx(RM,{className:_e("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Wne.displayName=Vp.displayName;const PM="Collapsible",[Bne,OM]=dn(PM),[Une,ix]=Bne(PM),qne=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,u]=On({prop:r,defaultProp:o,onChange:s});return m.createElement(Une,{scope:n,disabled:i,contentId:Yn(),open:l,onOpenToggle:m.useCallback(()=>u(d=>!d),[u])},m.createElement(ke.div,te({"data-state":sx(l),"data-disabled":i?"":void 0},a,{ref:t})))}),Gne="CollapsibleTrigger",Yne=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=ix(Gne,n);return m.createElement(ke.button,te({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":sx(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:we(e.onClick,o.onOpenToggle)}))}),DM="CollapsibleContent",Kne=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ix(DM,e.__scopeCollapsible);return m.createElement(Zt,{present:n||o.open},({present:i})=>m.createElement(Xne,te({},r,{ref:t,present:i})))}),Xne=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=ix(DM,n),[a,l]=m.useState(r),u=m.useRef(null),d=Xe(t,u),h=m.useRef(0),p=h.current,g=m.useRef(0),b=g.current,y=s.open||a,x=m.useRef(y),_=m.useRef();return m.useEffect(()=>{const w=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(w)},[]),Pn(()=>{const w=u.current;if(w){_.current=_.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const C=w.getBoundingClientRect();h.current=C.height,g.current=C.width,x.current||(w.style.transitionDuration=_.current.transitionDuration,w.style.animationName=_.current.animationName),l(r)}},[s.open,r]),m.createElement(ke.div,te({"data-state":sx(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!y},i,{ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style}}),y&&o)});function sx(e){return e?"open":"closed"}const Qne=qne,Zne=Yne,Jne=Kne,Zi="Accordion",ere=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ax,tre,nre]=Xh(Zi),[Hp,boe]=dn(Zi,[nre,OM]),lx=OM(),MM=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(ax.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(sre,te({},i,{ref:t})):m.createElement(ire,te({},o,{ref:t})))});MM.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[TM,rre]=Hp(Zi),[AM,ore]=Hp(Zi,{collapsible:!1}),ire=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=On({prop:n,defaultProp:r,onChange:o});return m.createElement(TM,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(AM,{scope:e.__scopeAccordion,collapsible:i},m.createElement(IM,te({},s,{ref:t}))))}),sre=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=On({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(d=>a((h=[])=>[...h,d]),[a]),u=m.useCallback(d=>a((h=[])=>h.filter(p=>p!==d)),[a]);return m.createElement(TM,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:u},m.createElement(AM,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(IM,te({},i,{ref:t}))))}),[are,Wp]=Hp(Zi),IM=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=m.useRef(null),l=Xe(a,t),u=tre(n),h=ha(o)==="ltr",p=we(e.onKeyDown,g=>{var b;if(!ere.includes(g.key))return;const y=g.target,x=u().filter(k=>{var L;return!((L=k.ref.current)!==null&&L!==void 0&&L.disabled)}),_=x.findIndex(k=>k.ref.current===y),w=x.length;if(_===-1)return;g.preventDefault();let C=_;const R=0,E=w-1,M=()=>{C=_+1,C>E&&(C=R)},D=()=>{C=_-1,C<R&&(C=E)};switch(g.key){case"Home":C=R;break;case"End":C=E;break;case"ArrowRight":i==="horizontal"&&(h?M():D());break;case"ArrowDown":i==="vertical"&&M();break;case"ArrowLeft":i==="horizontal"&&(h?D():M());break;case"ArrowUp":i==="vertical"&&D();break}const A=C%w;(b=x[A].ref.current)===null||b===void 0||b.focus()});return m.createElement(are,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(ax.Slot,{scope:n},m.createElement(ke.div,te({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:p}))))}),Wb="AccordionItem",[lre,cx]=Hp(Wb),cre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Wp(Wb,n),s=rre(Wb,n),a=lx(n),l=Yn(),u=r&&s.value.includes(r)||!1,d=i.disabled||e.disabled;return m.createElement(lre,{scope:n,open:u,disabled:d,triggerId:l},m.createElement(Qne,te({"data-orientation":i.orientation,"data-state":kM(u)},a,o,{ref:t,disabled:d,open:u,onOpenChange:h=>{h?s.onItemOpen(r):s.onItemClose(r)}})))}),ure="AccordionHeader",dre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Wp(Zi,n),i=cx(ure,n);return m.createElement(ke.h3,te({"data-orientation":o.orientation,"data-state":kM(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),hE="AccordionTrigger",fre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Wp(Zi,n),i=cx(hE,n),s=ore(hE,n),a=lx(n);return m.createElement(ax.ItemSlot,{scope:n},m.createElement(Zne,te({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),hre="AccordionContent",pre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Wp(Zi,n),i=cx(hre,n),s=lx(n);return m.createElement(Jne,te({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function kM(e){return e?"open":"closed"}const gre=MM,mre=cre,vre=dre,NM=fre,LM=pre,bre=gre,FM=le.forwardRef(({className:e,...t},n)=>I.jsx(mre,{ref:n,className:_e("border-b",e),...t}));FM.displayName="AccordionItem";const zM=le.forwardRef(({className:e,children:t,...n},r)=>I.jsx(vre,{className:"flex",children:I.jsxs(NM,{ref:r,className:_e("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,I.jsx(xp,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));zM.displayName=NM.displayName;const jM=le.forwardRef(({className:e,children:t,...n},r)=>I.jsx(LM,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:I.jsx("div",{className:_e("pb-4 pt-0",e),children:t})}));jM.displayName=LM.displayName;const VM="Radio",[yre,HM]=dn(VM),[xre,wre]=yre(VM),_re=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...u}=e,[d,h]=m.useState(null),p=Xe(t,y=>h(y)),g=m.useRef(!1),b=d?!!d.closest("form"):!0;return m.createElement(xre,{scope:n,checked:o,disabled:s},m.createElement(ke.button,te({type:"button",role:"radio","aria-checked":o,"data-state":WM(o),"data-disabled":s?"":void 0,disabled:s,value:a},u,{ref:p,onClick:we(e.onClick,y=>{o||l==null||l(),b&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})})),b&&m.createElement(Ere,{control:d,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),Sre="RadioIndicator",Cre=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=wre(Sre,n);return m.createElement(Zt,{present:r||i.checked},m.createElement(ke.span,te({"data-state":WM(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),Ere=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Mp(n),a=mp(t);return m.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});h.call(l,n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",te({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function WM(e){return e?"checked":"unchecked"}const Rre=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],BM="RadioGroup",[$re,yoe]=dn(BM,[zl,HM]),UM=zl(),qM=HM(),[Pre,Ore]=$re(BM),Dre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:u,loop:d=!0,onValueChange:h,...p}=e,g=UM(n),b=ha(u),[y,x]=On({prop:i,defaultProp:o,onChange:h});return m.createElement(Pre,{scope:n,name:r,required:s,disabled:a,value:y,onValueChange:x},m.createElement(o0,te({asChild:!0},g,{orientation:l,dir:b,loop:d}),m.createElement(ke.div,te({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:b},p,{ref:t}))))}),Mre="RadioGroupItem",Tre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=Ore(Mre,n),s=i.disabled||r,a=UM(n),l=qM(n),u=m.useRef(null),d=Xe(t,u),h=i.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const g=y=>{Rre.includes(y.key)&&(p.current=!0)},b=()=>p.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",b)}},[]),m.createElement(i0,te({asChild:!0},a,{focusable:!s,active:h}),m.createElement(_re,te({disabled:s,required:i.required,checked:h},l,o,{name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:we(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:we(o.onFocus,()=>{var g;p.current&&((g=u.current)===null||g===void 0||g.click())})})))}),Are=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=qM(n);return m.createElement(Cre,te({},o,r,{ref:t}))}),GM=Dre,YM=Tre,Ire=Are,KM=le.forwardRef(({className:e,...t},n)=>I.jsx(GM,{className:_e("grid gap-2",e),...t,ref:n}));KM.displayName=GM.displayName;const XM=le.forwardRef(({className:e,...t},n)=>I.jsx(YM,{ref:n,className:_e("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:I.jsx(Ire,{className:"flex items-center justify-center",children:I.jsx(VP,{className:"h-2.5 w-2.5 fill-current text-current"})})}));XM.displayName=YM.displayName;var kre=Object.defineProperty,Nre=(e,t,n)=>t in e?kre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jf=(e,t,n)=>(Nre(e,typeof t!="symbol"?t+"":t,n),n);const Lre={stringify:e=>e,parse:e=>e},Fre={stringify:e=>`${e}`,parse:e=>parseFloat(e)},zre={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},jre={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},Vre={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},hv={string:Lre,number:Fre,boolean:zre,function:jre,json:Vre},pv=Symbol.for("r2wc.render"),Vf=Symbol.for("r2wc.connected"),Ds=Symbol.for("r2wc.context"),Ei=Symbol.for("r2wc.props");function Hre(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(h=>h!=="container"),a={},l={},u={};for(const h of s){a[h]=Array.isArray(t.props)?"string":t.props[h];const p=Wre(h);l[h]=p,u[p]=h}class d extends HTMLElement{constructor(){super(),jf(this,r,!0),jf(this,o),jf(this,i,{}),jf(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Ei].container=this.container;for(const p of s){const g=l[p],b=this.getAttribute(g),y=a[p],x=hv[y];b&&x!=null&&x.parse&&(this[Ei][p]=x.parse(b,this))}}static get observedAttributes(){return Object.keys(u)}connectedCallback(){this[Vf]=!0,this[pv]()}disconnectedCallback(){this[Vf]=!1,this[Ds]&&n.unmount(this[Ds]),delete this[Ds]}attributeChangedCallback(p,g,b){const y=u[p],x=a[y],_=hv[x];y in a&&_!=null&&_.parse&&(this[Ei][y]=_.parse(b,this),this[pv]())}[(r=Vf,o=Ds,i=Ei,pv)](){this[Vf]&&(this[Ds]?n.update(this[Ds],this[Ei]):this[Ds]=n.mount(this.container,e,this[Ei]))}}for(const h of s){const p=l[h],g=a[h];Object.defineProperty(d.prototype,h,{enumerable:!0,configurable:!0,get(){return this[Ei][h]},set(b){this[Ei][h]=b;const y=hv[g];if(y!=null&&y.stringify){const x=y.stringify(b);this.getAttribute(p)!==x&&this.setAttribute(p,x)}}})}return d}function Wre(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Bre(e,t,n){const r=Ev(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function Ure({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function qre({root:e}){e.unmount()}function Gre(e,t={}){return Hre(e,t,{mount:Bre,update:Ure,unmount:qre})}const Yre={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"},Kre=Gre(N2,{props:Yre});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=ND;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=AP;exports.Accordion=bre;exports.AccordionContent=jM;exports.AccordionItem=FM;exports.AccordionTrigger=zM;exports.BOOLEAN_DATA_TYPES=Kb;exports.Button=ea;exports.Calendar=zP;exports.Card=e0;exports.CardContent=Yh;exports.CardDescription=t0;exports.CardFooter=n0;exports.CardHeader=Gh;exports.CardTitle=Vu;exports.ChartJsVisual=fP;exports.Check=Zu;exports.CheckIcon=hP;exports.Checkbox=DD;exports.ChevronDown=xp;exports.ClipboardCopyIcon=oW;exports.Cross2Icon=pP;exports.DATE_DATA_TYPES=Fu;exports.Dashboard=N2;exports.DashboardPanel=oR;exports.DashboardTabs=I2;exports.DashboardWC=Kre;exports.Dialog=Lee;exports.DialogContent=wD;exports.DialogDescription=ED;exports.DialogFooter=SD;exports.DialogHeader=_D;exports.DialogTitle=CD;exports.DialogTrigger=Fee;exports.DropdownMenu=aee;exports.DropdownMenuContent=iD;exports.DropdownMenuLabel=aD;exports.DropdownMenuRadioGroup=cee;exports.DropdownMenuRadioItem=sD;exports.DropdownMenuSeparator=lD;exports.DropdownMenuTrigger=lee;exports.Editable=sa;exports.EditorAside=TD;exports.EditorMain=AD;exports.EditorPanel=MD;exports.Ft=Ane;exports.HoverCard=ZP;exports.HoverCardContent=fy;exports.HoverCardTrigger=JP;exports.InfoCircledIcon=dW;exports.Input=RD;exports.KPICard=BP;exports.Label=Xo;exports.LoaderCircle=ly;exports.NUMBER_DATA_TYPES=Cl;exports.PYTHON_DEFAULT_CODE=BE;exports.Panel=QD;exports.PanelGroup=dM;exports.PanelResizeHandle=fM;exports.PaperPlaneIcon=hW;exports.PlayIcon=gW;exports.Popover=Hy;exports.PopoverContent=Dp;exports.PopoverTrigger=Wy;exports.RadioGroup=KM;exports.RadioGroupItem=XM;exports.ScrollArea=qD;exports.ScrollBar=rx;exports.Select=P2;exports.SelectContent=Ky;exports.SelectGroup=VZ;exports.SelectItem=Qc;exports.SelectLabel=T2;exports.SelectSeparator=A2;exports.SelectTrigger=Yy;exports.SelectValue=O2;exports.SemaphorContextProvider=GP;exports.SemaphorQueryClient=UP;exports.Separator=Uy;exports.Settings=HP;exports.SliderIcon=vW;exports.Switch=$M;exports.TEXT_DATA_TYPES=Uh;exports.Table=hy;exports.TableBody=gy;exports.TableCell=$h;exports.TableHead=my;exports.TableHeader=py;exports.TableRow=Xc;exports.TableVisual=hO;exports.Tabs=mR;exports.TabsContent=a0;exports.TabsList=vR;exports.TabsTrigger=bR;exports.Textarea=By;exports.Toggle=SM;exports.Tooltip=NP;exports.TooltipContent=ay;exports.TooltipTrigger=LP;exports.TriangleDownIcon=K0;exports.TriangleUpIcon=X0;exports.UXProvider=k2;exports.X=WP;exports._=ia;exports.cleanCard=cD;exports.cn=_e;exports.commonjsGlobal=ks;exports.copyToClipboard=WN;exports.createChartConfig=YP;exports.createLucideIcon=br;exports.createSqlGenConfig=x6;exports.de=wM;exports.flexRender=$b;exports.fmt=Xb;exports.getBookmarkKey=uD;exports.getCanvasBackgroundColor=oh;exports.getColumnDataType=w6;exports.getContrastColor=ih;exports.getCoreRowModel=cO;exports.getDashbaordStateWithoutData=pee;exports.getDefaultExportFromCjs=Lu;exports.getDefaultFilterSql=rY;exports.getFilterValueType=sh;exports.getKeys=Nr;exports.getPaginationRowModel=dO;exports.getQualifiedTableName=UE;exports.getRequest=HN;exports.getSortedRowModel=uO;exports.getSql=y6;exports.isColumnInSqlGen=_6;exports.jsxRuntimeExports=I;exports.pivotData=Q0;exports.postRequest=jh;exports.resolveBaseQuery=DE;exports.resolveDataType=nu;exports.titleCase=UN;exports.useCard=SU;exports.useDashboardActions=Ki;exports.useDashboardCard=cy;exports.useDashboardStore=Ce;exports.useEditorActions=gP;exports.useEditorStore=Ar;exports.useQuery=ju;exports.useReactTable=fO;exports.useSemaphorContext=Wl;exports.useTheme=nR;exports.v4=fu;
|