semaphor 0.0.61 → 0.0.62
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-X3nH3ozc.js +215 -0
- package/dist/chunks/{dashboard-plus-clQZKAkW.js → dashboard-plus-gPTPW6Cj.js} +1846 -1850
- package/dist/chunks/{index-IpD-EtCy.js → index-Qjr2ilmn.js} +10481 -10345
- package/dist/chunks/index-rGnXyCK9.js +448 -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 +4 -4
- 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 +1 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/surfboard.d.ts +1 -0
- package/dist/types/types.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-i2f2gNsr.js +0 -215
- package/dist/chunks/index-09gssWkM.js +0 -448
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
"use strict";var Wz=Object.defineProperty;var Uz=(e,t,n)=>t in e?Wz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>(Uz(e,typeof t!="symbol"?t+"":t,n),n),Xb=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ae=(e,t,n)=>(Xb(e,t,"read from private field"),n?n.call(e):t.get(e)),Xe=(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)},Ve=(e,t,n,r)=>(Xb(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var lp=(e,t,n,r)=>({set _(o){Ve(e,t,o,n)},get _(){return ae(e,t,r)}}),Ct=(e,t,n)=>(Xb(e,t,"access private method"),n);const m=require("react"),Cr=require("react-dom");function YT(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 L=YT(m),ew=YT(Cr);var Ws=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tw(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 qy={exports:{}},Hu={};/**
|
|
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 TR;function qz(){return TR||(TR=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"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),b=Symbol.iterator,v="@@iterator";function w(D){if(D===null||typeof D!="object")return null;var re=b&&D[b]||D[v];return typeof re=="function"?re:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(D){{for(var re=arguments.length,he=new Array(re>1?re-1:0),Pe=1;Pe<re;Pe++)he[Pe-1]=arguments[Pe];S("error",D,he)}}function S(D,re,he){{var Pe=y.ReactDebugCurrentFrame,He=Pe.getStackAddendum();He!==""&&(re+="%s",he=he.concat([He]));var qe=he.map(function(ze){return String(ze)});qe.unshift("Warning: "+re),Function.prototype.apply.call(console[D],console,qe)}}var C=!1,E=!1,O=!1,T=!1,N=!1,M;M=Symbol.for("react.module.reference");function A(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===i||N||D===o||D===c||D===u||T||D===h||C||E||O||typeof D=="object"&&D!==null&&(D.$$typeof===p||D.$$typeof===f||D.$$typeof===s||D.$$typeof===a||D.$$typeof===l||D.$$typeof===M||D.getModuleId!==void 0))}function F(D,re,he){var Pe=D.displayName;if(Pe)return Pe;var He=re.displayName||re.name||"";return He!==""?he+"("+He+")":he}function z(D){return D.displayName||"Context"}function X(D){if(D==null)return null;if(typeof D.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case a:var re=D;return z(re)+".Consumer";case s:var he=D;return z(he._context)+".Provider";case l:return F(D,D.render,"ForwardRef");case f:var Pe=D.displayName||null;return Pe!==null?Pe:X(D.type)||"Memo";case p:{var He=D,qe=He._payload,ze=He._init;try{return X(ze(qe))}catch{return null}}}return null}var ee=Object.assign,H=0,Q,Y,J,W,$,V,U;function I(){}I.__reactDisabledLog=!0;function te(){{if(H===0){Q=console.log,Y=console.info,J=console.warn,W=console.error,$=console.group,V=console.groupCollapsed,U=console.groupEnd;var D={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}H++}}function fe(){{if(H--,H===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},D,{value:Q}),info:ee({},D,{value:Y}),warn:ee({},D,{value:J}),error:ee({},D,{value:W}),group:ee({},D,{value:$}),groupCollapsed:ee({},D,{value:V}),groupEnd:ee({},D,{value:U})})}H<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=y.ReactCurrentDispatcher,ue;function ie(D,re,he){{if(ue===void 0)try{throw Error()}catch(He){var Pe=He.stack.trim().match(/\n( *(at )?)/);ue=Pe&&Pe[1]||""}return`
|
|
10
|
-
`+ue+D}}var oe=!1,le;{var ye=typeof WeakMap=="function"?WeakMap:Map;le=new ye}function K(D,re){if(!D||oe)return"";{var he=le.get(D);if(he!==void 0)return he}var Pe;oe=!0;var He=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qe;qe=ne.current,ne.current=null,te();try{if(re){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(ft){Pe=ft}Reflect.construct(D,[],ze)}else{try{ze.call()}catch(ft){Pe=ft}D.call(ze.prototype)}}else{try{throw Error()}catch(ft){Pe=ft}D()}}catch(ft){if(ft&&Pe&&typeof ft.stack=="string"){for(var Fe=ft.stack.split(`
|
|
11
|
-
`),Ae=Pe.stack.split(`
|
|
12
|
-
`),G=Fe.length-1,me=Ae.length-1;G>=1&&me>=0&&Fe[G]!==Ae[me];)me--;for(;G>=1&&me>=0;G--,me--)if(Fe[G]!==Ae[me]){if(G!==1||me!==1)do if(G--,me--,me<0||Fe[G]!==Ae[me]){var ke=`
|
|
13
|
-
`+Fe[G].replace(" at new "," at ");return D.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",D.displayName)),typeof D=="function"&&le.set(D,ke),ke}while(G>=1&&me>=0);break}}}finally{oe=!1,ne.current=qe,fe(),Error.prepareStackTrace=He}var st=D?D.displayName||D.name:"",bn=st?ie(st):"";return typeof D=="function"&&le.set(D,bn),bn}function be(D,re,he){return K(D,!1)}function Se(D){var re=D.prototype;return!!(re&&re.isReactComponent)}function Oe(D,re,he){if(D==null)return"";if(typeof D=="function")return K(D,Se(D));if(typeof D=="string")return ie(D);switch(D){case c:return ie("Suspense");case u:return ie("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return be(D.render);case f:return Oe(D.type,re,he);case p:{var Pe=D,He=Pe._payload,qe=Pe._init;try{return Oe(qe(He),re,he)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Ue={},Be=y.ReactDebugCurrentFrame;function Ie(D){if(D){var re=D._owner,he=Oe(D.type,D._source,re?re.type:null);Be.setExtraStackFrame(he)}else Be.setExtraStackFrame(null)}function Ke(D,re,he,Pe,He){{var qe=Function.call.bind(Te);for(var ze in D)if(qe(D,ze)){var Fe=void 0;try{if(typeof D[ze]!="function"){var Ae=Error((Pe||"React class")+": "+he+" type `"+ze+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[ze]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ae.name="Invariant Violation",Ae}Fe=D[ze](re,ze,Pe,he,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(G){Fe=G}Fe&&!(Fe instanceof Error)&&(Ie(He),_("%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).",Pe||"React class",he,ze,typeof Fe),Ie(null)),Fe instanceof Error&&!(Fe.message in Ue)&&(Ue[Fe.message]=!0,Ie(He),_("Failed %s type: %s",he,Fe.message),Ie(null))}}}var lt=Array.isArray;function It(D){return lt(D)}function Dt(D){{var re=typeof Symbol=="function"&&Symbol.toStringTag,he=re&&D[Symbol.toStringTag]||D.constructor.name||"Object";return he}}function Ht(D){try{return pe(D),!1}catch{return!0}}function pe(D){return""+D}function Ee(D){if(Ht(D))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dt(D)),pe(D)}var Le=y.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Ze,Wt,Zt;Zt={};function Kt(D){if(Te.call(D,"ref")){var re=Object.getOwnPropertyDescriptor(D,"ref").get;if(re&&re.isReactWarning)return!1}return D.ref!==void 0}function vn(D){if(Te.call(D,"key")){var re=Object.getOwnPropertyDescriptor(D,"key").get;if(re&&re.isReactWarning)return!1}return D.key!==void 0}function ln(D,re){if(typeof D.ref=="string"&&Le.current&&re&&Le.current.stateNode!==re){var he=X(Le.current.type);Zt[he]||(_('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',X(Le.current.type),D.ref),Zt[he]=!0)}}function Lt(D,re){{var he=function(){Ze||(Ze=!0,_("%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)",re))};he.isReactWarning=!0,Object.defineProperty(D,"key",{get:he,configurable:!0})}}function tn(D,re){{var he=function(){Wt||(Wt=!0,_("%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)",re))};he.isReactWarning=!0,Object.defineProperty(D,"ref",{get:he,configurable:!0})}}var xn=function(D,re,he,Pe,He,qe,ze){var Fe={$$typeof:t,type:D,key:re,ref:he,props:ze,_owner:qe};return Fe._store={},Object.defineProperty(Fe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Fe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Pe}),Object.defineProperty(Fe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:He}),Object.freeze&&(Object.freeze(Fe.props),Object.freeze(Fe)),Fe};function nt(D,re,he,Pe,He){{var qe,ze={},Fe=null,Ae=null;he!==void 0&&(Ee(he),Fe=""+he),vn(re)&&(Ee(re.key),Fe=""+re.key),Kt(re)&&(Ae=re.ref,ln(re,He));for(qe in re)Te.call(re,qe)&&!Ge.hasOwnProperty(qe)&&(ze[qe]=re[qe]);if(D&&D.defaultProps){var G=D.defaultProps;for(qe in G)ze[qe]===void 0&&(ze[qe]=G[qe])}if(Fe||Ae){var me=typeof D=="function"?D.displayName||D.name||"Unknown":D;Fe&&Lt(ze,me),Ae&&tn(ze,me)}return xn(D,Fe,Ae,He,Pe,Le.current,ze)}}var ht=y.ReactCurrentOwner,At=y.ReactDebugCurrentFrame;function Xt(D){if(D){var re=D._owner,he=Oe(D.type,D._source,re?re.type:null);At.setExtraStackFrame(he)}else At.setExtraStackFrame(null)}var bt;bt=!1;function On(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Fo(){{if(ht.current){var D=X(ht.current.type);if(D)return`
|
|
14
|
-
|
|
15
|
-
Check the render method of \``+D+"`."}return""}}function vs(D){{if(D!==void 0){var re=D.fileName.replace(/^.*[\\\/]/,""),he=D.lineNumber;return`
|
|
16
|
-
|
|
17
|
-
Check your code at `+re+":"+he+"."}return""}}var jo={};function ki(D){{var re=Fo();if(!re){var he=typeof D=="string"?D:D.displayName||D.name;he&&(re=`
|
|
18
|
-
|
|
19
|
-
Check the top-level render call using <`+he+">.")}return re}}function ri(D,re){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var he=ki(re);if(jo[he])return;jo[he]=!0;var Pe="";D&&D._owner&&D._owner!==ht.current&&(Pe=" It was passed a child from "+X(D._owner.type)+"."),Xt(D),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',he,Pe),Xt(null)}}function Mi(D,re){{if(typeof D!="object")return;if(It(D))for(var he=0;he<D.length;he++){var Pe=D[he];On(Pe)&&ri(Pe,re)}else if(On(D))D._store&&(D._store.validated=!0);else if(D){var He=w(D);if(typeof He=="function"&&He!==D.entries)for(var qe=He.call(D),ze;!(ze=qe.next()).done;)On(ze.value)&&ri(ze.value,re)}}}function bs(D){{var re=D.type;if(re==null||typeof re=="string")return;var he;if(typeof re=="function")he=re.propTypes;else if(typeof re=="object"&&(re.$$typeof===l||re.$$typeof===f))he=re.propTypes;else return;if(he){var Pe=X(re);Ke(he,D.props,"prop",Pe,D)}else if(re.PropTypes!==void 0&&!bt){bt=!0;var He=X(re);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof re.getDefaultProps=="function"&&!re.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function oi(D){{for(var re=Object.keys(D.props),he=0;he<re.length;he++){var Pe=re[he];if(Pe!=="children"&&Pe!=="key"){Xt(D),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Pe),Xt(null);break}}D.ref!==null&&(Xt(D),_("Invalid attribute `ref` supplied to `React.Fragment`."),Xt(null))}}function Ii(D,re,he,Pe,He,qe){{var ze=A(D);if(!ze){var Fe="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(Fe+=" 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 Ae=vs(He);Ae?Fe+=Ae:Fe+=Fo();var G;D===null?G="null":It(D)?G="array":D!==void 0&&D.$$typeof===t?(G="<"+(X(D.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):G=typeof D,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",G,Fe)}var me=nt(D,re,he,He,qe);if(me==null)return me;if(ze){var ke=re.children;if(ke!==void 0)if(Pe)if(It(ke)){for(var st=0;st<ke.length;st++)Mi(ke[st],D);Object.freeze&&Object.freeze(ke)}else _("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 Mi(ke,D)}return D===r?oi(me):bs(me),me}}function Bn(D,re,he){return Ii(D,re,he,!0)}function ii(D,re,he){return Ii(D,re,he,!1)}var ys=ii,xs=Bn;Hu.Fragment=r,Hu.jsx=ys,Hu.jsxs=xs}()),Hu}var Wu={};/**
|
|
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 DR;function Gz(){if(DR)return Wu;DR=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,c){var u,f={},p=null,h=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:p,ref:h,props:f,_owner:o.current}}return Wu.Fragment=n,Wu.jsx=s,Wu.jsxs=s,Wu}process.env.NODE_ENV==="production"?qy.exports=Gz():qy.exports=qz();var R=qy.exports;function KT(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=KT(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function kg(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=KT(e))&&(r&&(r+=" "),r+=t);return r}const Yz=Object.freeze(Object.defineProperty({__proto__:null,clsx:kg,default:kg},Symbol.toStringTag,{value:"Module"})),nw="-";function Kz(e){const t=Qz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(nw);return a[0]===""&&a.length!==1&&a.shift(),XT(a,t)||Xz(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function XT(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?XT(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(nw);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const AR=/^\[(.+)\]$/;function Xz(e){if(AR.test(e)){const t=AR.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function Qz(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Zz(Object.entries(e.classGroups),n).forEach(([i,s])=>{Gy(s,r,i,t)}),r}function Gy(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:kR(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Jz(o)){Gy(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Gy(s,kR(t,i),n,r)})})}function kR(e,t){let n=e;return t.split(nw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Jz(e){return e.isThemeGetter}function Zz(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 eB(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 QT="!";function tB(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let v=0;v<s.length;v++){let w=s[v];if(l===0){if(w===r&&(n||s.slice(v,v+o)===t)){a.push(s.slice(c,v)),c=v+o;continue}if(w==="/"){u=v;continue}}w==="["?l++:w==="]"&&l--}const f=a.length===0?s:s.substring(c),p=f.startsWith(QT),h=p?f.substring(1):f,b=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:b}}}function nB(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 rB(e){return{cache:eB(e.cacheSize),splitModifiers:tB(e),...Kz(e)}}const oB=/\s+/;function iB(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(oB).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let f=r(u?c.substring(0,u):c),p=!!u;if(!f){if(!u)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};p=!1}const h=nB(a).join(":");return{isTailwindClass:!0,modifierId:l?h+QT:h,classGroupId:f,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(f=>i.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function sB(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=JT(t))&&(r&&(r+=" "),r+=n);return r}function JT(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=JT(e[r]))&&(n&&(n+=" "),n+=t);return n}function aB(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=rB(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=iB(l,n);return o(l,u),u}return function(){return i(sB.apply(null,arguments))}}function un(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const ZT=/^\[(?:([a-z-]+):)?(.+)\]$/i,lB=/^\d+\/\d+$/,cB=new Set(["px","full","screen"]),uB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dB=/\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$/,fB=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Wo(e){return Ya(e)||cB.has(e)||lB.test(e)}function Ts(e){return gu(e,"length",wB)}function Ya(e){return!!e&&!Number.isNaN(Number(e))}function cp(e){return gu(e,"number",Ya)}function Uu(e){return!!e&&Number.isInteger(Number(e))}function pB(e){return e.endsWith("%")&&Ya(e.slice(0,-1))}function xt(e){return ZT.test(e)}function Ds(e){return uB.test(e)}const gB=new Set(["length","size","percentage"]);function mB(e){return gu(e,gB,eD)}function vB(e){return gu(e,"position",eD)}const bB=new Set(["image","url"]);function yB(e){return gu(e,bB,SB)}function xB(e){return gu(e,"",_B)}function qu(){return!0}function gu(e,t,n){const r=ZT.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function wB(e){return dB.test(e)}function eD(){return!1}function _B(e){return fB.test(e)}function SB(e){return hB.test(e)}function CB(){const e=un("colors"),t=un("spacing"),n=un("blur"),r=un("brightness"),o=un("borderColor"),i=un("borderRadius"),s=un("borderSpacing"),a=un("borderWidth"),l=un("contrast"),c=un("grayscale"),u=un("hueRotate"),f=un("invert"),p=un("gap"),h=un("gradientColorStops"),b=un("gradientColorStopPositions"),v=un("inset"),w=un("margin"),y=un("opacity"),_=un("padding"),S=un("saturate"),C=un("scale"),E=un("sepia"),O=un("skew"),T=un("space"),N=un("translate"),M=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",xt,t],z=()=>[xt,t],X=()=>["",Wo,Ts],ee=()=>["auto",Ya,xt],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],J=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",xt],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Ya,cp],U=()=>[Ya,xt];return{cacheSize:500,separator:":",theme:{colors:[qu],spacing:[Wo,Ts],blur:["none","",Ds,xt],brightness:V(),borderColor:[e],borderRadius:["none","","full",Ds,xt],borderSpacing:z(),borderWidth:X(),contrast:V(),grayscale:W(),hueRotate:U(),invert:W(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[pB,Ts],inset:F(),margin:F(),opacity:V(),padding:z(),saturate:V(),scale:V(),sepia:W(),skew:U(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",xt]}],container:["container"],columns:[{columns:[Ds]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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:[...H(),xt]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Uu,xt]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",xt]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Uu,xt]}],"grid-cols":[{"grid-cols":[qu]}],"col-start-end":[{col:["auto",{span:["full",Uu,xt]},xt]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[qu]}],"row-start-end":[{row:["auto",{span:[Uu,xt]},xt]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",xt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",xt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...J()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...J(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...J(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",xt,t]}],"min-w":[{"min-w":["min","max","fit",xt,Wo]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Ds]},Ds,xt]}],h:[{h:[xt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Wo,xt]}],"max-h":[{"max-h":[xt,t,"min","max","fit"]}],"font-size":[{text:["base",Ds,Ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",cp]}],"font-family":[{font:[qu]}],"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",xt]}],"line-clamp":[{"line-clamp":["none",Ya,cp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wo,xt]}],"list-image":[{"list-image":["none",xt]}],"list-style-type":[{list:["none","disc","decimal",xt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wo,Ts]}],"underline-offset":[{"underline-offset":["auto",Wo,xt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xt]}],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",xt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),vB]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mB]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yB]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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":[y]}],"border-style":[{border:[...Q(),"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":[y]}],"divide-style":[{divide:Q()}],"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:["",...Q()]}],"outline-offset":[{"outline-offset":[Wo,xt]}],"outline-w":[{outline:[Wo,Ts]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Wo,Ts]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ds,xB]}],"shadow-color":[{shadow:[qu]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":Y()}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ds,xt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],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":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"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",xt]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",xt]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",xt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Uu,xt]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",xt]}],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",xt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",xt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wo,Ts,cp]}],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 EB=aB(CB);class RB extends Error{}RB.prototype.name="InvalidTokenError";async function PB(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function OB(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),p=>p.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),f=new Uint8Array(u.length+c.length);f.set(u),f.set(c,u.length);try{const p=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,f);return{decryptedData:o.decode(p)}}catch(p){throw new Error(`Decryption failed: ${p}`)}}function _e(...e){return EB(kg(e))}async function $B(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 zf(e,t,n={}){try{const r=JSON.stringify(n),o=await PB(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await OB(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}function TB(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 tD(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>DB(i,t))}function DB(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 AB(e){return e.charAt(0).toUpperCase()+e.slice(1)}const bg="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";var kB={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const MR=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const f=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(p=>p(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(kB?"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},MB=e=>e?MR(e):MR;var Yy={exports:{}},Qb={},up={exports:{}},Jb={};/**
|
|
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 IR;function IB(){return IR||(IR=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(S){{for(var C=arguments.length,E=new Array(C>1?C-1:0),O=1;O<C;O++)E[O-1]=arguments[O];r("error",S,E)}}function r(S,C,E){{var O=t.ReactDebugCurrentFrame,T=O.getStackAddendum();T!==""&&(C+="%s",E=E.concat([T]));var N=E.map(function(M){return String(M)});N.unshift("Warning: "+C),Function.prototype.apply.call(console[S],console,N)}}function o(S,C){return S===C&&(S!==0||1/S===1/C)||S!==S&&C!==C}var i=typeof Object.is=="function"?Object.is:o,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,f=!1;function p(S,C,E){u||e.startTransition!==void 0&&(u=!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 O=C();if(!f){var T=C();i(O,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var N=s({inst:{value:O,getSnapshot:C}}),M=N[0].inst,A=N[1];return l(function(){M.value=O,M.getSnapshot=C,h(M)&&A({inst:M})},[S,O,C]),a(function(){h(M)&&A({inst:M});var F=function(){h(M)&&A({inst:M})};return S(F)},[S]),c(O),O}function h(S){var C=S.getSnapshot,E=S.value;try{var O=C();return!i(E,O)}catch{return!0}}function b(S,C,E){return C()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",w=!v,y=w?b:p,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y;Jb.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Jb}var Zb={};/**
|
|
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 NR;function NB(){if(NR)return Zb;NR=1;var e=m;function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&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(f,p){var h=p(),b=r({inst:{value:h,getSnapshot:p}}),v=b[0].inst,w=b[1];return i(function(){v.value=h,v.getSnapshot=p,l(v)&&w({inst:v})},[f,h,p]),o(function(){return l(v)&&w({inst:v}),f(function(){l(v)&&w({inst:v})})},[f]),s(h),h}function l(f){var p=f.getSnapshot;f=f.value;try{var h=p();return!n(f,h)}catch{return!0}}function c(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Zb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Zb}var LR;function rw(){return LR||(LR=1,process.env.NODE_ENV==="production"?up.exports=NB():up.exports=IB()),up.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 FR;function LB(){return FR||(FR=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=rw();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}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 c(u,f,p,h,b){var v=i(null),w;v.current===null?(w={hasValue:!1,value:null},v.current=w):w=v.current;var y=a(function(){var E=!1,O,T,N=function(z){if(!E){E=!0,O=z;var X=h(z);if(b!==void 0&&w.hasValue){var ee=w.value;if(b(ee,X))return T=ee,ee}return T=X,X}var H=O,Q=T;if(r(H,z))return Q;var Y=h(z);return b!==void 0&&b(Q,Y)?Q:(O=z,T=Y,Y)},M=p===void 0?null:p,A=function(){return N(f())},F=M===null?void 0:function(){return N(M())};return[A,F]},[f,p,h,b]),_=y[0],S=y[1],C=o(u,_,S);return s(function(){w.hasValue=!0,w.value=C},[C]),l(C),C}Qb.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Qb}var e0={};/**
|
|
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 jR;function FB(){if(jR)return e0;jR=1;var e=m,t=rw();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}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 e0.useSyncExternalStoreWithSelector=function(c,u,f,p,h){var b=i(null);if(b.current===null){var v={hasValue:!1,value:null};b.current=v}else v=b.current;b=a(function(){function y(O){if(!_){if(_=!0,S=O,O=p(O),h!==void 0&&v.hasValue){var T=v.value;if(h(T,O))return C=T}return C=O}if(T=C,r(S,O))return T;var N=p(O);return h!==void 0&&h(T,N)?T:(S=O,C=N)}var _=!1,S,C,E=f===void 0?null:f;return[function(){return y(u())},E===null?void 0:function(){return y(E())}]},[u,f,p,h]);var w=o(c,b[0],b[1]);return s(function(){v.hasValue=!0,v.value=w},[w]),l(w),w},e0}process.env.NODE_ENV==="production"?Yy.exports=FB():Yy.exports=LB();var jB=Yy.exports;const zB=Rl(jB);var nD={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:BB}=m,{useSyncExternalStoreWithSelector:VB}=zB;let zR=!1;function HB(e,t=e.getState,n){(nD?"production":void 0)!=="production"&&n&&!zR&&(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"),zR=!0);const r=VB(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return BB(r),r}const BR=e=>{(nD?"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"?MB(e):e,n=(r,o)=>HB(t,r,o);return Object.assign(n,t),n},rD=e=>e?BR(e):BR;var oD=Symbol.for("immer-nothing"),VR=Symbol.for("immer-draftable"),uo=Symbol.for("immer-state"),WB=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 Lr(e,...t){if(process.env.NODE_ENV!=="production"){const n=WB[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 Qc=Object.getPrototypeOf;function Jc(e){return!!e&&!!e[uo]}function gl(e){var t;return e?iD(e)||Array.isArray(e)||!!e[VR]||!!((t=e.constructor)!=null&&t[VR])||Em(e)||Rm(e):!1}var UB=Object.prototype.constructor.toString();function iD(e){if(!e||typeof e!="object")return!1;const t=Qc(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)===UB}function Ld(e,t){Cm(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Cm(e){const t=e[uo];return t?t.type_:Array.isArray(e)?1:Em(e)?2:Rm(e)?3:0}function Ky(e,t){return Cm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function sD(e,t,n){const r=Cm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function qB(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Em(e){return e instanceof Map}function Rm(e){return e instanceof Set}function ja(e){return e.copy_||e.base_}function Xy(e,t){if(Em(e))return new Map(e);if(Rm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&iD(e))return Qc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[uo];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(Qc(e),n)}function ow(e,t=!1){return Pm(e)||Jc(e)||!gl(e)||(Cm(e)>1&&(e.set=e.add=e.clear=e.delete=GB),Object.freeze(e),t&&Ld(e,(n,r)=>ow(r,!0))),e}function GB(){Lr(2)}function Pm(e){return Object.isFrozen(e)}var YB={};function ml(e){const t=YB[e];return t||Lr(0,e),t}var Fd;function aD(){return Fd}function KB(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function HR(e,t){t&&(ml("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Qy(e){Jy(e),e.drafts_.forEach(XB),e.drafts_=null}function Jy(e){e===Fd&&(Fd=e.parent_)}function WR(e){return Fd=KB(Fd,e)}function XB(e){const t=e[uo];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function UR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[uo].modified_&&(Qy(t),Lr(4)),gl(e)&&(e=Mg(t,e),t.parent_||Ig(t,e)),t.patches_&&ml("Patches").generateReplacementPatches_(n[uo].base_,e,t.patches_,t.inversePatches_)):e=Mg(t,n,[]),Qy(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==oD?e:void 0}function Mg(e,t,n){if(Pm(t))return t;const r=t[uo];if(!r)return Ld(t,(o,i)=>qR(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Ig(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),Ld(i,(a,l)=>qR(e,r,o,a,l,n,s)),Ig(e,o,!1),n&&e.patches_&&ml("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function qR(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Lr(5),Jc(o)){const a=i&&t&&t.type_!==3&&!Ky(t.assigned_,r)?i.concat(r):void 0,l=Mg(e,o,a);if(sD(n,r,l),Jc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(gl(o)&&!Pm(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Mg(e,o),(!t||!t.scope_.parent_)&&Ig(e,o)}}function Ig(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ow(t,n)}function QB(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:aD(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=iw;n&&(o=[r],i=jd);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var iw={get(e,t){if(t===uo)return e;const n=ja(e);if(!Ky(n,t))return JB(e,n,t);const r=n[t];return e.finalized_||!gl(r)?r:r===t0(e.base_,t)?(n0(e),e.copy_[t]=ex(r,e)):r},has(e,t){return t in ja(e)},ownKeys(e){return Reflect.ownKeys(ja(e))},set(e,t,n){const r=lD(ja(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=t0(ja(e),t),i=o==null?void 0:o[uo];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(qB(n,o)&&(n!==void 0||Ky(e.base_,t)))return!0;n0(e),Zy(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 t0(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,n0(e),Zy(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ja(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Lr(11)},getPrototypeOf(e){return Qc(e.base_)},setPrototypeOf(){Lr(12)}},jd={};Ld(iw,(e,t)=>{jd[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});jd.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Lr(13),jd.set.call(this,e,t,void 0)};jd.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Lr(14),iw.set.call(this,e[0],t,n,e[0])};function t0(e,t){const n=e[uo];return(n?ja(n):e)[t]}function JB(e,t,n){var o;const r=lD(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function lD(e,t){if(!(t in e))return;let n=Qc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Qc(n)}}function Zy(e){e.modified_||(e.modified_=!0,e.parent_&&Zy(e.parent_))}function n0(e){e.copy_||(e.copy_=Xy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ZB=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,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Lr(6),r!==void 0&&typeof r!="function"&&Lr(7);let o;if(gl(t)){const i=WR(this),s=ex(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?Qy(i):Jy(i)}return HR(i,r),UR(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===oD&&(o=void 0),this.autoFreeze_&&ow(o,!0),r){const i=[],s=[];ml("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Lr(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){gl(e)||Lr(8),Jc(e)&&(e=eV(e));const t=WR(this),n=ex(e,void 0);return n[uo].isManual_=!0,Jy(t),n}finishDraft(e,t){const n=e&&e[uo];(!n||!n.isManual_)&&Lr(9);const{scope_:r}=n;return HR(r,t),UR(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=ml("Patches").applyPatches_;return Jc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function ex(e,t){const n=Em(e)?ml("MapSet").proxyMap_(e,t):Rm(e)?ml("MapSet").proxySet_(e,t):QB(e,t);return(t?t.scope_:aD()).drafts_.push(n),n}function eV(e){return Jc(e)||Lr(10,e),cD(e)}function cD(e){if(!gl(e)||Pm(e))return e;const t=e[uo];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Xy(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Xy(e,!0);return Ld(n,(r,o)=>{sD(n,r,cD(o))}),t&&(t.finalized_=!1),n}var fo=new ZB,tV=fo.produce;fo.produceWithPatches.bind(fo);fo.setAutoFreeze.bind(fo);fo.setUseStrictShallowCopy.bind(fo);fo.applyPatches.bind(fo);fo.createDraft.bind(fo);fo.finishDraft.bind(fo);const nV=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?tV(o):o;return t(a,i,...s)},e(r.setState,n,r)),uD=nV;var tx,dp=Cr;if(process.env.NODE_ENV==="production")tx=dp.createRoot,dp.hydrateRoot;else{var GR=dp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;tx=function(e,t){GR.usingClientEntryPoint=!0;try{return dp.createRoot(e,t)}finally{GR.usingClientEntryPoint=!1}}}var dD={},fD={},sw={exports:{}},dn=String,hD=function(){return{isColorSupported:!1,reset:dn,bold:dn,dim:dn,italic:dn,underline:dn,inverse:dn,hidden:dn,strikethrough:dn,black:dn,red:dn,green:dn,yellow:dn,blue:dn,magenta:dn,cyan:dn,white:dn,gray:dn,bgBlack:dn,bgRed:dn,bgGreen:dn,bgYellow:dn,bgBlue:dn,bgMagenta:dn,bgCyan:dn,bgWhite:dn}};sw.exports=hD();sw.exports.createColors=hD;var rV=sw.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(rV);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(fD);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(fD);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}}})(dD);let r0=dD;var oV=(r0.__esModule?r0:{default:r0}).default;const Bt=Rl(oV),pD=`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
|
-
`,gD="dm",nx=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],iV=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],aw=["lg","md","sm","xs","xxs"],rx={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],borderColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:ox},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},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:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],borderColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],datalables:{color:ox}},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:Bt.slate[800]}},y:{grid:{display:!0,color:Bt.slate[800]}}}}}}};function ox(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=zd()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=zd()),Zc(n)}function zd(){return $e.getState().theme==="dark"?"#000000":"#FFFFFF"}function Zc(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Bt.gray[500];const f=u.replace("#",""),p=parseInt(f.substring(0,2),16),h=parseInt(f.substring(2,4),16),b=parseInt(f.substring(4,6),16);t+=p,n+=h,r+=b,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const Om=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],eu=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],Bf=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],lw=["boolean"];function cw(e){return e.match(/[A-Z]/)?`"${e}"`:e}function sV(e,t,n,r){const{measures:o,dimensions:i}=e,s=o==null?void 0:o.map(u=>`${u.calc}(${u.name}) as ${u.calc}_${u.name.replace(/"/g,"")}`).join(", "),a=(i==null?void 0:i.join(", "))||"";let l="";const c=r?`${gD}.${r}`:mD(t,n);if(s&&a)return l=`SELECT ${a}, COUNT(*) as count, ${s} FROM ${c} GROUP BY ${a} ORDER BY ${a} DESC`,l;if(!s&&a)return l=`SELECT ${a}, COUNT(*) as count FROM ${c} GROUP BY ${a} ORDER BY ${a} DESC`,l;if(s&&!a)return l=`SELECT ${s} FROM ${c}`,l}function aV(e,t,n="AVG"){var i,s,a,l;let r={};const o=cw(e.column_name);return Om.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),eu.includes(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function Ng(e){return Om.includes(e.dataType)?"string":eu.includes(e.dataType)?"number":Bf.includes(e.dataType)?"date":lw.includes(e.dataType)?"boolean":"string"}function lV(e){let t;const n=e.data_type.toLowerCase();return Om.includes(n)?t="T":eu.includes(n)?t="#":Bf.includes(n)?t="D":lw.includes(n)?t="B":t="?",t}function cV(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 mD(e,t){return t==="api"||e===cw("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const uV=e=>{const t=new Date(e);return!isNaN(t.getTime())},dV=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Bd=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?uV(e)?t="date":dV(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function fV({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:c,columnValue:u}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(p=n.preferences)==null?void 0:p.filterOnClickField,valueType:Bd(u),operation:"=",values:[u]};if(l!=null&&l.find(h=>h.id===n.id)){const h=n.id;if(u==null){a(n),i(h);return}else s(f)}o(n),r(f)}var Lg={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
|
-
*/Lg.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__",c=500,u="__lodash_placeholder__",f=1,p=2,h=4,b=1,v=2,w=1,y=2,_=4,S=8,C=16,E=32,O=64,T=128,N=256,M=512,A=30,F="...",z=800,X=16,ee=1,H=2,Q=3,Y=1/0,J=9007199254740991,W=17976931348623157e292,$=NaN,V=4294967295,U=V-1,I=V>>>1,te=[["ary",T],["bind",w],["bindKey",y],["curry",S],["curryRight",C],["flip",M],["partial",E],["partialRight",O],["rearg",N]],fe="[object Arguments]",ne="[object Array]",ue="[object AsyncFunction]",ie="[object Boolean]",oe="[object Date]",le="[object DOMException]",ye="[object Error]",K="[object Function]",be="[object GeneratorFunction]",Se="[object Map]",Oe="[object Number]",Te="[object Null]",Ue="[object Object]",Be="[object Promise]",Ie="[object Proxy]",Ke="[object RegExp]",lt="[object Set]",It="[object String]",Dt="[object Symbol]",Ht="[object Undefined]",pe="[object WeakMap]",Ee="[object WeakSet]",Le="[object ArrayBuffer]",Ge="[object DataView]",Ze="[object Float32Array]",Wt="[object Float64Array]",Zt="[object Int8Array]",Kt="[object Int16Array]",vn="[object Int32Array]",ln="[object Uint8Array]",Lt="[object Uint8ClampedArray]",tn="[object Uint16Array]",xn="[object Uint32Array]",nt=/\b__p \+= '';/g,ht=/\b(__p \+=) '' \+/g,At=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xt=/&(?:amp|lt|gt|quot|#39);/g,bt=/[&<>"']/g,On=RegExp(Xt.source),Fo=RegExp(bt.source),vs=/<%-([\s\S]+?)%>/g,jo=/<%([\s\S]+?)%>/g,ki=/<%=([\s\S]+?)%>/g,ri=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mi=/^\w*$/,bs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oi=/[\\^$.*+?()[\]{}|]/g,Ii=RegExp(oi.source),Bn=/^\s+/,ii=/\s/,ys=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,xs=/\{\n\/\* \[wrapped with (.+)\] \*/,D=/,? & /,re=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,Pe=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qe=/\w*$/,ze=/^[-+]0x[0-9a-f]+$/i,Fe=/^0b[01]+$/i,Ae=/^\[object .+?Constructor\]$/,G=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ke=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,st=/($^)/,bn=/['\n\r\u2028\u2029\\]/g,ft="\\ud800-\\udfff",nr="\\u0300-\\u036f",vo="\\ufe20-\\ufe2f",wa="\\u20d0-\\u20ff",Vn=nr+vo+wa,Ru="\\u2700-\\u27bf",Pu="a-z\\xdf-\\xf6\\xf8-\\xff",zF="\\xac\\xb1\\xd7\\xf7",BF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",VF="\\u2000-\\u206f",HF=" \\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",lC="A-Z\\xc0-\\xd6\\xd8-\\xde",cC="\\ufe0e\\ufe0f",uC=zF+BF+VF+HF,zv="['’]",WF="["+ft+"]",dC="["+uC+"]",_h="["+Vn+"]",fC="\\d+",UF="["+Ru+"]",hC="["+Pu+"]",pC="[^"+ft+uC+fC+Ru+Pu+lC+"]",Bv="\\ud83c[\\udffb-\\udfff]",qF="(?:"+_h+"|"+Bv+")",gC="[^"+ft+"]",Vv="(?:\\ud83c[\\udde6-\\uddff]){2}",Hv="[\\ud800-\\udbff][\\udc00-\\udfff]",zl="["+lC+"]",mC="\\u200d",vC="(?:"+hC+"|"+pC+")",GF="(?:"+zl+"|"+pC+")",bC="(?:"+zv+"(?:d|ll|m|re|s|t|ve))?",yC="(?:"+zv+"(?:D|LL|M|RE|S|T|VE))?",xC=qF+"?",wC="["+cC+"]?",YF="(?:"+mC+"(?:"+[gC,Vv,Hv].join("|")+")"+wC+xC+")*",KF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",XF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",_C=wC+xC+YF,QF="(?:"+[UF,Vv,Hv].join("|")+")"+_C,JF="(?:"+[gC+_h+"?",_h,Vv,Hv,WF].join("|")+")",ZF=RegExp(zv,"g"),e7=RegExp(_h,"g"),Wv=RegExp(Bv+"(?="+Bv+")|"+JF+_C,"g"),t7=RegExp([zl+"?"+hC+"+"+bC+"(?="+[dC,zl,"$"].join("|")+")",GF+"+"+yC+"(?="+[dC,zl+vC,"$"].join("|")+")",zl+"?"+vC+"+"+bC,zl+"+"+yC,XF,KF,fC,QF].join("|"),"g"),n7=RegExp("["+mC+ft+Vn+cC+"]"),r7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,o7=["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"],i7=-1,cn={};cn[Ze]=cn[Wt]=cn[Zt]=cn[Kt]=cn[vn]=cn[ln]=cn[Lt]=cn[tn]=cn[xn]=!0,cn[fe]=cn[ne]=cn[Le]=cn[ie]=cn[Ge]=cn[oe]=cn[ye]=cn[K]=cn[Se]=cn[Oe]=cn[Ue]=cn[Ke]=cn[lt]=cn[It]=cn[pe]=!1;var rn={};rn[fe]=rn[ne]=rn[Le]=rn[Ge]=rn[ie]=rn[oe]=rn[Ze]=rn[Wt]=rn[Zt]=rn[Kt]=rn[vn]=rn[Se]=rn[Oe]=rn[Ue]=rn[Ke]=rn[lt]=rn[It]=rn[Dt]=rn[ln]=rn[Lt]=rn[tn]=rn[xn]=!0,rn[ye]=rn[K]=rn[pe]=!1;var s7={À:"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"},a7={"&":"&","<":"<",">":">",'"':""","'":"'"},l7={"&":"&","<":"<",">":">",""":'"',"'":"'"},c7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},u7=parseFloat,d7=parseInt,SC=typeof Ws=="object"&&Ws&&Ws.Object===Object&&Ws,f7=typeof self=="object"&&self&&self.Object===Object&&self,Gn=SC||f7||Function("return this")(),Uv=t&&!t.nodeType&&t,_a=Uv&&!0&&e&&!e.nodeType&&e,CC=_a&&_a.exports===Uv,qv=CC&&SC.process,bo=function(){try{var se=_a&&_a.require&&_a.require("util").types;return se||qv&&qv.binding&&qv.binding("util")}catch{}}(),EC=bo&&bo.isArrayBuffer,RC=bo&&bo.isDate,PC=bo&&bo.isMap,OC=bo&&bo.isRegExp,$C=bo&&bo.isSet,TC=bo&&bo.isTypedArray;function Hr(se,ve,ge){switch(ge.length){case 0:return se.call(ve);case 1:return se.call(ve,ge[0]);case 2:return se.call(ve,ge[0],ge[1]);case 3:return se.call(ve,ge[0],ge[1],ge[2])}return se.apply(ve,ge)}function h7(se,ve,ge,We){for(var ct=-1,jt=se==null?0:se.length;++ct<jt;){var Mn=se[ct];ve(We,Mn,ge(Mn),se)}return We}function yo(se,ve){for(var ge=-1,We=se==null?0:se.length;++ge<We&&ve(se[ge],ge,se)!==!1;);return se}function p7(se,ve){for(var ge=se==null?0:se.length;ge--&&ve(se[ge],ge,se)!==!1;);return se}function DC(se,ve){for(var ge=-1,We=se==null?0:se.length;++ge<We;)if(!ve(se[ge],ge,se))return!1;return!0}function ws(se,ve){for(var ge=-1,We=se==null?0:se.length,ct=0,jt=[];++ge<We;){var Mn=se[ge];ve(Mn,ge,se)&&(jt[ct++]=Mn)}return jt}function Sh(se,ve){var ge=se==null?0:se.length;return!!ge&&Bl(se,ve,0)>-1}function Gv(se,ve,ge){for(var We=-1,ct=se==null?0:se.length;++We<ct;)if(ge(ve,se[We]))return!0;return!1}function yn(se,ve){for(var ge=-1,We=se==null?0:se.length,ct=Array(We);++ge<We;)ct[ge]=ve(se[ge],ge,se);return ct}function _s(se,ve){for(var ge=-1,We=ve.length,ct=se.length;++ge<We;)se[ct+ge]=ve[ge];return se}function Yv(se,ve,ge,We){var ct=-1,jt=se==null?0:se.length;for(We&&jt&&(ge=se[++ct]);++ct<jt;)ge=ve(ge,se[ct],ct,se);return ge}function g7(se,ve,ge,We){var ct=se==null?0:se.length;for(We&&ct&&(ge=se[--ct]);ct--;)ge=ve(ge,se[ct],ct,se);return ge}function Kv(se,ve){for(var ge=-1,We=se==null?0:se.length;++ge<We;)if(ve(se[ge],ge,se))return!0;return!1}var m7=Xv("length");function v7(se){return se.split("")}function b7(se){return se.match(re)||[]}function AC(se,ve,ge){var We;return ge(se,function(ct,jt,Mn){if(ve(ct,jt,Mn))return We=jt,!1}),We}function Ch(se,ve,ge,We){for(var ct=se.length,jt=ge+(We?1:-1);We?jt--:++jt<ct;)if(ve(se[jt],jt,se))return jt;return-1}function Bl(se,ve,ge){return ve===ve?T7(se,ve,ge):Ch(se,kC,ge)}function y7(se,ve,ge,We){for(var ct=ge-1,jt=se.length;++ct<jt;)if(We(se[ct],ve))return ct;return-1}function kC(se){return se!==se}function MC(se,ve){var ge=se==null?0:se.length;return ge?Jv(se,ve)/ge:$}function Xv(se){return function(ve){return ve==null?n:ve[se]}}function Qv(se){return function(ve){return se==null?n:se[ve]}}function IC(se,ve,ge,We,ct){return ct(se,function(jt,Mn,nn){ge=We?(We=!1,jt):ve(ge,jt,Mn,nn)}),ge}function x7(se,ve){var ge=se.length;for(se.sort(ve);ge--;)se[ge]=se[ge].value;return se}function Jv(se,ve){for(var ge,We=-1,ct=se.length;++We<ct;){var jt=ve(se[We]);jt!==n&&(ge=ge===n?jt:ge+jt)}return ge}function Zv(se,ve){for(var ge=-1,We=Array(se);++ge<se;)We[ge]=ve(ge);return We}function w7(se,ve){return yn(ve,function(ge){return[ge,se[ge]]})}function NC(se){return se&&se.slice(0,zC(se)+1).replace(Bn,"")}function Wr(se){return function(ve){return se(ve)}}function eb(se,ve){return yn(ve,function(ge){return se[ge]})}function Ou(se,ve){return se.has(ve)}function LC(se,ve){for(var ge=-1,We=se.length;++ge<We&&Bl(ve,se[ge],0)>-1;);return ge}function FC(se,ve){for(var ge=se.length;ge--&&Bl(ve,se[ge],0)>-1;);return ge}function _7(se,ve){for(var ge=se.length,We=0;ge--;)se[ge]===ve&&++We;return We}var S7=Qv(s7),C7=Qv(a7);function E7(se){return"\\"+c7[se]}function R7(se,ve){return se==null?n:se[ve]}function Vl(se){return n7.test(se)}function P7(se){return r7.test(se)}function O7(se){for(var ve,ge=[];!(ve=se.next()).done;)ge.push(ve.value);return ge}function tb(se){var ve=-1,ge=Array(se.size);return se.forEach(function(We,ct){ge[++ve]=[ct,We]}),ge}function jC(se,ve){return function(ge){return se(ve(ge))}}function Ss(se,ve){for(var ge=-1,We=se.length,ct=0,jt=[];++ge<We;){var Mn=se[ge];(Mn===ve||Mn===u)&&(se[ge]=u,jt[ct++]=ge)}return jt}function Eh(se){var ve=-1,ge=Array(se.size);return se.forEach(function(We){ge[++ve]=We}),ge}function $7(se){var ve=-1,ge=Array(se.size);return se.forEach(function(We){ge[++ve]=[We,We]}),ge}function T7(se,ve,ge){for(var We=ge-1,ct=se.length;++We<ct;)if(se[We]===ve)return We;return-1}function D7(se,ve,ge){for(var We=ge+1;We--;)if(se[We]===ve)return We;return We}function Hl(se){return Vl(se)?k7(se):m7(se)}function zo(se){return Vl(se)?M7(se):v7(se)}function zC(se){for(var ve=se.length;ve--&&ii.test(se.charAt(ve)););return ve}var A7=Qv(l7);function k7(se){for(var ve=Wv.lastIndex=0;Wv.test(se);)++ve;return ve}function M7(se){return se.match(Wv)||[]}function I7(se){return se.match(t7)||[]}var N7=function se(ve){ve=ve==null?Gn:Wl.defaults(Gn.Object(),ve,Wl.pick(Gn,o7));var ge=ve.Array,We=ve.Date,ct=ve.Error,jt=ve.Function,Mn=ve.Math,nn=ve.Object,nb=ve.RegExp,L7=ve.String,xo=ve.TypeError,Rh=ge.prototype,F7=jt.prototype,Ul=nn.prototype,Ph=ve["__core-js_shared__"],Oh=F7.toString,Qt=Ul.hasOwnProperty,j7=0,BC=function(){var d=/[^.]+$/.exec(Ph&&Ph.keys&&Ph.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),$h=Ul.toString,z7=Oh.call(nn),B7=Gn._,V7=nb("^"+Oh.call(Qt).replace(oi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Th=CC?ve.Buffer:n,Cs=ve.Symbol,Dh=ve.Uint8Array,VC=Th?Th.allocUnsafe:n,Ah=jC(nn.getPrototypeOf,nn),HC=nn.create,WC=Ul.propertyIsEnumerable,kh=Rh.splice,UC=Cs?Cs.isConcatSpreadable:n,$u=Cs?Cs.iterator:n,Sa=Cs?Cs.toStringTag:n,Mh=function(){try{var d=Oa(nn,"defineProperty");return d({},"",{}),d}catch{}}(),H7=ve.clearTimeout!==Gn.clearTimeout&&ve.clearTimeout,W7=We&&We.now!==Gn.Date.now&&We.now,U7=ve.setTimeout!==Gn.setTimeout&&ve.setTimeout,Ih=Mn.ceil,Nh=Mn.floor,rb=nn.getOwnPropertySymbols,q7=Th?Th.isBuffer:n,qC=ve.isFinite,G7=Rh.join,Y7=jC(nn.keys,nn),In=Mn.max,rr=Mn.min,K7=We.now,X7=ve.parseInt,GC=Mn.random,Q7=Rh.reverse,ob=Oa(ve,"DataView"),Tu=Oa(ve,"Map"),ib=Oa(ve,"Promise"),ql=Oa(ve,"Set"),Du=Oa(ve,"WeakMap"),Au=Oa(nn,"create"),Lh=Du&&new Du,Gl={},J7=$a(ob),Z7=$a(Tu),e6=$a(ib),t6=$a(ql),n6=$a(Du),Fh=Cs?Cs.prototype:n,ku=Fh?Fh.valueOf:n,YC=Fh?Fh.toString:n;function j(d){if(Cn(d)&&!ut(d)&&!(d instanceof kt)){if(d instanceof wo)return d;if(Qt.call(d,"__wrapped__"))return KE(d)}return new wo(d)}var Yl=function(){function d(){}return function(g){if(!wn(g))return{};if(HC)return HC(g);d.prototype=g;var x=new d;return d.prototype=n,x}}();function jh(){}function wo(d,g){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}j.templateSettings={escape:vs,evaluate:jo,interpolate:ki,variable:"",imports:{_:j}},j.prototype=jh.prototype,j.prototype.constructor=j,wo.prototype=Yl(jh.prototype),wo.prototype.constructor=wo;function kt(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=V,this.__views__=[]}function r6(){var d=new kt(this.__wrapped__);return d.__actions__=Rr(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=Rr(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=Rr(this.__views__),d}function o6(){if(this.__filtered__){var d=new kt(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function i6(){var d=this.__wrapped__.value(),g=this.__dir__,x=ut(d),P=g<0,k=x?d.length:0,B=v9(0,k,this.__views__),q=B.start,Z=B.end,ce=Z-q,xe=P?Z:q-1,we=this.__iteratees__,Re=we.length,je=0,Ye=rr(ce,this.__takeCount__);if(!x||!P&&k==ce&&Ye==ce)return bE(d,this.__actions__);var et=[];e:for(;ce--&&je<Ye;){xe+=g;for(var yt=-1,tt=d[xe];++yt<Re;){var Ot=we[yt],Mt=Ot.iteratee,Gr=Ot.type,pr=Mt(tt);if(Gr==H)tt=pr;else if(!pr){if(Gr==ee)continue e;break e}}et[je++]=tt}return et}kt.prototype=Yl(jh.prototype),kt.prototype.constructor=kt;function Ca(d){var g=-1,x=d==null?0:d.length;for(this.clear();++g<x;){var P=d[g];this.set(P[0],P[1])}}function s6(){this.__data__=Au?Au(null):{},this.size=0}function a6(d){var g=this.has(d)&&delete this.__data__[d];return this.size-=g?1:0,g}function l6(d){var g=this.__data__;if(Au){var x=g[d];return x===l?n:x}return Qt.call(g,d)?g[d]:n}function c6(d){var g=this.__data__;return Au?g[d]!==n:Qt.call(g,d)}function u6(d,g){var x=this.__data__;return this.size+=this.has(d)?0:1,x[d]=Au&&g===n?l:g,this}Ca.prototype.clear=s6,Ca.prototype.delete=a6,Ca.prototype.get=l6,Ca.prototype.has=c6,Ca.prototype.set=u6;function Ni(d){var g=-1,x=d==null?0:d.length;for(this.clear();++g<x;){var P=d[g];this.set(P[0],P[1])}}function d6(){this.__data__=[],this.size=0}function f6(d){var g=this.__data__,x=zh(g,d);if(x<0)return!1;var P=g.length-1;return x==P?g.pop():kh.call(g,x,1),--this.size,!0}function h6(d){var g=this.__data__,x=zh(g,d);return x<0?n:g[x][1]}function p6(d){return zh(this.__data__,d)>-1}function g6(d,g){var x=this.__data__,P=zh(x,d);return P<0?(++this.size,x.push([d,g])):x[P][1]=g,this}Ni.prototype.clear=d6,Ni.prototype.delete=f6,Ni.prototype.get=h6,Ni.prototype.has=p6,Ni.prototype.set=g6;function Li(d){var g=-1,x=d==null?0:d.length;for(this.clear();++g<x;){var P=d[g];this.set(P[0],P[1])}}function m6(){this.size=0,this.__data__={hash:new Ca,map:new(Tu||Ni),string:new Ca}}function v6(d){var g=Jh(this,d).delete(d);return this.size-=g?1:0,g}function b6(d){return Jh(this,d).get(d)}function y6(d){return Jh(this,d).has(d)}function x6(d,g){var x=Jh(this,d),P=x.size;return x.set(d,g),this.size+=x.size==P?0:1,this}Li.prototype.clear=m6,Li.prototype.delete=v6,Li.prototype.get=b6,Li.prototype.has=y6,Li.prototype.set=x6;function Ea(d){var g=-1,x=d==null?0:d.length;for(this.__data__=new Li;++g<x;)this.add(d[g])}function w6(d){return this.__data__.set(d,l),this}function _6(d){return this.__data__.has(d)}Ea.prototype.add=Ea.prototype.push=w6,Ea.prototype.has=_6;function Bo(d){var g=this.__data__=new Ni(d);this.size=g.size}function S6(){this.__data__=new Ni,this.size=0}function C6(d){var g=this.__data__,x=g.delete(d);return this.size=g.size,x}function E6(d){return this.__data__.get(d)}function R6(d){return this.__data__.has(d)}function P6(d,g){var x=this.__data__;if(x instanceof Ni){var P=x.__data__;if(!Tu||P.length<o-1)return P.push([d,g]),this.size=++x.size,this;x=this.__data__=new Li(P)}return x.set(d,g),this.size=x.size,this}Bo.prototype.clear=S6,Bo.prototype.delete=C6,Bo.prototype.get=E6,Bo.prototype.has=R6,Bo.prototype.set=P6;function KC(d,g){var x=ut(d),P=!x&&Ta(d),k=!x&&!P&&$s(d),B=!x&&!P&&!k&&Jl(d),q=x||P||k||B,Z=q?Zv(d.length,L7):[],ce=Z.length;for(var xe in d)(g||Qt.call(d,xe))&&!(q&&(xe=="length"||k&&(xe=="offset"||xe=="parent")||B&&(xe=="buffer"||xe=="byteLength"||xe=="byteOffset")||Bi(xe,ce)))&&Z.push(xe);return Z}function XC(d){var g=d.length;return g?d[mb(0,g-1)]:n}function O6(d,g){return Zh(Rr(d),Ra(g,0,d.length))}function $6(d){return Zh(Rr(d))}function sb(d,g,x){(x!==n&&!Vo(d[g],x)||x===n&&!(g in d))&&Fi(d,g,x)}function Mu(d,g,x){var P=d[g];(!(Qt.call(d,g)&&Vo(P,x))||x===n&&!(g in d))&&Fi(d,g,x)}function zh(d,g){for(var x=d.length;x--;)if(Vo(d[x][0],g))return x;return-1}function T6(d,g,x,P){return Es(d,function(k,B,q){g(P,k,x(k),q)}),P}function QC(d,g){return d&&ai(g,Hn(g),d)}function D6(d,g){return d&&ai(g,Or(g),d)}function Fi(d,g,x){g=="__proto__"&&Mh?Mh(d,g,{configurable:!0,enumerable:!0,value:x,writable:!0}):d[g]=x}function ab(d,g){for(var x=-1,P=g.length,k=ge(P),B=d==null;++x<P;)k[x]=B?n:Bb(d,g[x]);return k}function Ra(d,g,x){return d===d&&(x!==n&&(d=d<=x?d:x),g!==n&&(d=d>=g?d:g)),d}function _o(d,g,x,P,k,B){var q,Z=g&f,ce=g&p,xe=g&h;if(x&&(q=k?x(d,P,k,B):x(d)),q!==n)return q;if(!wn(d))return d;var we=ut(d);if(we){if(q=y9(d),!Z)return Rr(d,q)}else{var Re=or(d),je=Re==K||Re==be;if($s(d))return wE(d,Z);if(Re==Ue||Re==fe||je&&!k){if(q=ce||je?{}:zE(d),!Z)return ce?l9(d,D6(q,d)):a9(d,QC(q,d))}else{if(!rn[Re])return k?d:{};q=x9(d,Re,Z)}}B||(B=new Bo);var Ye=B.get(d);if(Ye)return Ye;B.set(d,q),gR(d)?d.forEach(function(tt){q.add(_o(tt,g,x,tt,d,B))}):hR(d)&&d.forEach(function(tt,Ot){q.set(Ot,_o(tt,g,x,Ot,d,B))});var et=xe?ce?Pb:Rb:ce?Or:Hn,yt=we?n:et(d);return yo(yt||d,function(tt,Ot){yt&&(Ot=tt,tt=d[Ot]),Mu(q,Ot,_o(tt,g,x,Ot,d,B))}),q}function A6(d){var g=Hn(d);return function(x){return JC(x,d,g)}}function JC(d,g,x){var P=x.length;if(d==null)return!P;for(d=nn(d);P--;){var k=x[P],B=g[k],q=d[k];if(q===n&&!(k in d)||!B(q))return!1}return!0}function ZC(d,g,x){if(typeof d!="function")throw new xo(s);return Bu(function(){d.apply(n,x)},g)}function Iu(d,g,x,P){var k=-1,B=Sh,q=!0,Z=d.length,ce=[],xe=g.length;if(!Z)return ce;x&&(g=yn(g,Wr(x))),P?(B=Gv,q=!1):g.length>=o&&(B=Ou,q=!1,g=new Ea(g));e:for(;++k<Z;){var we=d[k],Re=x==null?we:x(we);if(we=P||we!==0?we:0,q&&Re===Re){for(var je=xe;je--;)if(g[je]===Re)continue e;ce.push(we)}else B(g,Re,P)||ce.push(we)}return ce}var Es=RE(si),eE=RE(cb,!0);function k6(d,g){var x=!0;return Es(d,function(P,k,B){return x=!!g(P,k,B),x}),x}function Bh(d,g,x){for(var P=-1,k=d.length;++P<k;){var B=d[P],q=g(B);if(q!=null&&(Z===n?q===q&&!qr(q):x(q,Z)))var Z=q,ce=B}return ce}function M6(d,g,x,P){var k=d.length;for(x=pt(x),x<0&&(x=-x>k?0:k+x),P=P===n||P>k?k:pt(P),P<0&&(P+=k),P=x>P?0:vR(P);x<P;)d[x++]=g;return d}function tE(d,g){var x=[];return Es(d,function(P,k,B){g(P,k,B)&&x.push(P)}),x}function Yn(d,g,x,P,k){var B=-1,q=d.length;for(x||(x=_9),k||(k=[]);++B<q;){var Z=d[B];g>0&&x(Z)?g>1?Yn(Z,g-1,x,P,k):_s(k,Z):P||(k[k.length]=Z)}return k}var lb=PE(),nE=PE(!0);function si(d,g){return d&&lb(d,g,Hn)}function cb(d,g){return d&&nE(d,g,Hn)}function Vh(d,g){return ws(g,function(x){return Vi(d[x])})}function Pa(d,g){g=Ps(g,d);for(var x=0,P=g.length;d!=null&&x<P;)d=d[li(g[x++])];return x&&x==P?d:n}function rE(d,g,x){var P=g(d);return ut(d)?P:_s(P,x(d))}function fr(d){return d==null?d===n?Ht:Te:Sa&&Sa in nn(d)?m9(d):$9(d)}function ub(d,g){return d>g}function I6(d,g){return d!=null&&Qt.call(d,g)}function N6(d,g){return d!=null&&g in nn(d)}function L6(d,g,x){return d>=rr(g,x)&&d<In(g,x)}function db(d,g,x){for(var P=x?Gv:Sh,k=d[0].length,B=d.length,q=B,Z=ge(B),ce=1/0,xe=[];q--;){var we=d[q];q&&g&&(we=yn(we,Wr(g))),ce=rr(we.length,ce),Z[q]=!x&&(g||k>=120&&we.length>=120)?new Ea(q&&we):n}we=d[0];var Re=-1,je=Z[0];e:for(;++Re<k&&xe.length<ce;){var Ye=we[Re],et=g?g(Ye):Ye;if(Ye=x||Ye!==0?Ye:0,!(je?Ou(je,et):P(xe,et,x))){for(q=B;--q;){var yt=Z[q];if(!(yt?Ou(yt,et):P(d[q],et,x)))continue e}je&&je.push(et),xe.push(Ye)}}return xe}function F6(d,g,x,P){return si(d,function(k,B,q){g(P,x(k),B,q)}),P}function Nu(d,g,x){g=Ps(g,d),d=WE(d,g);var P=d==null?d:d[li(Co(g))];return P==null?n:Hr(P,d,x)}function oE(d){return Cn(d)&&fr(d)==fe}function j6(d){return Cn(d)&&fr(d)==Le}function z6(d){return Cn(d)&&fr(d)==oe}function Lu(d,g,x,P,k){return d===g?!0:d==null||g==null||!Cn(d)&&!Cn(g)?d!==d&&g!==g:B6(d,g,x,P,Lu,k)}function B6(d,g,x,P,k,B){var q=ut(d),Z=ut(g),ce=q?ne:or(d),xe=Z?ne:or(g);ce=ce==fe?Ue:ce,xe=xe==fe?Ue:xe;var we=ce==Ue,Re=xe==Ue,je=ce==xe;if(je&&$s(d)){if(!$s(g))return!1;q=!0,we=!1}if(je&&!we)return B||(B=new Bo),q||Jl(d)?LE(d,g,x,P,k,B):p9(d,g,ce,x,P,k,B);if(!(x&b)){var Ye=we&&Qt.call(d,"__wrapped__"),et=Re&&Qt.call(g,"__wrapped__");if(Ye||et){var yt=Ye?d.value():d,tt=et?g.value():g;return B||(B=new Bo),k(yt,tt,x,P,B)}}return je?(B||(B=new Bo),g9(d,g,x,P,k,B)):!1}function V6(d){return Cn(d)&&or(d)==Se}function fb(d,g,x,P){var k=x.length,B=k,q=!P;if(d==null)return!B;for(d=nn(d);k--;){var Z=x[k];if(q&&Z[2]?Z[1]!==d[Z[0]]:!(Z[0]in d))return!1}for(;++k<B;){Z=x[k];var ce=Z[0],xe=d[ce],we=Z[1];if(q&&Z[2]){if(xe===n&&!(ce in d))return!1}else{var Re=new Bo;if(P)var je=P(xe,we,ce,d,g,Re);if(!(je===n?Lu(we,xe,b|v,P,Re):je))return!1}}return!0}function iE(d){if(!wn(d)||C9(d))return!1;var g=Vi(d)?V7:Ae;return g.test($a(d))}function H6(d){return Cn(d)&&fr(d)==Ke}function W6(d){return Cn(d)&&or(d)==lt}function U6(d){return Cn(d)&&ip(d.length)&&!!cn[fr(d)]}function sE(d){return typeof d=="function"?d:d==null?$r:typeof d=="object"?ut(d)?cE(d[0],d[1]):lE(d):OR(d)}function hb(d){if(!zu(d))return Y7(d);var g=[];for(var x in nn(d))Qt.call(d,x)&&x!="constructor"&&g.push(x);return g}function q6(d){if(!wn(d))return O9(d);var g=zu(d),x=[];for(var P in d)P=="constructor"&&(g||!Qt.call(d,P))||x.push(P);return x}function pb(d,g){return d<g}function aE(d,g){var x=-1,P=Pr(d)?ge(d.length):[];return Es(d,function(k,B,q){P[++x]=g(k,B,q)}),P}function lE(d){var g=$b(d);return g.length==1&&g[0][2]?VE(g[0][0],g[0][1]):function(x){return x===d||fb(x,d,g)}}function cE(d,g){return Db(d)&&BE(g)?VE(li(d),g):function(x){var P=Bb(x,d);return P===n&&P===g?Vb(x,d):Lu(g,P,b|v)}}function Hh(d,g,x,P,k){d!==g&&lb(g,function(B,q){if(k||(k=new Bo),wn(B))G6(d,g,q,x,Hh,P,k);else{var Z=P?P(kb(d,q),B,q+"",d,g,k):n;Z===n&&(Z=B),sb(d,q,Z)}},Or)}function G6(d,g,x,P,k,B,q){var Z=kb(d,x),ce=kb(g,x),xe=q.get(ce);if(xe){sb(d,x,xe);return}var we=B?B(Z,ce,x+"",d,g,q):n,Re=we===n;if(Re){var je=ut(ce),Ye=!je&&$s(ce),et=!je&&!Ye&&Jl(ce);we=ce,je||Ye||et?ut(Z)?we=Z:$n(Z)?we=Rr(Z):Ye?(Re=!1,we=wE(ce,!0)):et?(Re=!1,we=_E(ce,!0)):we=[]:Vu(ce)||Ta(ce)?(we=Z,Ta(Z)?we=bR(Z):(!wn(Z)||Vi(Z))&&(we=zE(ce))):Re=!1}Re&&(q.set(ce,we),k(we,ce,P,B,q),q.delete(ce)),sb(d,x,we)}function uE(d,g){var x=d.length;if(x)return g+=g<0?x:0,Bi(g,x)?d[g]:n}function dE(d,g,x){g.length?g=yn(g,function(B){return ut(B)?function(q){return Pa(q,B.length===1?B[0]:B)}:B}):g=[$r];var P=-1;g=yn(g,Wr(Je()));var k=aE(d,function(B,q,Z){var ce=yn(g,function(xe){return xe(B)});return{criteria:ce,index:++P,value:B}});return x7(k,function(B,q){return s9(B,q,x)})}function Y6(d,g){return fE(d,g,function(x,P){return Vb(d,P)})}function fE(d,g,x){for(var P=-1,k=g.length,B={};++P<k;){var q=g[P],Z=Pa(d,q);x(Z,q)&&Fu(B,Ps(q,d),Z)}return B}function K6(d){return function(g){return Pa(g,d)}}function gb(d,g,x,P){var k=P?y7:Bl,B=-1,q=g.length,Z=d;for(d===g&&(g=Rr(g)),x&&(Z=yn(d,Wr(x)));++B<q;)for(var ce=0,xe=g[B],we=x?x(xe):xe;(ce=k(Z,we,ce,P))>-1;)Z!==d&&kh.call(Z,ce,1),kh.call(d,ce,1);return d}function hE(d,g){for(var x=d?g.length:0,P=x-1;x--;){var k=g[x];if(x==P||k!==B){var B=k;Bi(k)?kh.call(d,k,1):yb(d,k)}}return d}function mb(d,g){return d+Nh(GC()*(g-d+1))}function X6(d,g,x,P){for(var k=-1,B=In(Ih((g-d)/(x||1)),0),q=ge(B);B--;)q[P?B:++k]=d,d+=x;return q}function vb(d,g){var x="";if(!d||g<1||g>J)return x;do g%2&&(x+=d),g=Nh(g/2),g&&(d+=d);while(g);return x}function St(d,g){return Mb(HE(d,g,$r),d+"")}function Q6(d){return XC(Zl(d))}function J6(d,g){var x=Zl(d);return Zh(x,Ra(g,0,x.length))}function Fu(d,g,x,P){if(!wn(d))return d;g=Ps(g,d);for(var k=-1,B=g.length,q=B-1,Z=d;Z!=null&&++k<B;){var ce=li(g[k]),xe=x;if(ce==="__proto__"||ce==="constructor"||ce==="prototype")return d;if(k!=q){var we=Z[ce];xe=P?P(we,ce,Z):n,xe===n&&(xe=wn(we)?we:Bi(g[k+1])?[]:{})}Mu(Z,ce,xe),Z=Z[ce]}return d}var pE=Lh?function(d,g){return Lh.set(d,g),d}:$r,Z6=Mh?function(d,g){return Mh(d,"toString",{configurable:!0,enumerable:!1,value:Wb(g),writable:!0})}:$r;function e9(d){return Zh(Zl(d))}function So(d,g,x){var P=-1,k=d.length;g<0&&(g=-g>k?0:k+g),x=x>k?k:x,x<0&&(x+=k),k=g>x?0:x-g>>>0,g>>>=0;for(var B=ge(k);++P<k;)B[P]=d[P+g];return B}function t9(d,g){var x;return Es(d,function(P,k,B){return x=g(P,k,B),!x}),!!x}function Wh(d,g,x){var P=0,k=d==null?P:d.length;if(typeof g=="number"&&g===g&&k<=I){for(;P<k;){var B=P+k>>>1,q=d[B];q!==null&&!qr(q)&&(x?q<=g:q<g)?P=B+1:k=B}return k}return bb(d,g,$r,x)}function bb(d,g,x,P){var k=0,B=d==null?0:d.length;if(B===0)return 0;g=x(g);for(var q=g!==g,Z=g===null,ce=qr(g),xe=g===n;k<B;){var we=Nh((k+B)/2),Re=x(d[we]),je=Re!==n,Ye=Re===null,et=Re===Re,yt=qr(Re);if(q)var tt=P||et;else xe?tt=et&&(P||je):Z?tt=et&&je&&(P||!Ye):ce?tt=et&&je&&!Ye&&(P||!yt):Ye||yt?tt=!1:tt=P?Re<=g:Re<g;tt?k=we+1:B=we}return rr(B,U)}function gE(d,g){for(var x=-1,P=d.length,k=0,B=[];++x<P;){var q=d[x],Z=g?g(q):q;if(!x||!Vo(Z,ce)){var ce=Z;B[k++]=q===0?0:q}}return B}function mE(d){return typeof d=="number"?d:qr(d)?$:+d}function Ur(d){if(typeof d=="string")return d;if(ut(d))return yn(d,Ur)+"";if(qr(d))return YC?YC.call(d):"";var g=d+"";return g=="0"&&1/d==-Y?"-0":g}function Rs(d,g,x){var P=-1,k=Sh,B=d.length,q=!0,Z=[],ce=Z;if(x)q=!1,k=Gv;else if(B>=o){var xe=g?null:f9(d);if(xe)return Eh(xe);q=!1,k=Ou,ce=new Ea}else ce=g?[]:Z;e:for(;++P<B;){var we=d[P],Re=g?g(we):we;if(we=x||we!==0?we:0,q&&Re===Re){for(var je=ce.length;je--;)if(ce[je]===Re)continue e;g&&ce.push(Re),Z.push(we)}else k(ce,Re,x)||(ce!==Z&&ce.push(Re),Z.push(we))}return Z}function yb(d,g){return g=Ps(g,d),d=WE(d,g),d==null||delete d[li(Co(g))]}function vE(d,g,x,P){return Fu(d,g,x(Pa(d,g)),P)}function Uh(d,g,x,P){for(var k=d.length,B=P?k:-1;(P?B--:++B<k)&&g(d[B],B,d););return x?So(d,P?0:B,P?B+1:k):So(d,P?B+1:0,P?k:B)}function bE(d,g){var x=d;return x instanceof kt&&(x=x.value()),Yv(g,function(P,k){return k.func.apply(k.thisArg,_s([P],k.args))},x)}function xb(d,g,x){var P=d.length;if(P<2)return P?Rs(d[0]):[];for(var k=-1,B=ge(P);++k<P;)for(var q=d[k],Z=-1;++Z<P;)Z!=k&&(B[k]=Iu(B[k]||q,d[Z],g,x));return Rs(Yn(B,1),g,x)}function yE(d,g,x){for(var P=-1,k=d.length,B=g.length,q={};++P<k;){var Z=P<B?g[P]:n;x(q,d[P],Z)}return q}function wb(d){return $n(d)?d:[]}function _b(d){return typeof d=="function"?d:$r}function Ps(d,g){return ut(d)?d:Db(d,g)?[d]:YE(Ut(d))}var n9=St;function Os(d,g,x){var P=d.length;return x=x===n?P:x,!g&&x>=P?d:So(d,g,x)}var xE=H7||function(d){return Gn.clearTimeout(d)};function wE(d,g){if(g)return d.slice();var x=d.length,P=VC?VC(x):new d.constructor(x);return d.copy(P),P}function Sb(d){var g=new d.constructor(d.byteLength);return new Dh(g).set(new Dh(d)),g}function r9(d,g){var x=g?Sb(d.buffer):d.buffer;return new d.constructor(x,d.byteOffset,d.byteLength)}function o9(d){var g=new d.constructor(d.source,qe.exec(d));return g.lastIndex=d.lastIndex,g}function i9(d){return ku?nn(ku.call(d)):{}}function _E(d,g){var x=g?Sb(d.buffer):d.buffer;return new d.constructor(x,d.byteOffset,d.length)}function SE(d,g){if(d!==g){var x=d!==n,P=d===null,k=d===d,B=qr(d),q=g!==n,Z=g===null,ce=g===g,xe=qr(g);if(!Z&&!xe&&!B&&d>g||B&&q&&ce&&!Z&&!xe||P&&q&&ce||!x&&ce||!k)return 1;if(!P&&!B&&!xe&&d<g||xe&&x&&k&&!P&&!B||Z&&x&&k||!q&&k||!ce)return-1}return 0}function s9(d,g,x){for(var P=-1,k=d.criteria,B=g.criteria,q=k.length,Z=x.length;++P<q;){var ce=SE(k[P],B[P]);if(ce){if(P>=Z)return ce;var xe=x[P];return ce*(xe=="desc"?-1:1)}}return d.index-g.index}function CE(d,g,x,P){for(var k=-1,B=d.length,q=x.length,Z=-1,ce=g.length,xe=In(B-q,0),we=ge(ce+xe),Re=!P;++Z<ce;)we[Z]=g[Z];for(;++k<q;)(Re||k<B)&&(we[x[k]]=d[k]);for(;xe--;)we[Z++]=d[k++];return we}function EE(d,g,x,P){for(var k=-1,B=d.length,q=-1,Z=x.length,ce=-1,xe=g.length,we=In(B-Z,0),Re=ge(we+xe),je=!P;++k<we;)Re[k]=d[k];for(var Ye=k;++ce<xe;)Re[Ye+ce]=g[ce];for(;++q<Z;)(je||k<B)&&(Re[Ye+x[q]]=d[k++]);return Re}function Rr(d,g){var x=-1,P=d.length;for(g||(g=ge(P));++x<P;)g[x]=d[x];return g}function ai(d,g,x,P){var k=!x;x||(x={});for(var B=-1,q=g.length;++B<q;){var Z=g[B],ce=P?P(x[Z],d[Z],Z,x,d):n;ce===n&&(ce=d[Z]),k?Fi(x,Z,ce):Mu(x,Z,ce)}return x}function a9(d,g){return ai(d,Tb(d),g)}function l9(d,g){return ai(d,FE(d),g)}function qh(d,g){return function(x,P){var k=ut(x)?h7:T6,B=g?g():{};return k(x,d,Je(P,2),B)}}function Kl(d){return St(function(g,x){var P=-1,k=x.length,B=k>1?x[k-1]:n,q=k>2?x[2]:n;for(B=d.length>3&&typeof B=="function"?(k--,B):n,q&&hr(x[0],x[1],q)&&(B=k<3?n:B,k=1),g=nn(g);++P<k;){var Z=x[P];Z&&d(g,Z,P,B)}return g})}function RE(d,g){return function(x,P){if(x==null)return x;if(!Pr(x))return d(x,P);for(var k=x.length,B=g?k:-1,q=nn(x);(g?B--:++B<k)&&P(q[B],B,q)!==!1;);return x}}function PE(d){return function(g,x,P){for(var k=-1,B=nn(g),q=P(g),Z=q.length;Z--;){var ce=q[d?Z:++k];if(x(B[ce],ce,B)===!1)break}return g}}function c9(d,g,x){var P=g&w,k=ju(d);function B(){var q=this&&this!==Gn&&this instanceof B?k:d;return q.apply(P?x:this,arguments)}return B}function OE(d){return function(g){g=Ut(g);var x=Vl(g)?zo(g):n,P=x?x[0]:g.charAt(0),k=x?Os(x,1).join(""):g.slice(1);return P[d]()+k}}function Xl(d){return function(g){return Yv(RR(ER(g).replace(ZF,"")),d,"")}}function ju(d){return function(){var g=arguments;switch(g.length){case 0:return new d;case 1:return new d(g[0]);case 2:return new d(g[0],g[1]);case 3:return new d(g[0],g[1],g[2]);case 4:return new d(g[0],g[1],g[2],g[3]);case 5:return new d(g[0],g[1],g[2],g[3],g[4]);case 6:return new d(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new d(g[0],g[1],g[2],g[3],g[4],g[5],g[6])}var x=Yl(d.prototype),P=d.apply(x,g);return wn(P)?P:x}}function u9(d,g,x){var P=ju(d);function k(){for(var B=arguments.length,q=ge(B),Z=B,ce=Ql(k);Z--;)q[Z]=arguments[Z];var xe=B<3&&q[0]!==ce&&q[B-1]!==ce?[]:Ss(q,ce);if(B-=xe.length,B<x)return kE(d,g,Gh,k.placeholder,n,q,xe,n,n,x-B);var we=this&&this!==Gn&&this instanceof k?P:d;return Hr(we,this,q)}return k}function $E(d){return function(g,x,P){var k=nn(g);if(!Pr(g)){var B=Je(x,3);g=Hn(g),x=function(Z){return B(k[Z],Z,k)}}var q=d(g,x,P);return q>-1?k[B?g[q]:q]:n}}function TE(d){return zi(function(g){var x=g.length,P=x,k=wo.prototype.thru;for(d&&g.reverse();P--;){var B=g[P];if(typeof B!="function")throw new xo(s);if(k&&!q&&Qh(B)=="wrapper")var q=new wo([],!0)}for(P=q?P:x;++P<x;){B=g[P];var Z=Qh(B),ce=Z=="wrapper"?Ob(B):n;ce&&Ab(ce[0])&&ce[1]==(T|S|E|N)&&!ce[4].length&&ce[9]==1?q=q[Qh(ce[0])].apply(q,ce[3]):q=B.length==1&&Ab(B)?q[Z]():q.thru(B)}return function(){var xe=arguments,we=xe[0];if(q&&xe.length==1&&ut(we))return q.plant(we).value();for(var Re=0,je=x?g[Re].apply(this,xe):we;++Re<x;)je=g[Re].call(this,je);return je}})}function Gh(d,g,x,P,k,B,q,Z,ce,xe){var we=g&T,Re=g&w,je=g&y,Ye=g&(S|C),et=g&M,yt=je?n:ju(d);function tt(){for(var Ot=arguments.length,Mt=ge(Ot),Gr=Ot;Gr--;)Mt[Gr]=arguments[Gr];if(Ye)var pr=Ql(tt),Yr=_7(Mt,pr);if(P&&(Mt=CE(Mt,P,k,Ye)),B&&(Mt=EE(Mt,B,q,Ye)),Ot-=Yr,Ye&&Ot<xe){var Tn=Ss(Mt,pr);return kE(d,g,Gh,tt.placeholder,x,Mt,Tn,Z,ce,xe-Ot)}var Ho=Re?x:this,Wi=je?Ho[d]:d;return Ot=Mt.length,Z?Mt=T9(Mt,Z):et&&Ot>1&&Mt.reverse(),we&&ce<Ot&&(Mt.length=ce),this&&this!==Gn&&this instanceof tt&&(Wi=yt||ju(Wi)),Wi.apply(Ho,Mt)}return tt}function DE(d,g){return function(x,P){return F6(x,d,g(P),{})}}function Yh(d,g){return function(x,P){var k;if(x===n&&P===n)return g;if(x!==n&&(k=x),P!==n){if(k===n)return P;typeof x=="string"||typeof P=="string"?(x=Ur(x),P=Ur(P)):(x=mE(x),P=mE(P)),k=d(x,P)}return k}}function Cb(d){return zi(function(g){return g=yn(g,Wr(Je())),St(function(x){var P=this;return d(g,function(k){return Hr(k,P,x)})})})}function Kh(d,g){g=g===n?" ":Ur(g);var x=g.length;if(x<2)return x?vb(g,d):g;var P=vb(g,Ih(d/Hl(g)));return Vl(g)?Os(zo(P),0,d).join(""):P.slice(0,d)}function d9(d,g,x,P){var k=g&w,B=ju(d);function q(){for(var Z=-1,ce=arguments.length,xe=-1,we=P.length,Re=ge(we+ce),je=this&&this!==Gn&&this instanceof q?B:d;++xe<we;)Re[xe]=P[xe];for(;ce--;)Re[xe++]=arguments[++Z];return Hr(je,k?x:this,Re)}return q}function AE(d){return function(g,x,P){return P&&typeof P!="number"&&hr(g,x,P)&&(x=P=n),g=Hi(g),x===n?(x=g,g=0):x=Hi(x),P=P===n?g<x?1:-1:Hi(P),X6(g,x,P,d)}}function Xh(d){return function(g,x){return typeof g=="string"&&typeof x=="string"||(g=Eo(g),x=Eo(x)),d(g,x)}}function kE(d,g,x,P,k,B,q,Z,ce,xe){var we=g&S,Re=we?q:n,je=we?n:q,Ye=we?B:n,et=we?n:B;g|=we?E:O,g&=~(we?O:E),g&_||(g&=~(w|y));var yt=[d,g,k,Ye,Re,et,je,Z,ce,xe],tt=x.apply(n,yt);return Ab(d)&&UE(tt,yt),tt.placeholder=P,qE(tt,d,g)}function Eb(d){var g=Mn[d];return function(x,P){if(x=Eo(x),P=P==null?0:rr(pt(P),292),P&&qC(x)){var k=(Ut(x)+"e").split("e"),B=g(k[0]+"e"+(+k[1]+P));return k=(Ut(B)+"e").split("e"),+(k[0]+"e"+(+k[1]-P))}return g(x)}}var f9=ql&&1/Eh(new ql([,-0]))[1]==Y?function(d){return new ql(d)}:Gb;function ME(d){return function(g){var x=or(g);return x==Se?tb(g):x==lt?$7(g):w7(g,d(g))}}function ji(d,g,x,P,k,B,q,Z){var ce=g&y;if(!ce&&typeof d!="function")throw new xo(s);var xe=P?P.length:0;if(xe||(g&=~(E|O),P=k=n),q=q===n?q:In(pt(q),0),Z=Z===n?Z:pt(Z),xe-=k?k.length:0,g&O){var we=P,Re=k;P=k=n}var je=ce?n:Ob(d),Ye=[d,g,x,P,k,we,Re,B,q,Z];if(je&&P9(Ye,je),d=Ye[0],g=Ye[1],x=Ye[2],P=Ye[3],k=Ye[4],Z=Ye[9]=Ye[9]===n?ce?0:d.length:In(Ye[9]-xe,0),!Z&&g&(S|C)&&(g&=~(S|C)),!g||g==w)var et=c9(d,g,x);else g==S||g==C?et=u9(d,g,Z):(g==E||g==(w|E))&&!k.length?et=d9(d,g,x,P):et=Gh.apply(n,Ye);var yt=je?pE:UE;return qE(yt(et,Ye),d,g)}function IE(d,g,x,P){return d===n||Vo(d,Ul[x])&&!Qt.call(P,x)?g:d}function NE(d,g,x,P,k,B){return wn(d)&&wn(g)&&(B.set(g,d),Hh(d,g,n,NE,B),B.delete(g)),d}function h9(d){return Vu(d)?n:d}function LE(d,g,x,P,k,B){var q=x&b,Z=d.length,ce=g.length;if(Z!=ce&&!(q&&ce>Z))return!1;var xe=B.get(d),we=B.get(g);if(xe&&we)return xe==g&&we==d;var Re=-1,je=!0,Ye=x&v?new Ea:n;for(B.set(d,g),B.set(g,d);++Re<Z;){var et=d[Re],yt=g[Re];if(P)var tt=q?P(yt,et,Re,g,d,B):P(et,yt,Re,d,g,B);if(tt!==n){if(tt)continue;je=!1;break}if(Ye){if(!Kv(g,function(Ot,Mt){if(!Ou(Ye,Mt)&&(et===Ot||k(et,Ot,x,P,B)))return Ye.push(Mt)})){je=!1;break}}else if(!(et===yt||k(et,yt,x,P,B))){je=!1;break}}return B.delete(d),B.delete(g),je}function p9(d,g,x,P,k,B,q){switch(x){case Ge:if(d.byteLength!=g.byteLength||d.byteOffset!=g.byteOffset)return!1;d=d.buffer,g=g.buffer;case Le:return!(d.byteLength!=g.byteLength||!B(new Dh(d),new Dh(g)));case ie:case oe:case Oe:return Vo(+d,+g);case ye:return d.name==g.name&&d.message==g.message;case Ke:case It:return d==g+"";case Se:var Z=tb;case lt:var ce=P&b;if(Z||(Z=Eh),d.size!=g.size&&!ce)return!1;var xe=q.get(d);if(xe)return xe==g;P|=v,q.set(d,g);var we=LE(Z(d),Z(g),P,k,B,q);return q.delete(d),we;case Dt:if(ku)return ku.call(d)==ku.call(g)}return!1}function g9(d,g,x,P,k,B){var q=x&b,Z=Rb(d),ce=Z.length,xe=Rb(g),we=xe.length;if(ce!=we&&!q)return!1;for(var Re=ce;Re--;){var je=Z[Re];if(!(q?je in g:Qt.call(g,je)))return!1}var Ye=B.get(d),et=B.get(g);if(Ye&&et)return Ye==g&&et==d;var yt=!0;B.set(d,g),B.set(g,d);for(var tt=q;++Re<ce;){je=Z[Re];var Ot=d[je],Mt=g[je];if(P)var Gr=q?P(Mt,Ot,je,g,d,B):P(Ot,Mt,je,d,g,B);if(!(Gr===n?Ot===Mt||k(Ot,Mt,x,P,B):Gr)){yt=!1;break}tt||(tt=je=="constructor")}if(yt&&!tt){var pr=d.constructor,Yr=g.constructor;pr!=Yr&&"constructor"in d&&"constructor"in g&&!(typeof pr=="function"&&pr instanceof pr&&typeof Yr=="function"&&Yr instanceof Yr)&&(yt=!1)}return B.delete(d),B.delete(g),yt}function zi(d){return Mb(HE(d,n,JE),d+"")}function Rb(d){return rE(d,Hn,Tb)}function Pb(d){return rE(d,Or,FE)}var Ob=Lh?function(d){return Lh.get(d)}:Gb;function Qh(d){for(var g=d.name+"",x=Gl[g],P=Qt.call(Gl,g)?x.length:0;P--;){var k=x[P],B=k.func;if(B==null||B==d)return k.name}return g}function Ql(d){var g=Qt.call(j,"placeholder")?j:d;return g.placeholder}function Je(){var d=j.iteratee||Ub;return d=d===Ub?sE:d,arguments.length?d(arguments[0],arguments[1]):d}function Jh(d,g){var x=d.__data__;return S9(g)?x[typeof g=="string"?"string":"hash"]:x.map}function $b(d){for(var g=Hn(d),x=g.length;x--;){var P=g[x],k=d[P];g[x]=[P,k,BE(k)]}return g}function Oa(d,g){var x=R7(d,g);return iE(x)?x:n}function m9(d){var g=Qt.call(d,Sa),x=d[Sa];try{d[Sa]=n;var P=!0}catch{}var k=$h.call(d);return P&&(g?d[Sa]=x:delete d[Sa]),k}var Tb=rb?function(d){return d==null?[]:(d=nn(d),ws(rb(d),function(g){return WC.call(d,g)}))}:Yb,FE=rb?function(d){for(var g=[];d;)_s(g,Tb(d)),d=Ah(d);return g}:Yb,or=fr;(ob&&or(new ob(new ArrayBuffer(1)))!=Ge||Tu&&or(new Tu)!=Se||ib&&or(ib.resolve())!=Be||ql&&or(new ql)!=lt||Du&&or(new Du)!=pe)&&(or=function(d){var g=fr(d),x=g==Ue?d.constructor:n,P=x?$a(x):"";if(P)switch(P){case J7:return Ge;case Z7:return Se;case e6:return Be;case t6:return lt;case n6:return pe}return g});function v9(d,g,x){for(var P=-1,k=x.length;++P<k;){var B=x[P],q=B.size;switch(B.type){case"drop":d+=q;break;case"dropRight":g-=q;break;case"take":g=rr(g,d+q);break;case"takeRight":d=In(d,g-q);break}}return{start:d,end:g}}function b9(d){var g=d.match(xs);return g?g[1].split(D):[]}function jE(d,g,x){g=Ps(g,d);for(var P=-1,k=g.length,B=!1;++P<k;){var q=li(g[P]);if(!(B=d!=null&&x(d,q)))break;d=d[q]}return B||++P!=k?B:(k=d==null?0:d.length,!!k&&ip(k)&&Bi(q,k)&&(ut(d)||Ta(d)))}function y9(d){var g=d.length,x=new d.constructor(g);return g&&typeof d[0]=="string"&&Qt.call(d,"index")&&(x.index=d.index,x.input=d.input),x}function zE(d){return typeof d.constructor=="function"&&!zu(d)?Yl(Ah(d)):{}}function x9(d,g,x){var P=d.constructor;switch(g){case Le:return Sb(d);case ie:case oe:return new P(+d);case Ge:return r9(d,x);case Ze:case Wt:case Zt:case Kt:case vn:case ln:case Lt:case tn:case xn:return _E(d,x);case Se:return new P;case Oe:case It:return new P(d);case Ke:return o9(d);case lt:return new P;case Dt:return i9(d)}}function w9(d,g){var x=g.length;if(!x)return d;var P=x-1;return g[P]=(x>1?"& ":"")+g[P],g=g.join(x>2?", ":" "),d.replace(ys,`{
|
|
70
|
-
/* [wrapped with `+g+`] */
|
|
71
|
-
`)}function _9(d){return ut(d)||Ta(d)||!!(UC&&d&&d[UC])}function Bi(d,g){var x=typeof d;return g=g??J,!!g&&(x=="number"||x!="symbol"&&me.test(d))&&d>-1&&d%1==0&&d<g}function hr(d,g,x){if(!wn(x))return!1;var P=typeof g;return(P=="number"?Pr(x)&&Bi(g,x.length):P=="string"&&g in x)?Vo(x[g],d):!1}function Db(d,g){if(ut(d))return!1;var x=typeof d;return x=="number"||x=="symbol"||x=="boolean"||d==null||qr(d)?!0:Mi.test(d)||!ri.test(d)||g!=null&&d in nn(g)}function S9(d){var g=typeof d;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?d!=="__proto__":d===null}function Ab(d){var g=Qh(d),x=j[g];if(typeof x!="function"||!(g in kt.prototype))return!1;if(d===x)return!0;var P=Ob(x);return!!P&&d===P[0]}function C9(d){return!!BC&&BC in d}var E9=Ph?Vi:Kb;function zu(d){var g=d&&d.constructor,x=typeof g=="function"&&g.prototype||Ul;return d===x}function BE(d){return d===d&&!wn(d)}function VE(d,g){return function(x){return x==null?!1:x[d]===g&&(g!==n||d in nn(x))}}function R9(d){var g=rp(d,function(P){return x.size===c&&x.clear(),P}),x=g.cache;return g}function P9(d,g){var x=d[1],P=g[1],k=x|P,B=k<(w|y|T),q=P==T&&x==S||P==T&&x==N&&d[7].length<=g[8]||P==(T|N)&&g[7].length<=g[8]&&x==S;if(!(B||q))return d;P&w&&(d[2]=g[2],k|=x&w?0:_);var Z=g[3];if(Z){var ce=d[3];d[3]=ce?CE(ce,Z,g[4]):Z,d[4]=ce?Ss(d[3],u):g[4]}return Z=g[5],Z&&(ce=d[5],d[5]=ce?EE(ce,Z,g[6]):Z,d[6]=ce?Ss(d[5],u):g[6]),Z=g[7],Z&&(d[7]=Z),P&T&&(d[8]=d[8]==null?g[8]:rr(d[8],g[8])),d[9]==null&&(d[9]=g[9]),d[0]=g[0],d[1]=k,d}function O9(d){var g=[];if(d!=null)for(var x in nn(d))g.push(x);return g}function $9(d){return $h.call(d)}function HE(d,g,x){return g=In(g===n?d.length-1:g,0),function(){for(var P=arguments,k=-1,B=In(P.length-g,0),q=ge(B);++k<B;)q[k]=P[g+k];k=-1;for(var Z=ge(g+1);++k<g;)Z[k]=P[k];return Z[g]=x(q),Hr(d,this,Z)}}function WE(d,g){return g.length<2?d:Pa(d,So(g,0,-1))}function T9(d,g){for(var x=d.length,P=rr(g.length,x),k=Rr(d);P--;){var B=g[P];d[P]=Bi(B,x)?k[B]:n}return d}function kb(d,g){if(!(g==="constructor"&&typeof d[g]=="function")&&g!="__proto__")return d[g]}var UE=GE(pE),Bu=U7||function(d,g){return Gn.setTimeout(d,g)},Mb=GE(Z6);function qE(d,g,x){var P=g+"";return Mb(d,w9(P,D9(b9(P),x)))}function GE(d){var g=0,x=0;return function(){var P=K7(),k=X-(P-x);if(x=P,k>0){if(++g>=z)return arguments[0]}else g=0;return d.apply(n,arguments)}}function Zh(d,g){var x=-1,P=d.length,k=P-1;for(g=g===n?P:g;++x<g;){var B=mb(x,k),q=d[B];d[B]=d[x],d[x]=q}return d.length=g,d}var YE=R9(function(d){var g=[];return d.charCodeAt(0)===46&&g.push(""),d.replace(bs,function(x,P,k,B){g.push(k?B.replace(Pe,"$1"):P||x)}),g});function li(d){if(typeof d=="string"||qr(d))return d;var g=d+"";return g=="0"&&1/d==-Y?"-0":g}function $a(d){if(d!=null){try{return Oh.call(d)}catch{}try{return d+""}catch{}}return""}function D9(d,g){return yo(te,function(x){var P="_."+x[0];g&x[1]&&!Sh(d,P)&&d.push(P)}),d.sort()}function KE(d){if(d instanceof kt)return d.clone();var g=new wo(d.__wrapped__,d.__chain__);return g.__actions__=Rr(d.__actions__),g.__index__=d.__index__,g.__values__=d.__values__,g}function A9(d,g,x){(x?hr(d,g,x):g===n)?g=1:g=In(pt(g),0);var P=d==null?0:d.length;if(!P||g<1)return[];for(var k=0,B=0,q=ge(Ih(P/g));k<P;)q[B++]=So(d,k,k+=g);return q}function k9(d){for(var g=-1,x=d==null?0:d.length,P=0,k=[];++g<x;){var B=d[g];B&&(k[P++]=B)}return k}function M9(){var d=arguments.length;if(!d)return[];for(var g=ge(d-1),x=arguments[0],P=d;P--;)g[P-1]=arguments[P];return _s(ut(x)?Rr(x):[x],Yn(g,1))}var I9=St(function(d,g){return $n(d)?Iu(d,Yn(g,1,$n,!0)):[]}),N9=St(function(d,g){var x=Co(g);return $n(x)&&(x=n),$n(d)?Iu(d,Yn(g,1,$n,!0),Je(x,2)):[]}),L9=St(function(d,g){var x=Co(g);return $n(x)&&(x=n),$n(d)?Iu(d,Yn(g,1,$n,!0),n,x):[]});function F9(d,g,x){var P=d==null?0:d.length;return P?(g=x||g===n?1:pt(g),So(d,g<0?0:g,P)):[]}function j9(d,g,x){var P=d==null?0:d.length;return P?(g=x||g===n?1:pt(g),g=P-g,So(d,0,g<0?0:g)):[]}function z9(d,g){return d&&d.length?Uh(d,Je(g,3),!0,!0):[]}function B9(d,g){return d&&d.length?Uh(d,Je(g,3),!0):[]}function V9(d,g,x,P){var k=d==null?0:d.length;return k?(x&&typeof x!="number"&&hr(d,g,x)&&(x=0,P=k),M6(d,g,x,P)):[]}function XE(d,g,x){var P=d==null?0:d.length;if(!P)return-1;var k=x==null?0:pt(x);return k<0&&(k=In(P+k,0)),Ch(d,Je(g,3),k)}function QE(d,g,x){var P=d==null?0:d.length;if(!P)return-1;var k=P-1;return x!==n&&(k=pt(x),k=x<0?In(P+k,0):rr(k,P-1)),Ch(d,Je(g,3),k,!0)}function JE(d){var g=d==null?0:d.length;return g?Yn(d,1):[]}function H9(d){var g=d==null?0:d.length;return g?Yn(d,Y):[]}function W9(d,g){var x=d==null?0:d.length;return x?(g=g===n?1:pt(g),Yn(d,g)):[]}function U9(d){for(var g=-1,x=d==null?0:d.length,P={};++g<x;){var k=d[g];P[k[0]]=k[1]}return P}function ZE(d){return d&&d.length?d[0]:n}function q9(d,g,x){var P=d==null?0:d.length;if(!P)return-1;var k=x==null?0:pt(x);return k<0&&(k=In(P+k,0)),Bl(d,g,k)}function G9(d){var g=d==null?0:d.length;return g?So(d,0,-1):[]}var Y9=St(function(d){var g=yn(d,wb);return g.length&&g[0]===d[0]?db(g):[]}),K9=St(function(d){var g=Co(d),x=yn(d,wb);return g===Co(x)?g=n:x.pop(),x.length&&x[0]===d[0]?db(x,Je(g,2)):[]}),X9=St(function(d){var g=Co(d),x=yn(d,wb);return g=typeof g=="function"?g:n,g&&x.pop(),x.length&&x[0]===d[0]?db(x,n,g):[]});function Q9(d,g){return d==null?"":G7.call(d,g)}function Co(d){var g=d==null?0:d.length;return g?d[g-1]:n}function J9(d,g,x){var P=d==null?0:d.length;if(!P)return-1;var k=P;return x!==n&&(k=pt(x),k=k<0?In(P+k,0):rr(k,P-1)),g===g?D7(d,g,k):Ch(d,kC,k,!0)}function Z9(d,g){return d&&d.length?uE(d,pt(g)):n}var e4=St(eR);function eR(d,g){return d&&d.length&&g&&g.length?gb(d,g):d}function t4(d,g,x){return d&&d.length&&g&&g.length?gb(d,g,Je(x,2)):d}function n4(d,g,x){return d&&d.length&&g&&g.length?gb(d,g,n,x):d}var r4=zi(function(d,g){var x=d==null?0:d.length,P=ab(d,g);return hE(d,yn(g,function(k){return Bi(k,x)?+k:k}).sort(SE)),P});function o4(d,g){var x=[];if(!(d&&d.length))return x;var P=-1,k=[],B=d.length;for(g=Je(g,3);++P<B;){var q=d[P];g(q,P,d)&&(x.push(q),k.push(P))}return hE(d,k),x}function Ib(d){return d==null?d:Q7.call(d)}function i4(d,g,x){var P=d==null?0:d.length;return P?(x&&typeof x!="number"&&hr(d,g,x)?(g=0,x=P):(g=g==null?0:pt(g),x=x===n?P:pt(x)),So(d,g,x)):[]}function s4(d,g){return Wh(d,g)}function a4(d,g,x){return bb(d,g,Je(x,2))}function l4(d,g){var x=d==null?0:d.length;if(x){var P=Wh(d,g);if(P<x&&Vo(d[P],g))return P}return-1}function c4(d,g){return Wh(d,g,!0)}function u4(d,g,x){return bb(d,g,Je(x,2),!0)}function d4(d,g){var x=d==null?0:d.length;if(x){var P=Wh(d,g,!0)-1;if(Vo(d[P],g))return P}return-1}function f4(d){return d&&d.length?gE(d):[]}function h4(d,g){return d&&d.length?gE(d,Je(g,2)):[]}function p4(d){var g=d==null?0:d.length;return g?So(d,1,g):[]}function g4(d,g,x){return d&&d.length?(g=x||g===n?1:pt(g),So(d,0,g<0?0:g)):[]}function m4(d,g,x){var P=d==null?0:d.length;return P?(g=x||g===n?1:pt(g),g=P-g,So(d,g<0?0:g,P)):[]}function v4(d,g){return d&&d.length?Uh(d,Je(g,3),!1,!0):[]}function b4(d,g){return d&&d.length?Uh(d,Je(g,3)):[]}var y4=St(function(d){return Rs(Yn(d,1,$n,!0))}),x4=St(function(d){var g=Co(d);return $n(g)&&(g=n),Rs(Yn(d,1,$n,!0),Je(g,2))}),w4=St(function(d){var g=Co(d);return g=typeof g=="function"?g:n,Rs(Yn(d,1,$n,!0),n,g)});function _4(d){return d&&d.length?Rs(d):[]}function S4(d,g){return d&&d.length?Rs(d,Je(g,2)):[]}function C4(d,g){return g=typeof g=="function"?g:n,d&&d.length?Rs(d,n,g):[]}function Nb(d){if(!(d&&d.length))return[];var g=0;return d=ws(d,function(x){if($n(x))return g=In(x.length,g),!0}),Zv(g,function(x){return yn(d,Xv(x))})}function tR(d,g){if(!(d&&d.length))return[];var x=Nb(d);return g==null?x:yn(x,function(P){return Hr(g,n,P)})}var E4=St(function(d,g){return $n(d)?Iu(d,g):[]}),R4=St(function(d){return xb(ws(d,$n))}),P4=St(function(d){var g=Co(d);return $n(g)&&(g=n),xb(ws(d,$n),Je(g,2))}),O4=St(function(d){var g=Co(d);return g=typeof g=="function"?g:n,xb(ws(d,$n),n,g)}),$4=St(Nb);function T4(d,g){return yE(d||[],g||[],Mu)}function D4(d,g){return yE(d||[],g||[],Fu)}var A4=St(function(d){var g=d.length,x=g>1?d[g-1]:n;return x=typeof x=="function"?(d.pop(),x):n,tR(d,x)});function nR(d){var g=j(d);return g.__chain__=!0,g}function k4(d,g){return g(d),d}function ep(d,g){return g(d)}var M4=zi(function(d){var g=d.length,x=g?d[0]:0,P=this.__wrapped__,k=function(B){return ab(B,d)};return g>1||this.__actions__.length||!(P instanceof kt)||!Bi(x)?this.thru(k):(P=P.slice(x,+x+(g?1:0)),P.__actions__.push({func:ep,args:[k],thisArg:n}),new wo(P,this.__chain__).thru(function(B){return g&&!B.length&&B.push(n),B}))});function I4(){return nR(this)}function N4(){return new wo(this.value(),this.__chain__)}function L4(){this.__values__===n&&(this.__values__=mR(this.value()));var d=this.__index__>=this.__values__.length,g=d?n:this.__values__[this.__index__++];return{done:d,value:g}}function F4(){return this}function j4(d){for(var g,x=this;x instanceof jh;){var P=KE(x);P.__index__=0,P.__values__=n,g?k.__wrapped__=P:g=P;var k=P;x=x.__wrapped__}return k.__wrapped__=d,g}function z4(){var d=this.__wrapped__;if(d instanceof kt){var g=d;return this.__actions__.length&&(g=new kt(this)),g=g.reverse(),g.__actions__.push({func:ep,args:[Ib],thisArg:n}),new wo(g,this.__chain__)}return this.thru(Ib)}function B4(){return bE(this.__wrapped__,this.__actions__)}var V4=qh(function(d,g,x){Qt.call(d,x)?++d[x]:Fi(d,x,1)});function H4(d,g,x){var P=ut(d)?DC:k6;return x&&hr(d,g,x)&&(g=n),P(d,Je(g,3))}function W4(d,g){var x=ut(d)?ws:tE;return x(d,Je(g,3))}var U4=$E(XE),q4=$E(QE);function G4(d,g){return Yn(tp(d,g),1)}function Y4(d,g){return Yn(tp(d,g),Y)}function K4(d,g,x){return x=x===n?1:pt(x),Yn(tp(d,g),x)}function rR(d,g){var x=ut(d)?yo:Es;return x(d,Je(g,3))}function oR(d,g){var x=ut(d)?p7:eE;return x(d,Je(g,3))}var X4=qh(function(d,g,x){Qt.call(d,x)?d[x].push(g):Fi(d,x,[g])});function Q4(d,g,x,P){d=Pr(d)?d:Zl(d),x=x&&!P?pt(x):0;var k=d.length;return x<0&&(x=In(k+x,0)),sp(d)?x<=k&&d.indexOf(g,x)>-1:!!k&&Bl(d,g,x)>-1}var J4=St(function(d,g,x){var P=-1,k=typeof g=="function",B=Pr(d)?ge(d.length):[];return Es(d,function(q){B[++P]=k?Hr(g,q,x):Nu(q,g,x)}),B}),Z4=qh(function(d,g,x){Fi(d,x,g)});function tp(d,g){var x=ut(d)?yn:aE;return x(d,Je(g,3))}function e8(d,g,x,P){return d==null?[]:(ut(g)||(g=g==null?[]:[g]),x=P?n:x,ut(x)||(x=x==null?[]:[x]),dE(d,g,x))}var t8=qh(function(d,g,x){d[x?0:1].push(g)},function(){return[[],[]]});function n8(d,g,x){var P=ut(d)?Yv:IC,k=arguments.length<3;return P(d,Je(g,4),x,k,Es)}function r8(d,g,x){var P=ut(d)?g7:IC,k=arguments.length<3;return P(d,Je(g,4),x,k,eE)}function o8(d,g){var x=ut(d)?ws:tE;return x(d,op(Je(g,3)))}function i8(d){var g=ut(d)?XC:Q6;return g(d)}function s8(d,g,x){(x?hr(d,g,x):g===n)?g=1:g=pt(g);var P=ut(d)?O6:J6;return P(d,g)}function a8(d){var g=ut(d)?$6:e9;return g(d)}function l8(d){if(d==null)return 0;if(Pr(d))return sp(d)?Hl(d):d.length;var g=or(d);return g==Se||g==lt?d.size:hb(d).length}function c8(d,g,x){var P=ut(d)?Kv:t9;return x&&hr(d,g,x)&&(g=n),P(d,Je(g,3))}var u8=St(function(d,g){if(d==null)return[];var x=g.length;return x>1&&hr(d,g[0],g[1])?g=[]:x>2&&hr(g[0],g[1],g[2])&&(g=[g[0]]),dE(d,Yn(g,1),[])}),np=W7||function(){return Gn.Date.now()};function d8(d,g){if(typeof g!="function")throw new xo(s);return d=pt(d),function(){if(--d<1)return g.apply(this,arguments)}}function iR(d,g,x){return g=x?n:g,g=d&&g==null?d.length:g,ji(d,T,n,n,n,n,g)}function sR(d,g){var x;if(typeof g!="function")throw new xo(s);return d=pt(d),function(){return--d>0&&(x=g.apply(this,arguments)),d<=1&&(g=n),x}}var Lb=St(function(d,g,x){var P=w;if(x.length){var k=Ss(x,Ql(Lb));P|=E}return ji(d,P,g,x,k)}),aR=St(function(d,g,x){var P=w|y;if(x.length){var k=Ss(x,Ql(aR));P|=E}return ji(g,P,d,x,k)});function lR(d,g,x){g=x?n:g;var P=ji(d,S,n,n,n,n,n,g);return P.placeholder=lR.placeholder,P}function cR(d,g,x){g=x?n:g;var P=ji(d,C,n,n,n,n,n,g);return P.placeholder=cR.placeholder,P}function uR(d,g,x){var P,k,B,q,Z,ce,xe=0,we=!1,Re=!1,je=!0;if(typeof d!="function")throw new xo(s);g=Eo(g)||0,wn(x)&&(we=!!x.leading,Re="maxWait"in x,B=Re?In(Eo(x.maxWait)||0,g):B,je="trailing"in x?!!x.trailing:je);function Ye(Tn){var Ho=P,Wi=k;return P=k=n,xe=Tn,q=d.apply(Wi,Ho),q}function et(Tn){return xe=Tn,Z=Bu(Ot,g),we?Ye(Tn):q}function yt(Tn){var Ho=Tn-ce,Wi=Tn-xe,$R=g-Ho;return Re?rr($R,B-Wi):$R}function tt(Tn){var Ho=Tn-ce,Wi=Tn-xe;return ce===n||Ho>=g||Ho<0||Re&&Wi>=B}function Ot(){var Tn=np();if(tt(Tn))return Mt(Tn);Z=Bu(Ot,yt(Tn))}function Mt(Tn){return Z=n,je&&P?Ye(Tn):(P=k=n,q)}function Gr(){Z!==n&&xE(Z),xe=0,P=ce=k=Z=n}function pr(){return Z===n?q:Mt(np())}function Yr(){var Tn=np(),Ho=tt(Tn);if(P=arguments,k=this,ce=Tn,Ho){if(Z===n)return et(ce);if(Re)return xE(Z),Z=Bu(Ot,g),Ye(ce)}return Z===n&&(Z=Bu(Ot,g)),q}return Yr.cancel=Gr,Yr.flush=pr,Yr}var f8=St(function(d,g){return ZC(d,1,g)}),h8=St(function(d,g,x){return ZC(d,Eo(g)||0,x)});function p8(d){return ji(d,M)}function rp(d,g){if(typeof d!="function"||g!=null&&typeof g!="function")throw new xo(s);var x=function(){var P=arguments,k=g?g.apply(this,P):P[0],B=x.cache;if(B.has(k))return B.get(k);var q=d.apply(this,P);return x.cache=B.set(k,q)||B,q};return x.cache=new(rp.Cache||Li),x}rp.Cache=Li;function op(d){if(typeof d!="function")throw new xo(s);return function(){var g=arguments;switch(g.length){case 0:return!d.call(this);case 1:return!d.call(this,g[0]);case 2:return!d.call(this,g[0],g[1]);case 3:return!d.call(this,g[0],g[1],g[2])}return!d.apply(this,g)}}function g8(d){return sR(2,d)}var m8=n9(function(d,g){g=g.length==1&&ut(g[0])?yn(g[0],Wr(Je())):yn(Yn(g,1),Wr(Je()));var x=g.length;return St(function(P){for(var k=-1,B=rr(P.length,x);++k<B;)P[k]=g[k].call(this,P[k]);return Hr(d,this,P)})}),Fb=St(function(d,g){var x=Ss(g,Ql(Fb));return ji(d,E,n,g,x)}),dR=St(function(d,g){var x=Ss(g,Ql(dR));return ji(d,O,n,g,x)}),v8=zi(function(d,g){return ji(d,N,n,n,n,g)});function b8(d,g){if(typeof d!="function")throw new xo(s);return g=g===n?g:pt(g),St(d,g)}function y8(d,g){if(typeof d!="function")throw new xo(s);return g=g==null?0:In(pt(g),0),St(function(x){var P=x[g],k=Os(x,0,g);return P&&_s(k,P),Hr(d,this,k)})}function x8(d,g,x){var P=!0,k=!0;if(typeof d!="function")throw new xo(s);return wn(x)&&(P="leading"in x?!!x.leading:P,k="trailing"in x?!!x.trailing:k),uR(d,g,{leading:P,maxWait:g,trailing:k})}function w8(d){return iR(d,1)}function _8(d,g){return Fb(_b(g),d)}function S8(){if(!arguments.length)return[];var d=arguments[0];return ut(d)?d:[d]}function C8(d){return _o(d,h)}function E8(d,g){return g=typeof g=="function"?g:n,_o(d,h,g)}function R8(d){return _o(d,f|h)}function P8(d,g){return g=typeof g=="function"?g:n,_o(d,f|h,g)}function O8(d,g){return g==null||JC(d,g,Hn(g))}function Vo(d,g){return d===g||d!==d&&g!==g}var $8=Xh(ub),T8=Xh(function(d,g){return d>=g}),Ta=oE(function(){return arguments}())?oE:function(d){return Cn(d)&&Qt.call(d,"callee")&&!WC.call(d,"callee")},ut=ge.isArray,D8=EC?Wr(EC):j6;function Pr(d){return d!=null&&ip(d.length)&&!Vi(d)}function $n(d){return Cn(d)&&Pr(d)}function A8(d){return d===!0||d===!1||Cn(d)&&fr(d)==ie}var $s=q7||Kb,k8=RC?Wr(RC):z6;function M8(d){return Cn(d)&&d.nodeType===1&&!Vu(d)}function I8(d){if(d==null)return!0;if(Pr(d)&&(ut(d)||typeof d=="string"||typeof d.splice=="function"||$s(d)||Jl(d)||Ta(d)))return!d.length;var g=or(d);if(g==Se||g==lt)return!d.size;if(zu(d))return!hb(d).length;for(var x in d)if(Qt.call(d,x))return!1;return!0}function N8(d,g){return Lu(d,g)}function L8(d,g,x){x=typeof x=="function"?x:n;var P=x?x(d,g):n;return P===n?Lu(d,g,n,x):!!P}function jb(d){if(!Cn(d))return!1;var g=fr(d);return g==ye||g==le||typeof d.message=="string"&&typeof d.name=="string"&&!Vu(d)}function F8(d){return typeof d=="number"&&qC(d)}function Vi(d){if(!wn(d))return!1;var g=fr(d);return g==K||g==be||g==ue||g==Ie}function fR(d){return typeof d=="number"&&d==pt(d)}function ip(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=J}function wn(d){var g=typeof d;return d!=null&&(g=="object"||g=="function")}function Cn(d){return d!=null&&typeof d=="object"}var hR=PC?Wr(PC):V6;function j8(d,g){return d===g||fb(d,g,$b(g))}function z8(d,g,x){return x=typeof x=="function"?x:n,fb(d,g,$b(g),x)}function B8(d){return pR(d)&&d!=+d}function V8(d){if(E9(d))throw new ct(i);return iE(d)}function H8(d){return d===null}function W8(d){return d==null}function pR(d){return typeof d=="number"||Cn(d)&&fr(d)==Oe}function Vu(d){if(!Cn(d)||fr(d)!=Ue)return!1;var g=Ah(d);if(g===null)return!0;var x=Qt.call(g,"constructor")&&g.constructor;return typeof x=="function"&&x instanceof x&&Oh.call(x)==z7}var zb=OC?Wr(OC):H6;function U8(d){return fR(d)&&d>=-J&&d<=J}var gR=$C?Wr($C):W6;function sp(d){return typeof d=="string"||!ut(d)&&Cn(d)&&fr(d)==It}function qr(d){return typeof d=="symbol"||Cn(d)&&fr(d)==Dt}var Jl=TC?Wr(TC):U6;function q8(d){return d===n}function G8(d){return Cn(d)&&or(d)==pe}function Y8(d){return Cn(d)&&fr(d)==Ee}var K8=Xh(pb),X8=Xh(function(d,g){return d<=g});function mR(d){if(!d)return[];if(Pr(d))return sp(d)?zo(d):Rr(d);if($u&&d[$u])return O7(d[$u]());var g=or(d),x=g==Se?tb:g==lt?Eh:Zl;return x(d)}function Hi(d){if(!d)return d===0?d:0;if(d=Eo(d),d===Y||d===-Y){var g=d<0?-1:1;return g*W}return d===d?d:0}function pt(d){var g=Hi(d),x=g%1;return g===g?x?g-x:g:0}function vR(d){return d?Ra(pt(d),0,V):0}function Eo(d){if(typeof d=="number")return d;if(qr(d))return $;if(wn(d)){var g=typeof d.valueOf=="function"?d.valueOf():d;d=wn(g)?g+"":g}if(typeof d!="string")return d===0?d:+d;d=NC(d);var x=Fe.test(d);return x||G.test(d)?d7(d.slice(2),x?2:8):ze.test(d)?$:+d}function bR(d){return ai(d,Or(d))}function Q8(d){return d?Ra(pt(d),-J,J):d===0?d:0}function Ut(d){return d==null?"":Ur(d)}var J8=Kl(function(d,g){if(zu(g)||Pr(g)){ai(g,Hn(g),d);return}for(var x in g)Qt.call(g,x)&&Mu(d,x,g[x])}),yR=Kl(function(d,g){ai(g,Or(g),d)}),ap=Kl(function(d,g,x,P){ai(g,Or(g),d,P)}),Z8=Kl(function(d,g,x,P){ai(g,Hn(g),d,P)}),ej=zi(ab);function tj(d,g){var x=Yl(d);return g==null?x:QC(x,g)}var nj=St(function(d,g){d=nn(d);var x=-1,P=g.length,k=P>2?g[2]:n;for(k&&hr(g[0],g[1],k)&&(P=1);++x<P;)for(var B=g[x],q=Or(B),Z=-1,ce=q.length;++Z<ce;){var xe=q[Z],we=d[xe];(we===n||Vo(we,Ul[xe])&&!Qt.call(d,xe))&&(d[xe]=B[xe])}return d}),rj=St(function(d){return d.push(n,NE),Hr(xR,n,d)});function oj(d,g){return AC(d,Je(g,3),si)}function ij(d,g){return AC(d,Je(g,3),cb)}function sj(d,g){return d==null?d:lb(d,Je(g,3),Or)}function aj(d,g){return d==null?d:nE(d,Je(g,3),Or)}function lj(d,g){return d&&si(d,Je(g,3))}function cj(d,g){return d&&cb(d,Je(g,3))}function uj(d){return d==null?[]:Vh(d,Hn(d))}function dj(d){return d==null?[]:Vh(d,Or(d))}function Bb(d,g,x){var P=d==null?n:Pa(d,g);return P===n?x:P}function fj(d,g){return d!=null&&jE(d,g,I6)}function Vb(d,g){return d!=null&&jE(d,g,N6)}var hj=DE(function(d,g,x){g!=null&&typeof g.toString!="function"&&(g=$h.call(g)),d[g]=x},Wb($r)),pj=DE(function(d,g,x){g!=null&&typeof g.toString!="function"&&(g=$h.call(g)),Qt.call(d,g)?d[g].push(x):d[g]=[x]},Je),gj=St(Nu);function Hn(d){return Pr(d)?KC(d):hb(d)}function Or(d){return Pr(d)?KC(d,!0):q6(d)}function mj(d,g){var x={};return g=Je(g,3),si(d,function(P,k,B){Fi(x,g(P,k,B),P)}),x}function vj(d,g){var x={};return g=Je(g,3),si(d,function(P,k,B){Fi(x,k,g(P,k,B))}),x}var bj=Kl(function(d,g,x){Hh(d,g,x)}),xR=Kl(function(d,g,x,P){Hh(d,g,x,P)}),yj=zi(function(d,g){var x={};if(d==null)return x;var P=!1;g=yn(g,function(B){return B=Ps(B,d),P||(P=B.length>1),B}),ai(d,Pb(d),x),P&&(x=_o(x,f|p|h,h9));for(var k=g.length;k--;)yb(x,g[k]);return x});function xj(d,g){return wR(d,op(Je(g)))}var wj=zi(function(d,g){return d==null?{}:Y6(d,g)});function wR(d,g){if(d==null)return{};var x=yn(Pb(d),function(P){return[P]});return g=Je(g),fE(d,x,function(P,k){return g(P,k[0])})}function _j(d,g,x){g=Ps(g,d);var P=-1,k=g.length;for(k||(k=1,d=n);++P<k;){var B=d==null?n:d[li(g[P])];B===n&&(P=k,B=x),d=Vi(B)?B.call(d):B}return d}function Sj(d,g,x){return d==null?d:Fu(d,g,x)}function Cj(d,g,x,P){return P=typeof P=="function"?P:n,d==null?d:Fu(d,g,x,P)}var _R=ME(Hn),SR=ME(Or);function Ej(d,g,x){var P=ut(d),k=P||$s(d)||Jl(d);if(g=Je(g,4),x==null){var B=d&&d.constructor;k?x=P?new B:[]:wn(d)?x=Vi(B)?Yl(Ah(d)):{}:x={}}return(k?yo:si)(d,function(q,Z,ce){return g(x,q,Z,ce)}),x}function Rj(d,g){return d==null?!0:yb(d,g)}function Pj(d,g,x){return d==null?d:vE(d,g,_b(x))}function Oj(d,g,x,P){return P=typeof P=="function"?P:n,d==null?d:vE(d,g,_b(x),P)}function Zl(d){return d==null?[]:eb(d,Hn(d))}function $j(d){return d==null?[]:eb(d,Or(d))}function Tj(d,g,x){return x===n&&(x=g,g=n),x!==n&&(x=Eo(x),x=x===x?x:0),g!==n&&(g=Eo(g),g=g===g?g:0),Ra(Eo(d),g,x)}function Dj(d,g,x){return g=Hi(g),x===n?(x=g,g=0):x=Hi(x),d=Eo(d),L6(d,g,x)}function Aj(d,g,x){if(x&&typeof x!="boolean"&&hr(d,g,x)&&(g=x=n),x===n&&(typeof g=="boolean"?(x=g,g=n):typeof d=="boolean"&&(x=d,d=n)),d===n&&g===n?(d=0,g=1):(d=Hi(d),g===n?(g=d,d=0):g=Hi(g)),d>g){var P=d;d=g,g=P}if(x||d%1||g%1){var k=GC();return rr(d+k*(g-d+u7("1e-"+((k+"").length-1))),g)}return mb(d,g)}var kj=Xl(function(d,g,x){return g=g.toLowerCase(),d+(x?CR(g):g)});function CR(d){return Hb(Ut(d).toLowerCase())}function ER(d){return d=Ut(d),d&&d.replace(ke,S7).replace(e7,"")}function Mj(d,g,x){d=Ut(d),g=Ur(g);var P=d.length;x=x===n?P:Ra(pt(x),0,P);var k=x;return x-=g.length,x>=0&&d.slice(x,k)==g}function Ij(d){return d=Ut(d),d&&Fo.test(d)?d.replace(bt,C7):d}function Nj(d){return d=Ut(d),d&&Ii.test(d)?d.replace(oi,"\\$&"):d}var Lj=Xl(function(d,g,x){return d+(x?"-":"")+g.toLowerCase()}),Fj=Xl(function(d,g,x){return d+(x?" ":"")+g.toLowerCase()}),jj=OE("toLowerCase");function zj(d,g,x){d=Ut(d),g=pt(g);var P=g?Hl(d):0;if(!g||P>=g)return d;var k=(g-P)/2;return Kh(Nh(k),x)+d+Kh(Ih(k),x)}function Bj(d,g,x){d=Ut(d),g=pt(g);var P=g?Hl(d):0;return g&&P<g?d+Kh(g-P,x):d}function Vj(d,g,x){d=Ut(d),g=pt(g);var P=g?Hl(d):0;return g&&P<g?Kh(g-P,x)+d:d}function Hj(d,g,x){return x||g==null?g=0:g&&(g=+g),X7(Ut(d).replace(Bn,""),g||0)}function Wj(d,g,x){return(x?hr(d,g,x):g===n)?g=1:g=pt(g),vb(Ut(d),g)}function Uj(){var d=arguments,g=Ut(d[0]);return d.length<3?g:g.replace(d[1],d[2])}var qj=Xl(function(d,g,x){return d+(x?"_":"")+g.toLowerCase()});function Gj(d,g,x){return x&&typeof x!="number"&&hr(d,g,x)&&(g=x=n),x=x===n?V:x>>>0,x?(d=Ut(d),d&&(typeof g=="string"||g!=null&&!zb(g))&&(g=Ur(g),!g&&Vl(d))?Os(zo(d),0,x):d.split(g,x)):[]}var Yj=Xl(function(d,g,x){return d+(x?" ":"")+Hb(g)});function Kj(d,g,x){return d=Ut(d),x=x==null?0:Ra(pt(x),0,d.length),g=Ur(g),d.slice(x,x+g.length)==g}function Xj(d,g,x){var P=j.templateSettings;x&&hr(d,g,x)&&(g=n),d=Ut(d),g=ap({},g,P,IE);var k=ap({},g.imports,P.imports,IE),B=Hn(k),q=eb(k,B),Z,ce,xe=0,we=g.interpolate||st,Re="__p += '",je=nb((g.escape||st).source+"|"+we.source+"|"+(we===ki?He:st).source+"|"+(g.evaluate||st).source+"|$","g"),Ye="//# sourceURL="+(Qt.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++i7+"]")+`
|
|
72
|
-
`;d.replace(je,function(tt,Ot,Mt,Gr,pr,Yr){return Mt||(Mt=Gr),Re+=d.slice(xe,Yr).replace(bn,E7),Ot&&(Z=!0,Re+=`' +
|
|
73
|
-
__e(`+Ot+`) +
|
|
74
|
-
'`),pr&&(ce=!0,Re+=`';
|
|
75
|
-
`+pr+`;
|
|
76
|
-
__p += '`),Mt&&(Re+=`' +
|
|
77
|
-
((__t = (`+Mt+`)) == null ? '' : __t) +
|
|
78
|
-
'`),xe=Yr+tt.length,tt}),Re+=`';
|
|
79
|
-
`;var et=Qt.call(g,"variable")&&g.variable;if(!et)Re=`with (obj) {
|
|
80
|
-
`+Re+`
|
|
81
|
-
}
|
|
82
|
-
`;else if(he.test(et))throw new ct(a);Re=(ce?Re.replace(nt,""):Re).replace(ht,"$1").replace(At,"$1;"),Re="function("+(et||"obj")+`) {
|
|
83
|
-
`+(et?"":`obj || (obj = {});
|
|
84
|
-
`)+"var __t, __p = ''"+(Z?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join;
|
|
85
|
-
function print() { __p += __j.call(arguments, '') }
|
|
86
|
-
`:`;
|
|
87
|
-
`)+Re+`return __p
|
|
88
|
-
}`;var yt=PR(function(){return jt(B,Ye+"return "+Re).apply(n,q)});if(yt.source=Re,jb(yt))throw yt;return yt}function Qj(d){return Ut(d).toLowerCase()}function Jj(d){return Ut(d).toUpperCase()}function Zj(d,g,x){if(d=Ut(d),d&&(x||g===n))return NC(d);if(!d||!(g=Ur(g)))return d;var P=zo(d),k=zo(g),B=LC(P,k),q=FC(P,k)+1;return Os(P,B,q).join("")}function ez(d,g,x){if(d=Ut(d),d&&(x||g===n))return d.slice(0,zC(d)+1);if(!d||!(g=Ur(g)))return d;var P=zo(d),k=FC(P,zo(g))+1;return Os(P,0,k).join("")}function tz(d,g,x){if(d=Ut(d),d&&(x||g===n))return d.replace(Bn,"");if(!d||!(g=Ur(g)))return d;var P=zo(d),k=LC(P,zo(g));return Os(P,k).join("")}function nz(d,g){var x=A,P=F;if(wn(g)){var k="separator"in g?g.separator:k;x="length"in g?pt(g.length):x,P="omission"in g?Ur(g.omission):P}d=Ut(d);var B=d.length;if(Vl(d)){var q=zo(d);B=q.length}if(x>=B)return d;var Z=x-Hl(P);if(Z<1)return P;var ce=q?Os(q,0,Z).join(""):d.slice(0,Z);if(k===n)return ce+P;if(q&&(Z+=ce.length-Z),zb(k)){if(d.slice(Z).search(k)){var xe,we=ce;for(k.global||(k=nb(k.source,Ut(qe.exec(k))+"g")),k.lastIndex=0;xe=k.exec(we);)var Re=xe.index;ce=ce.slice(0,Re===n?Z:Re)}}else if(d.indexOf(Ur(k),Z)!=Z){var je=ce.lastIndexOf(k);je>-1&&(ce=ce.slice(0,je))}return ce+P}function rz(d){return d=Ut(d),d&&On.test(d)?d.replace(Xt,A7):d}var oz=Xl(function(d,g,x){return d+(x?" ":"")+g.toUpperCase()}),Hb=OE("toUpperCase");function RR(d,g,x){return d=Ut(d),g=x?n:g,g===n?P7(d)?I7(d):b7(d):d.match(g)||[]}var PR=St(function(d,g){try{return Hr(d,n,g)}catch(x){return jb(x)?x:new ct(x)}}),iz=zi(function(d,g){return yo(g,function(x){x=li(x),Fi(d,x,Lb(d[x],d))}),d});function sz(d){var g=d==null?0:d.length,x=Je();return d=g?yn(d,function(P){if(typeof P[1]!="function")throw new xo(s);return[x(P[0]),P[1]]}):[],St(function(P){for(var k=-1;++k<g;){var B=d[k];if(Hr(B[0],this,P))return Hr(B[1],this,P)}})}function az(d){return A6(_o(d,f))}function Wb(d){return function(){return d}}function lz(d,g){return d==null||d!==d?g:d}var cz=TE(),uz=TE(!0);function $r(d){return d}function Ub(d){return sE(typeof d=="function"?d:_o(d,f))}function dz(d){return lE(_o(d,f))}function fz(d,g){return cE(d,_o(g,f))}var hz=St(function(d,g){return function(x){return Nu(x,d,g)}}),pz=St(function(d,g){return function(x){return Nu(d,x,g)}});function qb(d,g,x){var P=Hn(g),k=Vh(g,P);x==null&&!(wn(g)&&(k.length||!P.length))&&(x=g,g=d,d=this,k=Vh(g,Hn(g)));var B=!(wn(x)&&"chain"in x)||!!x.chain,q=Vi(d);return yo(k,function(Z){var ce=g[Z];d[Z]=ce,q&&(d.prototype[Z]=function(){var xe=this.__chain__;if(B||xe){var we=d(this.__wrapped__),Re=we.__actions__=Rr(this.__actions__);return Re.push({func:ce,args:arguments,thisArg:d}),we.__chain__=xe,we}return ce.apply(d,_s([this.value()],arguments))})}),d}function gz(){return Gn._===this&&(Gn._=B7),this}function Gb(){}function mz(d){return d=pt(d),St(function(g){return uE(g,d)})}var vz=Cb(yn),bz=Cb(DC),yz=Cb(Kv);function OR(d){return Db(d)?Xv(li(d)):K6(d)}function xz(d){return function(g){return d==null?n:Pa(d,g)}}var wz=AE(),_z=AE(!0);function Yb(){return[]}function Kb(){return!1}function Sz(){return{}}function Cz(){return""}function Ez(){return!0}function Rz(d,g){if(d=pt(d),d<1||d>J)return[];var x=V,P=rr(d,V);g=Je(g),d-=V;for(var k=Zv(P,g);++x<d;)g(x);return k}function Pz(d){return ut(d)?yn(d,li):qr(d)?[d]:Rr(YE(Ut(d)))}function Oz(d){var g=++j7;return Ut(d)+g}var $z=Yh(function(d,g){return d+g},0),Tz=Eb("ceil"),Dz=Yh(function(d,g){return d/g},1),Az=Eb("floor");function kz(d){return d&&d.length?Bh(d,$r,ub):n}function Mz(d,g){return d&&d.length?Bh(d,Je(g,2),ub):n}function Iz(d){return MC(d,$r)}function Nz(d,g){return MC(d,Je(g,2))}function Lz(d){return d&&d.length?Bh(d,$r,pb):n}function Fz(d,g){return d&&d.length?Bh(d,Je(g,2),pb):n}var jz=Yh(function(d,g){return d*g},1),zz=Eb("round"),Bz=Yh(function(d,g){return d-g},0);function Vz(d){return d&&d.length?Jv(d,$r):0}function Hz(d,g){return d&&d.length?Jv(d,Je(g,2)):0}return j.after=d8,j.ary=iR,j.assign=J8,j.assignIn=yR,j.assignInWith=ap,j.assignWith=Z8,j.at=ej,j.before=sR,j.bind=Lb,j.bindAll=iz,j.bindKey=aR,j.castArray=S8,j.chain=nR,j.chunk=A9,j.compact=k9,j.concat=M9,j.cond=sz,j.conforms=az,j.constant=Wb,j.countBy=V4,j.create=tj,j.curry=lR,j.curryRight=cR,j.debounce=uR,j.defaults=nj,j.defaultsDeep=rj,j.defer=f8,j.delay=h8,j.difference=I9,j.differenceBy=N9,j.differenceWith=L9,j.drop=F9,j.dropRight=j9,j.dropRightWhile=z9,j.dropWhile=B9,j.fill=V9,j.filter=W4,j.flatMap=G4,j.flatMapDeep=Y4,j.flatMapDepth=K4,j.flatten=JE,j.flattenDeep=H9,j.flattenDepth=W9,j.flip=p8,j.flow=cz,j.flowRight=uz,j.fromPairs=U9,j.functions=uj,j.functionsIn=dj,j.groupBy=X4,j.initial=G9,j.intersection=Y9,j.intersectionBy=K9,j.intersectionWith=X9,j.invert=hj,j.invertBy=pj,j.invokeMap=J4,j.iteratee=Ub,j.keyBy=Z4,j.keys=Hn,j.keysIn=Or,j.map=tp,j.mapKeys=mj,j.mapValues=vj,j.matches=dz,j.matchesProperty=fz,j.memoize=rp,j.merge=bj,j.mergeWith=xR,j.method=hz,j.methodOf=pz,j.mixin=qb,j.negate=op,j.nthArg=mz,j.omit=yj,j.omitBy=xj,j.once=g8,j.orderBy=e8,j.over=vz,j.overArgs=m8,j.overEvery=bz,j.overSome=yz,j.partial=Fb,j.partialRight=dR,j.partition=t8,j.pick=wj,j.pickBy=wR,j.property=OR,j.propertyOf=xz,j.pull=e4,j.pullAll=eR,j.pullAllBy=t4,j.pullAllWith=n4,j.pullAt=r4,j.range=wz,j.rangeRight=_z,j.rearg=v8,j.reject=o8,j.remove=o4,j.rest=b8,j.reverse=Ib,j.sampleSize=s8,j.set=Sj,j.setWith=Cj,j.shuffle=a8,j.slice=i4,j.sortBy=u8,j.sortedUniq=f4,j.sortedUniqBy=h4,j.split=Gj,j.spread=y8,j.tail=p4,j.take=g4,j.takeRight=m4,j.takeRightWhile=v4,j.takeWhile=b4,j.tap=k4,j.throttle=x8,j.thru=ep,j.toArray=mR,j.toPairs=_R,j.toPairsIn=SR,j.toPath=Pz,j.toPlainObject=bR,j.transform=Ej,j.unary=w8,j.union=y4,j.unionBy=x4,j.unionWith=w4,j.uniq=_4,j.uniqBy=S4,j.uniqWith=C4,j.unset=Rj,j.unzip=Nb,j.unzipWith=tR,j.update=Pj,j.updateWith=Oj,j.values=Zl,j.valuesIn=$j,j.without=E4,j.words=RR,j.wrap=_8,j.xor=R4,j.xorBy=P4,j.xorWith=O4,j.zip=$4,j.zipObject=T4,j.zipObjectDeep=D4,j.zipWith=A4,j.entries=_R,j.entriesIn=SR,j.extend=yR,j.extendWith=ap,qb(j,j),j.add=$z,j.attempt=PR,j.camelCase=kj,j.capitalize=CR,j.ceil=Tz,j.clamp=Tj,j.clone=C8,j.cloneDeep=R8,j.cloneDeepWith=P8,j.cloneWith=E8,j.conformsTo=O8,j.deburr=ER,j.defaultTo=lz,j.divide=Dz,j.endsWith=Mj,j.eq=Vo,j.escape=Ij,j.escapeRegExp=Nj,j.every=H4,j.find=U4,j.findIndex=XE,j.findKey=oj,j.findLast=q4,j.findLastIndex=QE,j.findLastKey=ij,j.floor=Az,j.forEach=rR,j.forEachRight=oR,j.forIn=sj,j.forInRight=aj,j.forOwn=lj,j.forOwnRight=cj,j.get=Bb,j.gt=$8,j.gte=T8,j.has=fj,j.hasIn=Vb,j.head=ZE,j.identity=$r,j.includes=Q4,j.indexOf=q9,j.inRange=Dj,j.invoke=gj,j.isArguments=Ta,j.isArray=ut,j.isArrayBuffer=D8,j.isArrayLike=Pr,j.isArrayLikeObject=$n,j.isBoolean=A8,j.isBuffer=$s,j.isDate=k8,j.isElement=M8,j.isEmpty=I8,j.isEqual=N8,j.isEqualWith=L8,j.isError=jb,j.isFinite=F8,j.isFunction=Vi,j.isInteger=fR,j.isLength=ip,j.isMap=hR,j.isMatch=j8,j.isMatchWith=z8,j.isNaN=B8,j.isNative=V8,j.isNil=W8,j.isNull=H8,j.isNumber=pR,j.isObject=wn,j.isObjectLike=Cn,j.isPlainObject=Vu,j.isRegExp=zb,j.isSafeInteger=U8,j.isSet=gR,j.isString=sp,j.isSymbol=qr,j.isTypedArray=Jl,j.isUndefined=q8,j.isWeakMap=G8,j.isWeakSet=Y8,j.join=Q9,j.kebabCase=Lj,j.last=Co,j.lastIndexOf=J9,j.lowerCase=Fj,j.lowerFirst=jj,j.lt=K8,j.lte=X8,j.max=kz,j.maxBy=Mz,j.mean=Iz,j.meanBy=Nz,j.min=Lz,j.minBy=Fz,j.stubArray=Yb,j.stubFalse=Kb,j.stubObject=Sz,j.stubString=Cz,j.stubTrue=Ez,j.multiply=jz,j.nth=Z9,j.noConflict=gz,j.noop=Gb,j.now=np,j.pad=zj,j.padEnd=Bj,j.padStart=Vj,j.parseInt=Hj,j.random=Aj,j.reduce=n8,j.reduceRight=r8,j.repeat=Wj,j.replace=Uj,j.result=_j,j.round=zz,j.runInContext=se,j.sample=i8,j.size=l8,j.snakeCase=qj,j.some=c8,j.sortedIndex=s4,j.sortedIndexBy=a4,j.sortedIndexOf=l4,j.sortedLastIndex=c4,j.sortedLastIndexBy=u4,j.sortedLastIndexOf=d4,j.startCase=Yj,j.startsWith=Kj,j.subtract=Bz,j.sum=Vz,j.sumBy=Hz,j.template=Xj,j.times=Rz,j.toFinite=Hi,j.toInteger=pt,j.toLength=vR,j.toLower=Qj,j.toNumber=Eo,j.toSafeInteger=Q8,j.toString=Ut,j.toUpper=Jj,j.trim=Zj,j.trimEnd=ez,j.trimStart=tz,j.truncate=nz,j.unescape=rz,j.uniqueId=Oz,j.upperCase=oz,j.upperFirst=Hb,j.each=rR,j.eachRight=oR,j.first=ZE,qb(j,function(){var d={};return si(j,function(g,x){Qt.call(j.prototype,x)||(d[x]=g)}),d}(),{chain:!1}),j.VERSION=r,yo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){j[d].placeholder=j}),yo(["drop","take"],function(d,g){kt.prototype[d]=function(x){x=x===n?1:In(pt(x),0);var P=this.__filtered__&&!g?new kt(this):this.clone();return P.__filtered__?P.__takeCount__=rr(x,P.__takeCount__):P.__views__.push({size:rr(x,V),type:d+(P.__dir__<0?"Right":"")}),P},kt.prototype[d+"Right"]=function(x){return this.reverse()[d](x).reverse()}}),yo(["filter","map","takeWhile"],function(d,g){var x=g+1,P=x==ee||x==Q;kt.prototype[d]=function(k){var B=this.clone();return B.__iteratees__.push({iteratee:Je(k,3),type:x}),B.__filtered__=B.__filtered__||P,B}}),yo(["head","last"],function(d,g){var x="take"+(g?"Right":"");kt.prototype[d]=function(){return this[x](1).value()[0]}}),yo(["initial","tail"],function(d,g){var x="drop"+(g?"":"Right");kt.prototype[d]=function(){return this.__filtered__?new kt(this):this[x](1)}}),kt.prototype.compact=function(){return this.filter($r)},kt.prototype.find=function(d){return this.filter(d).head()},kt.prototype.findLast=function(d){return this.reverse().find(d)},kt.prototype.invokeMap=St(function(d,g){return typeof d=="function"?new kt(this):this.map(function(x){return Nu(x,d,g)})}),kt.prototype.reject=function(d){return this.filter(op(Je(d)))},kt.prototype.slice=function(d,g){d=pt(d);var x=this;return x.__filtered__&&(d>0||g<0)?new kt(x):(d<0?x=x.takeRight(-d):d&&(x=x.drop(d)),g!==n&&(g=pt(g),x=g<0?x.dropRight(-g):x.take(g-d)),x)},kt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},kt.prototype.toArray=function(){return this.take(V)},si(kt.prototype,function(d,g){var x=/^(?:filter|find|map|reject)|While$/.test(g),P=/^(?:head|last)$/.test(g),k=j[P?"take"+(g=="last"?"Right":""):g],B=P||/^find/.test(g);k&&(j.prototype[g]=function(){var q=this.__wrapped__,Z=P?[1]:arguments,ce=q instanceof kt,xe=Z[0],we=ce||ut(q),Re=function(Ot){var Mt=k.apply(j,_s([Ot],Z));return P&&je?Mt[0]:Mt};we&&x&&typeof xe=="function"&&xe.length!=1&&(ce=we=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=B&&!je,yt=ce&&!Ye;if(!B&&we){q=yt?q:new kt(this);var tt=d.apply(q,Z);return tt.__actions__.push({func:ep,args:[Re],thisArg:n}),new wo(tt,je)}return et&&yt?d.apply(this,Z):(tt=this.thru(Re),et?P?tt.value()[0]:tt.value():tt)})}),yo(["pop","push","shift","sort","splice","unshift"],function(d){var g=Rh[d],x=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",P=/^(?:pop|shift)$/.test(d);j.prototype[d]=function(){var k=arguments;if(P&&!this.__chain__){var B=this.value();return g.apply(ut(B)?B:[],k)}return this[x](function(q){return g.apply(ut(q)?q:[],k)})}}),si(kt.prototype,function(d,g){var x=j[g];if(x){var P=x.name+"";Qt.call(Gl,P)||(Gl[P]=[]),Gl[P].push({name:g,func:x})}}),Gl[Gh(n,y).name]=[{name:"wrapper",func:n}],kt.prototype.clone=r6,kt.prototype.reverse=o6,kt.prototype.value=i6,j.prototype.at=M4,j.prototype.chain=I4,j.prototype.commit=N4,j.prototype.next=L4,j.prototype.plant=j4,j.prototype.reverse=z4,j.prototype.toJSON=j.prototype.valueOf=j.prototype.value=B4,j.prototype.first=j.prototype.head,$u&&(j.prototype[$u]=F4),j},Wl=N7();_a?((_a.exports=Wl)._=Wl,Uv._=Wl):Gn._=Wl}).call(Ws)})(Lg,Lg.exports);var bc=Lg.exports;const al=Rl(bc);function YR({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10};return t||(t={}),aw.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,f)=>Math.max(u,f.y+f.h),0);a.y=a.y===0?0:c,t[l].push(a)}),t}function KR(e,t){t&&aw.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const $e=rD()(uD((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:rx},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{deleteSheet:n=>{e(r=>{var i,s,a,l;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(c=>c.id===n);o!==void 0&&o>-1&&((s=r.dashboard.sheets)==null||s.splice(o,1),r.selectedSheetId=(l=(a=r.dashboard.sheets)==null?void 0:a[0])==null?void 0:l.id)})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{aw.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},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&&bc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.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}))},setFilteringCards:n=>{e(()=>({filteringCards: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)})},setSheetTitle:(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.title=r)})},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(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.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&&bc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.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(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(p=>p.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,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(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.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(c=>c.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 i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);YR({id:n.id,layouts:o==null?void 0:o.layouts,y:0,initialHeight:8,minH:7,w:10})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);KR(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,p;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(f=a.cards)==null?void 0:f.findIndex(b=>b.id===o.id);h>-1&&((p=a.cards)==null||p.splice(h,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,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0,p=0;o==="start"&&(f=0),YR({id:r.id,layouts:s.layouts,minH:10,x:p,y:f}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),KR(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.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(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.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)},getCardFrame: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++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},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 c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},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},getCardSheet(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++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{fV({card:n,dataPoint:r,set:e,get:t})}}}))),wr=()=>$e(e=>e.actions);var Vf=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(){}},tu=typeof window>"u"||"Deno"in window;function To(){}function hV(e,t){return typeof e=="function"?e(t):e}function ix(e){return typeof e=="number"&&e>=0&&e!==1/0}function vD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function XR(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==uw(s,t.options))return!1}else if(!Hd(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 QR(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Vd(t.options.mutationKey)!==Vd(i))return!1}else if(!Hd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function uw(e,t){return((t==null?void 0:t.queryKeyHashFn)||Vd)(e)}function Vd(e){return JSON.stringify(e,(t,n)=>ax(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Hd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Hd(e[n],t[n])):!1}function bD(e,t){if(e===t)return e;const n=JR(e)&&JR(t);if(n||ax(e)&&ax(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 c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=bD(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function sx(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function JR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ax(e){if(!ZR(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!ZR(n)||!n.hasOwnProperty("isPrototypeOf"))}function ZR(e){return Object.prototype.toString.call(e)==="[object Object]"}function pV(e){return new Promise(t=>{setTimeout(t,e)})}function lx(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?bD(e,t):t}function gV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function mV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Za,Us,Nc,jT,vV=(jT=class extends Vf{constructor(){super();Xe(this,Za,void 0);Xe(this,Us,void 0);Xe(this,Nc,void 0);Ve(this,Nc,t=>{if(!tu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ae(this,Us)||this.setEventListener(ae(this,Nc))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,Us))==null||t.call(this),Ve(this,Us,void 0))}setEventListener(t){var n;Ve(this,Nc,t),(n=ae(this,Us))==null||n.call(this),Ve(this,Us,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ae(this,Za)!==t&&(Ve(this,Za,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof ae(this,Za)=="boolean"?ae(this,Za):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Za=new WeakMap,Us=new WeakMap,Nc=new WeakMap,jT),Fg=new vV,Lc,qs,Fc,zT,bV=(zT=class extends Vf{constructor(){super();Xe(this,Lc,!0);Xe(this,qs,void 0);Xe(this,Fc,void 0);Ve(this,Fc,t=>{if(!tu&&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(){ae(this,qs)||this.setEventListener(ae(this,Fc))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,qs))==null||t.call(this),Ve(this,qs,void 0))}setEventListener(t){var n;Ve(this,Fc,t),(n=ae(this,qs))==null||n.call(this),Ve(this,qs,t(this.setOnline.bind(this)))}setOnline(t){ae(this,Lc)!==t&&(Ve(this,Lc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ae(this,Lc)}},Lc=new WeakMap,qs=new WeakMap,Fc=new WeakMap,zT),jg=new bV;function yV(e){return Math.min(1e3*2**e,3e4)}function $m(e){return(e??"online")==="online"?jg.isOnline():!0}var yD=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function o0(e){return e instanceof yD}function xD(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((w,y)=>{i=w,s=y}),l=w=>{var y;r||(h(new yD(w)),(y=e.abort)==null||y.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!Fg.isFocused()||e.networkMode!=="always"&&!jg.isOnline(),p=w=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,w),o==null||o(),i(w))},h=w=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,w),o==null||o(),s(w))},b=()=>new Promise(w=>{var y;o=_=>{const S=r||!f();return S&&w(_),S},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;o=void 0,r||(w=e.onContinue)==null||w.call(e)}),v=()=>{if(r)return;let w;try{w=e.fn()}catch(y){w=Promise.reject(y)}Promise.resolve(w).then(p).catch(y=>{var O;if(r)return;const _=e.retry??(tu?0:3),S=e.retryDelay??yV,C=typeof S=="function"?S(n,y):S,E=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!E){h(y);return}n++,(O=e.onFail)==null||O.call(e,n,y),pV(C).then(()=>{if(f())return b()}).then(()=>{t?h(y):v()})})};return $m(e.networkMode)?v():b().then(v),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function xV(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const i=p=>{o=p},s=p=>{let h;t++;try{h=p()}finally{t--,t||c()}return h},a=p=>{t?e.push(p):o(()=>{n(p)})},l=p=>(...h)=>{a(()=>{p(...h)})},c=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(h=>{n(h)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:i}}var Qn=xV(),el,BT,wD=(BT=class{constructor(){Xe(this,el,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ix(this.gcTime)&&Ve(this,el,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tu?1/0:5*60*1e3))}clearGcTimeout(){ae(this,el)&&(clearTimeout(ae(this,el)),Ve(this,el,void 0))}},el=new WeakMap,BT),jc,zc,Po,Gs,Oo,Wn,Of,tl,Bc,yg,Yo,Yi,VT,wV=(VT=class extends wD{constructor(t){super();Xe(this,Bc);Xe(this,Yo);Xe(this,jc,void 0);Xe(this,zc,void 0);Xe(this,Po,void 0);Xe(this,Gs,void 0);Xe(this,Oo,void 0);Xe(this,Wn,void 0);Xe(this,Of,void 0);Xe(this,tl,void 0);Ve(this,tl,!1),Ve(this,Of,t.defaultOptions),Ct(this,Bc,yg).call(this,t.options),Ve(this,Wn,[]),Ve(this,Po,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,jc,t.state||_V(this.options)),this.state=ae(this,jc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ae(this,Wn).length&&this.state.fetchStatus==="idle"&&ae(this,Po).remove(this)}setData(t,n){const r=lx(this.state.data,t,this.options);return Ct(this,Yo,Yi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ct(this,Yo,Yi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=ae(this,Gs);return(r=ae(this,Oo))==null||r.cancel(t),n?n.then(To).catch(To):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ae(this,jc))}isActive(){return ae(this,Wn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ae(this,Wn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!vD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=ae(this,Wn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Oo))==null||n.continue()}onOnline(){var n;const t=ae(this,Wn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Oo))==null||n.continue()}addObserver(t){ae(this,Wn).includes(t)||(ae(this,Wn).push(t),this.clearGcTimeout(),ae(this,Po).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){ae(this,Wn).includes(t)&&(Ve(this,Wn,ae(this,Wn).filter(n=>n!==t)),ae(this,Wn).length||(ae(this,Oo)&&(ae(this,tl)?ae(this,Oo).cancel({revert:!0}):ae(this,Oo).cancelRetry()),this.scheduleGc()),ae(this,Po).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return ae(this,Wn).length}invalidate(){this.state.isInvalidated||Ct(this,Yo,Yi).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ae(this,Gs))return(c=ae(this,Oo))==null||c.continueRetry(),ae(this,Gs)}if(t&&Ct(this,Bc,yg).call(this,t),!this.options.queryFn){const h=ae(this,Wn).find(b=>b.options.queryFn);h&&Ct(this,Bc,yg).call(this,h.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=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Ve(this,tl,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,tl,!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),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,zc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Ct(this,Yo,Yi).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=h=>{var b,v,w,y;o0(h)&&h.silent||Ct(this,Yo,Yi).call(this,{type:"error",error:h}),o0(h)||((v=(b=ae(this,Po).config).onError)==null||v.call(b,h,this),(y=(w=ae(this,Po).config).onSettled)==null||y.call(w,this.state.data,h,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Oo,xD({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var b,v,w,y;if(typeof h>"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(h),(v=(b=ae(this,Po).config).onSuccess)==null||v.call(b,h,this),(y=(w=ae(this,Po).config).onSettled)==null||y.call(w,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(h,b)=>{Ct(this,Yo,Yi).call(this,{type:"failed",failureCount:h,error:b})},onPause:()=>{Ct(this,Yo,Yi).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Yo,Yi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Gs,ae(this,Oo).promise),ae(this,Gs)}},jc=new WeakMap,zc=new WeakMap,Po=new WeakMap,Gs=new WeakMap,Oo=new WeakMap,Wn=new WeakMap,Of=new WeakMap,tl=new WeakMap,Bc=new WeakSet,yg=function(t){this.options={...ae(this,Of),...t},this.updateGcTime(this.options.gcTime)},Yo=new WeakSet,Yi=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:$m(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 o0(o)&&o.revert&&ae(this,zc)?{...ae(this,zc),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),Qn.batch(()=>{ae(this,Wn).forEach(r=>{r.onQueryUpdate()}),ae(this,Po).notify({query:this,type:"updated",action:t})})},VT);function _V(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 hi,HT,_D=(HT=class extends Vf{constructor(t={}){super();Xe(this,hi,void 0);this.config=t,Ve(this,hi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??uw(o,n);let s=this.get(i);return s||(s=new wV({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ae(this,hi).has(t.queryHash)||(ae(this,hi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ae(this,hi).get(t.queryHash);n&&(t.destroy(),n===t&&ae(this,hi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ae(this,hi).get(t)}getAll(){return[...ae(this,hi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>XR(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},hi=new WeakMap,HT),pi,$f,Zr,Vc,gi,Fs,WT,SV=(WT=class extends wD{constructor(t){super();Xe(this,gi);Xe(this,pi,void 0);Xe(this,$f,void 0);Xe(this,Zr,void 0);Xe(this,Vc,void 0);this.mutationId=t.mutationId,Ve(this,$f,t.defaultOptions),Ve(this,Zr,t.mutationCache),Ve(this,pi,[]),this.state=t.state||CV(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...ae(this,$f),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ae(this,pi).includes(t)||(ae(this,pi).push(t),this.clearGcTimeout(),ae(this,Zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,pi,ae(this,pi).filter(n=>n!==t)),this.scheduleGc(),ae(this,Zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ae(this,pi).length||(this.state.status==="pending"?this.scheduleGc():ae(this,Zr).remove(this))}continue(){var t;return((t=ae(this,Vc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,p,h,b,v,w,y,_,S,C,E,O,T;const n=()=>(Ve(this,Vc,xD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(N,M)=>{Ct(this,gi,Fs).call(this,{type:"failed",failureCount:N,error:M})},onPause:()=>{Ct(this,gi,Fs).call(this,{type:"pause"})},onContinue:()=>{Ct(this,gi,Fs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ae(this,Vc).promise),r=this.state.status==="pending";try{if(!r){Ct(this,gi,Fs).call(this,{type:"pending",variables:t}),await((i=(o=ae(this,Zr).config).onMutate)==null?void 0:i.call(o,t,this));const M=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));M!==this.state.context&&Ct(this,gi,Fs).call(this,{type:"pending",context:M,variables:t})}const N=await n();return await((c=(l=ae(this,Zr).config).onSuccess)==null?void 0:c.call(l,N,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,N,t,this.state.context)),await((h=(p=ae(this,Zr).config).onSettled)==null?void 0:h.call(p,N,null,this.state.variables,this.state.context,this)),await((v=(b=this.options).onSettled)==null?void 0:v.call(b,N,null,t,this.state.context)),Ct(this,gi,Fs).call(this,{type:"success",data:N}),N}catch(N){try{throw await((y=(w=ae(this,Zr).config).onError)==null?void 0:y.call(w,N,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,N,t,this.state.context)),await((E=(C=ae(this,Zr).config).onSettled)==null?void 0:E.call(C,void 0,N,this.state.variables,this.state.context,this)),await((T=(O=this.options).onSettled)==null?void 0:T.call(O,void 0,N,t,this.state.context)),N}finally{Ct(this,gi,Fs).call(this,{type:"error",error:N})}}}},pi=new WeakMap,$f=new WeakMap,Zr=new WeakMap,Vc=new WeakMap,gi=new WeakSet,Fs=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:!$m(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),Qn.batch(()=>{ae(this,pi).forEach(r=>{r.onMutationUpdate(t)}),ae(this,Zr).notify({mutation:this,type:"updated",action:t})})},WT);function CV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $o,Tf,nl,UT,EV=(UT=class extends Vf{constructor(t={}){super();Xe(this,$o,void 0);Xe(this,Tf,void 0);Xe(this,nl,void 0);this.config=t,Ve(this,$o,[]),Ve(this,Tf,0)}build(t,n,r){const o=new SV({mutationCache:this,mutationId:++lp(this,Tf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ae(this,$o).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,$o,ae(this,$o).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Qn.batch(()=>{ae(this,$o).forEach(t=>{this.remove(t)})})}getAll(){return ae(this,$o)}find(t){const n={exact:!0,...t};return ae(this,$o).find(r=>QR(n,r))}findAll(t={}){return ae(this,$o).filter(n=>QR(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,nl,(ae(this,nl)??Promise.resolve()).then(()=>{const t=ae(this,$o).filter(n=>n.state.isPaused);return Qn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(To)),Promise.resolve()))}).then(()=>{Ve(this,nl,void 0)})),ae(this,nl)}},$o=new WeakMap,Tf=new WeakMap,nl=new WeakMap,UT);function RV(e){return{onFetch:(t,n)=>{const r=async()=>{var b,v,w,y,_;const o=t.options,i=(w=(v=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:v.fetchMore)==null?void 0:w.direction,s=((y=t.state.data)==null?void 0:y.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(S,C,E)=>{if(c)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const O={queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};u(O);const T=await f(O),{maxPages:N}=t.options,M=E?mV:gV;return{pages:M(S.pages,T,N),pageParams:M(S.pageParams,C,N)}};let h;if(i&&s.length){const S=i==="backward",C=S?PV:eP,E={pages:s,pageParams:a},O=C(o,E);h=await p(E,O,S)}else{h=await p(l,a[0]??o.initialPageParam);const S=e??s.length;for(let C=1;C<S;C++){const E=eP(o,h);h=await p(h,E)}}return h};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 eP(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function PV(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,Ys,Ks,Hc,Wc,Xs,Uc,qc,qT,OV=(qT=class{constructor(e={}){Xe(this,Nn,void 0);Xe(this,Ys,void 0);Xe(this,Ks,void 0);Xe(this,Hc,void 0);Xe(this,Wc,void 0);Xe(this,Xs,void 0);Xe(this,Uc,void 0);Xe(this,qc,void 0);Ve(this,Nn,e.queryCache||new _D),Ve(this,Ys,e.mutationCache||new EV),Ve(this,Ks,e.defaultOptions||{}),Ve(this,Hc,new Map),Ve(this,Wc,new Map),Ve(this,Xs,0)}mount(){lp(this,Xs)._++,ae(this,Xs)===1&&(Ve(this,Uc,Fg.subscribe(()=>{Fg.isFocused()&&(this.resumePausedMutations(),ae(this,Nn).onFocus())})),Ve(this,qc,jg.subscribe(()=>{jg.isOnline()&&(this.resumePausedMutations(),ae(this,Nn).onOnline())})))}unmount(){var e,t;lp(this,Xs)._--,ae(this,Xs)===0&&((e=ae(this,Uc))==null||e.call(this),Ve(this,Uc,void 0),(t=ae(this,qc))==null||t.call(this),Ve(this,qc,void 0))}isFetching(e){return ae(this,Nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ae(this,Ys).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=ae(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=ae(this,Nn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=hV(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return ae(this,Nn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=ae(this,Nn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=ae(this,Nn);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ae(this,Nn),r={type:"active",...e};return Qn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Qn.batch(()=>ae(this,Nn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(To).catch(To)}invalidateQueries(e={},t={}){return Qn.batch(()=>{if(ae(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=Qn.batch(()=>ae(this,Nn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(To)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(To)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=ae(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(To).catch(To)}fetchInfiniteQuery(e){return e.behavior=RV(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(To).catch(To)}resumePausedMutations(){return ae(this,Ys).resumePausedMutations()}getQueryCache(){return ae(this,Nn)}getMutationCache(){return ae(this,Ys)}getDefaultOptions(){return ae(this,Ks)}setDefaultOptions(e){Ve(this,Ks,e)}setQueryDefaults(e,t){ae(this,Hc).set(Vd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ae(this,Hc).values()];let n={};return t.forEach(r=>{Hd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ae(this,Wc).set(Vd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ae(this,Wc).values()];let n={};return t.forEach(r=>{Hd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...ae(this,Ks).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uw(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:{...ae(this,Ks).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ae(this,Nn).clear(),ae(this,Ys).clear()}},Nn=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Hc=new WeakMap,Wc=new WeakMap,Xs=new WeakMap,Uc=new WeakMap,qc=new WeakMap,qT),Ir,fn,Df,vr,rl,Gc,mi,Af,Yc,Kc,ol,il,Qs,Xc,sl,pd,kf,cx,Mf,ux,If,dx,Nf,fx,Lf,hx,Ff,px,jf,gx,Sm,SD,GT,$V=(GT=class extends Vf{constructor(t,n){super();Xe(this,sl);Xe(this,kf);Xe(this,Mf);Xe(this,If);Xe(this,Nf);Xe(this,Lf);Xe(this,Ff);Xe(this,jf);Xe(this,Sm);Xe(this,Ir,void 0);Xe(this,fn,void 0);Xe(this,Df,void 0);Xe(this,vr,void 0);Xe(this,rl,void 0);Xe(this,Gc,void 0);Xe(this,mi,void 0);Xe(this,Af,void 0);Xe(this,Yc,void 0);Xe(this,Kc,void 0);Xe(this,ol,void 0);Xe(this,il,void 0);Xe(this,Qs,void 0);Xe(this,Xc,new Set);this.options=n,Ve(this,Ir,t),Ve(this,mi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ae(this,fn).addObserver(this),tP(ae(this,fn),this.options)?Ct(this,sl,pd).call(this):this.updateResult(),Ct(this,Nf,fx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mx(ae(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mx(ae(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,Lf,hx).call(this),Ct(this,Ff,px).call(this),ae(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=ae(this,fn);if(this.options=ae(this,Ir).defaultQueryOptions(t),sx(r,this.options)||ae(this,Ir).getQueryCache().notify({type:"observerOptionsUpdated",query:ae(this,fn),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),Ct(this,jf,gx).call(this);const i=this.hasListeners();i&&nP(ae(this,fn),o,this.options,r)&&Ct(this,sl,pd).call(this),this.updateResult(n),i&&(ae(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ct(this,kf,cx).call(this);const s=Ct(this,Mf,ux).call(this);i&&(ae(this,fn)!==o||this.options.enabled!==r.enabled||s!==ae(this,Qs))&&Ct(this,If,dx).call(this,s)}getOptimisticResult(t){const n=ae(this,Ir).getQueryCache().build(ae(this,Ir),t),r=this.createResult(n,t);return DV(this,r)&&(Ve(this,vr,r),Ve(this,Gc,this.options),Ve(this,rl,ae(this,fn).state)),r}getCurrentResult(){return ae(this,vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(ae(this,Xc).add(r),t[r])})}),n}getCurrentQuery(){return ae(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ae(this,Ir).defaultQueryOptions(t),r=ae(this,Ir).getQueryCache().build(ae(this,Ir),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ct(this,sl,pd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ae(this,vr)))}createResult(t,n){var O;const r=ae(this,fn),o=this.options,i=ae(this,vr),s=ae(this,rl),a=ae(this,Gc),c=t!==r?t.state:ae(this,Df),{state:u}=t;let{error:f,errorUpdatedAt:p,fetchStatus:h,status:b}=u,v=!1,w;if(n._optimisticResults){const T=this.hasListeners(),N=!T&&tP(t,n),M=T&&nP(t,r,n,o);(N||M)&&(h=$m(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(b="pending")),n._optimisticResults==="isRestoring"&&(h="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===ae(this,Af))w=ae(this,Yc);else try{Ve(this,Af,n.select),w=n.select(u.data),w=lx(i==null?void 0:i.data,w,n),Ve(this,Yc,w),Ve(this,mi,null)}catch(T){Ve(this,mi,T)}else w=u.data;if(typeof n.placeholderData<"u"&&typeof w>"u"&&b==="pending"){let T;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=i.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((O=ae(this,Kc))==null?void 0:O.state.data,ae(this,Kc)):n.placeholderData,n.select&&typeof T<"u")try{T=n.select(T),Ve(this,mi,null)}catch(N){Ve(this,mi,N)}typeof T<"u"&&(b="success",w=lx(i==null?void 0:i.data,T,n),v=!0)}ae(this,mi)&&(f=ae(this,mi),w=ae(this,Yc),p=Date.now(),b="error");const y=h==="fetching",_=b==="pending",S=b==="error",C=_&&y;return{status:b,fetchStatus:h,isPending:_,isSuccess:b==="success",isError:S,isInitialLoading:C,isLoading:C,data:w,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:h==="paused",isPlaceholderData:v,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:dw(t,n),refetch:this.refetch}}updateResult(t){const n=ae(this,vr),r=this.createResult(ae(this,fn),this.options);if(Ve(this,rl,ae(this,fn).state),Ve(this,Gc,this.options),ae(this,rl).data!==void 0&&Ve(this,Kc,ae(this,fn)),sx(r,n))return;Ve(this,vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ae(this,Xc).size)return!0;const l=new Set(a??ae(this,Xc));return this.options.throwOnError&&l.add("error"),Object.keys(ae(this,vr)).some(c=>{const u=c;return ae(this,vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ct(this,Sm,SD).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,Nf,fx).call(this)}},Ir=new WeakMap,fn=new WeakMap,Df=new WeakMap,vr=new WeakMap,rl=new WeakMap,Gc=new WeakMap,mi=new WeakMap,Af=new WeakMap,Yc=new WeakMap,Kc=new WeakMap,ol=new WeakMap,il=new WeakMap,Qs=new WeakMap,Xc=new WeakMap,sl=new WeakSet,pd=function(t){Ct(this,jf,gx).call(this);let n=ae(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(To)),n},kf=new WeakSet,cx=function(){if(Ct(this,Lf,hx).call(this),tu||ae(this,vr).isStale||!ix(this.options.staleTime))return;const n=vD(ae(this,vr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,ol,setTimeout(()=>{ae(this,vr).isStale||this.updateResult()},n))},Mf=new WeakSet,ux=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ae(this,fn)):this.options.refetchInterval)??!1},If=new WeakSet,dx=function(t){Ct(this,Ff,px).call(this),Ve(this,Qs,t),!(tu||this.options.enabled===!1||!ix(ae(this,Qs))||ae(this,Qs)===0)&&Ve(this,il,setInterval(()=>{(this.options.refetchIntervalInBackground||Fg.isFocused())&&Ct(this,sl,pd).call(this)},ae(this,Qs)))},Nf=new WeakSet,fx=function(){Ct(this,kf,cx).call(this),Ct(this,If,dx).call(this,Ct(this,Mf,ux).call(this))},Lf=new WeakSet,hx=function(){ae(this,ol)&&(clearTimeout(ae(this,ol)),Ve(this,ol,void 0))},Ff=new WeakSet,px=function(){ae(this,il)&&(clearInterval(ae(this,il)),Ve(this,il,void 0))},jf=new WeakSet,gx=function(){const t=ae(this,Ir).getQueryCache().build(ae(this,Ir),this.options);if(t===ae(this,fn))return;const n=ae(this,fn);Ve(this,fn,t),Ve(this,Df,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Sm=new WeakSet,SD=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ae(this,vr))}),ae(this,Ir).getQueryCache().notify({query:ae(this,fn),type:"observerResultsUpdated"})})},GT);function TV(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function tP(e,t){return TV(e,t)||e.state.dataUpdatedAt>0&&mx(e,t,t.refetchOnMount)}function mx(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&dw(e,t)}return!1}function nP(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&dw(e,n)}function dw(e,t){return e.isStaleByTime(t.staleTime)}function DV(e,t){return!sx(e.getCurrentResult(),t)}var CD=L.createContext(void 0),ED=e=>{const t=L.useContext(CD);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},AV=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.createElement(CD.Provider,{value:e},t)),RD=L.createContext(!1),kV=()=>L.useContext(RD);RD.Provider;function MV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var IV=L.createContext(MV()),NV=()=>L.useContext(IV);function LV(e,t){return typeof e=="function"?e(...t):!!e}var FV=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},jV=e=>{L.useEffect(()=>{e.clearReset()},[e])},zV=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&LV(n,[e.error,r]),BV=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},VV=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,HV=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function WV(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=ED(n),o=kV(),i=NV(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",BV(s),FV(s,i),jV(i);const[a]=L.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(L.useSyncExternalStore(L.useCallback(c=>{const u=o?()=>{}:a.subscribe(Qn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),L.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),VV(s,l))throw HV(s,a,i);if(zV({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Hf(e,t){return WV(e,$V,t)}const UV={theme:"system",setTheme:()=>null},PD=m.createContext(UV);function qV({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 R.jsx(PD.Provider,{...r,value:s,children:e})}const OD=()=>{const e=m.useContext(PD);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function GV(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function $D(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function rP(e,t){const n=$D(e);return n==="dark"?al.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function YV({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=Hf({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>GV(e==null?void 0:e.accessToken),enabled:!1}),{theme:c,setTheme:u}=OD(),f=$e(T=>T.dashboard.globalStyle),{setDashboard:p,setSelectedSheetId:h,setStyle:b,setOnSaveFunction:v}=$e(T=>T.actions);$e(T=>T.actions.setCustomCards);const w=$e(T=>T.actions.setFilterValues),y=$e(T=>T.actions.setBookmarkKey),_=$e(T=>T.actions.setAuthToken),S=$e(T=>T.actions.setThemeStyle),C=$e(T=>T.actions.setDashboardTheme),E=$e(T=>T.actions.setOnEvent);m.useEffect(()=>{if(c){const T=$D(c);C(T)}},[c,C]),m.useEffect(()=>{n&&u(n)},[n,u]);function O(){const T=al.cloneDeep(rx),N=al.merge(T,f);if(t){const M=al.merge(N,t),A=rP(c,M);S(A),b(M)}else{const M=rP(c,N);S(M),b(rx)}}return m.useEffect(()=>{i&&i.dashboard&&O()},[c,t,f]),m.useEffect(()=>{var F;if(!i||!i.dashboard)return;const T=i.dashboard,N=A3(T.id),M=JSON.parse(localStorage.getItem(N)||"[]"),A=M.find(z=>z.default===!0);if(A)p(A.template),O(),y(A.name),A.filterValues&&w(A.filterValues);else{p(T),O();const z=M.find(X=>(X==null?void 0:X.name)==="Original");z?z.template=T:M.push({name:"Original",template:T,default:!1}),localStorage.setItem(N,JSON.stringify(M))}h((F=T.sheets)==null?void 0:F[0].id)},[i,p,h,w,y]),m.useEffect(()=>{r&&v(r),o&&E(o)},[r,v,o,E]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function Tm({className:e,...t}){return R.jsx("div",{className:_e("animate-pulse rounded-md bg-muted",e),...t})}const fw=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));fw.displayName="Card";const Dm=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));Dm.displayName="CardHeader";const Wf=L.forwardRef(({className:e,...t},n)=>R.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight",e),...t}));Wf.displayName="CardTitle";const hw=L.forwardRef(({className:e,...t},n)=>R.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));hw.displayName="CardDescription";const Am=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("px-6 pt-0",e),...t}));Am.displayName="CardContent";const pw=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));pw.displayName="CardFooter";function TD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,showAssistant:p,...h}){$e(_=>_.selectedSheetId);const b=$e(_=>_.themeStyle),v=$e(_=>_.isSessionExpired),{isLoading:w,isError:y}=YV({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return w||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?R.jsx(o,{message:"loading"}):R.jsx("div",{className:"flex items-center gap-3",children:R.jsx(Tm,{className:"h-1 w-full dark:h-[2px]"})})):y?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),R.jsx(i,{})):R.jsx("div",{children:"Error"})):v?(r==null||r({type:"error",message:"Session Expired"}),R.jsx("div",{className:"flex h-full items-center justify-center",children:R.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[R.jsx(Wf,{children:"Session Expired"}),R.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):R.jsx("div",{className:_e("flex h-full flex-col justify-between",b==null?void 0:b.dashboardPanel,e),role:"dashboard-panel",...h})}function de(){return de=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},de.apply(this,arguments)}function Me(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 er(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:p,children:h,...b}=f,v=(p==null?void 0:p[e][l])||a,w=m.useMemo(()=>b,Object.values(b));return m.createElement(v.Provider,{value:w},h)}function u(f,p){const h=(p==null?void 0:p[e][l])||a,b=m.useContext(h);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}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,KV(o,...t)]}function KV(...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:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function XV(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function us(...e){return t=>e.forEach(n=>XV(n,t))}function _t(...e){return m.useCallback(us(...e),e)}const vx=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(JV);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(bx,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(bx,de({},r,{ref:t}),n)});vx.displayName="Slot";const bx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...ZV(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});bx.displayName="SlotClone";const QV=({children:e})=>m.createElement(m.Fragment,null,e);function JV(e){return m.isValidElement(e)&&e.type===QV}function ZV(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 km(e){const t=e+"CollectionProvider",[n,r]=er(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:b,children:v}=h,w=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:y,collectionRef:w},v)},a=e+"CollectionSlot",l=m.forwardRef((h,b)=>{const{scope:v,children:w}=h,y=i(a,v),_=_t(b,y.collectionRef);return m.createElement(vx,{ref:_},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((h,b)=>{const{scope:v,children:w,...y}=h,_=m.useRef(null),S=_t(b,_),C=i(c,v);return m.useEffect(()=>(C.itemMap.set(_,{ref:_,...y}),()=>void C.itemMap.delete(_))),m.createElement(vx,{[u]:"",ref:S},w)});function p(h){const b=i(e+"CollectionConsumer",h);return m.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((C,E)=>y.indexOf(C.ref.current)-y.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},p,r]}const ur=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},eH=L.useId||(()=>{});let tH=0;function Zo(e){const[t,n]=L.useState(eH());return ur(()=>{e||n(r=>r??String(tH++))},[e]),e||(t?`radix-${t}`:"")}const DD=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(rH);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(yx,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(yx,de({},r,{ref:t}),n)});DD.displayName="Slot";const yx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...oH(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});yx.displayName="SlotClone";const nH=({children:e})=>m.createElement(m.Fragment,null,e);function rH(e){return m.isValidElement(e)&&e.type===nH}function oH(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}}const iH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=iH.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?DD:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,de({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function AD(e,t){e&&Cr.flushSync(()=>e.dispatchEvent(t))}function jn(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 _r({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=sH({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=jn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function sH({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=jn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const aH=m.createContext(void 0);function Pl(e){const t=m.useContext(aH);return e||t||"ltr"}const i0="rovingFocusGroup.onEntryFocus",lH={bubbles:!1,cancelable:!0},gw="RovingFocusGroup",[xx,kD,cH]=km(gw),[uH,mu]=er(gw,[cH]),[dH,fH]=uH(gw),hH=m.forwardRef((e,t)=>m.createElement(xx.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(xx.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(pH,de({},e,{ref:t}))))),pH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),p=_t(t,f),h=Pl(i),[b=null,v]=_r({prop:s,defaultProp:a,onChange:l}),[w,y]=m.useState(!1),_=jn(c),S=kD(n),C=m.useRef(!1),[E,O]=m.useState(0);return m.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(i0,_),()=>T.removeEventListener(i0,_)},[_]),m.createElement(dH,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(T=>v(T),[v]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>O(T=>T-1),[])},m.createElement(Qe.div,de({tabIndex:w||E===0?-1:0,"data-orientation":r},u,{ref:p,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{C.current=!0}),onFocus:Me(e.onFocus,T=>{const N=!C.current;if(T.target===T.currentTarget&&N&&!w){const M=new CustomEvent(i0,lH);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const A=S().filter(H=>H.focusable),F=A.find(H=>H.active),z=A.find(H=>H.id===b),ee=[F,z,...A].filter(Boolean).map(H=>H.ref.current);MD(ee)}}C.current=!1}),onBlur:Me(e.onBlur,()=>y(!1))})))}),gH="RovingFocusGroupItem",mH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Zo(),l=i||a,c=fH(gH,n),u=c.currentTabStopId===l,f=kD(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return m.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),m.createElement(xx.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,de({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Me(e.onMouseDown,b=>{r?c.onItemFocus(l):b.preventDefault()}),onFocus:Me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Me(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=yH(b,c.orientation,c.dir);if(v!==void 0){b.preventDefault();let y=f().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const _=y.indexOf(b.currentTarget);y=c.loop?xH(y,_+1):y.slice(_+1)}setTimeout(()=>MD(y))}})})))}),vH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function bH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yH(e,t,n){const r=bH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return vH[r]}function MD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function xH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const mw=hH,vw=mH;function wH(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const tr=e=>{const{present:t,children:n}=e,r=_H(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=_t(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};tr.displayName="Presence";function _H(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=wH(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=fp(r.current);i.current=a==="mounted"?c:"none"},[a]),ur(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,h=fp(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ur(()=>{if(t){const c=f=>{const h=fp(r.current).includes(f.animationName);f.target===t&&h&&Cr.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=fp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function fp(e){return(e==null?void 0:e.animationName)||"none"}const ID="Tabs",[SH,l1e]=er(ID,[mu]),ND=mu(),[CH,bw]=SH(ID),EH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Pl(a),[f,p]=_r({prop:r,onChange:o,defaultProp:i});return m.createElement(CH,{scope:n,baseId:Zo(),value:f,onValueChange:p,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,de({dir:u,"data-orientation":s},c,{ref:t})))}),RH="TabsList",PH=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=bw(RH,n),s=ND(n);return m.createElement(mw,de({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,de({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),OH="TabsTrigger",$H=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=bw(OH,n),a=ND(n),l=LD(s.baseId,r),c=FD(s.baseId,r),u=r===s.value;return m.createElement(vw,de({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,de({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Me(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Me(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),TH="TabsContent",DH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=bw(TH,n),l=LD(a.baseId,r),c=FD(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),m.createElement(tr,{present:o||u},({present:p})=>m.createElement(Qe.div,de({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),p&&i))});function LD(e,t){return`${e}-trigger-${t}`}function FD(e,t){return`${e}-content-${t}`}const AH=EH,jD=PH,zD=$H,BD=DH,yw=AH,Mm=L.forwardRef(({className:e,...t},n)=>R.jsx(jD,{ref:n,className:_e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Mm.displayName=jD.displayName;const Im=L.forwardRef(({className:e,...t},n)=>R.jsx(zD,{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}));Im.displayName=zD.displayName;const xw=L.forwardRef(({className:e,...t},n)=>R.jsx(BD,{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}));xw.displayName=BD.displayName;var VD={exports:{}},Uf={},wx={exports:{}};(function(e,t){(function(n,r){r(t)})(Ws,function(n){function r(ie){return function(le,ye,K,be,Se,Oe,Te){return ie(le,ye,Te)}}function o(ie){return function(le,ye,K,be){if(!le||!ye||typeof le!="object"||typeof ye!="object")return ie(le,ye,K,be);var Se=be.get(le),Oe=be.get(ye);if(Se&&Oe)return Se===ye&&Oe===le;be.set(le,ye),be.set(ye,le);var Te=ie(le,ye,K,be);return be.delete(le),be.delete(ye),Te}}function i(ie,oe){var le={};for(var ye in ie)le[ye]=ie[ye];for(var ye in oe)le[ye]=oe[ye];return le}function s(ie){return ie.constructor===Object||ie.constructor==null}function a(ie){return typeof ie.then=="function"}function l(ie,oe){return ie===oe||ie!==ie&&oe!==oe}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",p="[object RegExp]",h="[object Map]",b="[object Number]",v="[object Object]",w="[object Set]",y="[object String]",_=Object.prototype.toString;function S(ie){var oe=ie.areArraysEqual,le=ie.areDatesEqual,ye=ie.areMapsEqual,K=ie.areObjectsEqual,be=ie.areRegExpsEqual,Se=ie.areSetsEqual,Oe=ie.createIsNestedEqual,Te=Oe(Ue);function Ue(Be,Ie,Ke){if(Be===Ie)return!0;if(!Be||!Ie||typeof Be!="object"||typeof Ie!="object")return Be!==Be&&Ie!==Ie;if(s(Be)&&s(Ie))return K(Be,Ie,Te,Ke);var lt=Array.isArray(Be),It=Array.isArray(Ie);if(lt||It)return lt===It&&oe(Be,Ie,Te,Ke);var Dt=_.call(Be);return Dt!==_.call(Ie)?!1:Dt===f?le(Be,Ie,Te,Ke):Dt===p?be(Be,Ie,Te,Ke):Dt===h?ye(Be,Ie,Te,Ke):Dt===w?Se(Be,Ie,Te,Ke):Dt===v||Dt===c?a(Be)||a(Ie)?!1:K(Be,Ie,Te,Ke):Dt===u||Dt===b||Dt===y?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function C(ie,oe,le,ye){var K=ie.length;if(oe.length!==K)return!1;for(;K-- >0;)if(!le(ie[K],oe[K],K,K,ie,oe,ye))return!1;return!0}var E=o(C);function O(ie,oe){return l(ie.valueOf(),oe.valueOf())}function T(ie,oe,le,ye){var K=ie.size===oe.size;if(!K)return!1;if(!ie.size)return!0;var be={},Se=0;return ie.forEach(function(Oe,Te){if(K){var Ue=!1,Be=0;oe.forEach(function(Ie,Ke){!Ue&&!be[Be]&&(Ue=le(Te,Ke,Se,Be,ie,oe,ye)&&le(Oe,Ie,Te,Ke,ie,oe,ye))&&(be[Be]=!0),Be++}),Se++,K=Ue}}),K}var N=o(T),M="_owner",A=Object.prototype.hasOwnProperty;function F(ie,oe,le,ye){var K=Object.keys(ie),be=K.length;if(Object.keys(oe).length!==be)return!1;for(var Se;be-- >0;){if(Se=K[be],Se===M){var Oe=!!ie.$$typeof,Te=!!oe.$$typeof;if((Oe||Te)&&Oe!==Te)return!1}if(!A.call(oe,Se)||!le(ie[Se],oe[Se],Se,Se,ie,oe,ye))return!1}return!0}var z=o(F);function X(ie,oe){return ie.source===oe.source&&ie.flags===oe.flags}function ee(ie,oe,le,ye){var K=ie.size===oe.size;if(!K)return!1;if(!ie.size)return!0;var be={};return ie.forEach(function(Se,Oe){if(K){var Te=!1,Ue=0;oe.forEach(function(Be,Ie){!Te&&!be[Ue]&&(Te=le(Se,Be,Oe,Ie,ie,oe,ye))&&(be[Ue]=!0),Ue++}),K=Te}}),K}var H=o(ee),Q=Object.freeze({areArraysEqual:C,areDatesEqual:O,areMapsEqual:T,areObjectsEqual:F,areRegExpsEqual:X,areSetsEqual:ee,createIsNestedEqual:r}),Y=Object.freeze({areArraysEqual:E,areDatesEqual:O,areMapsEqual:N,areObjectsEqual:z,areRegExpsEqual:X,areSetsEqual:H,createIsNestedEqual:r}),J=S(Q);function W(ie,oe){return J(ie,oe,void 0)}var $=S(i(Q,{createIsNestedEqual:function(){return l}}));function V(ie,oe){return $(ie,oe,void 0)}var U=S(Y);function I(ie,oe){return U(ie,oe,new WeakMap)}var te=S(i(Y,{createIsNestedEqual:function(){return l}}));function fe(ie,oe){return te(ie,oe,new WeakMap)}function ne(ie){return S(i(Q,ie(Q)))}function ue(ie){var oe=S(i(Y,ie(Y)));return function(le,ye,K){return K===void 0&&(K=new WeakMap),oe(le,ye,K)}}n.circularDeepEqual=I,n.circularShallowEqual=fe,n.createCustomCircularEqual=ue,n.createCustomEqual=ne,n.deepEqual=W,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(wx,wx.exports);var ww=wx.exports;const _w=tw(Yz);var Pt={},kH=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(Pt,"__esModule",{value:!0});Pt.bottom=Sw;Pt.childrenEqual=LH;Pt.cloneLayout=HD;Pt.cloneLayoutItem=ll;Pt.collides=Nm;Pt.compact=UD;Pt.compactItem=qD;Pt.compactType=QH;Pt.correctBounds=GD;Pt.fastPositionEqual=jH;Pt.fastRGLPropsEqual=void 0;Pt.getAllCollisions=YD;Pt.getFirstCollision=Ka;Pt.getLayoutItem=Cw;Pt.getStatics=Ew;Pt.modifyLayout=WD;Pt.moveElement=md;Pt.moveElementAwayFromCollision=Sx;Pt.noop=void 0;Pt.perc=BH;Pt.resizeItemInDirection=GH;Pt.setTopLeft=KH;Pt.setTransform=YH;Pt.sortLayoutItems=Dw;Pt.sortLayoutItemsByColRow=ZD;Pt.sortLayoutItemsByRowCol=JD;Pt.synchronizeLayoutWithChildren=XH;Pt.validateLayout=eA;Pt.withLayoutItem=NH;var oP=ww,gd=MH(m);function MH(e){return e&&e.__esModule?e:{default:e}}const IH=process.env.NODE_ENV==="production";function Sw(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 HD(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=ll(e[n]);return t}function WD(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 NH(e,t,n){let r=Cw(e,t);return r?(r=n(ll(r)),e=WD(e,r),[e,r]):[e,null]}function ll(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 LH(e,t){return(0,oP.deepEqual)(gd.default.Children.map(e,n=>n==null?void 0:n.key),gd.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,oP.deepEqual)(gd.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),gd.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const FH=kH;Pt.fastRGLPropsEqual=FH;function jH(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Nm(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 UD(e,t,n,r){const o=Ew(e),i=Dw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=ll(i[a]);c.static||(c=qD(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const zH={x:"w",y:"h"};function _x(e,t,n,r){const o=zH[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;Nm(t,a)&&_x(e,a,n+t[o],r)}}t[r]=n}function qD(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Sw(e),t.y);t.y>0&&!Ka(e,t);)t.y--;else if(a)for(;t.x>0&&!Ka(e,t);)t.x--;let l;for(;(l=Ka(e,t))&&!(n===null&&i);)if(a?_x(o,t,l.x+l.w,"x"):_x(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ka(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function GD(e,t){const n=Ew(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(;Ka(n,i);)i.y++}return e}function Cw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ka(e,t){for(let n=0,r=e.length;n<r;n++)if(Nm(e[n],t))return e[n]}function YD(e,t){return e.filter(n=>Nm(n,t))}function Ew(e){return e.filter(t=>t.static)}function md(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 c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=Dw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const h=YD(f,t),b=h.length>0;if(b&&l)return HD(e);if(b&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let v=0,w=h.length;v<w;v++){const y=h[v];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(y.i," at [").concat(y.x,",").concat(y.y,"]"),!y.moved&&(y.static?e=Sx(e,y,t,o,s):e=Sx(e,t,y,o,s))}return e}function Sx(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={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=Ka(e,f),h=p&&p.y+p.h>t.y,b=p&&t.x+t.w>p.x;if(p){if(h&&a)return md(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(b&&s)return md(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),md(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:md(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function BH(e){return e*100+"%"}const KD=(e,t,n,r)=>e+n>r?t:n,XD=(e,t,n)=>e<0?t:n,QD=e=>Math.max(0,e),Rw=e=>Math.max(0,e),Pw=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:XD(s,e.height,o),top:Rw(s)}},Ow=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:KD(e.left,e.width,s,n),left:QD(o)}},$w=(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:KD(e.left,e.width,i,n),top:Rw(r),left:QD(s)}},Tw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:XD(r,e.height,i),top:Rw(r)}},VH=function(){return Pw(arguments.length<=0?void 0:arguments[0],Ow(...arguments))},HH=function(){return Pw(arguments.length<=0?void 0:arguments[0],$w(...arguments))},WH=function(){return Tw(arguments.length<=0?void 0:arguments[0],Ow(...arguments))},UH=function(){return Tw(arguments.length<=0?void 0:arguments[0],$w(...arguments))},qH={n:Pw,ne:VH,e:Ow,se:WH,s:Tw,sw:UH,w:$w,nw:HH};function GH(e,t,n,r){const o=qH[e];return o?o(t,{...t,...n},r):n}function YH(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 KH(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 Dw(e,t){return t==="horizontal"?ZD(e):t==="vertical"?JD(e):e}function JD(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 ZD(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 XH(e,t,n,r,o){e=e||[];const i=[];gd.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Cw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(ll(l)):c?(IH||eA([c],"ReactGridLayout.children"),i.push(ll({...c,i:a.key}))):i.push(ll({w:1,h:1,x:0,y:Sw(i),i:String(a.key)}))});const s=GD(i,{cols:n});return o?s:UD(s,r,n)}function eA(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 QH(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const JH=()=>{};Pt.noop=JH;var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.calcGridColWidth=Lm;Oi.calcGridItemPosition=ZH;Oi.calcGridItemWHPx=Cx;Oi.calcWH=tW;Oi.calcXY=eW;Oi.clamp=Xa;function Lm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Cx(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function ZH(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Lm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Cx(r,c,s[0]),u.height=Cx(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function eW(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=Lm(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Xa(u,0,s-r),f=Xa(f,0,l-o),{x:u,y:f}}function tW(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Lm(e);let f=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=Xa(f,0,l-r),b=Xa(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=Xa(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=Xa(p,0,a)),{w:h,h:b}}function Xa(e,t,n){return Math.max(Math.min(e,n),t)}var Fm={},Ex={exports:{}},s0,iP;function Aw(){if(iP)return s0;iP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return s0=e,s0}var a0,sP;function nW(){if(sP)return a0;sP=1;var e=Aw();function t(){}function n(){}return n.resetWarningCache=t,a0=function(){function r(s,a,l,c,u,f){if(f!==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},a0}var hp={exports:{}},qt={};/** @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 aP;function rW(){return aP||(aP=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,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(K){return typeof K=="string"||typeof K=="function"||K===r||K===c||K===i||K===o||K===f||K===p||typeof K=="object"&&K!==null&&(K.$$typeof===b||K.$$typeof===h||K.$$typeof===s||K.$$typeof===a||K.$$typeof===u||K.$$typeof===w||K.$$typeof===y||K.$$typeof===_||K.$$typeof===v)}function C(K){if(typeof K=="object"&&K!==null){var be=K.$$typeof;switch(be){case t:var Se=K.type;switch(Se){case l:case c:case r:case i:case o:case f:return Se;default:var Oe=Se&&Se.$$typeof;switch(Oe){case a:case u:case b:case h:case s:return Oe;default:return be}}case n:return be}}}var E=l,O=c,T=a,N=s,M=t,A=u,F=r,z=b,X=h,ee=n,H=i,Q=o,Y=f,J=!1;function W(K){return J||(J=!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.")),$(K)||C(K)===l}function $(K){return C(K)===c}function V(K){return C(K)===a}function U(K){return C(K)===s}function I(K){return typeof K=="object"&&K!==null&&K.$$typeof===t}function te(K){return C(K)===u}function fe(K){return C(K)===r}function ne(K){return C(K)===b}function ue(K){return C(K)===h}function ie(K){return C(K)===n}function oe(K){return C(K)===i}function le(K){return C(K)===o}function ye(K){return C(K)===f}qt.AsyncMode=E,qt.ConcurrentMode=O,qt.ContextConsumer=T,qt.ContextProvider=N,qt.Element=M,qt.ForwardRef=A,qt.Fragment=F,qt.Lazy=z,qt.Memo=X,qt.Portal=ee,qt.Profiler=H,qt.StrictMode=Q,qt.Suspense=Y,qt.isAsyncMode=W,qt.isConcurrentMode=$,qt.isContextConsumer=V,qt.isContextProvider=U,qt.isElement=I,qt.isForwardRef=te,qt.isFragment=fe,qt.isLazy=ne,qt.isMemo=ue,qt.isPortal=ie,qt.isProfiler=oe,qt.isStrictMode=le,qt.isSuspense=ye,qt.isValidElementType=S,qt.typeOf=C}()),qt}var Gt={};/** @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 lP;function oW(){if(lP)return Gt;lP=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,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(E){if(typeof E=="object"&&E!==null){var O=E.$$typeof;switch(O){case t:switch(E=E.type,E){case l:case c:case r:case i:case o:case f:return E;default:switch(E=E&&E.$$typeof,E){case a:case u:case b:case h:case s:return E;default:return O}}case n:return O}}}function C(E){return S(E)===c}return Gt.AsyncMode=l,Gt.ConcurrentMode=c,Gt.ContextConsumer=a,Gt.ContextProvider=s,Gt.Element=t,Gt.ForwardRef=u,Gt.Fragment=r,Gt.Lazy=b,Gt.Memo=h,Gt.Portal=n,Gt.Profiler=i,Gt.StrictMode=o,Gt.Suspense=f,Gt.isAsyncMode=function(E){return C(E)||S(E)===l},Gt.isConcurrentMode=C,Gt.isContextConsumer=function(E){return S(E)===a},Gt.isContextProvider=function(E){return S(E)===s},Gt.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},Gt.isForwardRef=function(E){return S(E)===u},Gt.isFragment=function(E){return S(E)===r},Gt.isLazy=function(E){return S(E)===b},Gt.isMemo=function(E){return S(E)===h},Gt.isPortal=function(E){return S(E)===n},Gt.isProfiler=function(E){return S(E)===i},Gt.isStrictMode=function(E){return S(E)===o},Gt.isSuspense=function(E){return S(E)===f},Gt.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===c||E===i||E===o||E===f||E===p||typeof E=="object"&&E!==null&&(E.$$typeof===b||E.$$typeof===h||E.$$typeof===s||E.$$typeof===a||E.$$typeof===u||E.$$typeof===w||E.$$typeof===y||E.$$typeof===_||E.$$typeof===v)},Gt.typeOf=S,Gt}var cP;function tA(){return cP||(cP=1,process.env.NODE_ENV==="production"?hp.exports=oW():hp.exports=rW()),hp.exports}/*
|
|
103
|
-
object-assign
|
|
104
|
-
(c) Sindre Sorhus
|
|
105
|
-
@license MIT
|
|
106
|
-
*/var l0,uP;function iW(){if(uP)return l0;uP=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(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return l0=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var p=0;p<c.length;p++)n.call(a,c[p])&&(l[c[p]]=a[c[p]])}}return l},l0}var c0,dP;function nA(){return dP||(dP=1,c0=Function.call.bind(Object.prototype.hasOwnProperty)),c0}var u0,fP;function sW(){if(fP)return u0;fP=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Aw(),n={},r=nA();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,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var p=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}f=i[u](s,u,l,a,null,t)}catch(b){f=b}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var h=c?c():"";e("Failed "+a+" type: "+f.message+(h??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},u0=o,u0}var d0,hP;function aW(){if(hP)return d0;hP=1;var e=tA(),t=iW(),n=Aw(),r=nA(),o=sW(),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 d0=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f($){var V=$&&(c&&$[c]||$[u]);if(typeof V=="function")return V}var p="<<anonymous>>",h={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:_(),arrayOf:S,element:C(),elementType:E(),instanceOf:O,node:A(),objectOf:N,oneOf:T,oneOfType:M,shape:z,exact:X};function b($,V){return $===V?$!==0||1/$===1/V:$!==$&&V!==V}function v($,V){this.message=$,this.data=V&&typeof V=="object"?V:{},this.stack=""}v.prototype=Error.prototype;function w($){if(process.env.NODE_ENV!=="production")var V={},U=0;function I(fe,ne,ue,ie,oe,le,ye){if(ie=ie||p,le=le||ue,ye!==n){if(l){var K=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 K.name="Invariant Violation",K}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var be=ie+":"+ue;!V[be]&&U<3&&(i("You are manually calling a React.PropTypes validation function for the `"+le+"` prop on `"+ie+"`. 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[be]=!0,U++)}}return ne[ue]==null?fe?ne[ue]===null?new v("The "+oe+" `"+le+"` is marked as required "+("in `"+ie+"`, but its value is `null`.")):new v("The "+oe+" `"+le+"` is marked as required in "+("`"+ie+"`, but its value is `undefined`.")):null:$(ne,ue,ie,oe,le)}var te=I.bind(null,!1);return te.isRequired=I.bind(null,!0),te}function y($){function V(U,I,te,fe,ne,ue){var ie=U[I],oe=Q(ie);if(oe!==$){var le=Y(ie);return new v("Invalid "+fe+" `"+ne+"` of type "+("`"+le+"` supplied to `"+te+"`, expected ")+("`"+$+"`."),{expectedType:$})}return null}return w(V)}function _(){return w(s)}function S($){function V(U,I,te,fe,ne){if(typeof $!="function")return new v("Property `"+ne+"` of component `"+te+"` has invalid PropType notation inside arrayOf.");var ue=U[I];if(!Array.isArray(ue)){var ie=Q(ue);return new v("Invalid "+fe+" `"+ne+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected an array."))}for(var oe=0;oe<ue.length;oe++){var le=$(ue,oe,te,fe,ne+"["+oe+"]",n);if(le instanceof Error)return le}return null}return w(V)}function C(){function $(V,U,I,te,fe){var ne=V[U];if(!a(ne)){var ue=Q(ne);return new v("Invalid "+te+" `"+fe+"` of type "+("`"+ue+"` supplied to `"+I+"`, expected a single ReactElement."))}return null}return w($)}function E(){function $(V,U,I,te,fe){var ne=V[U];if(!e.isValidElementType(ne)){var ue=Q(ne);return new v("Invalid "+te+" `"+fe+"` of type "+("`"+ue+"` supplied to `"+I+"`, expected a single ReactElement type."))}return null}return w($)}function O($){function V(U,I,te,fe,ne){if(!(U[I]instanceof $)){var ue=$.name||p,ie=W(U[I]);return new v("Invalid "+fe+" `"+ne+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected ")+("instance of `"+ue+"`."))}return null}return w(V)}function T($){if(!Array.isArray($))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(U,I,te,fe,ne){for(var ue=U[I],ie=0;ie<$.length;ie++)if(b(ue,$[ie]))return null;var oe=JSON.stringify($,function(ye,K){var be=Y(K);return be==="symbol"?String(K):K});return new v("Invalid "+fe+" `"+ne+"` of value `"+String(ue)+"` "+("supplied to `"+te+"`, expected one of "+oe+"."))}return w(V)}function N($){function V(U,I,te,fe,ne){if(typeof $!="function")return new v("Property `"+ne+"` of component `"+te+"` has invalid PropType notation inside objectOf.");var ue=U[I],ie=Q(ue);if(ie!=="object")return new v("Invalid "+fe+" `"+ne+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected an object."));for(var oe in ue)if(r(ue,oe)){var le=$(ue,oe,te,fe,ne+"."+oe,n);if(le instanceof Error)return le}return null}return w(V)}function M($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var V=0;V<$.length;V++){var U=$[V];if(typeof U!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(U)+" at index "+V+"."),s}function I(te,fe,ne,ue,ie){for(var oe=[],le=0;le<$.length;le++){var ye=$[le],K=ye(te,fe,ne,ue,ie,n);if(K==null)return null;K.data&&r(K.data,"expectedType")&&oe.push(K.data.expectedType)}var be=oe.length>0?", expected one of type ["+oe.join(", ")+"]":"";return new v("Invalid "+ue+" `"+ie+"` supplied to "+("`"+ne+"`"+be+"."))}return w(I)}function A(){function $(V,U,I,te,fe){return ee(V[U])?null:new v("Invalid "+te+" `"+fe+"` supplied to "+("`"+I+"`, expected a ReactNode."))}return w($)}function F($,V,U,I,te){return new v(($||"React class")+": "+V+" type `"+U+"."+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+te+"`.")}function z($){function V(U,I,te,fe,ne){var ue=U[I],ie=Q(ue);if(ie!=="object")return new v("Invalid "+fe+" `"+ne+"` of type `"+ie+"` "+("supplied to `"+te+"`, expected `object`."));for(var oe in $){var le=$[oe];if(typeof le!="function")return F(te,fe,ne,oe,Y(le));var ye=le(ue,oe,te,fe,ne+"."+oe,n);if(ye)return ye}return null}return w(V)}function X($){function V(U,I,te,fe,ne){var ue=U[I],ie=Q(ue);if(ie!=="object")return new v("Invalid "+fe+" `"+ne+"` of type `"+ie+"` "+("supplied to `"+te+"`, expected `object`."));var oe=t({},U[I],$);for(var le in oe){var ye=$[le];if(r($,le)&&typeof ye!="function")return F(te,fe,ne,le,Y(ye));if(!ye)return new v("Invalid "+fe+" `"+ne+"` key `"+le+"` supplied to `"+te+"`.\nBad object: "+JSON.stringify(U[I],null," ")+`
|
|
107
|
-
Valid keys: `+JSON.stringify(Object.keys($),null," "));var K=ye(ue,le,te,fe,ne+"."+le,n);if(K)return K}return null}return w(V)}function ee($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(ee);if($===null||a($))return!0;var V=f($);if(V){var U=V.call($),I;if(V!==$.entries){for(;!(I=U.next()).done;)if(!ee(I.value))return!1}else for(;!(I=U.next()).done;){var te=I.value;if(te&&!ee(te[1]))return!1}}else return!1;return!0;default:return!1}}function H($,V){return $==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function Q($){var V=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":H(V,$)?"symbol":V}function Y($){if(typeof $>"u"||$===null)return""+$;var V=Q($);if(V==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return V}function J($){var V=Y($);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function W($){return!$.constructor||!$.constructor.name?p:$.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},d0}if(process.env.NODE_ENV!=="production"){var lW=tA(),cW=!0;Ex.exports=aW()(lW.isElement,cW)}else Ex.exports=nW()();var ma=Ex.exports,jm={exports:{}},rA={};function oA(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=oA(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function pP(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=oA(e))&&(r&&(r+=" "),r+=t);return r}const uW=Object.freeze(Object.defineProperty({__proto__:null,clsx:pP,default:pP},Symbol.toStringTag,{value:"Module"})),dW=tw(uW);var Pn={},$i={};Object.defineProperty($i,"__esModule",{value:!0});$i.dontSetMe=mW;$i.findInArray=fW;$i.int=gW;$i.isFunction=hW;$i.isNum=pW;function fW(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function hW(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function pW(e){return typeof e=="number"&&!isNaN(e)}function gW(e){return parseInt(e,10)}function mW(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 Ol={};Object.defineProperty(Ol,"__esModule",{value:!0});Ol.browserPrefixToKey=sA;Ol.browserPrefixToStyle=vW;Ol.default=void 0;Ol.getPrefix=iA;const f0=["Moz","Webkit","O","ms"];function iA(){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<f0.length;r++)if(sA(t,f0[r])in n)return f0[r];return""}function sA(e,t){return t?"".concat(t).concat(bW(e)):e}function vW(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function bW(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}Ol.default=iA();Object.defineProperty(Pn,"__esModule",{value:!0});Pn.addClassName=cA;Pn.addEvent=wW;Pn.addUserSelectStyles=AW;Pn.createCSSTransform=OW;Pn.createSVGTransform=$W;Pn.getTouch=TW;Pn.getTouchIdentifier=DW;Pn.getTranslation=kw;Pn.innerHeight=EW;Pn.innerWidth=RW;Pn.matchesSelector=lA;Pn.matchesSelectorAndParentsTo=xW;Pn.offsetXYFromParent=PW;Pn.outerHeight=SW;Pn.outerWidth=CW;Pn.removeClassName=uA;Pn.removeEvent=_W;Pn.removeUserSelectStyles=kW;var lo=$i,gP=yW(Ol);function aA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(aA=function(r){return r?n:t})(e)}function yW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=aA(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 pp="";function lA(e,t){return pp||(pp=(0,lo.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,lo.isFunction)(e[n])})),(0,lo.isFunction)(e[pp])?e[pp](t):!1}function xW(e,t,n){let r=e;do{if(lA(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function wW(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 _W(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 SW(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,lo.int)(n.borderTopWidth),t+=(0,lo.int)(n.borderBottomWidth),t}function CW(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,lo.int)(n.borderLeftWidth),t+=(0,lo.int)(n.borderRightWidth),t}function EW(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,lo.int)(n.paddingTop),t-=(0,lo.int)(n.paddingBottom),t}function RW(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,lo.int)(n.paddingLeft),t-=(0,lo.int)(n.paddingRight),t}function PW(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 OW(e,t){const n=kw(e,t,"px");return{[(0,gP.browserPrefixToKey)("transform",gP.default)]:n}}function $W(e,t){return kw(e,t,"")}function kw(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 TW(e,t){return e.targetTouches&&(0,lo.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,lo.findInArray)(e.changedTouches,n=>t===n.identifier)}function DW(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function AW(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&&cA(e.body,"react-draggable-transparent-selection")}function kW(e){if(e)try{if(e.body&&uA(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 cA(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function uA(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.canDragX=NW;Ti.canDragY=LW;Ti.createCoreData=jW;Ti.createDraggableData=zW;Ti.getBoundPosition=MW;Ti.getControlPosition=FW;Ti.snapToGrid=IW;var Kr=$i,_c=Pn;function MW(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:BW(r);const o=Mw(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,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,Kr.int)(u.paddingLeft)+(0,Kr.int)(c.marginLeft),top:-o.offsetTop+(0,Kr.int)(u.paddingTop)+(0,Kr.int)(c.marginTop),right:(0,_c.innerWidth)(l)-(0,_c.outerWidth)(o)-o.offsetLeft+(0,Kr.int)(u.paddingRight)-(0,Kr.int)(c.marginRight),bottom:(0,_c.innerHeight)(l)-(0,_c.outerHeight)(o)-o.offsetTop+(0,Kr.int)(u.paddingBottom)-(0,Kr.int)(c.marginBottom)}}return(0,Kr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Kr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Kr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Kr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function IW(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function NW(e){return e.props.axis==="both"||e.props.axis==="x"}function LW(e){return e.props.axis==="both"||e.props.axis==="y"}function FW(e,t,n){const r=typeof t=="number"?(0,_c.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=Mw(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,_c.offsetXYFromParent)(r||e,i,n.props.scale)}function jW(e,t,n){const r=!(0,Kr.isNum)(e.lastX),o=Mw(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 zW(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 BW(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Mw(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var zm={},Bm={};Object.defineProperty(Bm,"__esModule",{value:!0});Bm.default=VW;function VW(){}Object.defineProperty(zm,"__esModule",{value:!0});zm.default=void 0;var h0=WW(m),Tr=Iw(ma),HW=Iw(Cr),ir=Pn,As=Ti,p0=$i,Gu=Iw(Bm);function Iw(e){return e&&e.__esModule?e:{default:e}}function dA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(dA=function(r){return r?n:t})(e)}function WW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=dA(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 mr(e,t,n){return t=UW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UW(e){var t=qW(e,"string");return typeof t=="symbol"?t:String(t)}function qW(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 Uo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ks=Uo.mouse,Vm=class extends h0.Component{constructor(){super(...arguments),mr(this,"dragging",!1),mr(this,"lastX",NaN),mr(this,"lastY",NaN),mr(this,"touchIdentifier",null),mr(this,"mounted",!1),mr(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,ir.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,ir.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,ir.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,As.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,As.createCoreData)(this,s,a);(0,Gu.default)("DraggableCore: handleDragStart: %j",l),(0,Gu.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,ir.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,ir.addEvent)(r,ks.move,this.handleDrag),(0,ir.addEvent)(r,ks.stop,this.handleDragStop))}),mr(this,"handleDrag",t=>{const n=(0,As.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,As.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,As.createCoreData)(this,r,o);if((0,Gu.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}),mr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,As.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,c=o-this.lastY||0;[l,c]=(0,As.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,As.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,ir.removeUserSelectStyles)(a.ownerDocument),(0,Gu.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Gu.default)("DraggableCore: Removing handlers"),(0,ir.removeEvent)(a.ownerDocument,ks.move,this.handleDrag),(0,ir.removeEvent)(a.ownerDocument,ks.stop,this.handleDragStop))}),mr(this,"onMouseDown",t=>(ks=Uo.mouse,this.handleDragStart(t))),mr(this,"onMouseUp",t=>(ks=Uo.mouse,this.handleDragStop(t))),mr(this,"onTouchStart",t=>(ks=Uo.touch,this.handleDragStart(t))),mr(this,"onTouchEnd",t=>(ks=Uo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,ir.addEvent)(t,Uo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,ir.removeEvent)(n,Uo.mouse.move,this.handleDrag),(0,ir.removeEvent)(n,Uo.touch.move,this.handleDrag),(0,ir.removeEvent)(n,Uo.mouse.stop,this.handleDragStop),(0,ir.removeEvent)(n,Uo.touch.stop,this.handleDragStop),(0,ir.removeEvent)(t,Uo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,ir.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:HW.default.findDOMNode(this)}render(){return h0.cloneElement(h0.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};zm.default=Vm;mr(Vm,"displayName","DraggableCore");mr(Vm,"propTypes",{allowAnyClick:Tr.default.bool,children:Tr.default.node.isRequired,disabled:Tr.default.bool,enableUserSelectHack:Tr.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:Tr.default.arrayOf(Tr.default.number),handle:Tr.default.string,cancel:Tr.default.string,nodeRef:Tr.default.object,onStart:Tr.default.func,onDrag:Tr.default.func,onStop:Tr.default.func,onMouseDown:Tr.default.func,scale:Tr.default.number,className:p0.dontSetMe,style:p0.dontSetMe,transform:p0.dontSetMe});mr(Vm,"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=u(ma),r=u(Cr),o=u(dW),i=Pn,s=Ti,a=$i,l=u(zm),c=u(Bm);function u(_){return _&&_.__esModule?_:{default:_}}function f(_){if(typeof WeakMap!="function")return null;var S=new WeakMap,C=new WeakMap;return(f=function(E){return E?C:S})(_)}function p(_,S){if(!S&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var C=f(S);if(C&&C.has(_))return C.get(_);var E={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in _)if(T!=="default"&&Object.prototype.hasOwnProperty.call(_,T)){var N=O?Object.getOwnPropertyDescriptor(_,T):null;N&&(N.get||N.set)?Object.defineProperty(E,T,N):E[T]=_[T]}return E.default=_,C&&C.set(_,E),E}function h(){return h=Object.assign?Object.assign.bind():function(_){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(_[E]=C[E])}return _},h.apply(this,arguments)}function b(_,S,C){return S=v(S),S in _?Object.defineProperty(_,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[S]=C,_}function v(_){var S=w(_,"string");return typeof S=="symbol"?S:String(S)}function w(_,S){if(typeof _!="object"||_===null)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var E=C.call(_,S||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(_)}class y extends t.Component{static getDerivedStateFromProps(S,C){let{position:E}=S,{prevPropsPosition:O}=C;return E&&(!O||E.x!==O.x||E.y!==O.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:O}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(S){super(S),b(this,"onDragStart",(C,E)=>{if((0,c.default)("Draggable: onDragStart: %j",E),this.props.onStart(C,(0,s.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(C,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const O=(0,s.createDraggableData)(this,E),T={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:A}=T;T.x+=this.state.slackX,T.y+=this.state.slackY;const[F,z]=(0,s.getBoundPosition)(this,T.x,T.y);T.x=F,T.y=z,T.slackX=this.state.slackX+(M-T.x),T.slackY=this.state.slackY+(A-T.y),O.x=T.x,O.y=T.y,O.deltaX=T.x-this.state.x,O.deltaY=T.y-this.state.y}if(this.props.onDrag(C,O)===!1)return!1;this.setState(T)}),b(this,"onDragStop",(C,E)=>{if(!this.state.dragging||this.props.onStop(C,(0,s.createDraggableData)(this,E))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",E);const T={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:A}=this.props.position;T.x=M,T.y=A}this.setState(T)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.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 S,C;return(S=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:C,children:E,defaultPosition:O,defaultClassName:T,defaultClassNameDragging:N,defaultClassNameDragged:M,position:A,positionOffset:F,scale:z,...X}=this.props;let ee={},H=null;const Y=!!!A||this.state.dragging,J=A||O,W={x:(0,s.canDragX)(this)&&Y?this.state.x:J.x,y:(0,s.canDragY)(this)&&Y?this.state.y:J.y};this.state.isElementSVG?H=(0,i.createSVGTransform)(W,F):ee=(0,i.createCSSTransform)(W,F);const $=(0,o.default)(E.props.className||"",T,{[N]:this.state.dragging,[M]:this.state.dragged});return t.createElement(l.default,h({},X,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:$,style:{...E.props.style,...ee},transform:H}))}}e.default=y,b(y,"displayName","Draggable"),b(y,"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(y,"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})})(rA);const{default:fA,DraggableCore:GW}=rA;jm.exports=fA;jm.exports.default=fA;jm.exports.DraggableCore=GW;var hA=jm.exports,Hm={exports:{}},qf={},Nw={};Nw.__esModule=!0;Nw.cloneElement=ZW;var YW=KW(m);function KW(e){return e&&e.__esModule?e:{default:e}}function mP(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 vP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mP(Object(n),!0).forEach(function(r){XW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XW(e,t,n){return t=QW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QW(e){var t=JW(e,"string");return typeof t=="symbol"?t:String(t)}function JW(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 ZW(e,t){return t.style&&e.props.style&&(t.style=vP(vP({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),YW.default.cloneElement(e,t)}var Gf={};Gf.__esModule=!0;Gf.resizableProps=void 0;var gt=eU(ma);function eU(e){return e&&e.__esModule?e:{default:e}}var tU={axis:gt.default.oneOf(["both","x","y","none"]),className:gt.default.string,children:gt.default.element.isRequired,draggableOpts:gt.default.shape({allowAnyClick:gt.default.bool,cancel:gt.default.string,children:gt.default.node,disabled:gt.default.bool,enableUserSelectHack:gt.default.bool,offsetParent:gt.default.node,grid:gt.default.arrayOf(gt.default.number),handle:gt.default.string,nodeRef:gt.default.object,onStart:gt.default.func,onDrag:gt.default.func,onStop:gt.default.func,onMouseDown:gt.default.func,scale:gt.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=gt.default.number).isRequired.apply(i,n)}return gt.default.number.apply(gt.default,n)},handle:gt.default.oneOfType([gt.default.node,gt.default.func]),handleSize:gt.default.arrayOf(gt.default.number),lockAspectRatio:gt.default.bool,maxConstraints:gt.default.arrayOf(gt.default.number),minConstraints:gt.default.arrayOf(gt.default.number),onResizeStop:gt.default.func,onResizeStart:gt.default.func,onResize:gt.default.func,resizeHandles:gt.default.arrayOf(gt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:gt.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=gt.default.number).isRequired.apply(i,n)}return gt.default.number.apply(gt.default,n)}};Gf.resizableProps=tU;qf.__esModule=!0;qf.default=void 0;var Yu=sU(m),nU=hA,rU=Nw,oU=Gf,iU=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function pA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(pA=function(o){return o?n:t})(e)}function sU(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=pA(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 Rx(){return Rx=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},Rx.apply(this,arguments)}function aU(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 bP(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 g0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bP(Object(n),!0).forEach(function(r){lU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lU(e,t,n){return t=cU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cU(e){var t=uU(e,"string");return typeof t=="symbol"?t:String(t)}function uU(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 dU(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Px(e,t)}function Px(e,t){return Px=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Px(e,t)}var Lw=function(e){dU(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,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,f=o-this.props.width,p=i-this.props.height;Math.abs(f)>Math.abs(p*u)?i=o/u:o=i*u}var h=o,b=i,v=this.slack||[0,0],w=v[0],y=v[1];return o+=w,i+=y,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=[w+(h-o),y+(b-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;o==="onResizeStart"&&s.resetData();var p=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!p&&!h)){var b=i[0],v=i[i.length-1],w=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(v==="w"){var y=w.left-s.lastHandleRect.left;u+=y}if(b==="n"){var _=w.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=w,v==="w"&&(u=-u),b==="n"&&(f=-f);var S=s.props.width+(p?u/s.props.transformScale:0),C=s.props.height+(h?f/s.props.transformScale:0),E=s.runConstraints(S,C);S=E[0],C=E[1];var O=S!==s.props.width||C!==s.props.height,T=typeof s.props[o]=="function"?s.props[o]:null,N=o==="onResize"&&!O;T&&!N&&(a.persist==null||a.persist(),T(a,{node:c,size:{width:S,height:C},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Yu.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=g0({ref:i},a?{}:{handleAxis:o});return Yu.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 c=i.resizeHandles;i.transformScale;var u=aU(i,iU);return(0,rU.cloneElement)(s,g0(g0({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var p,h=(p=o.handleRefs[f])!=null?p:o.handleRefs[f]=Yu.createRef();return Yu.createElement(nU.DraggableCore,Rx({},l,{nodeRef:h,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,h))}))}))},t}(Yu.Component);qf.default=Lw;Lw.propTypes=oU.resizableProps;Lw.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Wm={};Wm.__esModule=!0;Wm.default=void 0;var m0=mU(m),fU=gA(ma),hU=gA(qf),pU=Gf,gU=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function gA(e){return e&&e.__esModule?e:{default:e}}function mA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(mA=function(o){return o?n:t})(e)}function mU(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=mA(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 Ox(){return Ox=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},Ox.apply(this,arguments)}function yP(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 zg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yP(Object(n),!0).forEach(function(r){vU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vU(e,t,n){return t=bU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bU(e){var t=yU(e,"string");return typeof t=="symbol"?t:String(t)}function yU(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 xU(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 wU(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$x(e,t)}function $x(e,t){return $x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},$x(e,t)}var vA=function(e){wU(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 c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},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,c=o.draggableOpts,u=o.minConstraints,f=o.maxConstraints,p=o.lockAspectRatio,h=o.axis;o.width,o.height;var b=o.resizeHandles,v=o.style,w=o.transformScale,y=xU(o,gU);return m0.createElement(hU.default,{axis:h,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:b,transformScale:w,width:this.state.width},m0.createElement("div",Ox({},y,{style:zg(zg({},v),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(m0.Component);Wm.default=vA;vA.propTypes=zg(zg({},pU.resizableProps),{},{children:fU.default.element});Hm.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Hm.exports.Resizable=qf.default;Hm.exports.ResizableBox=Wm.default;var _U=Hm.exports,ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.resizeHandleType=ss.resizeHandleAxesType=ss.default=void 0;var wt=bA(ma),SU=bA(m);function bA(e){return e&&e.__esModule?e:{default:e}}const yA=wt.default.arrayOf(wt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));ss.resizeHandleAxesType=yA;const xA=wt.default.oneOfType([wt.default.node,wt.default.func]);ss.resizeHandleType=xA;var CU={className:wt.default.string,style:wt.default.object,width:wt.default.number,autoSize:wt.default.bool,cols:wt.default.number,draggableCancel:wt.default.string,draggableHandle:wt.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:wt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Pt.validateLayout(t,"layout")},margin:wt.default.arrayOf(wt.default.number),containerPadding:wt.default.arrayOf(wt.default.number),rowHeight:wt.default.number,maxRows:wt.default.number,isBounded:wt.default.bool,isDraggable:wt.default.bool,isResizable:wt.default.bool,allowOverlap:wt.default.bool,preventCollision:wt.default.bool,useCSSTransforms:wt.default.bool,transformScale:wt.default.number,isDroppable:wt.default.bool,resizeHandles:yA,resizeHandle:xA,onLayoutChange:wt.default.func,onDragStart:wt.default.func,onDrag:wt.default.func,onDragStop:wt.default.func,onResizeStart:wt.default.func,onResize:wt.default.func,onResizeStop:wt.default.func,onDrop:wt.default.func,droppingItem:wt.default.shape({i:wt.default.string.isRequired,w:wt.default.number.isRequired,h:wt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};SU.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:wt.default.any};ss.default=CU;Object.defineProperty(Fm,"__esModule",{value:!0});Fm.default=void 0;var ec=Fw(m),zt=Fw(ma),EU=hA,RU=_U,tc=Pt,Kn=Oi,xP=ss,PU=Fw(_w);function Fw(e){return e&&e.__esModule?e:{default:e}}function ui(e,t,n){return t=OU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OU(e){var t=$U(e,"string");return typeof t=="symbol"?t:String(t)}function $U(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 jw extends ec.default.Component{constructor(){super(...arguments),ui(this,"state",{resizing:null,dragging:null,className:""}),ui(this,"elementRef",ec.default.createRef()),ui(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(),c=r.getBoundingClientRect(),u=c.left/i,f=l.left/i,p=c.top/i,h=l.top/i;s.left=u-f+a.scrollLeft,s.top=p-h+a.scrollTop,this.setState({dragging:s});const{x:b,y:v}=(0,Kn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,b,v,{e:t,node:r,newPosition:s})}),ui(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:c,i:u,w:f,h:p,containerWidth:h}=this.props,b=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:C}=this.props,E=_.clientHeight-(0,Kn.calcGridItemWHPx)(p,C,S[1]);a=(0,Kn.clamp)(a,0,E);const O=(0,Kn.calcGridColWidth)(b),T=h-(0,Kn.calcGridItemWHPx)(f,O,S[0]);l=(0,Kn.clamp)(l,0,T)}}const v={top:a,left:l};this.setState({dragging:v});const{x:w,y}=(0,Kn.calcXY)(b,a,l,f,p);return s.call(this,u,w,y,{e:t,node:r,newPosition:v})}),ui(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:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:f,y:p}=(0,Kn.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,f,p,{e:t,node:r,newPosition:u})}),ui(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),ui(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),ui(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,Kn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Kn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,tc.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,tc.setTransform)(t):(i=(0,tc.setTopLeft)(t),n&&(i.left=(0,tc.perc)(t.left/r),i.width=(0,tc.perc)(t.width/r))),i}mixinDraggable(t,n){return ec.default.createElement(EU.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:c,resizeHandles:u,resizeHandle:f}=this.props,p=this.getPositionParams(),h=(0,Kn.calcGridItemPosition)(p,0,0,o,0).width,b=(0,Kn.calcGridItemPosition)(p,0,0,i,s),v=(0,Kn.calcGridItemPosition)(p,0,0,a,l),w=[b.width,b.height],y=[Math.min(v.width,h),Math.min(v.height,1/0)];return ec.default.createElement(RU.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:w,maxConstraints:y,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:f},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:f,maxH:p,minH:h,containerWidth:b}=this.props,{minW:v,maxW:w}=this.props;let y=s;i&&(y=(0,tc.resizeItemInDirection)(a,r,s,b),this.setState({resizing:o==="onResizeStop"?null:y}));let{w:_,h:S}=(0,Kn.calcWH)(this.getPositionParams(),y.width,y.height,c,u,a);_=(0,Kn.clamp)(_,Math.max(v,1),w),S=(0,Kn.clamp)(S,h,p),l.call(this,f,_,S,{e:t,node:i,size:y,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Kn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=ec.default.Children.only(this.props.children);let f=ec.default.cloneElement(u,{ref:this.elementRef,className:(0,PU.default)("react-grid-item",u.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,...u.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,i),f}}Fm.default=jw;ui(jw,"propTypes",{children:zt.default.element,cols:zt.default.number.isRequired,containerWidth:zt.default.number.isRequired,rowHeight:zt.default.number.isRequired,margin:zt.default.array.isRequired,maxRows:zt.default.number.isRequired,containerPadding:zt.default.array.isRequired,x:zt.default.number.isRequired,y:zt.default.number.isRequired,w:zt.default.number.isRequired,h:zt.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:zt.default.string.isRequired,resizeHandles:xP.resizeHandleAxesType,resizeHandle:xP.resizeHandleType,onDragStop:zt.default.func,onDragStart:zt.default.func,onDrag:zt.default.func,onResizeStop:zt.default.func,onResizeStart:zt.default.func,onResize:zt.default.func,isDraggable:zt.default.bool.isRequired,isResizable:zt.default.bool.isRequired,isBounded:zt.default.bool.isRequired,static:zt.default.bool,useCSSTransforms:zt.default.bool.isRequired,transformScale:zt.default.number,className:zt.default.string,handle:zt.default.string,cancel:zt.default.string,droppingPosition:zt.default.shape({e:zt.default.object.isRequired,left:zt.default.number.isRequired,top:zt.default.number.isRequired})});ui(jw,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(Uf,"__esModule",{value:!0});Uf.default=void 0;var Da=kU(m),v0=ww,TU=zw(_w),it=Pt,DU=Oi,wP=zw(Fm),AU=zw(ss);function zw(e){return e&&e.__esModule?e:{default:e}}function wA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(wA=function(r){return r?n:t})(e)}function kU(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=wA(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 sr(e,t,n){return t=MU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MU(e){var t=IU(e,"string");return typeof t=="symbol"?t:String(t)}function IU(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 _P="react-grid-layout";let _A=!1;try{_A=/firefox/i.test(navigator.userAgent)}catch{}class Um extends Da.Component{constructor(){super(...arguments),sr(this,"state",{activeDrag:null,layout:(0,it.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,it.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),sr(this,"dragEnterCounter",0),sr(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,it.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),sr(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:f}=this.props,p=(0,it.getLayoutItem)(l,t);if(!p)return;const h={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t},b=!0;l=(0,it.moveElement)(l,p,n,r,b,f,(0,it.compactType)(this.props),c,u),this.props.onDrag(l,a,p,h,i,s),this.setState({layout:u?l:(0,it.compact)(l,(0,it.compactType)(this.props),c),activeDrag:h})}),sr(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:c,preventCollision:u,allowOverlap:f}=this.props,p=(0,it.getLayoutItem)(l,t);if(!p)return;const h=!0;l=(0,it.moveElement)(l,p,n,r,h,u,(0,it.compactType)(this.props),c,f);const b=f?l:(0,it.compact)(l,(0,it.compactType)(this.props),c);this.props.onDragStop(b,a,p,null,i,s);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:b,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(b,v)}),sr(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,it.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),sr(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:f,preventCollision:p,allowOverlap:h}=this.props;let b=!1,v,w,y;const[_,S]=(0,it.withLayoutItem)(u,t,E=>{let O;return w=E.x,y=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(w=E.x+(E.w-n),n=E.x!==w&&w<0?E.w:n,w=w<0?0:w),["ne","n","nw"].indexOf(l)!==-1&&(y=E.y+(E.h-r),r=E.y!==y&&y<0?E.h:r,y=y<0?0:y),b=!0),p&&!h&&(O=(0,it.getAllCollisions)(u,{...E,w:n,h:r,x:w,y}).filter(N=>N.i!==E.i).length>0,O&&(y=E.y,r=E.h,w=E.x,n=E.w,b=!1)),E.w=n,E.h=r,E});if(!S)return;v=_,b&&(v=(0,it.moveElement)(_,S,w,y,!0,this.props.preventCollision,(0,it.compactType)(this.props),f,h));const C={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(v,c,S,C,i,s),this.setState({layout:h?v:(0,it.compact)(v,(0,it.compactType)(this.props),f),activeDrag:C})}),sr(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,f=(0,it.getLayoutItem)(a,t),p=u?a:(0,it.compact)(a,(0,it.compactType)(this.props),c);this.props.onResizeStop(p,l,f,null,i,s);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,h)}),sr(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),_A&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(_P)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:f}=this.props,p=o==null?void 0:o(t);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const h={...r,...p},{layout:b}=this.state,{layerX:v,layerY:w}=t.nativeEvent,y={left:v/f,top:w/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=v||S!=w)&&this.setState({droppingPosition:y})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},S=(0,DU.calcXY)(_,w,v,h.w,h.h);this.setState({droppingDOMNode:Da.createElement("div",{key:h.i}),droppingPosition:y,layout:[...b,{...h,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),sr(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,it.compact)(r.filter(i=>i.i!==t.i),(0,it.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),sr(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),sr(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),sr(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,v0.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,it.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,it.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,it.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,it.fastRGLPropsEqual)(this.props,t,v0.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,it.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,v0.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:c}=this.props;return Da.createElement(wP.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:c},Da.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,it.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:f,isBounded:p,useCSSTransforms:h,transformScale:b,draggableCancel:v,draggableHandle:w,resizeHandles:y,resizeHandle:_}=this.props,{mounted:S,droppingPosition:C}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,O=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,T=r.resizeHandles||y,N=E&&p&&r.isBounded!==!1;return Da.createElement(wP.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:v,handle:w,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:O,isBounded:N,useCSSTransforms:h&&S,usePercentages:!S,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?C:void 0,resizeHandles:T,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,TU.default)(_P,t),s={height:this.containerHeight(),...n};return Da.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:it.noop,onDragLeave:r?this.onDragLeave:it.noop,onDragEnter:r?this.onDragEnter:it.noop,onDragOver:r?this.onDragOver:it.noop},Da.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Uf.default=Um;sr(Um,"displayName","ReactGridLayout");sr(Um,"propTypes",AU.default);sr(Um,"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:it.noop,onDragStart:it.noop,onDrag:it.noop,onDragStop:it.noop,onResizeStart:it.noop,onResize:it.noop,onResizeStop:it.noop,onDrop:it.noop,onDropDragOver:it.noop});var qm={},$l={};Object.defineProperty($l,"__esModule",{value:!0});$l.findOrGenerateResponsiveLayout=FU;$l.getBreakpointFromWidth=NU;$l.getColsFromBreakpoint=LU;$l.sortBreakpoints=Bw;var gp=Pt;function NU(e,t){const n=Bw(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 LU(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function FU(e,t,n,r,o,i){if(e[n])return(0,gp.cloneLayout)(e[n]);let s=e[r];const a=Bw(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,gp.cloneLayout)(s||[]),(0,gp.compact)((0,gp.correctBounds)(s,{cols:o}),i,o)}function Bw(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(qm,"__esModule",{value:!0});qm.default=void 0;var SP=zU(m),Dr=SA(ma),b0=ww,Rc=Pt,Aa=$l,jU=SA(Uf);function SA(e){return e&&e.__esModule?e:{default:e}}function CA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(CA=function(r){return r?n:t})(e)}function zU(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=CA(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 Tx(){return Tx=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},Tx.apply(this,arguments)}function Bg(e,t,n){return t=BU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BU(e){var t=VU(e,"string");return typeof t=="symbol"?t:String(t)}function VU(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 CP=e=>Object.prototype.toString.call(e);function mp(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Vw extends SP.Component{constructor(){super(...arguments),Bg(this,"state",this.generateInitialState()),Bg(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,Aa.getBreakpointFromWidth)(n,t),s=(0,Aa.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Aa.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,b0.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Aa.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,b0.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,b0.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,Aa.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Aa.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Rc.cloneLayout)(this.state.layout));let p=(0,Aa.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);p=(0,Rc.synchronizeLayoutWithChildren)(p,this.props.children,l,i,this.props.allowOverlap),c[s]=p,this.props.onLayoutChange(p,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:p,cols:l})}const u=mp(this.props.margin,s),f=mp(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return SP.createElement(jU.default,Tx({},u,{margin:mp(i,this.state.breakpoint),containerPadding:mp(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}qm.default=Vw;Bg(Vw,"propTypes",{breakpoint:Dr.default.string,breakpoints:Dr.default.object,allowOverlap:Dr.default.bool,cols:Dr.default.object,margin:Dr.default.oneOfType([Dr.default.array,Dr.default.object]),containerPadding:Dr.default.oneOfType([Dr.default.array,Dr.default.object]),layouts(e,t){if(CP(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+CP(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,Rc.validateLayout)(e.layouts[n],"layouts."+n)})},width:Dr.default.number.isRequired,onBreakpointChange:Dr.default.func,onLayoutChange:Dr.default.func,onWidthChange:Dr.default.func});Bg(Vw,"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:Rc.noop,onLayoutChange:Rc.noop,onWidthChange:Rc.noop});var Hw={},EA=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}()}(),Dx=typeof window<"u"&&typeof document<"u"&&window.document===document,Vg=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")()}(),HU=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Vg):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),WU=2;function UU(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){HU(i)}function a(){var l=Date.now();if(n){if(l-o<WU)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var qU=20,GU=["top","right","bottom","left","width","height","size","weight"],YU=typeof MutationObserver<"u",KU=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=UU(this.refresh.bind(this),qU)}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(){!Dx||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),YU?(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(){!Dx||!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=GU.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}(),RA=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},nu=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Vg},PA=Gm(0,0,0,0);function Hg(e){return parseFloat(e)||0}function EP(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+Hg(i)},0)}function XU(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]=Hg(s)}return n}function QU(e){var t=e.getBBox();return Gm(0,0,t.width,t.height)}function JU(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return PA;var r=nu(e).getComputedStyle(e),o=XU(r),i=o.left+o.right,s=o.top+o.bottom,a=Hg(r.width),l=Hg(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=EP(r,"left","right")+i),Math.round(l+s)!==n&&(l-=EP(r,"top","bottom")+s)),!eq(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return Gm(o.left,o.top,a,l)}var ZU=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof nu(e).SVGGraphicsElement}:function(e){return e instanceof nu(e).SVGElement&&typeof e.getBBox=="function"}}();function eq(e){return e===nu(e).document.documentElement}function tq(e){return Dx?ZU(e)?QU(e):JU(e):PA}function nq(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 RA(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Gm(e,t,n,r){return{x:e,y:t,width:n,height:r}}var rq=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Gm(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=tq(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}(),oq=function(){function e(t,n){var r=nq(n);RA(this,{target:t,contentRect:r})}return e}(),iq=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new EA,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 nu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new rq(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 nu(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 oq(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}(),OA=typeof WeakMap<"u"?new WeakMap:new EA,$A=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=KU.getInstance(),r=new iq(t,n,this);OA.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){$A.prototype[e]=function(){var t;return(t=OA.get(this))[e].apply(t,arguments)}});var sq=function(){return typeof Vg.ResizeObserver<"u"?Vg.ResizeObserver:$A}();const aq=Object.freeze(Object.defineProperty({__proto__:null,default:sq},Symbol.toStringTag,{value:"Module"})),lq=tw(aq);Object.defineProperty(Hw,"__esModule",{value:!0});Hw.default=mq;var vp=fq(m),cq=Ww(ma),uq=Ww(lq),dq=Ww(_w);function Ww(e){return e&&e.__esModule?e:{default:e}}function TA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(TA=function(r){return r?n:t})(e)}function fq(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=TA(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 Ax(){return Ax=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},Ax.apply(this,arguments)}function nc(e,t,n){return t=hq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hq(e){var t=pq(e,"string");return typeof t=="symbol"?t:String(t)}function pq(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 gq="react-grid-layout";function mq(e){var t;return t=class extends vp.Component{constructor(){super(...arguments),nc(this,"state",{width:1280}),nc(this,"elementRef",vp.createRef()),nc(this,"mounted",!1),nc(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new uq.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?vp.createElement("div",{className:(0,dq.default)(this.props.className,gq),style:this.props.style,ref:this.elementRef}):vp.createElement(e,Ax({innerRef:this.elementRef},o,this.state))}},nc(t,"defaultProps",{measureBeforeMount:!1}),nc(t,"propTypes",{measureBeforeMount:cq.default.bool}),t}(function(e){e.exports=Uf.default,e.exports.utils=Pt,e.exports.calculateUtils=Oi,e.exports.Responsive=qm.default,e.exports.Responsive.utils=$l,e.exports.WidthProvider=Hw.default})(VD);var RP=VD.exports;function xi({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),c=$e(p=>p.isDashboardEditing),u=p=>{p.stopPropagation(),c&&s(!0)};function f(){return o==="textarea"?R.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))}}):R.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 R.jsx("div",{className:"flex",role:"editable",onDoubleClick:u,children:i?f():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 Yf(e){return e+.5|0}const Js=(e,t,n)=>Math.max(Math.min(e,n),t);function vd(e){return Js(Yf(e*2.55),0,255)}function ia(e){return Js(Yf(e*255),0,255)}function Ji(e){return Js(Yf(e/2.55)/100,0,1)}function PP(e){return Js(Yf(e*100),0,100)}const Ro={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},kx=[..."0123456789ABCDEF"],vq=e=>kx[e&15],bq=e=>kx[(e&240)>>4]+kx[e&15],bp=e=>(e&240)>>4===(e&15),yq=e=>bp(e.r)&&bp(e.g)&&bp(e.b)&&bp(e.a);function xq(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Ro[e[1]]*17,g:255&Ro[e[2]]*17,b:255&Ro[e[3]]*17,a:t===5?Ro[e[4]]*17:255}:(t===7||t===9)&&(n={r:Ro[e[1]]<<4|Ro[e[2]],g:Ro[e[3]]<<4|Ro[e[4]],b:Ro[e[5]]<<4|Ro[e[6]],a:t===9?Ro[e[7]]<<4|Ro[e[8]]:255})),n}const wq=(e,t)=>e<255?t(e):"";function _q(e){var t=yq(e)?vq:bq;return e?"#"+t(e.r)+t(e.g)+t(e.b)+wq(e.a,t):void 0}const Sq=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function DA(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 Cq(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 Eq(e,t,n){const r=DA(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 Rq(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 Uw(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,c,u;return i!==s&&(u=i-s,c=a>.5?u/(2-i-s):u/(i+s),l=Rq(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function qw(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(ia)}function Gw(e,t,n){return qw(DA,e,t,n)}function Pq(e,t,n){return qw(Eq,e,t,n)}function Oq(e,t,n){return qw(Cq,e,t,n)}function AA(e){return(e%360+360)%360}function $q(e){const t=Sq.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?vd(+t[5]):ia(+t[5]));const o=AA(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=Pq(o,i,s):t[1]==="hsv"?r=Oq(o,i,s):r=Gw(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function Tq(e,t){var n=Uw(e);n[0]=AA(n[0]+t),n=Gw(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Dq(e){if(!e)return;const t=Uw(e),n=t[0],r=PP(t[1]),o=PP(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Ji(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const OP={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"},$P={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 Aq(){const e={},t=Object.keys($P),n=Object.keys(OP);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,OP[i]);i=parseInt($P[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let yp;function kq(e){yp||(yp=Aq(),yp.transparent=[0,0,0,0]);const t=yp[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Mq=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Iq(e){const t=Mq.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?vd(s):Js(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?vd(r):Js(r,0,255)),o=255&(t[4]?vd(o):Js(o,0,255)),i=255&(t[6]?vd(i):Js(i,0,255)),{r,g:o,b:i,a:n}}}function Nq(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ji(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const y0=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,rc=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Lq(e,t,n){const r=rc(Ji(e.r)),o=rc(Ji(e.g)),i=rc(Ji(e.b));return{r:ia(y0(r+n*(rc(Ji(t.r))-r))),g:ia(y0(o+n*(rc(Ji(t.g))-o))),b:ia(y0(i+n*(rc(Ji(t.b))-i))),a:e.a+n*(t.a-e.a)}}function xp(e,t,n){if(e){let r=Uw(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Gw(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function kA(e,t){return e&&Object.assign(t||{},e)}function TP(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=ia(e[3]))):(t=kA(e,{r:0,g:0,b:0,a:1}),t.a=ia(t.a)),t}function Fq(e){return e.charAt(0)==="r"?Iq(e):$q(e)}class Wd{constructor(t){if(t instanceof Wd)return t;const n=typeof t;let r;n==="object"?r=TP(t):n==="string"&&(r=xq(t)||kq(t)||Fq(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=kA(this._rgb);return t&&(t.a=Ji(t.a)),t}set rgb(t){this._rgb=TP(t)}rgbString(){return this._valid?Nq(this._rgb):void 0}hexString(){return this._valid?_q(this._rgb):void 0}hslString(){return this._valid?Dq(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,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,r.r=255&c*r.r+i*o.r+.5,r.g=255&c*r.g+i*o.g+.5,r.b=255&c*r.b+i*o.b+.5,r.a=s*r.a+(1-s)*o.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=Lq(this._rgb,t._rgb,n)),this}clone(){return new Wd(this.rgb)}alpha(t){return this._rgb.a=ia(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Yf(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 xp(this._rgb,2,t),this}darken(t){return xp(this._rgb,2,-t),this}saturate(t){return xp(this._rgb,1,t),this}desaturate(t){return xp(this._rgb,1,-t),this}rotate(t){return Tq(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 Ui(){}const jq=(()=>{let e=0;return()=>e++})();function Rt(e){return e===null||typeof e>"u"}function pn(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 Tt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Rn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Jr(e,t){return Rn(e)?e:t}function dt(e,t){return typeof e>"u"?t:e}const zq=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,MA=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function en(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Yt(e,t,n,r){let o,i,s;if(pn(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(Tt(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function Wg(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 Ug(e){if(pn(e))return e.map(Ug);if(Tt(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=Ug(e[n[o]]);return t}return e}function IA(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Bq(e,t,n,r){if(!IA(e))return;const o=t[e],i=n[e];Tt(o)&&Tt(i)?Ci(o,i,r):t[e]=Ug(i)}function Ci(e,t,n){const r=pn(t)?t:[t],o=r.length;if(!Tt(e))return e;n=n||{};const i=n.merger||Bq;let s;for(let a=0;a<o;++a){if(s=r[a],!Tt(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)i(l[c],e,s,n)}return e}function Cd(e,t){return Ci(e,t,{merger:Vq})}function Vq(e,t,n){if(!IA(e))return;const r=t[e],o=n[e];Tt(r)&&Tt(o)?Cd(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ug(o))}const DP={"":e=>e,x:e=>e.x,y:e=>e.y};function Hq(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 Wq(e){const t=Hq(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function la(e,t){return(DP[t]||(DP[t]=Wq(t)))(e)}function Yw(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ud=e=>typeof e<"u",ca=e=>typeof e=="function",AP=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Uq(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const mn=Math.PI,gn=2*mn,qq=gn+mn,qg=Number.POSITIVE_INFINITY,Gq=mn/180,Dn=mn/2,ka=mn/4,kP=mn*2/3,Zs=Math.log10,wi=Math.sign;function Ed(e,t,n){return Math.abs(e-t)<n}function MP(e){const t=Math.round(e);e=Ed(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Zs(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Yq(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 ru(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Kq(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function NA(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 Ko(e){return e*(mn/180)}function Kw(e){return e*(180/mn)}function IP(e){if(!Rn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function LA(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*mn&&(i+=gn),{angle:i,distance:o}}function Mx(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Xq(e,t){return(e-t+qq)%gn-mn}function ro(e){return(e%gn+gn)%gn}function qd(e,t,n,r){const o=ro(e),i=ro(t),s=ro(n),a=ro(i-o),l=ro(s-o),c=ro(o-i),u=ro(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function qn(e,t,n){return Math.max(t,Math.min(n,e))}function Qq(e){return qn(e,-32768,32767)}function ns(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Xw(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 rs=(e,t,n,r)=>Xw(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),Jq=(e,t,n)=>Xw(e,n,r=>e[r][t]>=n);function Zq(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 FA=["push","pop","shift","splice","unshift"];function eG(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),FA.forEach(n=>{const r="_onData"+Yw(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 NP(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)&&(FA.forEach(i=>{delete e[i]}),delete e._chartjs)}function jA(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const zA=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function BA(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,zA.call(window,()=>{r=!1,e.apply(t,n)}))}}function tG(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Qw=e=>e==="start"?"left":e==="end"?"right":"center",ar=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,nG=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function VA(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:c,max:u,minDefined:f,maxDefined:p}=s.getUserBounds();f&&(o=qn(Math.min(rs(a,l,c).lo,n?r:rs(t,l,s.getPixelForValue(c)).lo),0,r-1)),p?i=qn(Math.max(rs(a,s.axis,u,!0).hi+1,n?0:rs(t,l,s.getPixelForValue(u),!0).hi+1),o,r)-o:i=r-o}return{start:o,count:i}}function HA(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 wp=e=>e===0||e===1,LP=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*gn/n)),FP=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*gn/n)+1,Rd={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*Dn)+1,easeOutSine:e=>Math.sin(e*Dn),easeInOutSine:e=>-.5*(Math.cos(mn*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=>wp(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=>wp(e)?e:LP(e,.075,.3),easeOutElastic:e=>wp(e)?e:FP(e,.075,.3),easeInOutElastic(e){return wp(e)?e:e<.5?.5*LP(e*2,.1125,.45):.5+.5*FP(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-Rd.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?Rd.easeInBounce(e*2)*.5:Rd.easeOutBounce(e*2-1)*.5+.5};function Jw(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function jP(e){return Jw(e)?e:new Wd(e)}function x0(e){return Jw(e)?e:new Wd(e).saturate(.5).darken(.1).hexString()}const rG=["x","y","borderWidth","radius","tension"],oG=["color","borderColor","backgroundColor"];function iG(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:oG},numbers:{type:"number",properties:rG}}),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 sG(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const zP=new Map;function aG(e,t){t=t||{};const n=e+JSON.stringify(t);let r=zP.get(n);return r||(r=new Intl.NumberFormat(e,t),zP.set(n,r)),r}function Kf(e,t,n){return aG(t,n).format(e)}const WA={values(e){return pn(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 c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(o="scientific"),i=lG(e,n)}const s=Zs(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),Kf(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Zs(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?WA.numeric.call(this,e,t,n):""}};function lG(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 Ym={formatters:WA};function cG(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:Ym.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 vl=Object.create(null),Ix=Object.create(null);function Pd(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 w0(e,t,n){return typeof t=="string"?Ci(Pd(e,t),n):Ci(Pd(e,""),t)}class uG{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)=>x0(o.backgroundColor),this.hoverBorderColor=(r,o)=>x0(o.borderColor),this.hoverColor=(r,o)=>x0(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 w0(this,t,n)}get(t){return Pd(this,t)}describe(t,n){return w0(Ix,t,n)}override(t,n){return w0(vl,t,n)}route(t,n,r,o){const i=Pd(this,t),s=Pd(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[o];return Tt(l)?Object.assign({},c,l):dt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var _n=new uG({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[iG,sG,cG]);function dG(e){return!e||Rt(e.size)||Rt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Gg(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 fG(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,c,u,f,p;for(l=0;l<a;l++)if(f=n[l],f!=null&&!pn(f))s=Gg(e,o,i,s,f);else if(pn(f))for(c=0,u=f.length;c<u;c++)p=f[c],p!=null&&!pn(p)&&(s=Gg(e,o,i,s,p));e.restore();const h=i.length/2;if(h>n.length){for(l=0;l<h;l++)delete o[i[l]];i.splice(0,h)}return s}function Ma(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 BP(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function Nx(e,t,n,r){UA(e,t,n,r,null)}function UA(e,t,n,r,o){let i,s,a,l,c,u,f,p;const h=t.pointStyle,b=t.rotation,v=t.radius;let w=(b||0)*Gq;if(h&&typeof h=="object"&&(i=h.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(w),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(v)||v<=0)){switch(e.beginPath(),h){default:o?e.ellipse(n,r,o/2,v,0,0,gn):e.arc(n,r,v,0,gn),e.closePath();break;case"triangle":u=o?o/2:v,e.moveTo(n+Math.sin(w)*u,r-Math.cos(w)*v),w+=kP,e.lineTo(n+Math.sin(w)*u,r-Math.cos(w)*v),w+=kP,e.lineTo(n+Math.sin(w)*u,r-Math.cos(w)*v),e.closePath();break;case"rectRounded":c=v*.516,l=v-c,s=Math.cos(w+ka)*l,f=Math.cos(w+ka)*(o?o/2-c:l),a=Math.sin(w+ka)*l,p=Math.sin(w+ka)*(o?o/2-c:l),e.arc(n-f,r-a,c,w-mn,w-Dn),e.arc(n+p,r-s,c,w-Dn,w),e.arc(n+f,r+a,c,w,w+Dn),e.arc(n-p,r+s,c,w+Dn,w+mn),e.closePath();break;case"rect":if(!b){l=Math.SQRT1_2*v,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}w+=ka;case"rectRot":f=Math.cos(w)*(o?o/2:v),s=Math.cos(w)*v,a=Math.sin(w)*v,p=Math.sin(w)*(o?o/2:v),e.moveTo(n-f,r-a),e.lineTo(n+p,r-s),e.lineTo(n+f,r+a),e.lineTo(n-p,r+s),e.closePath();break;case"crossRot":w+=ka;case"cross":f=Math.cos(w)*(o?o/2:v),s=Math.cos(w)*v,a=Math.sin(w)*v,p=Math.sin(w)*(o?o/2:v),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"star":f=Math.cos(w)*(o?o/2:v),s=Math.cos(w)*v,a=Math.sin(w)*v,p=Math.sin(w)*(o?o/2:v),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s),w+=ka,f=Math.cos(w)*(o?o/2:v),s=Math.cos(w)*v,a=Math.sin(w)*v,p=Math.sin(w)*(o?o/2:v),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"line":s=o?o/2:Math.cos(w)*v,a=Math.sin(w)*v,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(w)*(o?o/2:v),r+Math.sin(w)*v);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function os(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 Km(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Xm(e){e.restore()}function hG(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 pG(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 gG(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Rt(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 mG(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,c=n+i.actualBoundingBoxDescent,u=o.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(s,u),e.lineTo(a,u),e.stroke()}}function vG(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function bl(e,t,n,r,o,i={}){const s=pn(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=o.string,gG(e,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&vG(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),Rt(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),mG(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function Gd(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*mn,mn,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,mn,Dn,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,Dn,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-Dn,!0),e.lineTo(n+s.topLeft,r)}const bG=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,yG=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function xG(e,t){const n=(""+e).match(bG);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 wG=e=>+e||0;function Zw(e,t){const n={},r=Tt(t),o=r?Object.keys(t):t,i=Tt(e)?r?s=>dt(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=wG(i(s));return n}function qA(e){return Zw(e,{top:"y",right:"x",bottom:"y",left:"x"})}function cl(e){return Zw(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Zn(e){const t=qA(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function kn(e,t){e=e||{},t=t||_n.font;let n=dt(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=dt(e.style,t.style);r&&!(""+r).match(yG)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:dt(e.family,t.family),lineHeight:xG(dt(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:dt(e.weight,t.weight),string:""};return o.string=dG(o),o}function hn(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&&pn(a)&&(a=a[n%a.length],o=!1),a!==void 0))return r&&!o&&(r.cacheable=!1),a}function _G(e,t,n){const{min:r,max:o}=e,i=MA(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 va(e,t){return Object.assign(Object.create(e),t)}function e_(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=XA("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>e_([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 YA(a,l,()=>TG(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return HP(a).includes(l)},ownKeys(a){return HP(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function ou(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:GA(e,r),setContext:i=>ou(e,i,n,r),override:i=>ou(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 YA(i,s,()=>CG(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 GA(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:ca(n)?n:()=>n,isIndexable:ca(r)?r:()=>r}}const SG=(e,t)=>e?e+Yw(t):t,t_=(e,t)=>Tt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function YA(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function CG(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return ca(a)&&s.isScriptable(t)&&(a=EG(t,a,e,n)),pn(a)&&a.length&&(a=RG(t,a,e,s.isIndexable)),t_(t,a)&&(a=ou(a,o,i&&i[t],s)),a}function EG(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),t_(e,l)&&(l=n_(o._scopes,o,e,l)),l}function RG(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(Tt(t[0])){const l=t,c=o._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=n_(c,o,e,u);t.push(ou(f,i,s&&s[e],a))}}return t}function KA(e,t,n){return ca(e)?e(t,n):e}const PG=(e,t)=>e===!0?t:typeof e=="string"?la(t,e):void 0;function OG(e,t,n,r,o){for(const i of t){const s=PG(n,i);if(s){e.add(s);const a=KA(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 n_(e,t,n,r){const o=t._rootScopes,i=KA(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=VP(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=VP(a,s,i,l,r),l===null)?!1:e_(Array.from(a),[""],o,i,()=>$G(t,n,r))}function VP(e,t,n,r,o){for(;n;)n=OG(e,t,n,r,o);return n}function $G(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return pn(o)&&Tt(n)?n:o||{}}function TG(e,t,n,r){let o;for(const i of t)if(o=XA(SG(i,e),n),typeof o<"u")return t_(e,o)?n_(n,r,e,o):o}function XA(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function HP(e){let t=e._keys;return t||(t=e._keys=DG(e._scopes)),t}function DG(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 QA(e,t,n,r){const{iScale:o}=e,{key:i="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],s[a]={r:o.parse(la(u,i),c)};return s}const AG=Number.EPSILON||1e-14,iu=(e,t)=>t<e.length&&!e[t].skip&&e[t],JA=e=>e==="x"?"y":"x";function kG(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=Mx(i,o),l=Mx(s,i);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=r*c,p=r*u;return{previous:{x:i.x-f*(s.x-o.x),y:i.y-f*(s.y-o.y)},next:{x:i.x+p*(s.x-o.x),y:i.y+p*(s.y-o.y)}}}function MG(e,t,n){const r=e.length;let o,i,s,a,l,c=iu(e,0);for(let u=0;u<r-1;++u)if(l=c,c=iu(e,u+1),!(!l||!c)){if(Ed(t[u],0,AG)){n[u]=n[u+1]=0;continue}o=n[u]/t[u],i=n[u+1]/t[u],a=Math.pow(o,2)+Math.pow(i,2),!(a<=9)&&(s=3/Math.sqrt(a),n[u]=o*s*t[u],n[u+1]=i*s*t[u])}}function IG(e,t,n="x"){const r=JA(n),o=e.length;let i,s,a,l=iu(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=iu(e,c+1),!a)continue;const u=a[n],f=a[r];s&&(i=(u-s[n])/3,a[`cp1${n}`]=u-i,a[`cp1${r}`]=f-i*t[c]),l&&(i=(l[n]-u)/3,a[`cp2${n}`]=u+i,a[`cp2${r}`]=f+i*t[c])}}function NG(e,t="x"){const n=JA(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,c=iu(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=iu(e,s+1),!!l){if(c){const u=c[t]-l[t];o[s]=u!==0?(c[n]-l[n])/u:0}i[s]=a?c?wi(o[s-1])!==wi(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}MG(e,o,i),IG(e,i,t)}function _p(e,t,n){return Math.max(Math.min(e,n),t)}function LG(e,t){let n,r,o,i,s,a=os(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&os(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=_p(o.cp1x,t.left,t.right),o.cp1y=_p(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=_p(o.cp2x,t.left,t.right),o.cp2y=_p(o.cp2y,t.top,t.bottom)))}function FG(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")NG(e,o);else{let c=r?e[e.length-1]:e[0];for(i=0,s=e.length;i<s;++i)a=e[i],l=kG(c,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,c=a}t.capBezierPoints&&LG(e,n)}function r_(){return typeof window<"u"&&typeof document<"u"}function o_(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Yg(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 Qm=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function jG(e,t){return Qm(e).getPropertyValue(t)}const zG=["top","right","bottom","left"];function ul(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=zG[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const BG=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function VG(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(BG(o,i,e.target))a=o,l=i;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function za(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=Qm(n),i=o.boxSizing==="border-box",s=ul(o,"padding"),a=ul(o,"border","width"),{x:l,y:c,box:u}=VG(e,n),f=s.left+(u&&a.left),p=s.top+(u&&a.top);let{width:h,height:b}=t;return i&&(h-=s.width+a.width,b-=s.height+a.height),{x:Math.round((l-f)/h*n.width/r),y:Math.round((c-p)/b*n.height/r)}}function HG(e,t,n){let r,o;if(t===void 0||n===void 0){const i=o_(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=Qm(i),l=ul(a,"border","width"),c=ul(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Yg(a.maxWidth,i,"clientWidth"),o=Yg(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||qg,maxHeight:o||qg}}const Sp=e=>Math.round(e*10)/10;function WG(e,t,n,r){const o=Qm(e),i=ul(o,"margin"),s=Yg(o.maxWidth,e,"clientWidth")||qg,a=Yg(o.maxHeight,e,"clientHeight")||qg,l=HG(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const p=ul(o,"border","width"),h=ul(o,"padding");c-=h.width+p.width,u-=h.height+p.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=Sp(Math.min(c,s,l.maxWidth)),u=Sp(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Sp(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Sp(Math.floor(u*r))),{width:c,height:u}}function WP(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 UG=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};r_()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function UP(e,t){const n=jG(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Ba(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function qG(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 GG(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=Ba(e,o,n),a=Ba(o,i,n),l=Ba(i,t,n),c=Ba(s,a,n),u=Ba(a,l,n);return Ba(c,u,n)}const YG=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}}},KG=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Pc(e,t,n){return e?YG(t,n):KG()}function ZA(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 ek(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function tk(e){return e==="angle"?{between:qd,compare:Xq,normalize:ro}:{between:ns,compare:(t,n)=>t-n,normalize:t=>t}}function qP({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 XG(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=tk(r),l=t.length;let{start:c,end:u,loop:f}=e,p,h;if(f){for(c+=l,u+=l,p=0,h=l;p<h&&s(a(t[c%l][r]),o,i);++p)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:e.style}}function nk(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:c}=tk(r),{start:u,end:f,loop:p,style:h}=XG(e,t,n),b=[];let v=!1,w=null,y,_,S;const C=()=>l(o,S,y)&&a(o,S)!==0,E=()=>a(i,y)===0||l(i,S,y),O=()=>v||C(),T=()=>!v||E();for(let N=u,M=u;N<=f;++N)_=t[N%s],!_.skip&&(y=c(_[r]),y!==S&&(v=l(y,o,i),w===null&&O()&&(w=a(y,o)===0?N:M),w!==null&&T()&&(b.push(qP({start:w,end:N,loop:p,count:s,style:h})),w=null),M=N,S=y));return w!==null&&b.push(qP({start:w,end:f,loop:p,count:s,style:h})),b}function rk(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=nk(r[o],e.points,t);i.length&&n.push(...i)}return n}function QG(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 JG(e,t,n,r){const o=e.length,i=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%o];c.skip||c.stop?a.skip||(r=!1,i.push({start:t%o,end:(l-1)%o,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&i.push({start:t%o,end:s%o,loop:r}),i}function ZG(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=QG(n,o,i,r);if(r===!0)return GP(e,[{start:s,end:a,loop:i}],n,t);const l=a<s?a+o:a,c=!!e._fullLoop&&s===0&&a===o-1;return GP(e,JG(n,s,l,c),n,t)}function GP(e,t,n,r){return!r||!r.setContext||!n?t:eY(e,t,n,r)}function eY(e,t,n,r){const o=e._chart.getContext(),i=YP(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=i,f=t[0].start,p=f;function h(b,v,w,y){const _=a?-1:1;if(b!==v){for(b+=l;n[b%l].skip;)b-=_;for(;n[v%l].skip;)v+=_;b%l!==v%l&&(c.push({start:b%l,end:v%l,loop:w,style:y}),u=y,f=v%l)}}for(const b of t){f=a?f:b.start;let v=n[f%l],w;for(p=f+1;p<=b.end;p++){const y=n[p%l];w=YP(r.setContext(va(o,{type:"segment",p0:v,p1:y,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),tY(w,u)&&h(f,p-1,b.loop,u),v=y,u=w}f<p-1&&h(f,p-1,b.loop,u)}return c}function YP(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function tY(e,t){if(!t)return!1;const n=[],r=function(o,i){return Jw(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 nY{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=zA.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 Ki=new nY;const KP="transparent",rY={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=jP(e||KP),o=r.valid&&jP(t||KP);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class oY{constructor(t,n,r,o){const i=n[r];o=hn([t.to,o,i,t.from]);const s=hn([t.from,i,o]);this._active=!0,this._fn=t.fn||rY[t.type||typeof s],this._easing=Rd[t.easing]||Rd.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=hn([t.to,n,o,t.from]),this._from=hn([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 ok{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Tt(t))return;const n=Object.keys(_n.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!Tt(i))return;const s={};for(const a of n)s[a]=i[a];(pn(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=sY(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&iY(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 c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(t,n));continue}const u=n[c];let f=i[c];const p=r.get(c);if(f)if(p&&f.active()){f.update(p,u,a);continue}else f.cancel();if(!p||!p.duration){t[c]=u;continue}i[c]=f=new oY(p,t,c,u),o.push(f)}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 Ki.add(this._chart,r),!0}}function iY(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 sY(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 XP(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 aY(e,t,n){if(n===!1)return!1;const r=XP(e,n),o=XP(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function lY(e){let t,n,r,o;return Tt(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 ik(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 QP(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(r.all)continue;break}c=e.values[l],Rn(c)&&(i||t===0||wi(t)===wi(c))&&(t+=c)}return t}}function cY(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 JP(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function uY(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function dY(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 fY(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function ZP(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 eO(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:a}=r,l=i.axis,c=s.axis,u=uY(i,s,r),f=t.length;let p;for(let h=0;h<f;++h){const b=t[h],{[l]:v,[c]:w}=b,y=b._stacks||(b._stacks={});p=y[c]=fY(o,u,v),p[a]=w,p._top=ZP(p,s,!0,r.type),p._bottom=ZP(p,s,!1,r.type);const _=p._visualValues||(p._visualValues={});_[a]=w}}function _0(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function hY(e,t){return va(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function pY(e,t,n){return va(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ku(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 S0=e=>e==="reset"||e==="none",tO=(e,t)=>t?e:Object.assign({},e),gY=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:ik(n,!0),values:null};class Xo{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=JP(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&&Ku(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(f,p,h,b)=>f==="x"?p:f==="r"?b:h,i=n.xAxisID=dt(r.xAxisID,_0(t,"x")),s=n.yAxisID=dt(r.yAxisID,_0(t,"y")),a=n.rAxisID=dt(r.rAxisID,_0(t,"r")),l=n.indexAxis,c=n.iAxisID=o(l,i,s,a),u=n.vAxisID=o(l,s,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(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&&NP(this._data,this),t._stacked&&Ku(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Tt(n))this._data=cY(n);else if(r!==n){if(r){NP(r,this);const o=this._cachedMeta;Ku(o),o._parsed=[]}n&&Object.isExtensible(n)&&eG(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=JP(n.vScale,n),n.stack!==r.stack&&(o=!0,Ku(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&eO(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,c=t>0&&r._parsed[t-1],u,f,p;if(this._parsing===!1)r._parsed=o,r._sorted=!0,p=o;else{pn(o[t])?p=this.parseArrayData(r,o,t,n):Tt(o[t])?p=this.parseObjectData(r,o,t,n):p=this.parsePrimitiveData(r,o,t,n);const h=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=f=p[u],l&&(h()&&(l=!1),c=f);r._sorted=l}s&&eO(this,p)}parsePrimitiveData(t,n,r,o){const{iScale:i,vScale:s}=t,a=i.axis,l=s.axis,c=i.getLabels(),u=i===s,f=new Array(o);let p,h,b;for(p=0,h=o;p<h;++p)b=p+r,f[p]={[a]:u||i.parse(c[b],b),[l]:s.parse(n[b],b)};return f}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,c,u,f;for(l=0,c=o;l<c;++l)u=l+r,f=n[u],a[l]={x:i.parse(f[0],u),y:s.parse(f[1],u)};return a}parseObjectData(t,n,r,o){const{xScale:i,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,f,p,h;for(u=0,f=o;u<f;++u)p=u+r,h=n[p],c[u]={x:i.parse(la(h,a),p),y:s.parse(la(h,l),p)};return c}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:ik(o,!0),values:n._stacks[t.axis]._visualValues};return QP(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=QP(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=gY(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=dY(a);let p,h;function b(){h=o[p];const v=h[a.axis];return!Rn(h[t.axis])||u>v||f<v}for(p=0;p<s&&!(!b()&&(this.updateRangeFromParsed(c,t,h,l),i));++p);if(i){for(p=s-1;p>=0;--p)if(!b()){this.updateRangeFromParsed(c,t,h,l);break}}return c}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],Rn(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=lY(dt(this.options.clip,aY(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,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,i,a,l),u=a;u<a+l;++u){const f=o[u];f.hidden||(f.active&&c?s.push(f):f.draw(t,i))}for(u=0;u<s.length;++u)s[u].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=pY(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=hY(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&&Ud(r);if(a)return tO(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=o?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),u),h=Object.keys(_n.elements[t]),b=()=>this.getContext(r,o,n),v=c.resolveNamedOptions(p,h,b,f);return v.$shared&&(v.$shared=l,i[s]=Object.freeze(tO(v,l))),v}_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 u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),p=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(p,this.getContext(t,r,n))}const c=new ok(o,l&&l.animations);return l&&l._cacheable&&(i[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||S0(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){S0(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!S0(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,c]of this._syncList)this[a](l,c);this._syncList=[];const o=r.length,i=n.length,s=Math.min(i,o);s&&this.parse(0,s),i>o?this._insertElements(o,i-o,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=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[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&&Ku(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])}}Ne(Xo,"defaults",{}),Ne(Xo,"datasetElementType",null),Ne(Xo,"dataElementType",null);function mY(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=jA(r.sort((o,i)=>o-i))}return e._cache.$bar}function vY(e){const t=e.iScale,n=mY(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(Ud(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 bY(e,t,n,r){const o=n.barThickness;let i,s;return Rt(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 yY(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 c=i-(i-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function xY(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,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:s,max:a}}function sk(e,t,n,r){return pn(e)?xY(e,t,n,r):t[n.axis]=n.parse(e,r),t}function nO(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,f,p;for(c=n,u=n+r;c<u;++c)p=t[c],f={},f[o.axis]=a||o.parse(s[c],c),l.push(sk(p,f,i,c));return l}function C0(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function wY(e,t,n){return e!==0?wi(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function _Y(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 SY(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:c,bottom:u}=_Y(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[rO(u,s,a,l)]=!0,o=c)),i[rO(o,s,a,l)]=!0,e.borderSkipped=i}function rO(e,t,n,r){return r?(e=CY(e,t,n),e=oO(e,n,t)):e=oO(e,t,n),e}function CY(e,t,n){return e===t?n:e===n?t:e}function oO(e,t,n){return e==="start"?t:e==="end"?n:e}function EY(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class xg extends Xo{parsePrimitiveData(t,n,r,o){return nO(t,n,r,o)}parseArrayData(t,n,r,o){return nO(t,n,r,o)}parseObjectData(t,n,r,o){const{iScale:i,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,u=s.axis==="x"?a:l,f=[];let p,h,b,v;for(p=r,h=r+o;p<h;++p)v=n[p],b={},b[i.axis]=i.parse(la(v,c),p),f.push(sk(la(v,u),b,s,p));return f}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=C0(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(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:p}=this._getSharedOptions(n,o);for(let h=n;h<n+r;h++){const b=this.getParsed(h),v=i||Rt(b[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),w=this._calculateBarIndexPixels(h,u),y=(b._stacks||{})[a.axis],_={horizontal:c,base:v.base,enableBorderRadius:!y||C0(b._custom)||s===y._top||s===y._bottom,x:c?v.head:w.center,y:c?w.center:v.head,height:c?w.size:Math.abs(v.size),width:c?Math.abs(v.size):w.size};p&&(_.options=f||this.resolveDataElementOptions(h,t[h].active?"active":o));const S=_.options||t[h].options;SY(_,S,y,s),EY(_,S,u.ratio),this.updateElement(t[h],h,_,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 c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(Rt(u)||isNaN(u))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||vY(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),c=l._custom,u=C0(c);let f=l[n.axis],p=0,h=r?this.applyStack(n,l,r):f,b,v;h!==f&&(p=h-f,h=f),u&&(f=c.barStart,h=c.barEnd-c.barStart,f!==0&&wi(f)!==wi(c.barEnd)&&(p=0),p+=f);const w=!Rt(i)&&!u?i:p;let y=n.getPixelForValue(w);if(this.chart.getDataVisibility(t)?b=n.getPixelForValue(p+h):b=y,v=b-y,Math.abs(v)<s){v=wY(v,n,a)*s,f===a&&(y-=v/2);const _=n.getPixelForDecimal(0),S=n.getPixelForDecimal(1),C=Math.min(_,S),E=Math.max(_,S);y=Math.max(Math.min(y,E),C),b=y+v,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(b)-n.getValueForPixel(y))}if(y===n.getPixelForValue(a)){const _=wi(v)*n.getLineWidthForValue(a)/2;y+=_,v-=_}return{size:v,base:y,head:b,center:b+v/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=dt(o.maxBarThickness,1/0);let a,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?yY(t,n,o,c):bY(t,n,o,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=u.start+u.chunk*f+u.chunk/2,l=Math.min(s,u.chunk*u.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)}}Ne(xg,"id","bar"),Ne(xg,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ne(xg,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class wg extends Xo{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=dt(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=dt(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),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}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:c}=this._getSharedOptions(n,o),u=s.axis,f=a.axis;for(let p=n;p<n+r;p++){const h=t[p],b=!i&&this.getParsed(p),v={},w=v[u]=i?s.getPixelForDecimal(.5):s.getPixelForValue(b[u]),y=v[f]=i?a.getBasePixel():a.getPixelForValue(b[f]);v.skip=isNaN(w)||isNaN(y),c&&(v.options=l||this.resolveDataElementOptions(p,h.active?"active":o),i&&(v.options.radius=0)),this.updateElement(h,p,v,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+=dt(r&&r._custom,i),o}}Ne(wg,"id","bubble"),Ne(wg,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Ne(wg,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function RY(e,t,n){let r=1,o=1,i=0,s=0;if(t<gn){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),p=Math.sin(l),h=(S,C,E)=>qd(S,a,l,!0)?1:Math.max(C,C*n,E,E*n),b=(S,C,E)=>qd(S,a,l,!0)?-1:Math.min(C,C*n,E,E*n),v=h(0,c,f),w=h(Dn,u,p),y=b(mn,c,f),_=b(mn+Dn,u,p);r=(v-y)/2,o=(w-_)/2,i=-(v+y)/2,s=-(w+_)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class Qa extends Xo{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(Tt(r[t])){const{key:l="value"}=this._parsing;i=c=>+la(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return Ko(this.options.rotation-90)}_getCircumference(){return Ko(this.options.circumference)}_getRotationExtents(){let t=gn,n=-gn;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(zq(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:b,offsetY:v}=RY(f,u,l),w=(r.width-s)/p,y=(r.height-s)/h,_=Math.max(Math.min(w,y)/2,0),S=MA(this.options.radius,_),C=Math.max(S*l,0),E=(S-C)/this._getVisibleDatasetWeightTotal();this.offsetX=b*S,this.offsetY=v*S,o.total=this.calculateTotal(),this.outerRadius=S-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*c,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/gn)}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,p=i&&c.animateScale,h=p?0:this.innerRadius,b=p?0:this.outerRadius,{sharedOptions:v,includeOptions:w}=this._getSharedOptions(n,o);let y=this._getRotation(),_;for(_=0;_<n;++_)y+=this._circumference(_,i);for(_=n;_<n+r;++_){const S=this._circumference(_,i),C=t[_],E={x:u+this.offsetX,y:f+this.offsetY,startAngle:y,endAngle:y+S,circumference:S,outerRadius:b,innerRadius:h};w&&(E.options=v||this.resolveDataElementOptions(_,C.active?"active":o)),y+=S,this.updateElement(C,_,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)?gn*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=Kf(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(dt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ne(Qa,"id","doughnut"),Ne(Qa,"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"}),Ne(Qa,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ne(Qa,"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 _g extends Xo{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}=VA(n,o,s);this._drawStart=a,this._drawCount=l,HA(n)&&(a=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(o,a,l,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,o),p=s.axis,h=a.axis,{spanGaps:b,segment:v}=this.options,w=ru(b)?b:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||i||o==="none",_=n+r,S=t.length;let C=n>0&&this.getParsed(n-1);for(let E=0;E<S;++E){const O=t[E],T=y?O:{};if(E<n||E>=_){T.skip=!0;continue}const N=this.getParsed(E),M=Rt(N[h]),A=T[p]=s.getPixelForValue(N[p],E),F=T[h]=i||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,N,l):N[h],E);T.skip=isNaN(A)||isNaN(F)||M,T.stop=E>0&&Math.abs(N[p]-C[p])>w,v&&(T.parsed=N,T.raw=c.data[E]),f&&(T.options=u||this.resolveDataElementOptions(E,O.active?"active":o)),y||this.updateElement(O,E,T,o),C=N}}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()}}Ne(_g,"id","line"),Ne(_g,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ne(_g,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Od extends Xo{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=Kf(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return QA.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,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,p=c.getIndexAngle(0)-.5*mn;let h=p,b;const v=360/this.countVisibleElements();for(b=0;b<n;++b)h+=this._computeAngle(b,o,v);for(b=n;b<n+r;b++){const w=t[b];let y=h,_=h+this._computeAngle(b,o,v),S=s.getDataVisibility(b)?c.getDistanceFromCenterForValue(this.getParsed(b).r):0;h=_,i&&(l.animateScale&&(S=0),l.animateRotate&&(y=_=p));const C={x:u,y:f,innerRadius:0,outerRadius:S,startAngle:y,endAngle:_,options:this.resolveDataElementOptions(b,w.active?"active":o)};this.updateElement(w,b,C,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)?Ko(this.resolveDataElementOptions(t,n).angle||r):0}}Ne(Od,"id","polarArea"),Ne(Od,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Ne(Od,"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 Lx extends Qa{}Ne(Lx,"id","pie"),Ne(Lx,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Sg extends Xo{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 QA.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],c=this.resolveDataElementOptions(a,l.active?"active":o),u=i.getPointPositionForValue(a,this.getParsed(a).r),f=s?i.xCenter:u.x,p=s?i.yCenter:u.y,h={x:f,y:p,angle:u.angle,skip:isNaN(f)||isNaN(p),options:c};this.updateElement(l,a,h,o)}}}Ne(Sg,"id","radar"),Ne(Sg,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Ne(Sg,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Cg extends Xo{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}=VA(n,r,o);if(this._drawStart=i,this._drawCount=s,HA(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 c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!o,options:c},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:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,o),f=this.getSharedOptions(u),p=this.includeOptions(o,f),h=s.axis,b=a.axis,{spanGaps:v,segment:w}=this.options,y=ru(v)?v:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||i||o==="none";let S=n>0&&this.getParsed(n-1);for(let C=n;C<n+r;++C){const E=t[C],O=this.getParsed(C),T=_?E:{},N=Rt(O[b]),M=T[h]=s.getPixelForValue(O[h],C),A=T[b]=i||N?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,O,l):O[b],C);T.skip=isNaN(M)||isNaN(A)||N,T.stop=C>0&&Math.abs(O[h]-S[h])>y,w&&(T.parsed=O,T.raw=c.data[C]),p&&(T.options=f||this.resolveDataElementOptions(C,E.active?"active":o)),_||this.updateElement(E,C,T,o),S=O}this.updateSharedOptions(f,o,u)}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}}Ne(Cg,"id","scatter"),Ne(Cg,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Ne(Cg,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var PY=Object.freeze({__proto__:null,BarController:xg,BubbleController:wg,DoughnutController:Qa,LineController:_g,PieController:Lx,PolarAreaController:Od,RadarController:Sg,ScatterController:Cg});function Ia(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class i_{constructor(t){Ne(this,"options");this.options=t||{}}static override(t){Object.assign(i_.prototype,t)}init(){}formats(){return Ia()}parse(){return Ia()}format(){return Ia()}add(){return Ia()}diff(){return Ia()}startOf(){return Ia()}endOf(){return Ia()}}var OY={_date:i_};function $Y(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?Jq:rs;if(r){if(o._sharedOptions){const c=i[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const f=l(i,t,n-u),p=l(i,t,n+u);return{lo:f.lo,hi:p.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function Xf(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=i.length;a<l;++a){const{index:c,data:u}=i[a],{lo:f,hi:p}=$Y(i[a],t,s,o);for(let h=f;h<=p;++h){const b=u[h];b.skip||r(b,c,h)}}}function TY(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 E0(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||Xf(e,n,t,function(a,l,c){!o&&!os(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function DY(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:f}=LA(s,{x:t.x,y:t.y});qd(f,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return Xf(e,n,t,i),o}function AY(e,t,n,r,o,i){let s=[];const a=TY(n);let l=Number.POSITIVE_INFINITY;function c(u,f,p){const h=u.inRange(t.x,t.y,o);if(r&&!h)return;const b=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(b))&&!h)return;const w=a(t,b);w<l?(s=[{element:u,datasetIndex:f,index:p}],l=w):w===l&&s.push({element:u,datasetIndex:f,index:p})}return Xf(e,n,t,c),s}function R0(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?DY(e,t,n,o):AY(e,t,n,r,o,i)}function iO(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Xf(e,n,t,(l,c,u)=>{l[s](t[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,o))}),r&&!a?[]:i}var kY={evaluateInteractionItems:Xf,modes:{index(e,t,n,r){const o=za(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?E0(e,o,i,r,s):R0(e,o,i,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const o=za(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?E0(e,o,i,r,s):R0(e,o,i,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const o=za(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return E0(e,o,i,r,s)},nearest(e,t,n,r){const o=za(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return R0(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=za(t,e);return iO(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=za(t,e);return iO(e,o,"y",n.intersect,r)}}};const ak=["left","top","right","bottom"];function Xu(e,t){return e.filter(n=>n.pos===t)}function sO(e,t){return e.filter(n=>ak.indexOf(n.pos)===-1&&n.box.axis===t)}function Qu(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 MY(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 IY(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!ak.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 NY(e,t){const n=IY(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,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=o):(a.width=r,a.height=u?u*o:l&&t.availableHeight)}return n}function LY(e){const t=MY(e),n=Qu(t.filter(c=>c.box.fullSize),!0),r=Qu(Xu(t,"left"),!0),o=Qu(Xu(t,"right")),i=Qu(Xu(t,"top"),!0),s=Qu(Xu(t,"bottom")),a=sO(t,"x"),l=sO(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:Xu(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function aO(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function lk(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 FY(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!Tt(o)){n.size&&(e[o]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?i.height:i.width),n.size=f.size/f.count,e[o]+=n.size}i.getPadding&&lk(s,i.getPadding());const a=Math.max(0,t.outerWidth-aO(s,e,"left","right")),l=Math.max(0,t.outerHeight-aO(s,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function jY(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 zY(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 bd(e,t,n,r){const o=[];let i,s,a,l,c,u;for(i=0,s=e.length,c=0;i<s;++i){a=e[i],l=a.box,l.update(a.width||t.w,a.height||t.h,zY(a.horizontal,t));const{same:f,other:p}=FY(t,n,a,r);c|=f&&o.length,u=u||p,l.fullSize||o.push(a)}return c&&bd(o,t,n,r)||u}function Cp(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 lO(e,t,n,r){const o=n.padding;let{x:i,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*u,p=c.size||l.height;Ud(c.start)&&(s=c.start),l.fullSize?Cp(l,o.left,s,n.outerWidth-o.right-o.left,p):Cp(l,t.left+c.placed,s,f,p),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*u,p=c.size||l.width;Ud(c.start)&&(i=c.start),l.fullSize?Cp(l,i,o.top,p,n.outerHeight-o.bottom-o.top):Cp(l,i,t.top+c.placed,p,f),c.start=i,c.placed+=f,i=l.right}}t.x=i,t.y=s}var cr={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=Zn(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=LY(e.boxes),l=a.vertical,c=a.horizontal;Yt(e.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const u=l.reduce((v,w)=>w.box.options&&w.box.options.display===!1?v:v+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),p=Object.assign({},o);lk(p,Zn(r));const h=Object.assign({maxPadding:p,w:i,h:s,x:o.left,y:o.top},o),b=NY(l.concat(c),f);bd(a.fullSize,h,f,b),bd(l,h,f,b),bd(c,h,f,b)&&bd(l,h,f,b),jY(h),lO(a.leftAndTop,h,f,b),h.x+=h.w,h.y+=h.h,lO(a.rightAndBottom,h,f,b),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Yt(a.chartArea,v=>{const w=v.box;Object.assign(w,e.chartArea),w.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class ck{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 BY extends ck{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Eg="$chartjs",VY={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},cO=e=>e===null||e==="";function HY(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Eg]={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",cO(o)){const i=UP(e,"width");i!==void 0&&(e.width=i)}if(cO(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=UP(e,"height");i!==void 0&&(e.height=i)}return e}const uk=UG?{passive:!0}:!1;function WY(e,t,n){e.addEventListener(t,n,uk)}function UY(e,t,n){e.canvas.removeEventListener(t,n,uk)}function qY(e,t){const n=VY[e.type]||e.type,{x:r,y:o}=za(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function Kg(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function GY(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Kg(a.addedNodes,r),s=s&&!Kg(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function YY(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Kg(a.removedNodes,r),s=s&&!Kg(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Yd=new Map;let uO=0;function dk(){const e=window.devicePixelRatio;e!==uO&&(uO=e,Yd.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function KY(e,t){Yd.size||window.addEventListener("resize",dk),Yd.set(e,t)}function XY(e){Yd.delete(e),Yd.size||window.removeEventListener("resize",dk)}function QY(e,t,n){const r=e.canvas,o=r&&o_(r);if(!o)return;const i=BA((a,l)=>{const c=o.clientWidth;n(a,l),c<o.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return s.observe(o),KY(e,i),s}function P0(e,t,n){n&&n.disconnect(),t==="resize"&&XY(e)}function JY(e,t,n){const r=e.canvas,o=BA(i=>{e.ctx!==null&&n(qY(i,e))},e);return WY(r,t,o),o}class ZY extends ck{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(HY(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Eg])return!1;const r=n[Eg].initial;["height","width"].forEach(i=>{const s=r[i];Rt(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[Eg],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:GY,detach:YY,resize:QY}[n]||JY;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:P0,detach:P0,resize:P0}[n]||UY)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return WG(t,n,r,o)}isAttached(t){const n=o_(t);return!!(n&&n.isConnected)}}function eK(e){return!r_()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?BY:ZY}var vg;let ds=(vg=class{constructor(){Ne(this,"x");Ne(this,"y");Ne(this,"active",!1);Ne(this,"options");Ne(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return ru(this.x)&&ru(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}},Ne(vg,"defaults",{}),Ne(vg,"defaultRoutes"),vg);function tK(e,t){const n=e.options.ticks,r=nK(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?oK(t):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return iK(t,c,i,s/o),c;const u=rK(i,t,o);if(s>0){let f,p;const h=s>1?Math.round((l-a)/(s-1)):null;for(Ep(t,c,u,Rt(h)?0:a-h,a),f=0,p=s-1;f<p;f++)Ep(t,c,u,i[f],i[f+1]);return Ep(t,c,u,l,Rt(h)?t.length:l+h),c}return Ep(t,c,u),c}function nK(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 rK(e,t,n){const r=sK(e),o=t.length/n;if(!r)return Math.max(o,1);const i=Yq(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 oK(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function iK(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 Ep(e,t,n,r,o){const i=dt(r,0),s=Math.min(dt(o,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(c=Math.max(i,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(i+a*n))}function sK(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 aK=e=>e==="left"?"right":e==="right"?"left":e,dO=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,fO=(e,t)=>Math.min(t||e,e);function hO(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 lK(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),c;if(!(n&&(r===1?c=Math.max(l-i,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(o-1))/2,l+=o<t?c:-c,l<i-a||l>s+a)))return l}function cK(e,t){Yt(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 Ju(e){return e.drawTicks?e.tickLength:0}function pO(e,t){if(!e.display)return 0;const n=kn(e.font,t),r=Zn(e.padding);return(pn(e.text)?e.text.length:1)*n.lineHeight+r.height}function uK(e,t){return va(e,{scale:t,type:"scale"})}function dK(e,t,n){return va(e,{tick:n,index:t,type:"tick"})}function fK(e,t,n){let r=Qw(e);return(n&&t!=="right"||!n&&t==="right")&&(r=aK(r)),r}function hK(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,p,h,b;const v=s-o,w=a-i;if(e.isHorizontal()){if(h=ar(r,i,a),Tt(n)){const y=Object.keys(n)[0],_=n[y];b=u[y].getPixelForValue(_)+v-t}else n==="center"?b=(c.bottom+c.top)/2+v-t:b=dO(e,n,t);p=a-i}else{if(Tt(n)){const y=Object.keys(n)[0],_=n[y];h=u[y].getPixelForValue(_)-w+t}else n==="center"?h=(c.left+c.right)/2-w+t:h=dO(e,n,t);b=ar(r,s,o),f=n==="left"?-Dn:Dn}return{titleX:h,titleY:b,maxWidth:p,rotation:f}}class Tl extends ds{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=Jr(t,Number.POSITIVE_INFINITY),n=Jr(n,Number.NEGATIVE_INFINITY),r=Jr(r,Number.POSITIVE_INFINITY),o=Jr(o,Number.NEGATIVE_INFINITY),{min:Jr(t,r),max:Jr(n,o),minDefined:Rn(t),maxDefined:Rn(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,c=a.length;l<c;++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:Jr(n,Jr(r,n)),max:Jr(r,Jr(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(){en(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=_G(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?hO(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=tK(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(){en(this.options.afterUpdate,[this])}beforeSetDimensions(){en(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(){en(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),en(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){en(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=en(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){en(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){en(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=fO(this.ticks.length,t.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let s=o,a,l,c;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),f=u.widest.width,p=u.highest.height,h=qn(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),f+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-Ju(t.grid)-n.padding-pO(t.title,this.chart.options.font),c=Math.sqrt(f*f+p*p),s=Kw(Math.min(Math.asin(qn((u.highest.height+6)/a,-1,1)),Math.asin(qn(l/c,-1,1))-Math.asin(qn(p/c,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){en(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){en(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=pO(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ju(i)+l):(t.height=this.maxHeight,t.width=Ju(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:p}=this._getLabelSizes(),h=r.padding*2,b=Ko(this.labelRotation),v=Math.cos(b),w=Math.sin(b);if(a){const y=r.mirror?0:w*f.width+v*p.height;t.height=Math.min(this.maxHeight,t.height+y+h)}else{const y=r.mirror?0:v*f.width+w*p.height;t.width=Math.min(this.maxWidth,t.width+y+h)}this._calculatePadding(c,u,w,v)}}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,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,h=0;l?c?(p=o*t.width,h=r*n.height):(p=r*t.height,h=o*n.width):i==="start"?h=n.width:i==="end"?p=t.width:i!=="inner"&&(p=t.width/2,h=n.width/2),this.paddingLeft=Math.max((p-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+s)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;i==="start"?(u=0,f=t.height):i==="end"&&(u=n.height,f=0),this.paddingTop=u+s,this.paddingBottom=f+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(){en(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++)Rt(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=hO(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/fO(n,r));let c=0,u=0,f,p,h,b,v,w,y,_,S,C,E;for(f=0;f<n;f+=l){if(b=t[f].label,v=this._resolveTickFontOptions(f),o.font=w=v.string,y=i[w]=i[w]||{data:{},gc:[]},_=v.lineHeight,S=C=0,!Rt(b)&&!pn(b))S=Gg(o,y.data,y.gc,S,b),C=_;else if(pn(b))for(p=0,h=b.length;p<h;++p)E=b[p],!Rt(E)&&!pn(E)&&(S=Gg(o,y.data,y.gc,S,E),C+=_);s.push(S),a.push(C),c=Math.max(S,c),u=Math.max(C,u)}cK(i,n);const O=s.indexOf(c),T=a.indexOf(u),N=M=>({width:s[M]||0,height:a[M]||0});return{first:N(0),last:N(n-1),widest:N(O),highest:N(T),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 Qq(this._alignToPixels?Ma(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=dK(this.getContext(),t,r))}return this.$context||(this.$context=uK(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Ko(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,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),p=Ju(i),h=[],b=a.setContext(this.getContext()),v=b.display?b.width:0,w=v/2,y=function(Q){return Ma(r,Q,v)};let _,S,C,E,O,T,N,M,A,F,z,X;if(s==="top")_=y(this.bottom),T=this.bottom-p,M=_-w,F=y(t.top)+w,X=t.bottom;else if(s==="bottom")_=y(this.top),F=t.top,X=y(t.bottom)-w,T=_+w,M=this.top+p;else if(s==="left")_=y(this.right),O=this.right-p,N=_-w,A=y(t.left)+w,z=t.right;else if(s==="right")_=y(this.left),A=t.left,z=y(t.right)-w,O=_+w,N=this.left+p;else if(n==="x"){if(s==="center")_=y((t.top+t.bottom)/2+.5);else if(Tt(s)){const Q=Object.keys(s)[0],Y=s[Q];_=y(this.chart.scales[Q].getPixelForValue(Y))}F=t.top,X=t.bottom,T=_+w,M=T+p}else if(n==="y"){if(s==="center")_=y((t.left+t.right)/2);else if(Tt(s)){const Q=Object.keys(s)[0],Y=s[Q];_=y(this.chart.scales[Q].getPixelForValue(Y))}O=_-w,N=O-p,A=t.left,z=t.right}const ee=dt(o.ticks.maxTicksLimit,f),H=Math.max(1,Math.ceil(f/ee));for(S=0;S<f;S+=H){const Q=this.getContext(S),Y=i.setContext(Q),J=a.setContext(Q),W=Y.lineWidth,$=Y.color,V=J.dash||[],U=J.dashOffset,I=Y.tickWidth,te=Y.tickColor,fe=Y.tickBorderDash||[],ne=Y.tickBorderDashOffset;C=lK(this,S,l),C!==void 0&&(E=Ma(r,C,W),c?O=N=A=z=E:T=M=F=X=E,h.push({tx1:O,ty1:T,tx2:N,ty2:M,x1:A,y1:F,x2:z,y2:X,width:W,color:$,borderDash:V,borderDashOffset:U,tickWidth:I,tickColor:te,tickBorderDash:fe,tickBorderDashOffset:ne}))}return this._ticksLength=f,this._borderValue=_,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=i,p=Ju(r.grid),h=p+u,b=f?-u:h,v=-Ko(this.labelRotation),w=[];let y,_,S,C,E,O,T,N,M,A,F,z,X="middle";if(o==="top")O=this.bottom-b,T=this._getXAxisLabelAlignment();else if(o==="bottom")O=this.top+b,T=this._getXAxisLabelAlignment();else if(o==="left"){const H=this._getYAxisLabelAlignment(p);T=H.textAlign,E=H.x}else if(o==="right"){const H=this._getYAxisLabelAlignment(p);T=H.textAlign,E=H.x}else if(n==="x"){if(o==="center")O=(t.top+t.bottom)/2+h;else if(Tt(o)){const H=Object.keys(o)[0],Q=o[H];O=this.chart.scales[H].getPixelForValue(Q)+h}T=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(t.left+t.right)/2-h;else if(Tt(o)){const H=Object.keys(o)[0],Q=o[H];E=this.chart.scales[H].getPixelForValue(Q)}T=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));const ee=this._getLabelSizes();for(y=0,_=a.length;y<_;++y){S=a[y],C=S.label;const H=i.setContext(this.getContext(y));N=this.getPixelForTick(y)+i.labelOffset,M=this._resolveTickFontOptions(y),A=M.lineHeight,F=pn(C)?C.length:1;const Q=F/2,Y=H.color,J=H.textStrokeColor,W=H.textStrokeWidth;let $=T;s?(E=N,T==="inner"&&(y===_-1?$=this.options.reverse?"left":"right":y===0?$=this.options.reverse?"right":"left":$="center"),o==="top"?c==="near"||v!==0?z=-F*A+A/2:c==="center"?z=-ee.highest.height/2-Q*A+A:z=-ee.highest.height+A/2:c==="near"||v!==0?z=A/2:c==="center"?z=ee.highest.height/2-Q*A:z=ee.highest.height-F*A,f&&(z*=-1),v!==0&&!H.showLabelBackdrop&&(E+=A/2*Math.sin(v))):(O=N,z=(1-F)*A/2);let V;if(H.showLabelBackdrop){const U=Zn(H.backdropPadding),I=ee.heights[y],te=ee.widths[y];let fe=z-U.top,ne=0-U.left;switch(X){case"middle":fe-=I/2;break;case"bottom":fe-=I;break}switch(T){case"center":ne-=te/2;break;case"right":ne-=te;break;case"inner":y===_-1?ne-=te:y>0&&(ne-=te/2);break}V={left:ne,top:fe,width:te+U.width,height:I+U.height,color:H.backdropColor}}w.push({label:C,font:M,textOffset:z,options:{rotation:v,color:Y,strokeColor:J,strokeWidth:W,textAlign:$,textBaseline:X,translation:[E,O],backdrop:V}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ko(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 c,u;return n==="left"?o?(u=this.right+i,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?o?(u=this.left+i,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const 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,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(i=0,s=o.length;i<s;++i){const l=o[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart: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 c,u,f,p;this.isHorizontal()?(c=Ma(t,this.left,s)-s/2,u=Ma(t,this.right,a)+a/2,f=p=l):(f=Ma(t,this.top,s)-s/2,p=Ma(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&Km(r,o);const i=this.getLabelItems(t);for(const s of i){const a=s.options,l=s.font,c=s.label,u=s.textOffset;bl(r,c,0,u,l,a)}o&&Xm(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=kn(r.font),s=Zn(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Tt(n)?(l+=s.bottom,pn(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:f,rotation:p}=hK(this,l,n,a);bl(t,r.text,0,0,i,{color:r.color,maxWidth:f,rotation:p,textAlign:fK(a,n,o),textBaseline:"middle",translation:[c,u]})}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=dt(t.grid&&t.grid.z,-1),o=dt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Tl.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 kn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Rp{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;mK(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,pK(t,s,r),this.override&&_n.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 _n[o]&&(delete _n[o][r],this.override&&delete vl[r])}}function pK(e,t,n){const r=Ci(Object.create(null),[n?_n.get(n):{},_n.get(t),e.defaults]);_n.set(t,r),e.defaultRoutes&&gK(t,e.defaultRoutes),e.descriptors&&_n.describe(t,e.descriptors)}function gK(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(".");_n.route(i,o,l,a)})}function mK(e){return"id"in e&&"defaults"in e}class vK{constructor(){this.controllers=new Rp(Xo,"datasets",!0),this.elements=new Rp(ds,"elements"),this.plugins=new Rp(Object,"plugins"),this.scales=new Rp(Tl,"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):Yt(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=Yw(t);en(r["before"+o],[],r),n[t](r),en(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 di=new vK;class bK{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(en(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){Rt(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=dt(r.options&&r.options.plugins,{}),i=yK(r);return o===!1&&!n?[]:wK(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 yK(e){const t={},n=[],r=Object.keys(di.plugins.items);for(let i=0;i<r.length;i++)n.push(di.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 xK(e,t){return!t&&e===!1?null:e===!0?{}:e}function wK(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,c=xK(r[l],o);c!==null&&i.push({plugin:a,options:_K(e.config,{plugin:a,local:n[l]},c,s)})}return i}function _K(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 Fx(e,t){const n=_n.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function SK(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function CK(e,t){return e===t?"_index_":"_value_"}function gO(e){if(e==="x"||e==="y"||e==="r")return e}function EK(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function jx(e,...t){if(gO(e))return e;for(const n of t){const r=n.axis||EK(n.position)||e.length>1&&gO(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function mO(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function RK(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 mO(e,"x",n[0])||mO(e,"y",n[0])}return{}}function PK(e,t){const n=vl[e.type]||{scales:{}},r=t.scales||{},o=Fx(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Tt(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=jx(s,a,RK(s,e),_n.scales[a.type]),c=CK(l,o),u=n.scales||{};i[s]=Cd(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||Fx(a,t),u=(vl[a]||{}).scales||{};Object.keys(u).forEach(f=>{const p=SK(f,l),h=s[p+"AxisID"]||p;i[h]=i[h]||Object.create(null),Cd(i[h],[{axis:p},r[h],u[f]])})}),Object.keys(i).forEach(s=>{const a=i[s];Cd(a,[_n.scales[a.type],_n.scale])}),i}function fk(e){const t=e.options||(e.options={});t.plugins=dt(t.plugins,{}),t.scales=PK(e,t)}function hk(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function OK(e){return e=e||{},e.data=hk(e.data),fk(e),e}const vO=new Map,pk=new Set;function Pp(e,t){let n=vO.get(e);return n||(n=t(),vO.set(e,n),pk.add(n)),n}const Zu=(e,t,n)=>{const r=la(t,n);r!==void 0&&e.add(r)};class $K{constructor(t){this._config=OK(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=hk(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(),fk(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Pp(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Pp(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Pp(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Pp(`${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(u=>{t&&(l.add(t),u.forEach(f=>Zu(l,t,f))),u.forEach(f=>Zu(l,o,f)),u.forEach(f=>Zu(l,vl[i]||{},f)),u.forEach(f=>Zu(l,_n,f)),u.forEach(f=>Zu(l,Ix,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),pk.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,vl[n]||{},_n.datasets[n]||{},{type:n},_n,Ix]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=bO(this._resolverCache,t,o);let l=s;if(DK(s,n)){i.$shared=!1,r=ca(r)?r():r;const c=this.createResolver(t,r,a);l=ou(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=bO(this._resolverCache,t,r);return Tt(n)?ou(i,n,void 0,o):i}}function bO(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:e_(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const TK=e=>Tt(e)&&Object.getOwnPropertyNames(e).some(t=>ca(e[t]));function DK(e,t){const{isScriptable:n,isIndexable:r}=GA(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(ca(a)||TK(a))||s&&pn(a))return!0}return!1}var AK="4.4.1";const kK=["top","bottom","left","right","chartArea"];function yO(e,t){return e==="top"||e==="bottom"||kK.indexOf(e)===-1&&t==="x"}function xO(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function wO(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),en(n&&n.onComplete,[e],t)}function MK(e){const t=e.chart,n=t.options.animation;en(n&&n.onProgress,[e],t)}function gk(e){return r_()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Rg={},_O=e=>{const t=gk(e);return Object.values(Rg).filter(n=>n.canvas===t).pop()};function IK(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 NK(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Op(e,t,n){return e.options.clip?e[n]:t[n]}function LK(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Op(n,t,"left"),right:Op(n,t,"right"),top:Op(r,t,"top"),bottom:Op(r,t,"bottom")}:t}class Do{static register(...t){di.add(...t),SO()}static unregister(...t){di.remove(...t),SO()}constructor(t,n){const r=this.config=new $K(n),o=gk(t),i=_O(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||eK(o)),this.platform.updateConfig(r);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=jq(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new bK,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=tG(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],Rg[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ki.listen(this,"complete",wO),Ki.listen(this,"progress",MK),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return Rt(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 di}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():WP(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return BP(this.canvas,this.ctx),this}stop(){return Ki.stop(this),this}resize(t,n){Ki.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,WP(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),en(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Yt(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=jx(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Yt(i,s=>{const a=s.options,l=a.id,c=jx(l,a),u=dt(a.type,s.dtype);(a.position===void 0||yO(a.position,c)!==yO(s.dposition))&&(a.position=s.dposition),o[l]=!0;let f=null;if(l in r&&r[l].type===u)f=r[l];else{const p=di.getScale(u);f=new p({id:l,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),Yt(o,(s,a)=>{s||delete r[a]}),Yt(r,s=>{cr.configure(this,s,s.options),cr.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(xO("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||Fx(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=di.getController(a),{datasetElementType:c,dataElementType:u}=_n.datasets[a];Object.assign(l,{dataElementType:di.getElement(u),datasetElementType:c&&di.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Yt(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 c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),p=!o&&i.indexOf(f)===-1;f.buildOrUpdateElements(p),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||Yt(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(xO("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Yt(this.scales,t=>{cr.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!AP(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;IK(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(!AP(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;cr.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Yt(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,ca(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&&(Ki.has(this)?this.attached&&!Ki.running(this)&&Ki.start(this):(this.draw(),wO({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=LK(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&Km(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&&Xm(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return os(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=kY.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=va(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);Ud(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(),Ki.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(),BP(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Rg[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)};Yt(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},o=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{o("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",s)};s=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Yt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Yt(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 c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[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}});!Wg(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,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.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=Uq(t),c=NK(t,this._lastEvent,r,l);r&&(this._lastEvent=null,en(i.onHover,[t,a,this],this),l&&en(i.onClick,[t,a,this],this));const u=!Wg(a,o);return(u||n)&&(this._active=a,this._updateHoverStyles(a,o,n)),this._lastEvent=c,u}_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)}}Ne(Do,"defaults",_n),Ne(Do,"instances",Rg),Ne(Do,"overrides",vl),Ne(Do,"registry",di),Ne(Do,"version",AK),Ne(Do,"getChart",_O);function SO(){return Yt(Do.instances,e=>e._plugins.invalidate())}function FK(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:s,outerRadius:a,innerRadius:l}=t;let c=o/a;e.beginPath(),e.arc(i,s,a,r-c,n+c),l>o?(c=o/l,e.arc(i,s,l,n+c,r-c,!0)):e.arc(i,s,o,n+Dn,r-Dn),e.closePath(),e.clip()}function jK(e){return Zw(e,["outerStart","outerEnd","innerStart","innerEnd"])}function zK(e,t,n,r){const o=jK(e.options.borderRadius),i=(n-t)/2,s=Math.min(i,r*t/2),a=l=>{const c=(n-Math.min(i,l))*r/2;return qn(l,0,Math.min(i,c))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:qn(o.innerStart,0,s),innerEnd:qn(o.innerEnd,0,s)}}function oc(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Xg(e,t,n,r,o,i){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+r+n-c,0),p=u>0?u+r+n+c:0;let h=0;const b=o-l;if(r){const H=u>0?u-r:0,Q=f>0?f-r:0,Y=(H+Q)/2,J=Y!==0?b*Y/(Y+r):b;h=(b-J)/2}const v=Math.max(.001,b*f-n/mn)/f,w=(b-v)/2,y=l+w+h,_=o-w-h,{outerStart:S,outerEnd:C,innerStart:E,innerEnd:O}=zK(t,p,f,_-y),T=f-S,N=f-C,M=y+S/T,A=_-C/N,F=p+E,z=p+O,X=y+E/F,ee=_-O/z;if(e.beginPath(),i){const H=(M+A)/2;if(e.arc(s,a,f,M,H),e.arc(s,a,f,H,A),C>0){const W=oc(N,A,s,a);e.arc(W.x,W.y,C,A,_+Dn)}const Q=oc(z,_,s,a);if(e.lineTo(Q.x,Q.y),O>0){const W=oc(z,ee,s,a);e.arc(W.x,W.y,O,_+Dn,ee+Math.PI)}const Y=(_-O/p+(y+E/p))/2;if(e.arc(s,a,p,_-O/p,Y,!0),e.arc(s,a,p,Y,y+E/p,!0),E>0){const W=oc(F,X,s,a);e.arc(W.x,W.y,E,X+Math.PI,y-Dn)}const J=oc(T,y,s,a);if(e.lineTo(J.x,J.y),S>0){const W=oc(T,M,s,a);e.arc(W.x,W.y,S,y-Dn,M)}}else{e.moveTo(s,a);const H=Math.cos(M)*f+s,Q=Math.sin(M)*f+a;e.lineTo(H,Q);const Y=Math.cos(A)*f+s,J=Math.sin(A)*f+a;e.lineTo(Y,J)}e.closePath()}function BK(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){Xg(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=s+(a%gn||gn))}return Xg(e,t,n,r,l,o),e.fill(),l}function VK(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:p}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=p,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let b=t.endAngle;if(i){Xg(e,t,n,r,b,o);for(let v=0;v<i;++v)e.stroke();isNaN(a)||(b=s+(a%gn||gn))}h&&FK(e,t,b),i||(Xg(e,t,n,r,b,o),e.stroke())}class Sc extends ds{constructor(n){super();Ne(this,"circumference");Ne(this,"endAngle");Ne(this,"fullCircles");Ne(this,"innerRadius");Ne(this,"outerRadius");Ne(this,"pixelMargin");Ne(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}=LA(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:f,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),h=(this.options.spacing+this.options.borderWidth)/2,v=dt(p,c-l)>=gn||qd(s,l,c),w=ns(a,u+h,f+h);return v&&w}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:c,spacing:u}=this.options,f=(i+s)/2,p=(a+l+u+c)/2;return{x:r+Math.cos(f)*p,y:o+Math.sin(f)*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>gn?Math.floor(o/gn):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 c=1-Math.sin(Math.min(mn,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,BK(n,this,u,s,a),VK(n,this,u,s,a),n.restore()}}Ne(Sc,"id","arc"),Ne(Sc,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Ne(Sc,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ne(Sc,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function mk(e,t,n=t){e.lineCap=dt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(dt(n.borderDash,t.borderDash)),e.lineDashOffset=dt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=dt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=dt(n.borderWidth,t.borderWidth),e.strokeStyle=dt(n.borderColor,t.borderColor)}function HK(e,t,n){e.lineTo(n.x,n.y)}function WK(e){return e.stepped?hG:e.tension||e.cubicInterpolationMode==="monotone"?pG:HK}function vk(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),c=Math.min(i,a),u=o<s&&i<s||o>a&&i>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function UK(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:c}=vk(o,n,r),u=WK(i);let{move:f=!0,reverse:p}=r||{},h,b,v;for(h=0;h<=c;++h)b=o[(a+(p?c-h:h))%s],!b.skip&&(f?(e.moveTo(b.x,b.y),f=!1):u(e,v,b,p,i.stepped),v=b);return l&&(b=o[(a+(p?c:0))%s],u(e,v,b,p,i.stepped)),!!l}function qK(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=vk(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,f=0,p,h,b,v,w,y;const _=C=>(s+(c?a-C:C))%i,S=()=>{v!==w&&(e.lineTo(u,w),e.lineTo(u,v),e.lineTo(u,y))};for(l&&(h=o[_(0)],e.moveTo(h.x,h.y)),p=0;p<=a;++p){if(h=o[_(p)],h.skip)continue;const C=h.x,E=h.y,O=C|0;O===b?(E<v?v=E:E>w&&(w=E),u=(f*u+C)/++f):(S(),e.lineTo(C,E),b=O,f=0,v=w=E),y=E}S()}function zx(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?qK:UK}function GK(e){return e.stepped?qG:e.tension||e.cubicInterpolationMode==="monotone"?GG:Ba}function YK(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),mk(e,t.options),e.stroke(o)}function KK(e,t,n,r){const{segments:o,options:i}=t,s=zx(t);for(const a of o)mk(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const XK=typeof Path2D=="function";function QK(e,t,n,r){XK&&!t.options.segment?YK(e,t,n,r):KK(e,t,n,r)}class ea extends ds{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;FG(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=ZG(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=rk(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=GK(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:f,end:p}=s[c],h=i[f],b=i[p];if(h===b){a.push(h);continue}const v=Math.abs((o-h[n])/(b[n]-h[n])),w=l(h,b,v,r.stepped);w[n]=t[n],a.push(w)}return a.length===1?a[0]:a}pathSegment(t,n,r){return zx(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=zx(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(),QK(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ne(ea,"id","line"),Ne(ea,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ne(ea,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ne(ea,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function CO(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class $d extends ds{constructor(n){super();Ne(this,"parsed");Ne(this,"skip");Ne(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 CO(this,n,"x",r)}inYRange(n,r){return CO(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||!os(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,Nx(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ne($d,"id","point"),Ne($d,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ne($d,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function bk(e,t){const{x:n,y:r,base:o,width:i,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,f;return e.horizontal?(f=s/2,a=Math.min(n,o),l=Math.max(n,o),c=r-f,u=r+f):(f=i/2,a=n-f,l=n+f,c=Math.min(r,o),u=Math.max(r,o)),{left:a,top:c,right:l,bottom:u}}function ta(e,t,n,r){return e?0:qn(t,n,r)}function JK(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=qA(r);return{t:ta(o.top,i.top,0,n),r:ta(o.right,i.right,0,t),b:ta(o.bottom,i.bottom,0,n),l:ta(o.left,i.left,0,t)}}function ZK(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=cl(o),s=Math.min(t,n),a=e.borderSkipped,l=r||Tt(o);return{topLeft:ta(!l||a.top||a.left,i.topLeft,0,s),topRight:ta(!l||a.top||a.right,i.topRight,0,s),bottomLeft:ta(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:ta(!l||a.bottom||a.right,i.bottomRight,0,s)}}function eX(e){const t=bk(e),n=t.right-t.left,r=t.bottom-t.top,o=JK(e,n/2,r/2),i=ZK(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 O0(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&bk(e,r);return a&&(o||ns(t,a.left,a.right))&&(i||ns(n,a.top,a.bottom))}function tX(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function nX(e,t){e.rect(t.x,t.y,t.w,t.h)}function $0(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 Td extends ds{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}=eX(this),a=tX(s.radius)?Gd:nX;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,$0(s,n,i)),t.clip(),a(t,$0(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,$0(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return O0(this,t,n,r)}inXRange(t,n){return O0(this,t,null,n)}inYRange(t,n){return O0(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}}Ne(Td,"id","bar"),Ne(Td,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ne(Td,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var rX=Object.freeze({__proto__:null,ArcElement:Sc,BarElement:Td,LineElement:ea,PointElement:$d});const Bx=["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)"],EO=Bx.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function yk(e){return Bx[e%Bx.length]}function xk(e){return EO[e%EO.length]}function oX(e,t){return e.borderColor=yk(t),e.backgroundColor=xk(t),++t}function iX(e,t){return e.backgroundColor=e.data.map(()=>yk(t++)),t}function sX(e,t){return e.backgroundColor=e.data.map(()=>xk(t++)),t}function aX(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Qa?t=iX(n,t):o instanceof Od?t=sX(n,t):o&&(t=oX(n,t))}}function RO(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function lX(e){return e&&(e.borderColor||e.backgroundColor)}var cX={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&&(RO(r)||lX(o)||i&&RO(i)))return;const s=aX(e);r.forEach(s)}};function uX(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 c=t+n-1;let u=t,f,p,h,b,v;for(s[l++]=e[u],f=0;f<i-2;f++){let w=0,y=0,_;const S=Math.floor((f+1)*a)+1+t,C=Math.min(Math.floor((f+2)*a)+1,n)+t,E=C-S;for(_=S;_<C;_++)w+=e[_].x,y+=e[_].y;w/=E,y/=E;const O=Math.floor(f*a)+1+t,T=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:N,y:M}=e[u];for(h=b=-1,_=O;_<T;_++)b=.5*Math.abs((N-w)*(e[_].y-M)-(N-e[_].x)*(y-M)),b>h&&(h=b,p=e[_],v=_);s[l++]=p,u=v}return s[l++]=e[c],s}function dX(e,t,n,r){let o=0,i=0,s,a,l,c,u,f,p,h,b,v;const w=[],y=t+n-1,_=e[t].x,C=e[y].x-_;for(s=t;s<t+n;++s){a=e[s],l=(a.x-_)/C*r,c=a.y;const E=l|0;if(E===u)c<b?(b=c,f=s):c>v&&(v=c,p=s),o=(i*o+a.x)/++i;else{const O=s-1;if(!Rt(f)&&!Rt(p)){const T=Math.min(f,p),N=Math.max(f,p);T!==h&&T!==O&&w.push({...e[T],x:o}),N!==h&&N!==O&&w.push({...e[N],x:o})}s>0&&O!==h&&w.push(e[O]),w.push(a),u=E,i=0,b=v=c,f=p=h=s}}return w}function wk(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 PO(e){e.data.datasets.forEach(t=>{wk(t)})}function fX(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:s,max:a,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(r=qn(rs(t,i.axis,s).lo,0,n-1)),c?o=qn(rs(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var hX={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){PO(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:s,indexAxis:a}=o,l=e.getDatasetMeta(i),c=s||o.data;if(hn([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:f,count:p}=fX(l,c);const h=n.threshold||4*r;if(p<=h){wk(o);return}Rt(s)&&(o._data=c,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(v){this._data=v}}));let b;switch(n.algorithm){case"lttb":b=uX(c,f,p,r,n);break;case"min-max":b=dX(c,f,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=b})},destroy(e){PO(e)}};function pX(e,t,n){const r=e.segments,o=e.points,i=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=s_(l,c,o);const u=Vx(n,o[l],o[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:o[l],end:o[c]});continue}const f=rk(t,u);for(const p of f){const h=Vx(n,i[p.start],i[p.end],p.loop),b=nk(a,o,h);for(const v of b)s.push({source:v,target:p,start:{[n]:OO(u,h,"start",Math.max)},end:{[n]:OO(u,h,"end",Math.min)}})}}return s}function Vx(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=ro(o),i=ro(i)),{property:e,start:o,end:i}}function gX(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=s_(s,a,o);const l=o[s],c=o[a];r!==null?(i.push({x:l.x,y:r}),i.push({x:c.x,y:r})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:c.y}))}),i}function s_(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function OO(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function _k(e,t){let n=[],r=!1;return pn(e)?(r=!0,n=e):n=gX(e,t),n.length?new ea({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function $O(e){return e&&e.fill!==!1}function mX(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(!Rn(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function vX(e,t,n){const r=wX(e);if(Tt(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Rn(o)&&Math.floor(o)===o?bX(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function bX(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function yX(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Tt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function xX(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Tt(e)?r=e.value:r=t.getBaseValue(),r}function wX(e){const t=e.options,n=t.fill;let r=dt(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function _X(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=SX(t,n);a.push(_k({x:null,y:t.bottom},r));for(let l=0;l<i.length;l++){const c=i[l];for(let u=c.start;u<=c.end;u++)CX(o,s[u],a)}return new ea({points:o,options:{}})}function SX(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 CX(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=EX(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function EX(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 c=0;c<i.length;c++){const u=i[c],f=s[u.start][n],p=s[u.end][n];if(ns(o,f,p)){a=o===f,l=o===p;break}}return{first:a,last:l,point:r}}class Sk{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:gn},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 RX(e){const{chart:t,fill:n,line:r}=e;if(Rn(n))return PX(t,n);if(n==="stack")return _X(e);if(n==="shape")return!0;const o=OX(e);return o instanceof Sk?o:_k(o,r)}function PX(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function OX(e){return(e.scale||{}).getPointPositionForValue?TX(e):$X(e)}function $X(e){const{scale:t={},fill:n}=e,r=yX(n,t);if(Rn(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function TX(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=xX(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new Sk({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 T0(e,t,n){const r=RX(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:f=c}=l||{};r&&o.points.length&&(Km(e,n),DX(e,{line:o,target:r,above:u,below:f,area:n,scale:i,axis:s}),Xm(e))}function DX(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&&(TO(e,r,s.top),DO(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),TO(e,r,s.bottom)),DO(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function TO(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:c}=a,u=o[l],f=o[s_(l,c,o)];i?(e.moveTo(u.x,u.y),i=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function DO(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=pX(n,r,o);for(const{source:l,target:c,start:u,end:f}of a){const{style:{backgroundColor:p=i}={}}=l,h=r!==!0;e.save(),e.fillStyle=p,AX(e,s,h&&Vx(o,u,f)),e.beginPath();const b=!!n.pathSegment(e,l);let v;if(h){b?e.closePath():AO(e,r,f,o);const w=!!r.pathSegment(e,c,{move:b,reverse:!0});v=b&&w,v||AO(e,r,u,o)}e.closePath(),e.fill(v?"evenodd":"nonzero"),e.restore()}}function AX(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 AO(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var kX={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 ea&&(l={visible:e.isDatasetVisible(s),index:s,fill:vX(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=mX(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&&T0(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;$O(i)&&T0(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!$O(r)||n.drawTime!=="beforeDatasetDraw"||T0(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const kO=(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)}},MX=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class MO extends ds{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=en(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=kn(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=kO(r,i);let c,u;n.font=o.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,i,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,o,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,o){const{ctx:i,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=o+a;let f=t;i.textAlign="left",i.textBaseline="middle";let p=-1,h=-u;return this.legendItems.forEach((b,v)=>{const w=r+n/2+i.measureText(b.text).width;(v===0||c[c.length-1]+w+2*a>s)&&(f+=u,c[c.length-(v>0?0:1)]=0,h+=u,p++),l[v]={left:0,top:h,row:p,width:w,height:o},c[c.length-1]+=w+a}),f}_fitCols(t,n,r,o){const{ctx:i,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let f=a,p=0,h=0,b=0,v=0;return this.legendItems.forEach((w,y)=>{const{itemWidth:_,itemHeight:S}=IX(r,n,i,w,o);y>0&&h+S+2*a>u&&(f+=p+a,c.push({width:p,height:h}),b+=p+a,v++,p=h=0),l[y]={left:b,top:h,col:v,width:_,height:S},p=Math.max(p,_),h+=S+a}),f+=p,c.push({width:p,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Pc(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=ar(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=ar(r,this.left+o,this.right-this.lineWidths[a])),c.top+=this.top+t+o,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+o}else{let a=0,l=ar(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=ar(r,this.top+t+o,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+o,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Km(t,this),this._draw(),Xm(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=_n.color,l=Pc(t.rtl,this.left,this.width),c=kn(s.font),{padding:u}=s,f=c.size,p=f/2;let h;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:b,boxHeight:v,itemHeight:w}=kO(s,f),y=function(O,T,N){if(isNaN(b)||b<=0||isNaN(v)||v<0)return;o.save();const M=dt(N.lineWidth,1);if(o.fillStyle=dt(N.fillStyle,a),o.lineCap=dt(N.lineCap,"butt"),o.lineDashOffset=dt(N.lineDashOffset,0),o.lineJoin=dt(N.lineJoin,"miter"),o.lineWidth=M,o.strokeStyle=dt(N.strokeStyle,a),o.setLineDash(dt(N.lineDash,[])),s.usePointStyle){const A={radius:v*Math.SQRT2/2,pointStyle:N.pointStyle,rotation:N.rotation,borderWidth:M},F=l.xPlus(O,b/2),z=T+p;UA(o,A,F,z,s.pointStyleWidth&&b)}else{const A=T+Math.max((f-v)/2,0),F=l.leftForLtr(O,b),z=cl(N.borderRadius);o.beginPath(),Object.values(z).some(X=>X!==0)?Gd(o,{x:F,y:A,w:b,h:v,radius:z}):o.rect(F,A,b,v),o.fill(),M!==0&&o.stroke()}o.restore()},_=function(O,T,N){bl(o,N.text,O,T+w/2,c,{strikethrough:N.hidden,textAlign:l.textAlign(N.textAlign)})},S=this.isHorizontal(),C=this._computeTitleHeight();S?h={x:ar(i,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:h={x:this.left+u,y:ar(i,this.top+C+u,this.bottom-n[0].height),line:0},ZA(this.ctx,t.textDirection);const E=w+u;this.legendItems.forEach((O,T)=>{o.strokeStyle=O.fontColor,o.fillStyle=O.fontColor;const N=o.measureText(O.text).width,M=l.textAlign(O.textAlign||(O.textAlign=s.textAlign)),A=b+p+N;let F=h.x,z=h.y;l.setWidth(this.width),S?T>0&&F+A+u>this.right&&(z=h.y+=E,h.line++,F=h.x=ar(i,this.left+u,this.right-r[h.line])):T>0&&z+E>this.bottom&&(F=h.x=F+n[h.line].width+u,h.line++,z=h.y=ar(i,this.top+C+u,this.bottom-n[h.line].height));const X=l.x(F);if(y(X,z,O),F=nG(M,F+b+p,S?F+A:this.right,t.rtl),_(l.x(F),z,O),S)h.x+=A+u;else if(typeof O.text!="string"){const ee=c.lineHeight;h.y+=Ck(O,ee)+u}else h.y+=E}),ek(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=kn(n.font),o=Zn(n.padding);if(!n.display)return;const i=Pc(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=o.top+l;let u,f=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+c,f=ar(t.align,f,this.right-p);else{const b=this.columnSizes.reduce((v,w)=>Math.max(v,w.height),0);u=c+ar(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}const h=ar(a,f,f+p);s.textAlign=i.textAlign(Qw(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,bl(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=kn(t.font),r=Zn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(ns(t,this.left,this.right)&&ns(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],ns(t,o.left,o.left+o.width)&&ns(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!FX(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=MX(o,r);o&&!i&&en(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&en(n.onHover,[t,r,this],this)}else r&&en(n.onClick,[t,r,this],this)}}function IX(e,t,n,r,o){const i=NX(r,e,t,n),s=LX(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function NX(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 LX(e,t,n){let r=e;return typeof t.text!="string"&&(r=Ck(t,n)),r}function Ck(e,t){const n=e.text?e.text.length:0;return t*n}function FX(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var jX={id:"legend",_element:MO,start(e,t,n){const r=e.legend=new MO({ctx:e.ctx,options:n,chart:e});cr.configure(e,r,n),cr.addBox(e,r)},stop(e){cr.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;cr.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 c=l.controller.getStyle(n?0:void 0),u=Zn(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:o||c.textAlign,borderRadius:s&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let a_=class extends ds{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=pn(r.text)?r.text.length:1;this._padding=Zn(r.padding);const i=o*kn(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,c,u,f;return this.isHorizontal()?(u=ar(a,r,i),f=n+t,c=i-r):(s.position==="left"?(u=r+t,f=ar(a,o,n),l=mn*-.5):(u=i-t,f=ar(a,n,o),l=mn*.5),c=o-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=kn(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);bl(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Qw(n.align),textBaseline:"middle",translation:[s,a]})}};function zX(e,t){const n=new a_({ctx:e.ctx,options:t,chart:e});cr.configure(e,n,t),cr.addBox(e,n),e.titleBlock=n}var BX={id:"title",_element:a_,start(e,t,n){zX(e,n)},stop(e){const t=e.titleBlock;cr.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;cr.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 $p=new WeakMap;var VX={id:"subtitle",start(e,t,n){const r=new a_({ctx:e.ctx,options:n,chart:e});cr.configure(e,r,n),cr.addBox(e,r),$p.set(e,r)},stop(e){cr.removeBox(e,$p.get(e)),$p.delete(e)},beforeUpdate(e,t,n){const r=$p.get(e);cr.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 yd={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 c=l.getCenterPoint(),u=Mx(t,c);u<o&&(o=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function ci(e,t){return t&&(pn(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Xi(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
125
|
-
`)>-1?e.split(`
|
|
126
|
-
`):e}function HX(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 IO(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=kn(t.bodyFont),c=kn(t.titleFont),u=kn(t.footerFont),f=i.length,p=o.length,h=r.length,b=Zn(t.padding);let v=b.height,w=0,y=r.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,f&&(v+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),y){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;v+=h*C+(y-h)*l.lineHeight+(y-1)*t.bodySpacing}p&&(v+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let _=0;const S=function(C){w=Math.max(w,n.measureText(C).width+_)};return n.save(),n.font=c.string,Yt(e.title,S),n.font=l.string,Yt(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?s+2+t.boxPadding:0,Yt(r,C=>{Yt(C.before,S),Yt(C.lines,S),Yt(C.after,S)}),_=0,n.font=u.string,Yt(e.footer,S),n.restore(),w+=b.width,{width:w,height:v}}function WX(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function UX(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 qX(e,t,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=o<=(a+l)/2?"left":"right":o<=i/2?c="left":o>=s-i/2&&(c="right"),UX(c,e,t,n)&&(c="center"),c}function NO(e,t,n){const r=n.yAlign||t.yAlign||WX(e,n);return{xAlign:n.xAlign||t.xAlign||qX(e,t,n,r),yAlign:r}}function GX(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function YX(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function LO(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=o+i,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:h}=cl(s);let b=GX(t,a);const v=YX(t,l,c);return l==="center"?a==="left"?b+=c:a==="right"&&(b-=c):a==="left"?b-=Math.max(u,p)+o:a==="right"&&(b+=Math.max(f,h)+o),{x:qn(b,0,r.width-t.width),y:qn(v,0,r.height-t.height)}}function Tp(e,t,n){const r=Zn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function FO(e){return ci([],Xi(e))}function KX(e,t,n){return va(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function jO(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Ek={beforeTitle:Ui,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:Ui,beforeBody:Ui,beforeLabel:Ui,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 Rt(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:Ui,afterBody:Ui,beforeFooter:Ui,footer:Ui,afterFooter:Ui};function Ar(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?Ek[t].call(n,r):o}var Uy;let zO=(Uy=class extends ds{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 ok(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=KX(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Ar(r,"beforeTitle",this,t),i=Ar(r,"title",this,t),s=Ar(r,"afterTitle",this,t);let a=[];return a=ci(a,Xi(o)),a=ci(a,Xi(i)),a=ci(a,Xi(s)),a}getBeforeBody(t,n){return FO(Ar(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return Yt(t,i=>{const s={before:[],lines:[],after:[]},a=jO(r,i);ci(s.before,Xi(Ar(a,"beforeLabel",this,i))),ci(s.lines,Ar(a,"label",this,i)),ci(s.after,Xi(Ar(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return FO(Ar(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Ar(r,"beforeFooter",this,t),i=Ar(r,"footer",this,t),s=Ar(r,"afterFooter",this,t);let a=[];return a=ci(a,Xi(o)),a=ci(a,Xi(i)),a=ci(a,Xi(s)),a}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(HX(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,p)=>t.filter(u,f,p,r))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,r))),Yt(a,u=>{const f=jO(t.callbacks,u);o.push(Ar(f,"labelColor",this,u)),i.push(Ar(f,"labelPointStyle",this,u)),s.push(Ar(f,"labelTextColor",this,u))}),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=yd[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=IO(this,r),c=Object.assign({},a,l),u=NO(this.chart,r,c),f=LO(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:f.x,y:f.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:c,bottomLeft:u,bottomRight:f}=cl(a),{x:p,y:h}=t,{width:b,height:v}=n;let w,y,_,S,C,E;return i==="center"?(C=h+v/2,o==="left"?(w=p,y=w-s,S=C+s,E=C-s):(w=p+b,y=w+s,S=C-s,E=C+s),_=w):(o==="left"?y=p+Math.max(l,u)+s:o==="right"?y=p+b-Math.max(c,f)-s:y=this.caretX,i==="top"?(S=h,C=S-s,w=y-s,_=y+s):(S=h+v,C=S+s,w=y+s,_=y-s),E=S),{x1:w,x2:y,x3:_,y1:S,y2:C,y3:E}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=Pc(r.rtl,this.x,this.width);for(t.x=Tp(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=kn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],c.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:c}=i,u=kn(i.bodyFont),f=Tp(this,"left",i),p=o.x(f),h=l<u.lineHeight?(u.lineHeight-l)/2:0,b=n.y+h;if(i.usePointStyle){const v={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=o.leftForLtr(p,c)+c/2,y=b+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,Nx(t,v,w,y),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Nx(t,v,w,y)}else{t.lineWidth=Tt(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 v=o.leftForLtr(p,c),w=o.leftForLtr(o.xPlus(p,1),c-2),y=cl(s.borderRadius);Object.values(y).some(_=>_!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Gd(t,{x:v,y:b,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Gd(t,{x:w,y:b+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(v,b,c,l),t.strokeRect(v,b,c,l),t.fillStyle=s.backgroundColor,t.fillRect(w,b+1,c-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:c,boxPadding:u}=r,f=kn(r.bodyFont);let p=f.lineHeight,h=0;const b=Pc(r.rtl,this.x,this.width),v=function(N){n.fillText(N,b.x(t.x+h),t.y+p/2),t.y+=p+i},w=b.textAlign(s);let y,_,S,C,E,O,T;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=Tp(this,w,r),n.fillStyle=r.bodyColor,Yt(this.beforeBody,v),h=a&&w!=="right"?s==="center"?c/2+u:c+2+u:0,C=0,O=o.length;C<O;++C){for(y=o[C],_=this.labelTextColors[C],n.fillStyle=_,Yt(y.before,v),S=y.lines,a&&S.length&&(this._drawColorBox(n,t,C,b,r),p=Math.max(f.lineHeight,l)),E=0,T=S.length;E<T;++E)v(S[E]),p=f.lineHeight;Yt(y.after,v)}h=0,p=f.lineHeight,Yt(this.afterBody,v),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=Pc(r.rtl,this.x,this.width);for(t.x=Tp(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=kn(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:c,height:u}=r,{topLeft:f,topRight:p,bottomLeft:h,bottomRight:b}=cl(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+f,l),s==="top"&&this.drawCaret(t,n,r,o),n.lineTo(a+c-p,l),n.quadraticCurveTo(a+c,l,a+c,l+p),s==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(a+c,l+u-b),n.quadraticCurveTo(a+c,l+u,a+c-b,l+u),s==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),s==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,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=yd[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=IO(this,t),l=Object.assign({},s,this._size),c=NO(n,t,l),u=LO(t,l,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(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=Zn(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),ZA(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),ek(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),i=!Wg(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||!Wg(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=yd[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Ne(Uy,"positioners",yd),Uy);var XX={id:"tooltip",_element:zO,positioners:yd,afterInit(e,t,n){n&&(e.tooltip=new zO({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:Ek},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"]},QX=Object.freeze({__proto__:null,Colors:cX,Decimation:hX,Filler:kX,Legend:jX,SubTitle:VX,Title:BX,Tooltip:XX});const JX=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function ZX(e,t,n,r){const o=e.indexOf(t);if(o===-1)return JX(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const eQ=(e,t)=>e===null?null:qn(Math.round(e),0,t);function BO(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Hx extends Tl{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(Rt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:ZX(r,t,dt(n,t),this._addedLabels),eQ(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 BO.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}}Ne(Hx,"id","category"),Ne(Hx,"defaults",{ticks:{callback:BO}});function tQ(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:p}=e,h=i||1,b=u-1,{min:v,max:w}=t,y=!Rt(s),_=!Rt(a),S=!Rt(c),C=(w-v)/(f+1);let E=MP((w-v)/b/h)*h,O,T,N,M;if(E<1e-14&&!y&&!_)return[{value:v},{value:w}];M=Math.ceil(w/E)-Math.floor(v/E),M>b&&(E=MP(M*E/b/h)*h),Rt(l)||(O=Math.pow(10,l),E=Math.ceil(E*O)/O),o==="ticks"?(T=Math.floor(v/E)*E,N=Math.ceil(w/E)*E):(T=v,N=w),y&&_&&i&&Kq((a-s)/i,E/1e3)?(M=Math.round(Math.min((a-s)/E,u)),E=(a-s)/M,T=s,N=a):S?(T=y?s:T,N=_?a:N,M=c-1,E=(N-T)/M):(M=(N-T)/E,Ed(M,Math.round(M),E/1e3)?M=Math.round(M):M=Math.ceil(M));const A=Math.max(IP(E),IP(T));O=Math.pow(10,Rt(l)?A:l),T=Math.round(T*O)/O,N=Math.round(N*O)/O;let F=0;for(y&&(p&&T!==s?(n.push({value:s}),T<s&&F++,Ed(Math.round((T+F*E)*O)/O,s,VO(s,C,e))&&F++):T<s&&F++);F<M;++F){const z=Math.round((T+F*E)*O)/O;if(_&&z>a)break;n.push({value:z})}return _&&p&&N!==a?n.length&&Ed(n[n.length-1].value,a,VO(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!_||N===a)&&n.push({value:N}),n}function VO(e,t,{horizontal:n,minRotation:r}){const o=Ko(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class Qg extends Tl{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 Rt(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=wi(o),c=wi(i);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);a(i+l),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=tQ(o,i);return t.bounds==="ticks"&&NA(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 Kf(t,this.chart.options.locale,this.options.ticks.format)}}class Wx extends Qg{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Rn(t)?t:0,this.max=Rn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Ko(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}}Ne(Wx,"id","linear"),Ne(Wx,"defaults",{ticks:{callback:Ym.formatters.numeric}});const Kd=e=>Math.floor(Zs(e)),Na=(e,t)=>Math.pow(10,Kd(e)+t);function HO(e){return e/Math.pow(10,Kd(e))===1}function WO(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function nQ(e,t){const n=t-e;let r=Kd(n);for(;WO(e,t,r)>10;)r++;for(;WO(e,t,r)<10;)r--;return Math.min(r,Kd(e))}function rQ(e,{min:t,max:n}){t=Jr(e.min,t);const r=[],o=Kd(t);let i=nQ(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,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,i)),p=Jr(e.min,Math.round((l+u+f*Math.pow(10,i))*s)/s);for(;p<n;)r.push({value:p,major:HO(p),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(i++,f=2,s=i>=0?1:s),p=Math.round((l+u+f*Math.pow(10,i))*s)/s;const h=Jr(e.max,p);return r.push({value:h,major:HO(h),significand:f}),r}class Ux extends Tl{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Qg.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Rn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Rn(t)?Math.max(0,t):null,this.max=Rn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Rn(this._userMin)&&(this.min=t===Na(this.min,0)?Na(this.min,-1):Na(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(Na(r,-1)),s(Na(o,1)))),r<=0&&i(Na(o,-1)),o<=0&&s(Na(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=rQ(n,this);return t.bounds==="ticks"&&NA(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":Kf(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Zs(t),this._valueRange=Zs(this.max)-Zs(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Zs(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ne(Ux,"id","logarithmic"),Ne(Ux,"defaults",{ticks:{callback:Ym.formatters.logarithmic,major:{enabled:!0}}});function qx(e){const t=e.ticks;if(t.display&&e.display){const n=Zn(t.backdropPadding);return dt(t.font&&t.font.size,_n.font.size)+n.height}return 0}function oQ(e,t,n){return n=pn(n)?n:[n],{w:fG(e,t.string,n),h:n.length*t.lineHeight}}function UO(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 iQ(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?mn/i:0;for(let l=0;l<i;l++){const c=s.setContext(e.getPointLabelContext(l));o[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+o[l],a),f=kn(c.font),p=oQ(e.ctx,f,e._pointLabels[l]);r[l]=p;const h=ro(e.getIndexAngle(l)+a),b=Math.round(Kw(h)),v=UO(b,u.x,p.w,0,180),w=UO(b,u.y,p.h,90,270);sQ(n,t,h,v,w)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=cQ(e,r,o)}function sQ(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 aQ(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:s,size:a}=n,l=e.getPointPosition(t,r+o+s,i),c=Math.round(Kw(ro(l.angle+Dn))),u=fQ(l.y,a.h,c),f=uQ(c),p=dQ(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:p,top:u,right:p+a.w,bottom:u+a.h}}function lQ(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(os({x:n,y:r},t)||os({x:n,y:i},t)||os({x:o,y:r},t)||os({x:o,y:i},t))}function cQ(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:qx(i)/2,additionalAngle:s?mn/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const f=aQ(e,u,l);r.push(f),a==="auto"&&(f.visible=lQ(f,c),f.visible&&(c=f))}return r}function uQ(e){return e===0||e===180?"center":e<180?"left":"right"}function dQ(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function fQ(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function hQ(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!Rt(a)){const l=cl(t.borderRadius),c=Zn(t.backdropPadding);e.fillStyle=a;const u=r-c.left,f=o-c.top,p=i-r+c.width,h=s-o+c.height;Object.values(l).some(b=>b!==0)?(e.beginPath(),Gd(e,{x:u,y:f,w:p,h,radius:l}),e.fill()):e.fillRect(u,f,p,h)}}function pQ(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));hQ(n,s,i);const a=kn(s.font),{x:l,y:c,textAlign:u}=i;bl(n,e._pointLabels[o],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function Rk(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,gn);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 gQ(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(),Rk(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function mQ(e,t,n){return va(e,{label:n,index:t,type:"pointLabel"})}class xd extends Qg{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=Zn(qx(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=Rn(t)&&!isNaN(t)?t:0,this.max=Rn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/qx(this.options))}generateTickLabels(t){Qg.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=en(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?iQ(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=gn/(this._pointLabels.length||1),r=this.options.startAngle||0;return ro(t*n+Ko(r))}getDistanceFromCenterForValue(t){if(Rt(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(Rt(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 mQ(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-Dn+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(),Rk(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,c;if(n.pointLabels.display&&pQ(this,s),o.display&&this.ticks.forEach((u,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(f),h=o.setContext(p),b=i.setContext(p);gQ(this,h,l,s,b)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:p}=u;!p||!f||(t.lineWidth=p,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.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 c=r.setContext(this.getContext(l)),u=kn(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=Zn(c.backdropPadding);t.fillRect(-s/2-f.left,-i-u.size/2-f.top,s+f.width,u.size+f.height)}bl(t,a.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Ne(xd,"id","radialLinear"),Ne(xd,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ym.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ne(xd,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ne(xd,"descriptors",{angleLines:{_fallback:"grid"}});const Jm={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}},Fr=Object.keys(Jm);function qO(e,t){return e-t}function GO(e,t){if(Rt(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)),Rn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(ru(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function YO(e,t,n,r){const o=Fr.length;for(let i=Fr.indexOf(e);i<o-1;++i){const s=Jm[Fr[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return Fr[i]}return Fr[o-1]}function vQ(e,t,n,r,o){for(let i=Fr.length-1;i>=Fr.indexOf(n);i--){const s=Fr[i];if(Jm[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return Fr[n?Fr.indexOf(n):0]}function bQ(e){for(let t=Fr.indexOf(e)+1,n=Fr.length;t<n;++t)if(Jm[Fr[t]].common)return Fr[t]}function KO(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=Xw(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function yQ(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 XO(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:yQ(e,r,o,n)}class Xd extends Tl{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 OY._date(t.adapters.date);o.init(n),Cd(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:GO(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(c){!s&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=Rn(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Rn(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=Zq(o,i,s);return this._unit=n.unit||(r.autoSkip?YO(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):vQ(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:bQ(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),XO(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=qn(n,0,s),r=qn(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||YO(i.minUnit,n,r,this._getLabelCapacity(n)),a=dt(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=ru(l)||l===!0,u={};let f=n,p,h;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"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=f,h=0;p<r;p=+t.add(p,a,s),h++)KO(u,p,b);return(p===r||o.bounds==="ticks"||h===1)&&KO(u,p,b),Object.keys(u).sort(qO).map(v=>+v)}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 en(s,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],p=r[n],h=c&&f&&p&&p.major;return this._adapter.format(t,o||(h?f:u))}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=Ko(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,XO(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(GO(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return jA(t.sort(qO))}}Ne(Xd,"id","time"),Ne(Xd,"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 Dp(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}=rs(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}=rs(e,"time",t)),{time:i,pos:a}=e[r],{time:s,pos:l}=e[o]);const c=s-i;return c?a+(l-a)*(t-i)/c:a}class Gx extends Xd{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=Dp(n,this.min),this._tableRange=Dp(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let s,a,l,c,u;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=o.length;s<a;++s)u=o[s+1],l=o[s-1],c=o[s],Math.round((u+l)/2)!==c&&i.push({time:c,pos:s/(a-1)});return i}_generate(){const 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(Dp(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Dp(this._table,r*this._tableRange+this._minPos,!0)}}Ne(Gx,"id","timeseries"),Ne(Gx,"defaults",Xd.defaults);var xQ=Object.freeze({__proto__:null,CategoryScale:Hx,LinearScale:Wx,LogarithmicScale:Ux,RadialLinearScale:xd,TimeScale:Xd,TimeSeriesScale:Gx});const wQ=[PY,rX,QX,xQ];/*!
|
|
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 QO=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}(),Dd={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):Rt(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*QO)/QO}};function D0(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 _Q(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 SQ=0,Pk=1,Ok=2,$k=4,Tk=8;function Ap(e,t,n){var r=SQ;return e<n.left?r|=Pk:e>n.right&&(r|=Ok),t<n.top?r|=Tk:t>n.bottom&&(r|=$k),r}function CQ(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=Ap(n,r,t),a=Ap(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&Tk?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&$k?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&Ok?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&Pk&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=Ap(n,r,t)):(o=c,i=u,a=Ap(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function kp(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=CQ(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),_Q(o,i,e.vx,e.vy,t.align)}var Mp={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 kp({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=D0(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return kp({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=D0(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)),kp({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=D0(e,t.origin);return kp({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)}},is=Dd.rasterize;function EQ(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 RQ(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 PQ(e){return e instanceof Sc?Mp.arc:e instanceof $d?Mp.point:e instanceof Td?Mp.bar:Mp.fallback}function OQ(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,c=n+a,u=t+r-a,f=n+o-a;e.moveTo(t,c),l<u&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function $Q(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),OQ(e,is(t.x)+i/2,is(t.y)+i/2,is(t.w)-i,is(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 TQ(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 DQ(e,t,n){var r=e.shadowBlur,o=n.stroked,i=is(n.x),s=is(n.y),a=is(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 AQ(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,f=c&&u,p;if(!(!l||!s&&!f))for(n=TQ(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),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),p=0,l=t.length;p<l;++p)DQ(e,t[p],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var Dk=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};Ci(Dk.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=kn(hn([n.font,{}],r,i)),a=hn([n.color,_n.color],r,i);return{align:hn([n.align,"center"],r,i),anchor:hn([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:hn([n.backgroundColor,null],r,i),borderColor:hn([n.borderColor,null],r,i),borderRadius:hn([n.borderRadius,0],r,i),borderWidth:hn([n.borderWidth,0],r,i),clamp:hn([n.clamp,!1],r,i),clip:hn([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:hn([n.offset,4],r,i),opacity:hn([n.opacity,1],r,i),origin:RQ(o._el,r),padding:Zn(hn([n.padding,4],r,i)),positioner:PQ(o._el),rotation:hn([n.rotation,0],r,i)*(Math.PI/180),size:Dd.textSize(o._ctx,t,s),textAlign:hn([n.textAlign,"start"],r,i),textShadowBlur:hn([n.textShadowBlur,0],r,i),textShadowColor:hn([n.textShadowColor,a],r,i),textStrokeColor:hn([n.textStrokeColor,a],r,i),textStrokeWidth:hn([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,c=hn([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=dt(en(i.formatter,[s,e]),s),l=Rt(a)?[]:Dd.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=EQ(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=Dd.bound(0,o.opacity,1),r.translate(is(t.x),is(t.y)),r.rotate(o.rotation),$Q(r,i.frame,o),AQ(r,o.lines,i.text,o),r.restore())}});var kQ=Number.MIN_SAFE_INTEGER||-9007199254740991,MQ=Number.MAX_SAFE_INTEGER||9007199254740991;function ed(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 JO(e,t){var n=MQ,r=kQ,o=t.origin,i,s,a,l,c;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function Ip(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 Ak=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Ci(Ak.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=ed(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=[Ip(t[0],t[1]),Ip(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(Ip(n[0],n[1]),Ip(n[0],n[3])),o=0;o<r.length;++o)if(i=JO(t,r[o]),s=JO(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[ed({x:t.x,y:t.y},r,n),ed({x:t.x+t.w,y:t.y},r,n),ed({x:t.x+t.w,y:t.y+t.h},r,n),ed({x:t.x,y:t.y+t.h},r,n)]}});function kk(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,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*f,u*=i*f,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function IQ(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 NQ(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,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),s=kk(a,r.model(),i),o._box.update(s,i,r.rotation()));return IQ(e,function(l,c){var u=l._hidable,f=c._hidable;u&&f||f?c._visible=!1:u&&(l._visible=!1)})}var Ad={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 Ak,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._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&&NQ(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=kk(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},LQ=function(e){if(Rt(e))return null;var t=e,n,r,o;if(Tt(e))if(!Rt(e.label))t=e.label;else if(!Rt(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},FQ={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:LQ,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},Mr="$datalabels",Mk="$default";function jQ(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=Ci({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(Ci({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return Yt(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||Mk]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function Yx(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&en(s,[o,r])===!0&&(e[Mr]._dirty=!0,n.update(o)))}}function zQ(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&Yx(e,t.leave,n,o),i&&Yx(e,t.enter,r,o))}function BQ(e,t){var n=e[Mr],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=Ad.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,zQ(e,r,o,i,t)}}function VQ(e,t){var n=e[Mr],r=n._listeners.click,o=r&&Ad.lookup(n._labels,t);o&&Yx(e,r,o,t)}var HQ={id:"datalabels",defaults:FQ,beforeInit:function(e){e[Mr]={_actives:[]}},beforeUpdate:function(e){var t=e[Mr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Mr],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=jQ(a,n),c=t.meta.data||[],u=e.ctx,f,p,h,b,v,w,y,_;for(u.save(),f=0,h=c.length;f<h;++f)if(y=c[f],y[Mr]=[],s&&y&&e.getDataVisibility(f)&&!y.skip)for(p=0,b=l.labels.length;p<b;++p)v=l.labels[p],w=v._key,_=new Dk(v,u,y,f),_.$groups={_set:r,_key:w||Mk},_.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},_.update(_.$context),y[Mr].push(_),i.push(_);u.restore(),Ci(o._listeners,l.listeners,{merger:function(S,C,E){C[S]=C[S]||{},C[S][t.index]=E[S],o._listened=!0}})},afterUpdate:function(e){e[Mr]._labels=Ad.prepare(e[Mr]._datasets)},afterDatasetsDraw:function(e){Ad.draw(e,e[Mr]._labels)},beforeEvent:function(e,t){if(e[Mr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":BQ(e,n);break;case"click":VQ(e,n);break}}},afterEvent:function(e){var t=e[Mr],n=t._actives,r=t._actives=e.getActiveElements(),o=Dd.arrayDiff(n,r),i,s,a,l,c,u,f;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(f=c[0].element[Mr]||[],a=0,l=f.length;a<l;++a)u=f[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(Ad.update(t._labels),e.render()),delete t._dirty}};Do.register(...wQ);Do.register(HQ);function l_({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=$e(l=>l.themeStyle);m.useEffect(()=>{var u,f,p,h;(f=(u=i==null?void 0:i.chart)==null?void 0:u.font)!=null&&f.family&&(Do.defaults.font={...Do.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=(h=n==null?void 0:n.current)==null?void 0:h.getContext("2d");if(!l)return;let c;try{c=new Do(l,e),o(c)}catch(b){console.log("error creating chart",b)}return()=>{c&&c.destroy()}},[(a=i==null?void 0:i.chart)==null?void 0:a.font]);function s(l){var u,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const p=c[0].datasetIndex,h=c[0].index,b=(f=(u=c[0].element)==null?void 0:u.$context)==null?void 0:f.raw;t==null||t(r,p,h,b)}}return R.jsx("div",{onClick:s,className:"relative h-[99%]",children:R.jsx("canvas",{ref:n})})}function Er(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 WQ=["color"],UQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,WQ);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.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),qQ=["color"],Ik=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,qQ);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"}))}),GQ=["color"],YQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,GQ);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"}))}),KQ=["color"],XQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,KQ);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"}))}),QQ=["color"],Nk=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,QQ);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"}))}),JQ=["color"],ZQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,JQ);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:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),eJ=["color"],tJ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,eJ);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"}))}),nJ=["color"],rJ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,nJ);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"}))}),oJ=["color"],iJ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,oJ);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"}))}),sJ=["color"],Lk=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,sJ);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"}))}),aJ=["color"],lJ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,aJ);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"}))}),cJ=["color"],uJ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,cJ);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"}))}),dJ=["color"],fJ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,dJ);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:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),hJ=["color"],c_=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,hJ);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}))}),pJ=["color"],u_=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Er(e,pJ);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 Np;const gJ=new Uint8Array(16);function mJ(){if(!Np&&(Np=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Np))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Np(gJ)}const Xn=[];for(let e=0;e<256;++e)Xn.push((e+256).toString(16).slice(1));function vJ(e,t=0){return Xn[e[t+0]]+Xn[e[t+1]]+Xn[e[t+2]]+Xn[e[t+3]]+"-"+Xn[e[t+4]]+Xn[e[t+5]]+"-"+Xn[e[t+6]]+Xn[e[t+7]]+"-"+Xn[e[t+8]]+Xn[e[t+9]]+"-"+Xn[e[t+10]]+Xn[e[t+11]]+Xn[e[t+12]]+Xn[e[t+13]]+Xn[e[t+14]]+Xn[e[t+15]]}const bJ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ZO={randomUUID:bJ};function ua(e,t,n){if(ZO.randomUUID&&!t&&!e)return ZO.randomUUID();e=e||{};const r=e.random||(e.rng||mJ)();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 vJ(r)}const br=rD()(uD((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:ua(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:ua(),cards:[],activeCardId:""},actions:{setChartOrientation:n=>{e(r=>{var s,a,l,c,u,f;const o=r.card.preferences;let i={};((s=o==null?void 0:o.chartOptions)==null?void 0:s.indexAxis)!==n&&(i={x:(l=(a=o==null?void 0:o.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(f=o==null?void 0:o.chartOptions)==null?void 0:f.scales,...i},indexAxis:n}}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},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})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(o=>o.id===n.id?n:o)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},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})},setSelectedDatamodelId:n=>{var r,o;e(i=>{i.selectedDatamodelId=n,i.card.datamodelId=n}),(o=(r=t()).onDatamodelChange)==null||o.call(r,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})}}}))),Zm=()=>br(e=>e.actions);function yJ(e,t,n){var l,c,u,f;const r=n==null?void 0:n.datasetOptions,o=$e.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,s=(f=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:f.borderColor;return e.map((p,h)=>{var _;const b=r==null?void 0:r.find(S=>S.idx===h),v=i==null?void 0:i[h%i.length],w=s==null?void 0:s[h%s.length];return{label:p.charAt(0).toUpperCase()+p.slice(1),data:t.map(S=>S[p]),...b,datalabels:{...b==null?void 0:b.datalabels,color:xJ((_=b==null?void 0:b.datalabels)==null?void 0:_.align,v)},backgroundColor:v,borderColor:w}})}function xJ(e,t){return Zc(e==="end"||e==="start"?zd():t)}function wJ(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=lr(e);let r=[];const o=$e.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const f=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:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(p=>p[n==null?void 0:n[1]]))].map((p,h)=>{const b=e.filter(v=>v[n==null?void 0:n[1]]===p);return{label:p,data:b.map(v=>({x:v[t[0]],y:v[t[1]],r:v[t[2]],label:v[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[h%i.length],borderColor:s==null?void 0:s[h%s.length]}})),r}function _J(e){var c,u,f,p;const{dimensionKeys:t,metricKeys:n}=lr(e),r=$e.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(p=(f=r==null?void 0:r.chart)==null?void 0:f.dataset)==null?void 0:p.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(h=>h==null?void 0:h[s]))].map((h,b)=>({label:h,data:e.filter(v=>(v==null?void 0:v[s])===h).map(v=>[v==null?void 0:v[n[0]],v==null?void 0:v[n[1]],v==null?void 0:v[n[2]]]),backgroundColor:o==null?void 0:o[b%o.length],borderColor:i==null?void 0:i[b%i.length],borderSkipped:!1}))}function SJ(e,t){var s,a,l,c;const n=$e.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(f=>f[u]),backgroundColor:t.map((f,p)=>r==null?void 0:r[p%r.length]),borderColor:t.map((f,p)=>o==null?void 0:o[p%o.length])}))}function CJ(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 lr(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=CJ(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,f,p,h;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((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((f=e==null?void 0:e[1])==null?void 0:f[i])=="string"||typeof((p=e==null?void 0:e[2])==null?void 0:p[i])&&typeof((h=e==null?void 0:e[2])==null?void 0:h[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 Pg(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 Jg({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const o=e.reduce((i,s)=>{const a=s[t],l=s[n],c=s[r];return i[a]||(i[a]={[t]:a}),i[a][l]=c,i},{});return Object.values(o)}function Go(e,t){var s;const n=$e.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=al.cloneDeep(r);return al.merge(o,e,t)}function Kx(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
|
|
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 EJ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Fk=(...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 RJ={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 PJ=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,...RJ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Fk("lucide",o),...a},[...s.map(([c,u])=>m.createElement(c,u)),...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 Sn=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(PJ,{ref:i,iconNode:t,className:Fk(`lucide-${EJ(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 Xx=Sn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
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 jk=Sn("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"}]]);/**
|
|
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 Qf=Sn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 d_=Sn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 zk=Sn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 f_=Sn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 OJ=Sn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
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 Bk=Sn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 $J=Sn("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
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 Vk=Sn("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
|
|
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 Hk=Sn("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
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 TJ=Sn("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
213
|
-
* @license lucide-react v0.379.0 - ISC
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the ISC license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/const DJ=Sn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
218
|
-
* @license lucide-react v0.379.0 - ISC
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the ISC license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/const AJ=Sn("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
|
|
223
|
-
* @license lucide-react v0.379.0 - ISC
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the ISC license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/const h_=Sn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
228
|
-
* @license lucide-react v0.379.0 - ISC
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the ISC license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/const kJ=Sn("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
|
|
233
|
-
* @license lucide-react v0.379.0 - ISC
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the ISC license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/const MJ=Sn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
238
|
-
* @license lucide-react v0.379.0 - ISC
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the ISC license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const p_=Sn("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"}]]);/**
|
|
243
|
-
* @license lucide-react v0.379.0 - ISC
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the ISC license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/const Wk=Sn("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
|
|
248
|
-
* @license lucide-react v0.379.0 - ISC
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the ISC license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/const IJ=Sn("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"}]]);/**
|
|
253
|
-
* @license lucide-react v0.379.0 - ISC
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the ISC license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/const NJ=Sn("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
258
|
-
* @license lucide-react v0.379.0 - ISC
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the ISC license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/const Jf=Sn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),LJ=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],o=Object.keys(e[0]);r.push(o.join(","));for(const c of e){const u=o.map(f=>`"${(""+c[f]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
|
|
263
|
-
`),s=new Blob([i],{type:"text/csv"}),a=window.URL.createObjectURL(s),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",a),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return R.jsx($J,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function FJ({frame:e}){var S;const t=$e(C=>C.isDashboardEditing),n=$e(C=>C.filterValues),r=$e(C=>C.isVisualEditing),o=$e(C=>C.selectedSheetId);$e(C=>C.currentBreakpoint);const{removeFrame:i}=$e(C=>C.actions),s=$e(C=>C.actions.setIsVisualEditing),a=br(C=>C.actions.setFilterValues),l=br(C=>C.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:f}=br(C=>C.actions),p=br(C=>C.actions.setSelectedConnectionId),h=br(C=>C.actions.setSelectedDatamodelId),b=br(C=>C.actions.setSelectedDatabaseName),v=br(C=>C.actions.setSelectedSchemaName),w=br(C=>C.actions.setSelectedTableName),y=e.cards.find(C=>C.id===e.activeCardId);function _(){s(!r),c(y);const{dimensionKeys:C}=lr((y==null?void 0:y.data)||[]);f(C),u(e),y!=null&&y.connectionId&&p(y==null?void 0:y.connectionId),y!=null&&y.datamodelId&&y.datamodelId!=="none"&&(h(y==null?void 0:y.datamodelId),b("")),y!=null&&y.lastSelectedDatabase&&y.lastSelectedDatabase!=="none"&&(b(y==null?void 0:y.lastSelectedDatabase),h("")),y!=null&&y.lastSelectedSchema&&v(y==null?void 0:y.lastSelectedSchema),y!=null&&y.lastSelectedTable&&w(y==null?void 0:y.lastSelectedTable),n&&(a(n),l(!0))}return R.jsx("section",{className:"absolute right-2 top-2 z-10",children:R.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?R.jsx(tJ,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):R.jsx(rJ,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&R.jsx(Nk,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((S=y.preferences)==null?void 0:S.allowDownload)===!0&&R.jsx(LJ,{data:(y==null?void 0:y.data)||[],filename:y.title})]})})}function jJ(e,t=globalThis==null?void 0:globalThis.document){const n=jn(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Qx="dismissableLayer.update",zJ="dismissableLayer.pointerDownOutside",BJ="dismissableLayer.focusOutside";let e$;const VJ=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zf=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=m.useContext(VJ),[f,p]=m.useState(null),h=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=m.useState({}),v=_t(t,N=>p(N)),w=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=w.indexOf(y),S=f?w.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,O=HJ(N=>{const M=N.target,A=[...u.branches].some(F=>F.contains(M));!E||A||(i==null||i(N),a==null||a(N),N.defaultPrevented||l==null||l())},h),T=WJ(N=>{const M=N.target;[...u.branches].some(F=>F.contains(M))||(s==null||s(N),a==null||a(N),N.defaultPrevented||l==null||l())},h);return jJ(N=>{S===u.layers.size-1&&(o==null||o(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},h),m.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(e$=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),t$(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=e$)}},[f,h,r,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),t$())},[f,u]),m.useEffect(()=>{const N=()=>b({});return document.addEventListener(Qx,N),()=>document.removeEventListener(Qx,N)},[]),m.createElement(Qe.div,de({},c,{ref:v,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:Me(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Me(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Me(e.onPointerDownCapture,O.onPointerDownCapture)}))});function HJ(e,t=globalThis==null?void 0:globalThis.document){const n=jn(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){Uk(zJ,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}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 WJ(e,t=globalThis==null?void 0:globalThis.document){const n=jn(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&Uk(BJ,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 t$(){const e=new CustomEvent(Qx);document.dispatchEvent(e)}function Uk(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?AD(o,i):o.dispatchEvent(i)}const UJ=["top","right","bottom","left"],da=Math.min,io=Math.max,Zg=Math.round,Lp=Math.floor,fa=e=>({x:e,y:e}),qJ={left:"right",right:"left",bottom:"top",top:"bottom"},GJ={start:"end",end:"start"};function Jx(e,t,n){return io(e,da(t,n))}function as(e,t){return typeof e=="function"?e(t):e}function ls(e){return e.split("-")[0]}function vu(e){return e.split("-")[1]}function g_(e){return e==="x"?"y":"x"}function m_(e){return e==="y"?"height":"width"}function bu(e){return["top","bottom"].includes(ls(e))?"y":"x"}function v_(e){return g_(bu(e))}function YJ(e,t,n){n===void 0&&(n=!1);const r=vu(e),o=v_(e),i=m_(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=em(s)),[s,em(s)]}function KJ(e){const t=em(e);return[Zx(e),t,Zx(t)]}function Zx(e){return e.replace(/start|end/g,t=>GJ[t])}function XJ(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 QJ(e,t,n,r){const o=vu(e);let i=XJ(ls(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Zx)))),i}function em(e){return e.replace(/left|right|bottom|top/g,t=>qJ[t])}function JJ(e){return{top:0,right:0,bottom:0,left:0,...e}}function qk(e){return typeof e!="number"?JJ(e):{top:e,right:e,bottom:e,left:e}}function tm(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function n$(e,t,n){let{reference:r,floating:o}=e;const i=bu(t),s=v_(t),a=m_(s),l=ls(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(vu(t)){case"start":h[s]-=p*(n&&c?-1:1);break;case"end":h[s]+=p*(n&&c?-1:1);break}return h}const ZJ=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 c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=n$(c,r,l),p=r,h={},b=0;for(let v=0;v<a.length;v++){const{name:w,fn:y}=a[v],{x:_,y:S,data:C,reset:E}=await y({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=_??u,f=S??f,h={...h,[w]:{...h[w],...C}},E&&b<=50){b++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:f}=n$(c,p,l)),v=-1;continue}}return{x:u,y:f,placement:p,strategy:o,middlewareData:h}};async function Qd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=as(t,e),b=qk(h),w=a[p?f==="floating"?"reference":"floating":f],y=tm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=f==="floating"?{...s.floating,x:r,y:o}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),C=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=tm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(y.top-E.top+b.top)/C.y,bottom:(E.bottom-y.bottom+b.bottom)/C.y,left:(y.left-E.left+b.left)/C.x,right:(E.right-y.right+b.right)/C.x}}const r$=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:c,padding:u=0}=as(e,t)||{};if(c==null)return{};const f=qk(u),p={x:n,y:r},h=v_(o),b=m_(h),v=await s.getDimensions(c),w=h==="y",y=w?"top":"left",_=w?"bottom":"right",S=w?"clientHeight":"clientWidth",C=i.reference[b]+i.reference[h]-p[h]-i.floating[b],E=p[h]-i.reference[h],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=O?O[S]:0;(!T||!await(s.isElement==null?void 0:s.isElement(O)))&&(T=a.floating[S]||i.floating[b]);const N=C/2-E/2,M=T/2-v[b]/2-1,A=da(f[y],M),F=da(f[_],M),z=A,X=T-v[b]-F,ee=T/2-v[b]/2+N,H=Jx(z,ee,X),Q=!l.arrow&&vu(o)!=null&&ee!=H&&i.reference[b]/2-(ee<z?A:F)-v[b]/2<0,Y=Q?ee<z?ee-z:ee-X:0;return{[h]:p[h]+Y,data:{[h]:H,centerOffset:ee-H-Y,...Q&&{alignmentOffset:Y}},reset:Q}}}),eZ=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:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:v=!0,...w}=as(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=ls(o),_=ls(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(_||!v?[em(a)]:KJ(a));!p&&b!=="none"&&C.push(...QJ(a,v,b,S));const E=[a,...C],O=await Qd(t,w),T=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&T.push(O[y]),f){const z=YJ(o,s,S);T.push(O[z[0]],O[z[1]])}if(N=[...N,{placement:o,overflows:T}],!T.every(z=>z<=0)){var M,A;const z=(((M=i.flip)==null?void 0:M.index)||0)+1,X=E[z];if(X)return{data:{index:z,overflows:N},reset:{placement:X}};let ee=(A=N.filter(H=>H.overflows[0]<=0).sort((H,Q)=>H.overflows[1]-Q.overflows[1])[0])==null?void 0:A.placement;if(!ee)switch(h){case"bestFit":{var F;const H=(F=N.map(Q=>[Q.placement,Q.overflows.filter(Y=>Y>0).reduce((Y,J)=>Y+J,0)]).sort((Q,Y)=>Q[1]-Y[1])[0])==null?void 0:F[0];H&&(ee=H);break}case"initialPlacement":ee=a;break}if(o!==ee)return{reset:{placement:ee}}}return{}}}};function o$(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function i$(e){return UJ.some(t=>e[t]>=0)}const tZ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=as(e,t);switch(r){case"referenceHidden":{const i=await Qd(t,{...o,elementContext:"reference"}),s=o$(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:i$(s)}}}case"escaped":{const i=await Qd(t,{...o,altBoundary:!0}),s=o$(i,n.floating);return{data:{escapedOffsets:s,escaped:i$(s)}}}default:return{}}}}};async function nZ(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ls(n),a=vu(n),l=bu(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,f=as(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:b}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof b=="number"&&(h=a==="end"?b*-1:b),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const rZ=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 nZ(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}}}}},oZ=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:w=>{let{x:y,y:_}=w;return{x:y,y:_}}},...l}=as(e,t),c={x:n,y:r},u=await Qd(t,l),f=bu(ls(o)),p=g_(f);let h=c[p],b=c[f];if(i){const w=p==="y"?"top":"left",y=p==="y"?"bottom":"right",_=h+u[w],S=h-u[y];h=Jx(_,h,S)}if(s){const w=f==="y"?"top":"left",y=f==="y"?"bottom":"right",_=b+u[w],S=b-u[y];b=Jx(_,b,S)}const v=a.fn({...t,[p]:h,[f]:b});return{...v,data:{x:v.x-n,y:v.y-r}}}}},iZ=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:c=!0}=as(e,t),u={x:n,y:r},f=bu(o),p=g_(f);let h=u[p],b=u[f];const v=as(a,t),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const S=p==="y"?"height":"width",C=i.reference[p]-i.floating[S]+w.mainAxis,E=i.reference[p]+i.reference[S]-w.mainAxis;h<C?h=C:h>E&&(h=E)}if(c){var y,_;const S=p==="y"?"width":"height",C=["top","left"].includes(ls(o)),E=i.reference[f]-i.floating[S]+(C&&((y=s.offset)==null?void 0:y[f])||0)+(C?0:w.crossAxis),O=i.reference[f]+i.reference[S]+(C?0:((_=s.offset)==null?void 0:_[f])||0)-(C?w.crossAxis:0);b<E?b=E:b>O&&(b=O)}return{[p]:h,[f]:b}}}},sZ=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}=as(e,t),l=await Qd(t,a),c=ls(n),u=vu(n),f=bu(n)==="y",{width:p,height:h}=r.floating;let b,v;c==="top"||c==="bottom"?(b=c,v=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(v=c,b=u==="end"?"top":"bottom");const w=h-l[b],y=p-l[v],_=!t.middlewareData.shift;let S=w,C=y;if(f){const O=p-l.left-l.right;C=u||_?da(y,O):O}else{const O=h-l.top-l.bottom;S=u||_?da(w,O):O}if(_&&!u){const O=io(l.left,0),T=io(l.right,0),N=io(l.top,0),M=io(l.bottom,0);f?C=p-2*(O!==0||T!==0?O+T:io(l.left,l.right)):S=h-2*(N!==0||M!==0?N+M:io(l.top,l.bottom))}await s({...t,availableWidth:C,availableHeight:S});const E=await o.getDimensions(i.floating);return p!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}};function ha(e){return Gk(e)?(e.nodeName||"").toLowerCase():"#document"}function co(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fs(e){var t;return(t=(Gk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Gk(e){return e instanceof Node||e instanceof co(e).Node}function cs(e){return e instanceof Element||e instanceof co(e).Element}function Ei(e){return e instanceof HTMLElement||e instanceof co(e).HTMLElement}function s$(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof co(e).ShadowRoot}function eh(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Mo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function aZ(e){return["table","td","th"].includes(ha(e))}function b_(e){const t=y_(),n=Mo(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 lZ(e){let t=su(e);for(;Ei(t)&&!ev(t);){if(b_(t))return t;t=su(t)}return null}function y_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ev(e){return["html","body","#document"].includes(ha(e))}function Mo(e){return co(e).getComputedStyle(e)}function tv(e){return cs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function su(e){if(ha(e)==="html")return e;const t=e.assignedSlot||e.parentNode||s$(e)&&e.host||fs(e);return s$(t)?t.host:t}function Yk(e){const t=su(e);return ev(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ei(t)&&eh(t)?t:Yk(t)}function Jd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Yk(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=co(o);return i?t.concat(s,s.visualViewport||[],eh(o)?o:[],s.frameElement&&n?Jd(s.frameElement):[]):t.concat(o,Jd(o,[],n))}function Kk(e){const t=Mo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ei(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Zg(n)!==i||Zg(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function x_(e){return cs(e)?e:e.contextElement}function Oc(e){const t=x_(e);if(!Ei(t))return fa(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Kk(t);let s=(i?Zg(n.width):n.width)/r,a=(i?Zg(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const cZ=fa(0);function Xk(e){const t=co(e);return!y_()||!t.visualViewport?cZ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uZ(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==co(e)?!1:t}function yl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=x_(e);let s=fa(1);t&&(r?cs(r)&&(s=Oc(r)):s=Oc(e));const a=uZ(i,n,r)?Xk(i):fa(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const p=co(i),h=r&&cs(r)?co(r):r;let b=p.frameElement;for(;b&&r&&h!==p;){const v=Oc(b),w=b.getBoundingClientRect(),y=Mo(b),_=w.left+(b.clientLeft+parseFloat(y.paddingLeft))*v.x,S=w.top+(b.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,f*=v.y,l+=_,c+=S,b=co(b).frameElement}}return tm({width:u,height:f,x:l,y:c})}function dZ(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Ei(n),i=fs(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=fa(1);const l=fa(0);if((o||!o&&r!=="fixed")&&((ha(n)!=="body"||eh(i))&&(s=tv(n)),Ei(n))){const c=yl(n);a=Oc(n),l.x=c.x+n.clientLeft,l.y=c.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 fZ(e){return Array.from(e.getClientRects())}function Qk(e){return yl(fs(e)).left+tv(e).scrollLeft}function hZ(e){const t=fs(e),n=tv(e),r=e.ownerDocument.body,o=io(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=io(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Qk(e);const a=-n.scrollTop;return Mo(r).direction==="rtl"&&(s+=io(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function pZ(e,t){const n=co(e),r=fs(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=y_();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function gZ(e,t){const n=yl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ei(e)?Oc(e):fa(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function a$(e,t,n){let r;if(t==="viewport")r=pZ(e,n);else if(t==="document")r=hZ(fs(e));else if(cs(t))r=gZ(t,n);else{const o=Xk(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return tm(r)}function Jk(e,t){const n=su(e);return n===t||!cs(n)||ev(n)?!1:Mo(n).position==="fixed"||Jk(n,t)}function mZ(e,t){const n=t.get(e);if(n)return n;let r=Jd(e,[],!1).filter(a=>cs(a)&&ha(a)!=="body"),o=null;const i=Mo(e).position==="fixed";let s=i?su(e):e;for(;cs(s)&&!ev(s);){const a=Mo(s),l=b_(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||eh(s)&&!l&&Jk(e,s))?r=r.filter(u=>u!==s):o=a,s=su(s)}return t.set(e,r),r}function vZ(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?mZ(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=a$(t,u,o);return c.top=io(f.top,c.top),c.right=da(f.right,c.right),c.bottom=da(f.bottom,c.bottom),c.left=io(f.left,c.left),c},a$(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function bZ(e){return Kk(e)}function yZ(e,t,n){const r=Ei(t),o=fs(t),i=n==="fixed",s=yl(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=fa(0);if(r||!r&&!i)if((ha(t)!=="body"||eh(o))&&(a=tv(t)),r){const c=yl(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=Qk(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function l$(e,t){return!Ei(e)||Mo(e).position==="fixed"?null:t?t(e):e.offsetParent}function Zk(e,t){const n=co(e);if(!Ei(e))return n;let r=l$(e,t);for(;r&&aZ(r)&&Mo(r).position==="static";)r=l$(r,t);return r&&(ha(r)==="html"||ha(r)==="body"&&Mo(r).position==="static"&&!b_(r))?n:r||lZ(e)||n}const xZ=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Zk,i=this.getDimensions;return{reference:yZ(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function wZ(e){return Mo(e).direction==="rtl"}const _Z={convertOffsetParentRelativeRectToViewportRelativeRect:dZ,getDocumentElement:fs,getClippingRect:vZ,getOffsetParent:Zk,getElementRects:xZ,getClientRects:fZ,getDimensions:bZ,getScale:Oc,isElement:cs,isRTL:wZ};function SZ(e,t){let n=null,r;const o=fs(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:c,top:u,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const h=Lp(u),b=Lp(o.clientWidth-(c+f)),v=Lp(o.clientHeight-(u+p)),w=Lp(c),_={rootMargin:-h+"px "+-b+"px "+-v+"px "+-w+"px",threshold:io(0,da(1,l))||1};let S=!0;function C(E){const O=E[0].intersectionRatio;if(O!==l){if(!S)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(C,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return s(!0),i}function CZ(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,c=x_(e),u=o||i?[...c?Jd(c):[],...Jd(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=c&&a?SZ(c,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(y=>{let[_]=y;_&&_.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{h&&h.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let b,v=l?yl(e):null;l&&w();function w(){const y=yl(e);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&n(),v=y,b=requestAnimationFrame(w)}return n(),()=>{u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f&&f(),h&&h.disconnect(),h=null,l&&cancelAnimationFrame(b)}}const EZ=(e,t,n)=>{const r=new Map,o={platform:_Z,...n},i={...o.platform,_c:r};return ZJ(e,t,{...o,platform:i})},RZ=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?r$({element:r.current,padding:o}).fn(n):{}:r?r$({element:r,padding:o}).fn(n):{}}}};var Og=typeof document<"u"?m.useLayoutEffect:m.useEffect;function nm(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(!nm(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)&&!nm(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function eM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function c$(e,t){const n=eM(e);return Math.round(t*n)/n}function u$(e){const t=L.useRef(e);return Og(()=>{t.current=e}),t}function PZ(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:c}=e,[u,f]=L.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=L.useState(r);nm(p,r)||h(r);const[b,v]=L.useState(null),[w,y]=L.useState(null),_=L.useCallback(Q=>{Q!=O.current&&(O.current=Q,v(Q))},[v]),S=L.useCallback(Q=>{Q!==T.current&&(T.current=Q,y(Q))},[y]),C=i||b,E=s||w,O=L.useRef(null),T=L.useRef(null),N=L.useRef(u),M=u$(l),A=u$(o),F=L.useCallback(()=>{if(!O.current||!T.current)return;const Q={placement:t,strategy:n,middleware:p};A.current&&(Q.platform=A.current),EZ(O.current,T.current,Q).then(Y=>{const J={...Y,isPositioned:!0};z.current&&!nm(N.current,J)&&(N.current=J,ew.flushSync(()=>{f(J)}))})},[p,t,n,A]);Og(()=>{c===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,f(Q=>({...Q,isPositioned:!1})))},[c]);const z=L.useRef(!1);Og(()=>(z.current=!0,()=>{z.current=!1}),[]),Og(()=>{if(C&&(O.current=C),E&&(T.current=E),C&&E){if(M.current)return M.current(C,E,F);F()}},[C,E,F,M]);const X=L.useMemo(()=>({reference:O,floating:T,setReference:_,setFloating:S}),[_,S]),ee=L.useMemo(()=>({reference:C,floating:E}),[C,E]),H=L.useMemo(()=>{const Q={position:n,left:0,top:0};if(!ee.floating)return Q;const Y=c$(ee.floating,u.x),J=c$(ee.floating,u.y);return a?{...Q,transform:"translate("+Y+"px, "+J+"px)",...eM(ee.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:J}},[n,a,ee.floating,u.x,u.y]);return L.useMemo(()=>({...u,update:F,refs:X,elements:ee,floatingStyles:H}),[u,F,X,ee,H])}function nv(e){const[t,n]=m.useState(void 0);return ur(()=>{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,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.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 tM="Popper",[nM,Di]=er(tM),[OZ,rM]=nM(tM),$Z=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(OZ,{scope:t,anchor:r,onAnchorChange:o},n)},TZ="PopperAnchor",DZ=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=rM(TZ,n),s=m.useRef(null),a=_t(t,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(Qe.div,de({},o,{ref:a}))}),oM="PopperContent",[AZ,p1e]=nM(oM),kZ=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:p=0,align:h="center",alignOffset:b=0,arrowPadding:v=0,avoidCollisions:w=!0,collisionBoundary:y=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:O,...T}=e,N=rM(oM,u),[M,A]=m.useState(null),F=_t(t,Oe=>A(Oe)),[z,X]=m.useState(null),ee=nv(z),H=(n=ee==null?void 0:ee.width)!==null&&n!==void 0?n:0,Q=(r=ee==null?void 0:ee.height)!==null&&r!==void 0?r:0,Y=f+(h!=="center"?"-"+h:""),J=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},W=Array.isArray(y)?y:[y],$=W.length>0,V={padding:J,boundary:W.filter(MZ),altBoundary:$},{refs:U,floatingStyles:I,placement:te,isPositioned:fe,middlewareData:ne}=PZ({strategy:"fixed",placement:Y,whileElementsMounted:(...Oe)=>CZ(...Oe,{animationFrame:E==="always"}),elements:{reference:N.anchor},middleware:[rZ({mainAxis:p+Q,alignmentAxis:b}),w&&oZ({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?iZ():void 0,...V}),w&&eZ({...V}),sZ({...V,apply:({elements:Oe,rects:Te,availableWidth:Ue,availableHeight:Be})=>{const{width:Ie,height:Ke}=Te.reference,lt=Oe.floating.style;lt.setProperty("--radix-popper-available-width",`${Ue}px`),lt.setProperty("--radix-popper-available-height",`${Be}px`),lt.setProperty("--radix-popper-anchor-width",`${Ie}px`),lt.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),z&&RZ({element:z,padding:v}),IZ({arrowWidth:H,arrowHeight:Q}),C&&tZ({strategy:"referenceHidden",...V})]}),[ue,ie]=iM(te),oe=jn(O);ur(()=>{fe&&(oe==null||oe())},[fe,oe]);const le=(o=ne.arrow)===null||o===void 0?void 0:o.x,ye=(i=ne.arrow)===null||i===void 0?void 0:i.y,K=((s=ne.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[be,Se]=m.useState();return ur(()=>{M&&Se(window.getComputedStyle(M).zIndex)},[M]),m.createElement("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:fe?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(a=ne.transformOrigin)===null||a===void 0?void 0:a.x,(l=ne.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(AZ,{scope:u,placedSide:ue,onArrowChange:X,arrowX:le,arrowY:ye,shouldHideArrow:K},m.createElement(Qe.div,de({"data-side":ue,"data-align":ie},T,{ref:F,style:{...T.style,animation:fe?void 0:"none",opacity:(c=ne.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function MZ(e){return e!==null}const IZ=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=f?0:e.arrowWidth,h=f?0:e.arrowHeight,[b,v]=iM(a),w={start:"0%",center:"50%",end:"100%"}[v],y=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+p/2,_=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+h/2;let S="",C="";return b==="bottom"?(S=f?w:`${y}px`,C=`${-h}px`):b==="top"?(S=f?w:`${y}px`,C=`${l.floating.height+h}px`):b==="right"?(S=`${-h}px`,C=f?w:`${_}px`):b==="left"&&(S=`${l.floating.width+h}px`,C=f?w:`${_}px`),{data:{x:S,y:C}}}});function iM(e){const[t,n="center"]=e.split("-");return[t,n]}const th=$Z,nh=DZ,rh=kZ,w_=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?Cr.createPortal(m.createElement(Qe.div,de({},o,{ref:t})),r):null}),NZ=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(LZ);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(e1,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(e1,de({},r,{ref:t}),n)});NZ.displayName="Slot";const e1=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...FZ(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});e1.displayName="SlotClone";const sM=({children:e})=>m.createElement(m.Fragment,null,e);function LZ(e){return m.isValidElement(e)&&e.type===sM}function FZ(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}}const aM=m.forwardRef((e,t)=>m.createElement(Qe.span,de({},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}}))),jZ=aM,[rv,g1e]=er("Tooltip",[Di]),__=Di(),zZ="TooltipProvider",BZ=700,t1="tooltip.open",[VZ,S_]=rv(zZ),HZ=e=>{const{__scopeTooltip:t,delayDuration:n=BZ,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(VZ,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},C_="Tooltip",[WZ,ov]=rv(C_),UZ=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=S_(C_,e.__scopeTooltip),c=__(t),[u,f]=m.useState(null),p=Zo(),h=m.useRef(0),b=s??l.disableHoverableContent,v=a??l.delayDuration,w=m.useRef(!1),[y=!1,_]=_r({prop:r,defaultProp:o,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(t1))):l.onClose(),i==null||i(T)}}),S=m.useMemo(()=>y?w.current?"delayed-open":"instant-open":"closed",[y]),C=m.useCallback(()=>{window.clearTimeout(h.current),w.current=!1,_(!0)},[_]),E=m.useCallback(()=>{window.clearTimeout(h.current),_(!1)},[_]),O=m.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{w.current=!0,_(!0)},v)},[v,_]);return m.useEffect(()=>()=>window.clearTimeout(h.current),[]),m.createElement(th,c,m.createElement(WZ,{scope:t,contentId:p,open:y,stateAttribute:S,trigger:u,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?O():C()},[l.isOpenDelayed,O,C]),onTriggerLeave:m.useCallback(()=>{b?E():window.clearTimeout(h.current)},[E,b]),onOpen:C,onClose:E,disableHoverableContent:b},n))},d$="TooltipTrigger",lM=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ov(d$,n),i=S_(d$,n),s=__(n),a=m.useRef(null),l=_t(t,a,o.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(nh,de({asChild:!0},s),m.createElement(Qe.button,de({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:Me(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Me(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Me(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Me(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Me(e.onBlur,o.onClose),onClick:Me(e.onClick,o.onClose)})))}),qZ="TooltipPortal",[m1e,GZ]=rv(qZ,{forceMount:void 0}),Zd="TooltipContent",YZ=m.forwardRef((e,t)=>{const n=GZ(Zd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=ov(Zd,e.__scopeTooltip);return m.createElement(tr,{present:r||s.open},s.disableHoverableContent?m.createElement(cM,de({side:o},i,{ref:t})):m.createElement(KZ,de({side:o},i,{ref:t})))}),KZ=m.forwardRef((e,t)=>{const n=ov(Zd,e.__scopeTooltip),r=S_(Zd,e.__scopeTooltip),o=m.useRef(null),i=_t(t,o),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,p=m.useCallback(()=>{a(null),f(!1)},[f]),h=m.useCallback((b,v)=>{const w=b.currentTarget,y={x:b.clientX,y:b.clientY},_=QZ(y,w.getBoundingClientRect()),S=JZ(y,_),C=ZZ(v.getBoundingClientRect()),E=tee([...S,...C]);a(E),f(!0)},[f]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(l&&u){const b=w=>h(w,u),v=w=>h(w,l);return l.addEventListener("pointerleave",b),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",v)}}},[l,u,h,p]),m.useEffect(()=>{if(s){const b=v=>{const w=v.target,y={x:v.clientX,y:v.clientY},_=(l==null?void 0:l.contains(w))||(u==null?void 0:u.contains(w)),S=!eee(y,s);_?p():S&&(p(),c())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,u,s,c,p]),m.createElement(cM,de({},e,{ref:i}))}),[XZ,v1e]=rv(C_,{isInside:!1}),cM=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=ov(Zd,n),c=__(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(t1,u),()=>document.removeEventListener(t1,u)),[u]),m.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.createElement(Zf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},m.createElement(rh,de({"data-state":l.stateAttribute},c,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(sM,null,r),m.createElement(XZ,{scope:n,isInside:!0},m.createElement(jZ,{id:l.contentId,role:"tooltip"},o||r))))});function QZ(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 JZ(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 ZZ(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 eee(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,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function tee(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),nee(t)}function nee(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 ree=HZ,oee=UZ,iee=lM,uM=YZ,see=ree,dM=oee,fM=iee,E_=L.forwardRef(({className:e,sideOffset:t=4,...n},r)=>R.jsx(uM,{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}));E_.displayName=uM.displayName;function dl({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const c=t;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 u=e/s,f={maximumFractionDigits:c,minimumFractionDigits:c};if(o){f.style="currency",f.currency=o;try{new Intl.NumberFormat(i,f).format(0)}catch{f.currency="USD"}}try{new Intl.NumberFormat(i,f).format(0)}catch{l="en-US"}let h=new Intl.NumberFormat(l,f).format(u);return n&&(h+=a),h}function hM(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function pM({card:e}){var w,y,_,S,C,E,O,T,N,M,A,F,z,X,ee,H,Q,Y,J,W,$,V,U,I;const t=$e(te=>te.actions.setCardTitle),n=$e(te=>te.actions.setCardDescription),r=$e(te=>te.isVisualEditing),o=br(te=>te.card),i=br(te=>te.actions.setCard);br(te=>te.actions.setNumberFormat);const s=$e(te=>te.selectedSheetId),a=e.data,l=(y=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:y.colorRanges,{metricKeys:c}=lr(a||[]),u=(_=a==null?void 0:a[0])==null?void 0:_[c==null?void 0:c[0]],f=(S=a==null?void 0:a[0])==null?void 0:S[c==null?void 0:c[1]],p=!!e.data&&e.data.length>0;function h(te){r?i({...o,title:te}):t(s,e.id,te)}function b(te){r?i({...o,description:te}):n(s,e.id,te)}const v=f&&f-u!==0?(u-f)/f:null;return R.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[R.jsxs(Dm,{className:"grow pb-3",children:[R.jsx(xi,{text:r?o.title:e.title,onSave:h,children:R.jsx("div",{className:"flex items-center gap-2",children:R.jsx(Wf,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),p&&R.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[R.jsx("p",{style:{color:hM(u,l)},className:"text-3xl font-semibold",children:dl({number:u,decimalPlaces:((E=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:E.decimalPlaces)||0,useSuffix:!!((T=(O=e.preferences)==null?void 0:O.formatNumber)!=null&&T.suffix),customSuffix:((M=(N=e.preferences)==null?void 0:N.formatNumber)==null?void 0:M.suffix)||"",locale:((F=(A=e.preferences)==null?void 0:A.formatNumber)==null?void 0:F.locale)||"",currency:((X=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:X.currency)||""})}),f&&R.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",dl({number:f,decimalPlaces:((H=(ee=e.preferences)==null?void 0:ee.formatNumber)==null?void 0:H.decimalPlaces)||0,useSuffix:!!((Y=(Q=e.preferences)==null?void 0:Q.formatNumber)!=null&&Y.suffix),customSuffix:((W=(J=e.preferences)==null?void 0:J.formatNumber)==null?void 0:W.suffix)||"",locale:((V=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:V.locale)||"",currency:((I=(U=e.preferences)==null?void 0:U.formatNumber)==null?void 0:I.currency)||""})]})]})]}),v&&R.jsxs(Am,{className:"grow items-start gap-1 pb-4 text-sm",children:[R.jsx(aee,{children:v}),R.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[v>0?"up ":"down ",R.jsx(xi,{text:e.description||"",onSave:b,children:e.description})]})]})]})}function aee({children:e}){const t=e>0?R.jsx(u_,{className:"h-4 w-4"}):R.jsx(c_,{className:"h-4 w-4"}),n=`${Math.abs(e*100).toFixed(0)}%`;return R.jsxs("div",{className:_e("flex items-center",{"text-green-600":e>0,"text-destructive":e<0}),children:[t,R.jsx("span",{className:"ml-[1px]",children:n})]})}var au=1e3,lu=au*60,cu=lu*60,xl=cu*24,lee=xl*7,cee=xl*365.25,uee=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return dee(e);if(n==="number"&&isFinite(e))return t.long?hee(e):fee(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function dee(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*cee;case"weeks":case"week":case"w":return n*lee;case"days":case"day":case"d":return n*xl;case"hours":case"hour":case"hrs":case"hr":case"h":return n*cu;case"minutes":case"minute":case"mins":case"min":case"m":return n*lu;case"seconds":case"second":case"secs":case"sec":case"s":return n*au;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fee(e){var t=Math.abs(e);return t>=xl?Math.round(e/xl)+"d":t>=cu?Math.round(e/cu)+"h":t>=lu?Math.round(e/lu)+"m":t>=au?Math.round(e/au)+"s":e+"ms"}function hee(e){var t=Math.abs(e);return t>=xl?Fp(e,t,xl,"day"):t>=cu?Fp(e,t,cu,"hour"):t>=lu?Fp(e,t,lu,"minute"):t>=au?Fp(e,t,au,"second"):e+" ms"}function Fp(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const pee=Rl(uee);function gM({children:e}){const{setIsSessionExpired:t}=wr(),n=new OV({queryCache:new _D({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return R.jsx(AV,{client:n,children:e})}const yu=m.forwardRef(({children:e,className:t,...n},r)=>R.jsx("div",{className:_e("semaphor-scope",t),ref:r,...n,children:e})),gee={id:"",authToken:void 0},mM=m.createContext(gee),vM=({children:e,dashboardProps:t})=>R.jsx(gM,{children:R.jsx(mM.Provider,{value:t,children:R.jsx(yu,{style:{height:"100%"},children:e})})});function ba(){const e=m.useContext(mM);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function mee(e){$e(l=>l.bookmarkKey),$e(l=>l.selectedSheetId);const t=$e(l=>l.dashboard.baseQueries);$e(l=>l.actions.getCardSheet),$e(l=>l.actions.getSelectedFrame());const{authToken:n}=ba(),r=$e(l=>l.authToken),o=$e(l=>l.filterValues),i=pee((e==null?void 0:e.refreshInterval)||"0"),s=tD(e.sql,t);return Hf({queryKey:[e.id,s,JSON.stringify(o)],queryFn:()=>zf("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:s,python:e.python===pD?"":e.python,active_filters:o}),refetchInterval:i,enabled:!!e.connectionId})}function La({data:e,cfg:t,customCfg:n,preferences:r}){const{dimensionKeys:o,metricKeys:i}=lr(e),s=yJ(i,e,r),a=Pg(s,n),l=o[0],c=Kx(e,l);R_(r,t),bM(r);const u=yM(t,r),f=Go((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions),p=Go(u,f),h=Go(p,(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:a},options:h}}function R_(e,t){var o,i,s;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function bM(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function yM(e,t){var i,s,a,l,c,u,f,p,h,b,v,w;const n=R_(t,e),r=bM(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.scales,[n]:{...(a=(s=e==null?void 0:e.options)==null?void 0:s.scales)==null?void 0:a[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:y=>{var _,S,C,E;return dl({number:Number(y),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}},[r]:{...(h=(p=(f=e==null?void 0:e.options)==null?void 0:f.scales)==null?void 0:p[r])==null?void 0:h.ticks,callback:null}},plugins:{...(b=e==null?void 0:e.options)==null?void 0:b.plugins,datalabels:{...(w=(v=e==null?void 0:e.options)==null?void 0:v.plugins)==null?void 0:w.datalabels,formatter:function(y){var _,S,C,E;return dl({number:Number(y),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}}}}function vee(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function bee(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}}}}}function yee(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function xee(e,t=!1){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}}}}}function wee(e,t){var r,o,i,s;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(s=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:s.y,display:!0,stacked:t==="stackedBar"}}}}}function _ee(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function See(e,t){var r;return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(r=t==null?void 0:t.options)==null?void 0:r.plugins,legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function Cee(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function Eee(e){const n=new Function("getDatalabelColor",e)(ox);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}function P_({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){var a,l,c;if(t==="bar"){const u=yee(n);return La({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const u=vee(n);return La({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pyramid"){const u=bee(n),{dimensionKeys:f,metricKeys:p}=lr(e),h=Jg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:p[0]}),b=La({data:h,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s}),v="x2";return{...b,data:{...b.data,datasets:b.data.datasets.map((y,_)=>_===1?{...y,xAxisID:v}:y)},options:{...b.options,scales:{...(a=b==null?void 0:b.options)==null?void 0:a.scales,[v]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const u=wee(n,t),{dimensionKeys:f,metricKeys:p}=lr(e),h=Jg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:p[0]});return La({data:h,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const u=_ee(n);return La({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="range"){const u=xee(n),f=_J(e),p=Pg(f,r),{plugins:h,options:b}=Eee((s==null?void 0:s.customVisualCode)||""),v=Go((u==null?void 0:u.options)||{},(n==null?void 0:n.options)||{}),w=Go(v,(s==null?void 0:s.chartOptions)||{}),y=Go(w,(r==null?void 0:r.options)||{}),_=Go(y,b),S=yM(n,s),C=Go(_,S),E={...C,plugins:{...C==null?void 0:C.plugins,datalabels:{...(l=C==null?void 0:C.plugins)==null?void 0:l.datalabels,formatter:(A,F)=>A.map(X=>{var ee,H,Q,Y;return dl({number:Number(X),decimalPlaces:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.decimalPlaces)||0,useSuffix:!!((H=s==null?void 0:s.numberAxisFormat)!=null&&H.suffix),customSuffix:"",locale:((Q=s==null?void 0:s.numberAxisFormat)==null?void 0:Q.locale)||"",currency:((Y=s==null?void 0:s.numberAxisFormat)==null?void 0:Y.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:O}=lr(e),T=O[0];return{type:"bar",data:{labels:[...new Set(Kx(e,T))],datasets:p},options:E,plugins:[...h]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const u=See(t,n),{dimensionKeys:f,metricKeys:p}=lr(e),h=SJ(p,e),b=Pg(h,r),v=f[0],w=Kx(e,v),y=Go((u==null?void 0:u.options)||{},(r==null?void 0:r.options)||{}),_=Go(y,(s==null?void 0:s.chartOptions)||{}),S={..._,plugins:{..._.plugins,datalabels:{...(c=_.plugins)==null?void 0:c.datalabels,formatter:(O,T)=>{var N,M,A,F;return dl({number:Number(O),decimalPlaces:((N=s==null?void 0:s.numberAxisFormat)==null?void 0:N.decimalPlaces)||0,useSuffix:!!((M=s==null?void 0:s.numberAxisFormat)!=null&&M.suffix),customSuffix:"",locale:((A=s==null?void 0:s.numberAxisFormat)==null?void 0:A.locale)||"",currency:((F=s==null?void 0:s.numberAxisFormat)==null?void 0:F.currency)||""})}}}};return{type:t,data:{labels:w,datasets:b},options:S,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(O,T,N){var Q,Y,J,W;const{ctx:M,data:A}=O;M.save();const F=O.getDatasetMeta(0).data[0].x,z=O.getDatasetMeta(0).data[0].y,X=Zc(zd());M.font="1.2em Arial",M.fontWeight="bolder",M.fillStyle=X,M.textAlign="center",M.textBaseline="middle";const ee=A.datasets[0].data.reduce(($,V)=>$+V,0),H=dl({number:Number(ee),decimalPlaces:((Q=s==null?void 0:s.numberAxisFormat)==null?void 0:Q.decimalPlaces)||0,useSuffix:!!((Y=s==null?void 0:s.numberAxisFormat)!=null&&Y.suffix),customSuffix:"",locale:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.locale)||"",currency:((W=s==null?void 0:s.numberAxisFormat)==null?void 0:W.currency)||""});M.fillText(H,F,z)}}:""]}}if(t==="radar"){const u=Cee(n);return La({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:u}=lr(e);if(u.length<3){console.log("Bubble charts require 3 numeric columns");return}const f=wJ(e),p=Pg(f,r),h={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:u[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:u[1]},beginAtZero:!0,ticks:{precision:0}}}},b=Go(h,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:p},options:b}}return La({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function Ree({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=$e.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)&&Oee(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&$ee(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&Pee({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function Pee(e){var a,l,c,u;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((f,p)=>{var h,b;typeof f.backgroundColor=="string"&&(f.backgroundColor=new Array(f.data.length).fill(f.backgroundColor),f.borderColor=new Array(f.data.length).fill(f.borderColor)),f.backgroundColor=(h=f==null?void 0:f.backgroundColor)==null?void 0:h.map((v,w)=>w===n&&p===r?v:s),f.borderColor=(b=f==null?void 0:f.borderColor)==null?void 0:b.map((v,w)=>w===n&&p===r?v:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((f,p)=>{var h,b,v,w,y,_;f.backgroundColor=new Array(f.data.length).fill((v=(b=(h=o==null?void 0:o.data)==null?void 0:h.datasets)==null?void 0:b[p])==null?void 0:v.backgroundColor),f.borderColor=new Array(f.data.length).fill((_=(y=(w=o==null?void 0:o.data)==null?void 0:w.datasets)==null?void 0:y[p])==null?void 0:_.borderColor)}),t==null||t.update()}function Oee(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(c=>{var u,f;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,h)=>h===t?p:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((p,h)=>h===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,p,h,b,v,w;c.backgroundColor=new Array(c.data.length).fill((h=(p=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:p[u])==null?void 0:h.backgroundColor),c.borderColor=new Array(c.data.length).fill((w=(v=(b=n==null?void 0:n.data)==null?void 0:b.datasets)==null?void 0:v[u])==null?void 0:w.borderColor)}),e==null||e.update()}function $ee(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(c=>{var u,f;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,h)=>h===t?p:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((p,h)=>h===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,p,h,b,v,w,y,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(h=(p=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:p[u])==null?void 0:h.backgroundColor,c.borderColor=(w=(v=(b=n==null?void 0:n.data)==null?void 0:b.datasets)==null?void 0:v[u])==null?void 0:w.borderColor),c.backgroundColor=(y=c==null?void 0:c.backgroundColor)==null?void 0:y.map((S,C)=>{var E;return(E=n.data.datasets[u].backgroundColor)==null?void 0:E[C]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((S,C)=>{var E;return(E=n.data.datasets[u].borderColor)==null?void 0:E[C]})}),e==null||e.update()}function Tee(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=lr(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],c=(o=e.data[n])==null?void 0:o[l];return[{columnName:l,columnValue:c,metric:a[t],value:r}]}if(["stackedBar","pyramid"].includes(e.type)){const l=Jg({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),c=s[0],u=(i=l[n])==null?void 0:i[c],f=s[1],{metricKeys:p}=lr(l),h=p[t];return[{columnName:c,columnValue:u,metric:a[0],value:r},{columnName:f,columnValue:h,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],c=r.label;return[{columnName:l,columnValue:c,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 Dee(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=wr(),r=n(e),o=O_(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 O_(e){var Q,Y,J;const{onChartElementClicked:t}=ba(),[n,r]=m.useState(0),o=((Q=e==null?void 0:e.preferences)==null?void 0:Q.filterOnClickColumnIndex)===void 0?0:(Y=e.preferences)==null?void 0:Y.filterOnClickColumnIndex,i=$e(W=>W.bookmarkKey);$e(W=>W.isVisualEditing);const s=$e(W=>W.filteringCards),a=$e(W=>W.selectedSheetId);$e(W=>W.selectedCardId),$e(W=>W.isDashboardEditing);const l=$e(W=>W.themeStyle),c=$e(W=>W.filterValues),u=m.useRef(c),f=(J=e==null?void 0:e.preferences)==null?void 0:J.onClickFilter,{addFrame:p,addFilteringCard:h,setFrameCardData:b,getCardFrame:v,addOrUpdateFilterValue:w,addOrUpdateFilterValues:y,removeFilterValue:_,removeFilteringCard:S}=wr(),{data:C,isLoading:E,isFetching:O,isError:T,refetch:N}=mee(e),M=s==null?void 0:s.find(W=>W.id===e.id),A=v(e.id),F=(A==null?void 0:A.cards)||[],z=(F==null?void 0:F.length)==1;let X;e.data&&e.data.length>0&&(X=P_({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences})),m.useEffect(()=>{!C||!C.records||M&&z||b(a,e.id,(C==null?void 0:C.records)||[])},[C,a,e.id,b,c]);const ee=m.useRef({filteringCards:s});m.useEffect(()=>{e.data&&(M&&z||r(n+1))},[JSON.stringify(e.data),e.type,e.cfg,e.customCfg,e.preferences,l]),m.useEffect(()=>{e.connectionId&&!M&&(u.current=c)},[c,i]),m.useEffect(()=>{var $;M&&(ee.current.filteringCards=[...s||[]]),!M&&(($=ee.current.filteringCards)==null?void 0:$.find(V=>V.id===e.id))&&z&&r(n+1)},[M]);function H(W,$,V,U){var fe,ne;let I=!1;if(!e.data)return;const te=Tee(e,$,V,U);if(console.log("fieldValues",te),t==null||t(e,te),!!(((fe=e==null?void 0:e.preferences)==null?void 0:fe.onClickFilter)??[]).length){if(M){const ue=e.id;_(ue),S(e)}else{if(I=!0,!te)return;const ue=[];te.forEach((ie,oe)=>{const le=f==null?void 0:f.find(K=>K.columnIndex===oe);if(!le)return;const ye={filterId:e.id+"-"+ie.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:ie.columnName,expression:le.expression,valueType:Bd(te[le.columnIndex].columnValue),operation:"=",values:[te[le.columnIndex].columnValue]};ue.push(ye)}),e.id,e==null||e.connectionId,e.lastSelectedTable,te[o].columnName,(ne=e.preferences)==null||ne.filterOnClickField,Bd(te[o].columnValue),te[o].columnValue,y(ue),h(e)}Ree({chart:W,elementIndex:V,datasetIndex:$,cardType:e.type,cfg:X,apply:I})}}return{isError:T,isLoading:E,isFetching:O,data:C,visualKey:n,handleDatapointClick:H,cfg:X}}var Aee=e=>{switch(e){case"success":return Iee;case"info":return Lee;case"warning":return Nee;case"error":return Fee;default:return null}},kee=Array(12).fill(0),Mee=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},kee.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Iee=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Nee=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Lee=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Fee=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),jee=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},n1=1,zee=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;let{message:r,...o}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:n1++,s=this.toasts.find(l=>l.id===i),a=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:r}),{...l,...t,id:i,dismissible:a,title:r}):l):this.addToast({title:r,...o,dismissible:a,id:i}),i},this.dismiss=t=>(t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:t,dismiss:!0})),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let o=t instanceof Promise?t:t(),i=r!==void 0;return o.then(async s=>{if(Vee(s)&&!s.ok){i=!1;let a=typeof n.error=="function"?await n.error(`HTTP error! status: ${s.status}`):n.error,l=typeof n.description=="function"?await n.description(`HTTP error! status: ${s.status}`):n.description;this.create({id:r,type:"error",message:a,description:l})}else if(n.success!==void 0){i=!1;let a=typeof n.success=="function"?await n.success(s):n.success,l=typeof n.description=="function"?await n.description(s):n.description;this.create({id:r,type:"success",message:a,description:l})}}).catch(async s=>{if(n.error!==void 0){i=!1;let a=typeof n.error=="function"?await n.error(s):n.error,l=typeof n.description=="function"?await n.description(s):n.description;this.create({id:r,type:"error",message:a,description:l})}}).finally(()=>{var s;i&&(this.dismiss(r),r=void 0),(s=n.finally)==null||s.call(n)}),r},this.custom=(t,n)=>{let r=(n==null?void 0:n.id)||n1++;return this.create({jsx:t(r),id:r,...n}),r},this.subscribers=[],this.toasts=[]}},eo=new zee,Bee=(e,t)=>{let n=(t==null?void 0:t.id)||n1++;return eo.addToast({title:e,...t,id:n}),n},Vee=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Hee=Bee,Wee=()=>eo.toasts,xM=Object.assign(Hee,{success:eo.success,info:eo.info,warning:eo.warning,error:eo.error,custom:eo.custom,message:eo.message,promise:eo.promise,dismiss:eo.dismiss,loading:eo.loading},{getHistory:Wee});function Uee(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Uee(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
264
|
-
`);function jp(e){return e.label!==void 0}var qee=3,Gee="32px",Yee=4e3,Kee=356,Xee=14,Qee=20,Jee=200;function Zee(...e){return e.filter(Boolean).join(" ")}var ete=e=>{var t,n,r,o,i,s,a,l,c,u;let{invert:f,toast:p,unstyled:h,interacting:b,setHeights:v,visibleToasts:w,heights:y,index:_,toasts:S,expanded:C,removeToast:E,defaultRichColors:O,closeButton:T,style:N,cancelButtonStyle:M,actionButtonStyle:A,className:F="",descriptionClassName:z="",duration:X,position:ee,gap:H,loadingIcon:Q,expandByDefault:Y,classNames:J,icons:W,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:V,cn:U}=e,[I,te]=m.useState(!1),[fe,ne]=m.useState(!1),[ue,ie]=m.useState(!1),[oe,le]=m.useState(!1),[ye,K]=m.useState(0),[be,Se]=m.useState(0),Oe=m.useRef(null),Te=m.useRef(null),Ue=_===0,Be=_+1<=w,Ie=p.type,Ke=p.dismissible!==!1,lt=p.className||"",It=p.descriptionClassName||"",Dt=m.useMemo(()=>y.findIndex(nt=>nt.toastId===p.id)||0,[y,p.id]),Ht=m.useMemo(()=>{var nt;return(nt=p.closeButton)!=null?nt:T},[p.closeButton,T]),pe=m.useMemo(()=>p.duration||X||Yee,[p.duration,X]),Ee=m.useRef(0),Le=m.useRef(0),Ge=m.useRef(0),Ze=m.useRef(null),[Wt,Zt]=ee.split("-"),Kt=m.useMemo(()=>y.reduce((nt,ht,At)=>At>=Dt?nt:nt+ht.height,0),[y,Dt]),vn=jee(),ln=p.invert||f,Lt=Ie==="loading";Le.current=m.useMemo(()=>Dt*H+Kt,[Dt,Kt]),m.useEffect(()=>{te(!0)},[]),m.useLayoutEffect(()=>{if(!I)return;let nt=Te.current,ht=nt.style.height;nt.style.height="auto";let At=nt.getBoundingClientRect().height;nt.style.height=ht,Se(At),v(Xt=>Xt.find(bt=>bt.toastId===p.id)?Xt.map(bt=>bt.toastId===p.id?{...bt,height:At}:bt):[{toastId:p.id,height:At,position:p.position},...Xt])},[I,p.title,p.description,v,p.id]);let tn=m.useCallback(()=>{ne(!0),K(Le.current),v(nt=>nt.filter(ht=>ht.toastId!==p.id)),setTimeout(()=>{E(p)},Jee)},[p,E,v,Le]);m.useEffect(()=>{if(p.promise&&Ie==="loading"||p.duration===1/0||p.type==="loading")return;let nt,ht=pe;return C||b||V&&vn?(()=>{if(Ge.current<Ee.current){let At=new Date().getTime()-Ee.current;ht=ht-At}Ge.current=new Date().getTime()})():ht!==1/0&&(Ee.current=new Date().getTime(),nt=setTimeout(()=>{var At;(At=p.onAutoClose)==null||At.call(p,p),tn()},ht)),()=>clearTimeout(nt)},[C,b,Y,p,pe,tn,p.promise,Ie,V,vn]),m.useEffect(()=>{let nt=Te.current;if(nt){let ht=nt.getBoundingClientRect().height;return Se(ht),v(At=>[{toastId:p.id,height:ht,position:p.position},...At]),()=>v(At=>At.filter(Xt=>Xt.toastId!==p.id))}},[v,p.id]),m.useEffect(()=>{p.delete&&tn()},[tn,p.delete]);function xn(){return W!=null&&W.loading?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},W.loading):Q?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},Q):m.createElement(Mee,{visible:Ie==="loading"})}return m.createElement("li",{"aria-live":p.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Te,className:U(F,lt,J==null?void 0:J.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,J==null?void 0:J.default,J==null?void 0:J[Ie],(n=p==null?void 0:p.classNames)==null?void 0:n[Ie]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:O,"data-styled":!(p.jsx||p.unstyled||h),"data-mounted":I,"data-promise":!!p.promise,"data-removed":fe,"data-visible":Be,"data-y-position":Wt,"data-x-position":Zt,"data-index":_,"data-front":Ue,"data-swiping":ue,"data-dismissible":Ke,"data-type":Ie,"data-invert":ln,"data-swipe-out":oe,"data-expanded":!!(C||Y&&I),style:{"--index":_,"--toasts-before":_,"--z-index":S.length-_,"--offset":`${fe?ye:Le.current}px`,"--initial-height":Y?"auto":`${be}px`,...N,...p.style},onPointerDown:nt=>{Lt||!Ke||(Oe.current=new Date,K(Le.current),nt.target.setPointerCapture(nt.pointerId),nt.target.tagName!=="BUTTON"&&(ie(!0),Ze.current={x:nt.clientX,y:nt.clientY}))},onPointerUp:()=>{var nt,ht,At,Xt;if(oe||!Ke)return;Ze.current=null;let bt=Number(((nt=Te.current)==null?void 0:nt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),On=new Date().getTime()-((ht=Oe.current)==null?void 0:ht.getTime()),Fo=Math.abs(bt)/On;if(Math.abs(bt)>=Qee||Fo>.11){K(Le.current),(At=p.onDismiss)==null||At.call(p,p),tn(),le(!0);return}(Xt=Te.current)==null||Xt.style.setProperty("--swipe-amount","0px"),ie(!1)},onPointerMove:nt=>{var ht;if(!Ze.current||!Ke)return;let At=nt.clientY-Ze.current.y,Xt=nt.clientX-Ze.current.x,bt=(Wt==="top"?Math.min:Math.max)(0,At),On=nt.pointerType==="touch"?10:2;Math.abs(bt)>On?(ht=Te.current)==null||ht.style.setProperty("--swipe-amount",`${At}px`):Math.abs(Xt)>On&&(Ze.current=null)}},Ht&&!p.jsx?m.createElement("button",{"aria-label":$,"data-disabled":Lt,"data-close-button":!0,onClick:Lt||!Ke?()=>{}:()=>{var nt;tn(),(nt=p.onDismiss)==null||nt.call(p,p)},className:U(J==null?void 0:J.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},m.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,p.jsx||m.isValidElement(p.title)?p.jsx||p.title:m.createElement(m.Fragment,null,Ie||p.icon||p.promise?m.createElement("div",{"data-icon":"",className:U(J==null?void 0:J.icon,(i=p==null?void 0:p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||xn():null,p.type!=="loading"?p.icon||(W==null?void 0:W[Ie])||Aee(Ie):null):null,m.createElement("div",{"data-content":"",className:U(J==null?void 0:J.content,(s=p==null?void 0:p.classNames)==null?void 0:s.content)},m.createElement("div",{"data-title":"",className:U(J==null?void 0:J.title,(a=p==null?void 0:p.classNames)==null?void 0:a.title)},p.title),p.description?m.createElement("div",{"data-description":"",className:U(z,It,J==null?void 0:J.description,(l=p==null?void 0:p.classNames)==null?void 0:l.description)},p.description):null),m.isValidElement(p.cancel)?p.cancel:p.cancel&&jp(p.cancel)?m.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||M,onClick:nt=>{var ht,At;jp(p.cancel)&&Ke&&((At=(ht=p.cancel).onClick)==null||At.call(ht,nt),tn())},className:U(J==null?void 0:J.cancelButton,(c=p==null?void 0:p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,m.isValidElement(p.action)?p.action:p.action&&jp(p.action)?m.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||A,onClick:nt=>{var ht,At;jp(p.action)&&(nt.defaultPrevented||((At=(ht=p.action).onClick)==null||At.call(ht,nt),tn()))},className:U(J==null?void 0:J.actionButton,(u=p==null?void 0:p.classNames)==null?void 0:u.actionButton)},p.action.label):null))};function f$(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var tte=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:s,offset:a,theme:l="light",richColors:c,duration:u,style:f,visibleToasts:p=qee,toastOptions:h,dir:b=f$(),gap:v=Xee,loadingIcon:w,icons:y,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S,cn:C=Zee}=e,[E,O]=m.useState([]),T=m.useMemo(()=>Array.from(new Set([n].concat(E.filter(V=>V.position).map(V=>V.position)))),[E,n]),[N,M]=m.useState([]),[A,F]=m.useState(!1),[z,X]=m.useState(!1),[ee,H]=m.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=m.useRef(null),Y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),J=m.useRef(null),W=m.useRef(!1),$=m.useCallback(V=>{var U;(U=E.find(I=>I.id===V.id))!=null&&U.delete||eo.dismiss(V.id),O(I=>I.filter(({id:te})=>te!==V.id))},[E]);return m.useEffect(()=>eo.subscribe(V=>{if(V.dismiss){O(U=>U.map(I=>I.id===V.id?{...I,delete:!0}:I));return}setTimeout(()=>{Cr.flushSync(()=>{O(U=>{let I=U.findIndex(te=>te.id===V.id);return I!==-1?[...U.slice(0,I),{...U[I],...V},...U.slice(I+1)]:[V,...U]})})})}),[]),m.useEffect(()=>{if(l!=="system"){H(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:V})=>{H(V?"dark":"light")})},[l]),m.useEffect(()=>{E.length<=1&&F(!1)},[E]),m.useEffect(()=>{let V=U=>{var I,te;r.every(fe=>U[fe]||U.code===fe)&&(F(!0),(I=Q.current)==null||I.focus()),U.code==="Escape"&&(document.activeElement===Q.current||(te=Q.current)!=null&&te.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[r]),m.useEffect(()=>{if(Q.current)return()=>{J.current&&(J.current.focus({preventScroll:!0}),J.current=null,W.current=!1)}},[Q.current]),E.length?m.createElement("section",{"aria-label":`${_} ${Y}`,tabIndex:-1},T.map((V,U)=>{var I;let[te,fe]=V.split("-");return m.createElement("ol",{key:V,dir:b==="auto"?f$():b,tabIndex:-1,ref:Q,className:s,"data-sonner-toaster":!0,"data-theme":ee,"data-y-position":te,"data-x-position":fe,style:{"--front-toast-height":`${((I=N[0])==null?void 0:I.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||Gee,"--width":`${Kee}px`,"--gap":`${v}px`,...f},onBlur:ne=>{W.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(W.current=!1,J.current&&(J.current.focus({preventScroll:!0}),J.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||W.current||(W.current=!0,J.current=ne.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{z||F(!1)},onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},E.filter(ne=>!ne.position&&U===0||ne.position===V).map((ne,ue)=>{var ie,oe;return m.createElement(ete,{key:ne.id,icons:y,index:ue,toast:ne,defaultRichColors:c,duration:(ie=h==null?void 0:h.duration)!=null?ie:u,className:h==null?void 0:h.className,descriptionClassName:h==null?void 0:h.descriptionClassName,invert:t,visibleToasts:p,closeButton:(oe=h==null?void 0:h.closeButton)!=null?oe:i,interacting:z,position:V,style:h==null?void 0:h.style,unstyled:h==null?void 0:h.unstyled,classNames:h==null?void 0:h.classNames,cancelButtonStyle:h==null?void 0:h.cancelButtonStyle,actionButtonStyle:h==null?void 0:h.actionButtonStyle,removeToast:$,toasts:E.filter(le=>le.position==ne.position),heights:N.filter(le=>le.position==ne.position),setHeights:M,expandByDefault:o,gap:v,loadingIcon:w,expanded:A,pauseWhenPageIsHidden:S,cn:C})}))})):null};function nte(e,t){const n=$e(u=>u.selectedSheetId),r=$e(u=>u.selectedFrameId),o=$e(u=>u.isDashboardEditing),i=$e(u=>u.isVisualEditing),{addFrame:s,getSelectedFrame:a,setSelectedFrameId:l}=$e(u=>u.actions);m.useEffect(()=>{const u=p=>{if(o&&((p.metaKey||p.ctrlKey)&&p.key==="c"&&(navigator.clipboard.writeText(JSON.stringify(a())),xM.success("Card copied to clipboard")),(p.ctrlKey||p.metaKey)&&p.key==="v")){console.log("Ctrl+V has been pressed");try{navigator.clipboard.readText().then(h=>{try{const b=JSON.parse(h);if(b&&b.id){b.id=ua();const v=b.activeCardId;b.cards.forEach(w=>{const y=w.id;w.id=ua(),y===v&&(b.activeCardId=w.id,w.title=`${w.title} (Copy)`)}),s(n,b),l(b.id)}}catch(b){console.error("Failed to parse clipboard contents: ",b)}})}catch(h){console.error("Failed to read clipboard contents: ",h)}}},f=t==null?void 0:t.current;return f==null||f.addEventListener("keydown",u),()=>{f==null||f.removeEventListener("keydown",u)}},[o,n,a,s,t,l]),m.useEffect(()=>{r===e.id&&o&&!i&&c()},[r,e.id,o,i]);function c(){const u=t==null?void 0:t.current;u==null||u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}let A0;const wM="HoverCard",[_M,y1e]=er(wM,[Di]),$_=Di(),[rte,T_]=_M(wM),ote=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=$_(t),c=m.useRef(0),u=m.useRef(0),f=m.useRef(!1),p=m.useRef(!1),[h=!1,b]=_r({prop:r,defaultProp:o,onChange:i}),v=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>b(!0),s)},[s,b]),w=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!p.current&&(u.current=window.setTimeout(()=>b(!1),a))},[a,b]),y=m.useCallback(()=>b(!1),[b]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(rte,{scope:t,open:h,onOpenChange:b,onOpen:v,onClose:w,onDismiss:y,hasSelectionRef:f,isPointerDownOnContentRef:p},m.createElement(th,l,n))},ite="HoverCardTrigger",ste=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=T_(ite,n),i=$_(n);return m.createElement(nh,de({asChild:!0},i),m.createElement(Qe.a,de({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:Me(e.onPointerEnter,rm(o.onOpen)),onPointerLeave:Me(e.onPointerLeave,rm(o.onClose)),onFocus:Me(e.onFocus,o.onOpen),onBlur:Me(e.onBlur,o.onClose),onTouchStart:Me(e.onTouchStart,s=>s.preventDefault())})))}),ate="HoverCardPortal",[x1e,lte]=_M(ate,{forceMount:void 0}),r1="HoverCardContent",cte=m.forwardRef((e,t)=>{const n=lte(r1,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=T_(r1,e.__scopeHoverCard);return m.createElement(tr,{present:r||i.open},m.createElement(ute,de({"data-state":i.open?"open":"closed"},o,{onPointerEnter:Me(e.onPointerEnter,rm(i.onOpen)),onPointerLeave:Me(e.onPointerLeave,rm(i.onClose)),ref:t})))}),ute=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=T_(r1,n),c=$_(n),u=m.useRef(null),f=_t(t,u),[p,h]=m.useState(!1);return m.useEffect(()=>{if(p){const b=document.body;return A0=b.style.userSelect||b.style.webkitUserSelect,b.style.userSelect="none",b.style.webkitUserSelect="none",()=>{b.style.userSelect=A0,b.style.webkitUserSelect=A0}}},[p]),m.useEffect(()=>{if(u.current){const b=()=>{h(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())===null||v===void 0?void 0:v.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(()=>{u.current&&dte(u.current).forEach(v=>v.setAttribute("tabindex","-1"))}),m.createElement(Zf,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Me(i,b=>{b.preventDefault()}),onDismiss:l.onDismiss},m.createElement(rh,de({},c,a,{onPointerDown:Me(a.onPointerDown,b=>{b.currentTarget.contains(b.target)&&h(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,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 rm(e){return t=>t.pointerType==="touch"?void 0:e()}function dte(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 fte=ote,hte=ste,SM=cte,iv=fte,sv=hte,oh=L.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>R.jsx(SM,{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}));oh.displayName=SM.displayName;function pte({card:e}){const{setCardInfo:t}=wr();return R.jsxs(iv,{openDelay:0,children:[R.jsx(sv,{children:R.jsx(DJ,{className:"size-4 text-muted-foreground/40"})}),R.jsx(oh,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:R.jsx(xi,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:R.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}const D_=L.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>R.jsx("div",{style:n,className:_e("relative w-full overflow-auto",t),children:R.jsx("table",{ref:o,className:_e("w-full caption-bottom text-sm",e),...r})}));D_.displayName="Table";const A_=L.forwardRef(({className:e,...t},n)=>R.jsx("thead",{ref:n,className:_e("[&_tr]:border-b",e),...t}));A_.displayName="TableHeader";const k_=L.forwardRef(({className:e,...t},n)=>R.jsx("tbody",{ref:n,className:_e("[&_tr:last-child]:border-0",e),...t}));k_.displayName="TableBody";const gte=L.forwardRef(({className:e,...t},n)=>R.jsx("tfoot",{ref:n,className:_e("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));gte.displayName="TableFooter";const kd=L.forwardRef(({className:e,...t},n)=>R.jsx("tr",{ref:n,className:_e("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));kd.displayName="TableRow";const M_=L.forwardRef(({className:e,...t},n)=>R.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}));M_.displayName="TableHead";const om=L.forwardRef(({className:e,...t},n)=>R.jsx("td",{ref:n,className:_e("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));om.displayName="TableCell";const mte=L.forwardRef(({className:e,...t},n)=>R.jsx("caption",{ref:n,className:_e("mt-4 text-sm text-muted-foreground",e),...t}));mte.displayName="TableCaption";/**
|
|
265
|
-
* table-core
|
|
266
|
-
*
|
|
267
|
-
* Copyright (c) TanStack
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the MIT license found in the
|
|
270
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
271
|
-
*
|
|
272
|
-
* @license MIT
|
|
273
|
-
*/function na(e,t){return typeof e=="function"?e(t):e}function ho(e,t){return n=>{t.setState(r=>({...r,[e]:na(n,r[e])}))}}function im(e){return e instanceof Function}function vte(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function bte(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 at(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((c,u)=>r[u]!==c)))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 c=Math.round((Date.now()-i)*100)/100,u=Math.round((Date.now()-l)*100)/100,f=u/16,p=(h,b)=>{for(h=String(h);h.length<b;)h=" "+h;return h};console.info(`%c⏱ ${p(u,5)} /${p(c,5)} ms`,`
|
|
274
|
-
font-size: .6rem;
|
|
275
|
-
font-weight: bold;
|
|
276
|
-
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function yte(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?l.replace(".","_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=p=>{let h=p;for(const v of l.split(".")){var b;h=(b=h)==null?void 0:b[v],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${v}" in deeply nested key "${l}" returned undefined.`)}return h}:u=p=>p[a.accessorKey]),!c)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 f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:at(()=>[!0],()=>{var p;return[f,...(p=f.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var p;return(p=e.options.debugAll)!=null?p:e.options.debugColumns}}),getLeafColumns:at(()=>[e._getOrderColumnsFn()],p=>{var h;if((h=f.columns)!=null&&h.length){let b=f.columns.flatMap(v=>v.getLeafColumns());return p(b)}return[f]},{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(f,e);return f}function h$(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 xte={createTable:e=>{e.getHeaderGroups=at(()=>[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(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return zp(t,[...a,...c,...l],e)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=at(()=>[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))),zp(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=at(()=>[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 zp(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=at(()=>[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 zp(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=at(()=>[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=at(()=>[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=at(()=>[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=at(()=>[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=at(()=>[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=at(()=>[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=at(()=>[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=at(()=>[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=at(()=>[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=at(()=>[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=at(()=>[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=at(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})}};function zp(e,t,n,r){var o,i;let s=0;const a=function(p,h){h===void 0&&(h=1),s=Math.max(s,h),p.filter(b=>b.getIsVisible()).forEach(b=>{var v;(v=b.columns)!=null&&v.length&&a(b.columns,h+1)},0)};a(e);let l=[];const c=(p,h)=>{const b={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},v=[];p.forEach(w=>{const y=[...v].reverse()[0],_=w.column.depth===b.depth;let S,C=!1;if(_&&w.column.parent?S=w.column.parent:(S=w.column,C=!0),y&&(y==null?void 0:y.column)===S)y.subHeaders.push(w);else{const E=h$(n,S,{id:[r,h,S.id,w==null?void 0:w.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${v.filter(O=>O.column===S).length}`:void 0,depth:h,index:v.length});E.subHeaders.push(w),v.push(E)}b.headers.push(w),w.headerGroup=b}),l.push(b),h>0&&c(v,h-1)},u=t.map((p,h)=>h$(n,p,{depth:s,index:h}));c(u,s-1),l.reverse();const f=p=>p.filter(b=>b.column.getIsVisible()).map(b=>{let v=0,w=0,y=[0];b.subHeaders&&b.subHeaders.length?(y=[],f(b.subHeaders).forEach(S=>{let{colSpan:C,rowSpan:E}=S;v+=C,y.push(E)})):v=1;const _=Math.min(...y);return w=w+_,b.colSpan=v,b.rowSpan=w,{colSpan:v,rowSpan:w}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Bp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},k0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),wte={getDefaultColumnDef:()=>Bp,getInitialState:e=>({columnSizing:{},columnSizingInfo:k0(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:ho("columnSizing",e),onColumnSizingInfoChange:ho("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:Bp.minSize,(r=i??e.columnDef.size)!=null?r:Bp.size),(o=e.columnDef.maxSize)!=null?o:Bp.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(),M0(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],l=M0(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(y,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(S=>{var C,E;const O=t.options.columnResizeDirection==="rtl"?-1:1,T=(_-((C=S==null?void 0:S.startOffset)!=null?C:0))*O,N=Math.max(T/((E=S==null?void 0:S.startSize)!=null?E:0),-.999999);return S.columnSizingStart.forEach(M=>{let[A,F]=M;c[A]=Math.round(Math.max(F+F*N,0)*100)/100}),{...S,deltaOffset:T,deltaPercentage:N}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(S=>({...S,...c})))},f=y=>u("move",y),p=y=>{u("end",y),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,b={moveHandler:y=>f(y.clientX),upHandler:y=>{h==null||h.removeEventListener("mousemove",b.moveHandler),h==null||h.removeEventListener("mouseup",b.upHandler),p(y.clientX)}},v={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),f(y.touches[0].clientX),!1),upHandler:y=>{var _;h==null||h.removeEventListener("touchmove",v.moveHandler),h==null||h.removeEventListener("touchend",v.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),p((_=y.touches[0])==null?void 0:_.clientX)}},w=_te()?{passive:!1}:!1;M0(i)?(h==null||h.addEventListener("touchmove",v.moveHandler,w),h==null||h.addEventListener("touchend",v.upHandler,w)):(h==null||h.addEventListener("mousemove",b.moveHandler,w),h==null||h.addEventListener("mouseup",b.upHandler,w)),t.setColumnSizingInfo(y=>({...y,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?k0():(n=e.initialState.columnSizingInfo)!=null?n:k0())},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 Vp=null;function _te(){if(typeof Vp=="boolean")return Vp;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 Vp=e,Vp}function M0(e){return e.type==="touchstart"}const Ste={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:ho("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()}}}},CM=(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))};CM.autoRemove=e=>Qo(e);const EM=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};EM.autoRemove=e=>Qo(e);const RM=(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())};RM.autoRemove=e=>Qo(e);const PM=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};PM.autoRemove=e=>Qo(e)||!(e!=null&&e.length);const OM=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});OM.autoRemove=e=>Qo(e)||!(e!=null&&e.length);const $M=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});$M.autoRemove=e=>Qo(e)||!(e!=null&&e.length);const TM=(e,t,n)=>e.getValue(t)===n;TM.autoRemove=e=>Qo(e);const DM=(e,t,n)=>e.getValue(t)==n;DM.autoRemove=e=>Qo(e);const I_=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};I_.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]};I_.autoRemove=e=>Qo(e)||Qo(e[0])&&Qo(e[1]);const qi={includesString:CM,includesStringSensitive:EM,equalsString:RM,arrIncludes:PM,arrIncludesAll:OM,arrIncludesSome:$M,equals:TM,weakEquals:DM,inNumberRange:I_};function Qo(e){return e==null||e===""}const Cte={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:ho("columnFilters",e),onGlobalFilterChange:ho("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"?qi.includesString:typeof r=="number"?qi.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?qi.equals:Array.isArray(r)?qi.arrIncludes:qi.weakEquals},e.getFilterFn=()=>{var n,r;return im(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:qi[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(u=>u.id===e.id),s=na(n,i?i.value:void 0);if(p$(o,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}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=()=>qi.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return im(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:qi[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=na(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(p$(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 p$(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Ete=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),Rte=(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},Pte=(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},Ote=(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]},$te=(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},Tte=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!vte(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},Dte=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Ate=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,kte=(e,t)=>t.length,I0={sum:Ete,min:Rte,max:Pte,extent:Ote,mean:$te,median:Tte,unique:Dte,uniqueCount:Ate,count:kte},Mte={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:ho("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 I0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return I0.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return im(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:I0[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 Ite(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 Nte={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:ho("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=at(()=>[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(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return Ite(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},o1=0,i1=10,N0=()=>({pageIndex:o1,pageSize:i1}),Lte={getInitialState:e=>({...e,pagination:{...N0(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:ho("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=>na(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?N0():(o=e.initialState.pagination)!=null?o:N0())},e.setPageIndex=r=>{e.setPagination(o=>{let i=na(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?o1:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:o1)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?i1:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:i1)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,na(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=na(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=at(()=>[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)}}},L0=()=>({left:[],right:[]}),F0=()=>({top:[],bottom:[]}),Fte={getInitialState:e=>({columnPinning:L0(),rowPinning:F0(),...e}),getDefaultOptions:e=>({onColumnPinningChange:ho("columnPinning",e),onRowPinningChange:ho("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(f=>!(r!=null&&r.includes(f))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},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:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,p;return{top:((f=l==null?void 0:l.top)!=null?f:[]).filter(v=>!(a!=null&&a.has(v))),bottom:[...((p=l==null?void 0:l.bottom)!=null?p:[]).filter(v=>!(a!=null&&a.has(v))),...Array.from(a)]}}if(n==="top"){var h,b;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(v=>!(a!=null&&a.has(v))),...Array.from(a)],bottom:((b=l==null?void 0:l.bottom)!=null?b:[]).filter(v=>!(a!=null&&a.has(v)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(v=>!(a!=null&&a.has(v))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(v=>!(a!=null&&a.has(v)))}})},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=at(()=>[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=at(()=>[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=at(()=>[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?L0():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:L0())},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=at(()=>[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=at(()=>[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=at(()=>[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?F0():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:F0())},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=>at(()=>[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=at(()=>[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}})}},jte={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:ho("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=>{s1(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=at(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?j0(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=at(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?j0(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=at(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?j0(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 s1(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return N_(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return a1(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return a1(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)}}}},s1=(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=>s1(e,a.id,n,r,o))};function j0(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=N_(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function N_(e,t){var n;return(n=t[e.id])!=null?n:!1}function a1(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()&&(N_(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=a1(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const l1=/([0-9]+)/gm,zte=(e,t,n)=>AM(pa(e.getValue(n)).toLowerCase(),pa(t.getValue(n)).toLowerCase()),Bte=(e,t,n)=>AM(pa(e.getValue(n)),pa(t.getValue(n))),Vte=(e,t,n)=>L_(pa(e.getValue(n)).toLowerCase(),pa(t.getValue(n)).toLowerCase()),Hte=(e,t,n)=>L_(pa(e.getValue(n)),pa(t.getValue(n))),Wte=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Ute=(e,t,n)=>L_(e.getValue(n),t.getValue(n));function L_(e,t){return e===t?0:e>t?1:-1}function pa(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function AM(e,t){const n=e.split(l1).filter(Boolean),r=t.split(l1).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 td={alphanumeric:zte,alphanumericCaseSensitive:Bte,text:Vte,textCaseSensitive:Hte,datetime:Wte,basic:Ute},qte={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:ho("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 td.datetime;if(typeof i=="string"&&(r=!0,i.split(l1).length>1))return td.alphanumeric}return r?td.text:td.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 im(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:td[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(h=>h.id===e.id),l=s==null?void 0:s.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var p;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},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())}},Gte={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:ho("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=at(()=>[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=at(()=>[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)=>at(()=>[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)}}},g$=[xte,Gte,Nte,Fte,Cte,qte,Mte,Ste,Lte,jte,wte];function Yte(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:g$};const r=n._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),o=u=>n.options.mergeOptions?n.options.mergeOptions(r,u):{...r,...u};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(u=>{var f;s=(f=u.getInitialState==null?void 0:u.getInitialState(s))!=null?f:s});const a=[];let l=!1;const c={_features:g$,options:{...r,...e},initialState:s,_queue:u=>{a.push(u),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const f=na(u,n.options);n.options=o(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,p)=>{var h;return(h=n.options.getRowId==null?void 0:n.options.getRowId(u,f,p))!=null?h:`${p?[p.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,f)=>{let p=(f?n.getPrePaginationRowModel():n.getRowModel()).rowsById[u];if(!p&&(p=n.getCoreRowModel().rowsById[u],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${u}`):new Error;return p},_getDefaultColumnDef:at(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:p=>{const h=p.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:p=>{var h,b;return(h=(b=p.renderValue())==null||b.toString==null?void 0:b.toString())!=null?h:null},...n._features.reduce((p,h)=>Object.assign(p,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:at(()=>[n._getColumnDefs()],u=>{const f=function(p,h,b){return b===void 0&&(b=0),p.map(v=>{const w=yte(n,v,b,h),y=v;return w.columns=y.columns?f(y.columns,w,b+1):[],w})};return f(u)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:at(()=>[n.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:at(()=>[n.getAllFlatColumns()],u=>u.reduce((f,p)=>(f[p.id]=p,f),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:at(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,f)=>{let p=u.flatMap(h=>h.getLeafColumns());return f(p)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>{const f=n._getAllFlatColumnsById()[u];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${u}' does not exist.`),f}};Object.assign(n,c);for(let u=0;u<n._features.length;u++){const f=n._features[u];f==null||f.createTable==null||f.createTable(n)}return n}function Kte(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:at(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.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 Xte=(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 c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>bte(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:at(()=>[e.getAllLeafColumns()],l=>l.map(c=>Kte(e,a,c,c.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:at(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),{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 c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a};function kM(){return e=>at(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=Xte(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}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 MM(){return e=>at(()=>[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 c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let h=0;h<i.length;h+=1){var p;const b=i[h],v=s[b.id],w=(p=b==null?void 0:b.desc)!=null?p:!1;let y=0;if(v.sortUndefined){const _=u.getValue(b.id),S=f.getValue(b.id),C=_===void 0,E=S===void 0;(C||E)&&(y=C&&E?0:C?v.sortUndefined:-v.sortUndefined)}if(y===0&&(y=v.sortingFn(u,f,b.id)),y!==0)return w&&(y*=-1),v.invertSorting&&(y*=-1),y}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};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 Qte(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 IM(e){return t=>at(()=>[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 c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=Qte({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const p=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(p)};return f.rows.forEach(p),f},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
|
|
277
|
-
* react-table
|
|
278
|
-
*
|
|
279
|
-
* Copyright (c) TanStack
|
|
280
|
-
*
|
|
281
|
-
* This source code is licensed under the MIT license found in the
|
|
282
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
283
|
-
*
|
|
284
|
-
* @license MIT
|
|
285
|
-
*/function c1(e,t){return e?Jte(e)?L.createElement(e,t):e:null}function Jte(e){return Zte(e)||typeof e=="function"||ene(e)}function Zte(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function ene(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function NM(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=L.useState(()=>({current:Yte(t)})),[r,o]=L.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 u1(e,[t,n]){return Math.min(n,Math.max(t,e))}let z0=0;function F_(){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:m$()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:m$()),z0++,()=>{z0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),z0--}},[])}function m$(){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 B0="focusScope.autoFocusOnMount",V0="focusScope.autoFocusOnUnmount",v$={bubbles:!1,cancelable:!0},j_=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=m.useState(null),c=jn(o),u=jn(i),f=m.useRef(null),p=_t(t,v=>l(v)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=function(S){if(h.paused||!a)return;const C=S.target;a.contains(C)?f.current=C:js(f.current,{select:!0})},w=function(S){if(h.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||js(f.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&js(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const _=new MutationObserver(y);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),_.disconnect()}}},[r,a,h.paused]),m.useEffect(()=>{if(a){y$.add(h);const v=document.activeElement;if(!a.contains(v)){const y=new CustomEvent(B0,v$);a.addEventListener(B0,c),a.dispatchEvent(y),y.defaultPrevented||(tne(sne(LM(a)),{select:!0}),document.activeElement===v&&js(a))}return()=>{a.removeEventListener(B0,c),setTimeout(()=>{const y=new CustomEvent(V0,v$);a.addEventListener(V0,u),a.dispatchEvent(y),y.defaultPrevented||js(v??document.body,{select:!0}),a.removeEventListener(V0,u),y$.remove(h)},0)}}},[a,c,u,h]);const b=m.useCallback(v=>{if(!n&&!r||h.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(w&&y){const _=v.currentTarget,[S,C]=nne(_);S&&C?!v.shiftKey&&y===C?(v.preventDefault(),n&&js(S,{select:!0})):v.shiftKey&&y===S&&(v.preventDefault(),n&&js(C,{select:!0})):y===_&&v.preventDefault()}},[n,r,h.paused]);return m.createElement(Qe.div,de({tabIndex:-1},s,{ref:p,onKeyDown:b}))});function tne(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(js(r,{select:t}),document.activeElement!==n)return}function nne(e){const t=LM(e),n=b$(t,e),r=b$(t.reverse(),e);return[n,r]}function LM(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 b$(e,t){for(const n of e)if(!rne(n,{upTo:t}))return n}function rne(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 one(e){return e instanceof HTMLInputElement&&"select"in e}function js(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&one(e)&&t&&e.select()}}const y$=ine();function ine(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=x$(e,t),e.unshift(t)},remove(t){var n;e=x$(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function x$(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function sne(e){return e.filter(t=>t.tagName!=="A")}const FM=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(lne);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(d1,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(d1,de({},r,{ref:t}),n)});FM.displayName="Slot";const d1=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...cne(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});d1.displayName="SlotClone";const ane=({children:e})=>m.createElement(m.Fragment,null,e);function lne(e){return m.isValidElement(e)&&e.type===ane}function cne(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 av(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])}var une=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ic=new WeakMap,Hp=new WeakMap,Wp={},H0=0,jM=function(e){return e&&(e.host||jM(e.parentNode))},dne=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=jM(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})},fne=function(e,t,n,r){var o=dne(t,Array.isArray(e)?e:[e]);Wp[n]||(Wp[n]=new WeakMap);var i=Wp[n],s=[],a=new Set,l=new Set(o),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};o.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))u(p);else{var h=p.getAttribute(r),b=h!==null&&h!=="false",v=(ic.get(p)||0)+1,w=(i.get(p)||0)+1;ic.set(p,v),i.set(p,w),s.push(p),v===1&&b&&Hp.set(p,!0),w===1&&p.setAttribute(n,"true"),b||p.setAttribute(r,"true")}})};return u(t),a.clear(),H0++,function(){s.forEach(function(f){var p=ic.get(f)-1,h=i.get(f)-1;ic.set(f,p),i.set(f,h),p||(Hp.has(f)||f.removeAttribute(r),Hp.delete(f)),h||f.removeAttribute(n)}),H0--,H0||(ic=new WeakMap,ic=new WeakMap,Hp=new WeakMap,Wp={})}},ih=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||une(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),fne(r,o,n,"aria-hidden")):function(){return null}},En=function(){return En=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},En.apply(this,arguments)};function lv(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 z_(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 $c="right-scroll-bar-position",Tc="width-before-scroll-bar",hne="with-scroll-bars-hidden",pne="--removed-body-scroll-bar-size";function gne(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mne(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 B_(e,t){return mne(t||null,function(n){return e.forEach(function(r){return gne(r,n)})})}function vne(e){return e}function bne(e,t){t===void 0&&(t=vne);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 u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function V_(e){e===void 0&&(e={});var t=bne(null);return t.options=En({async:!0,ssr:!1},e),t}var zM=function(e){var t=e.sideCar,n=lv(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 L.createElement(r,En({},n))};zM.isSideCarExport=!0;function H_(e,t){return e.useMedium(t),zM}var BM=V_(),W0=function(){},cv=L.forwardRef(function(e,t){var n=L.useRef(null),r=L.useState({onScrollCapture:W0,onWheelCapture:W0,onTouchMoveCapture:W0}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,h=e.noIsolation,b=e.inert,v=e.allowPinchZoom,w=e.as,y=w===void 0?"div":w,_=lv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=p,C=B_([n,t]),E=En(En({},_),o);return L.createElement(L.Fragment,null,u&&L.createElement(S,{sideCar:BM,removeScrollBar:c,shards:f,noIsolation:h,inert:b,setCallbacks:i,allowPinchZoom:!!v,lockRef:n}),s?L.cloneElement(L.Children.only(a),En(En({},E),{ref:C})):L.createElement(y,En({},E,{className:l,ref:C}),a))});cv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cv.classNames={fullWidth:Tc,zeroRight:$c};var w$,yne=function(){if(w$)return w$;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function xne(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=yne();return t&&e.setAttribute("nonce",t),e}function wne(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _ne(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Sne=function(){var e=0,t=null;return{add:function(n){e==0&&(t=xne())&&(wne(t,n),_ne(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Cne=function(){var e=Sne();return function(t,n){L.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uv=function(){var e=Cne(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Ene={left:0,top:0,right:0,gap:0},U0=function(e){return parseInt(e||"",10)||0},Rne=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[U0(n),U0(r),U0(o)]},Pne=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ene;var t=Rne(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])}},One=uv(),$ne=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
286
|
-
.`.concat(hne,` {
|
|
287
|
-
overflow: hidden `).concat(r,`;
|
|
288
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
289
|
-
}
|
|
290
|
-
body {
|
|
291
|
-
overflow: hidden `).concat(r,`;
|
|
292
|
-
overscroll-behavior: contain;
|
|
293
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
294
|
-
padding-left: `.concat(o,`px;
|
|
295
|
-
padding-top: `).concat(i,`px;
|
|
296
|
-
padding-right: `).concat(s,`px;
|
|
297
|
-
margin-left:0;
|
|
298
|
-
margin-top:0;
|
|
299
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
300
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.`).concat($c,` {
|
|
304
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.`).concat(Tc,` {
|
|
308
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.`).concat($c," .").concat($c,` {
|
|
312
|
-
right: 0 `).concat(r,`;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.`).concat(Tc," .").concat(Tc,` {
|
|
316
|
-
margin-right: 0 `).concat(r,`;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
body {
|
|
320
|
-
`).concat(pne,": ").concat(a,`px;
|
|
321
|
-
}
|
|
322
|
-
`)},W_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=L.useMemo(function(){return Pne(o)},[o]);return L.createElement(One,{styles:$ne(i,!t,o,n?"":"!important")})},f1=!1;if(typeof window<"u")try{var Up=Object.defineProperty({},"passive",{get:function(){return f1=!0,!0}});window.addEventListener("test",Up,Up),window.removeEventListener("test",Up,Up)}catch{f1=!1}var sc=f1?{passive:!1}:!1,Tne=function(e){return e.tagName==="TEXTAREA"},VM=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Tne(e)&&n[t]==="visible")},Dne=function(e){return VM(e,"overflowY")},Ane=function(e){return VM(e,"overflowX")},_$=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=HM(e,n);if(r){var o=WM(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},kne=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Mne=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},HM=function(e,t){return e==="v"?Dne(t):Ane(t)},WM=function(e,t){return e==="v"?kne(t):Mne(t)},Ine=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nne=function(e,t,n,r,o){var i=Ine(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,p=0;do{var h=WM(e,a),b=h[0],v=h[1],w=h[2],y=v-w-i*b;(b||y)&&HM(e,a)&&(f+=y,p+=b),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&f===0||!o&&s>f)||!u&&(o&&p===0||!o&&-s>p))&&(c=!0),c},qp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},S$=function(e){return[e.deltaX,e.deltaY]},C$=function(e){return e&&"current"in e?e.current:e},Lne=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Fne=function(e){return`
|
|
323
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
324
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
325
|
-
`)},jne=0,ac=[];function zne(e){var t=L.useRef([]),n=L.useRef([0,0]),r=L.useRef(),o=L.useState(jne++)[0],i=L.useState(function(){return uv()})[0],s=L.useRef(e);L.useEffect(function(){s.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=z_([e.lockRef.current],(e.shards||[]).map(C$),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=L.useCallback(function(v,w){if("touches"in v&&v.touches.length===2)return!s.current.allowPinchZoom;var y=qp(v),_=n.current,S="deltaX"in v?v.deltaX:_[0]-y[0],C="deltaY"in v?v.deltaY:_[1]-y[1],E,O=v.target,T=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in v&&T==="h"&&O.type==="range")return!1;var N=_$(T,O);if(!N)return!0;if(N?E=T:(E=T==="v"?"h":"v",N=_$(T,O)),!N)return!1;if(!r.current&&"changedTouches"in v&&(S||C)&&(r.current=E),!E)return!0;var M=r.current||E;return Nne(M,w,v,M==="h"?S:C,!0)},[]),l=L.useCallback(function(v){var w=v;if(!(!ac.length||ac[ac.length-1]!==i)){var y="deltaY"in w?S$(w):qp(w),_=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&Lne(E.delta,y)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(C$).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=S.length>0?a(w,S[0]):!s.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),c=L.useCallback(function(v,w,y,_){var S={name:v,delta:w,target:y,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=L.useCallback(function(v){n.current=qp(v),r.current=void 0},[]),f=L.useCallback(function(v){c(v.type,S$(v),v.target,a(v,e.lockRef.current))},[]),p=L.useCallback(function(v){c(v.type,qp(v),v.target,a(v,e.lockRef.current))},[]);L.useEffect(function(){return ac.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,sc),document.addEventListener("touchmove",l,sc),document.addEventListener("touchstart",u,sc),function(){ac=ac.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,sc),document.removeEventListener("touchmove",l,sc),document.removeEventListener("touchstart",u,sc)}},[]);var h=e.removeScrollBar,b=e.inert;return L.createElement(L.Fragment,null,b?L.createElement(i,{styles:Fne(o)}):null,h?L.createElement(W_,{gapMode:"margin"}):null)}const Bne=H_(BM,zne);var UM=L.forwardRef(function(e,t){return L.createElement(cv,En({},e,{ref:t,sideCar:Bne}))});UM.classNames=cv.classNames;const U_=UM,Vne=[" ","Enter","ArrowUp","ArrowDown"],Hne=[" ","Enter"],dv="Select",[fv,hv,Wne]=km(dv),[xu,w1e]=er(dv,[Wne,Di]),q_=Di(),[Une,Dl]=xu(dv),[qne,Gne]=xu(dv),Yne=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:h}=e,b=q_(t),[v,w]=m.useState(null),[y,_]=m.useState(null),[S,C]=m.useState(!1),E=Pl(c),[O=!1,T]=_r({prop:r,defaultProp:o,onChange:i}),[N,M]=_r({prop:s,defaultProp:a,onChange:l}),A=m.useRef(null),F=v?!!v.closest("form"):!0,[z,X]=m.useState(new Set),ee=Array.from(z).map(H=>H.props.value).join(";");return m.createElement(th,b,m.createElement(Une,{required:h,scope:t,trigger:v,onTriggerChange:w,valueNode:y,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Zo(),value:N,onValueChange:M,open:O,onOpenChange:T,dir:E,triggerPointerDownPosRef:A,disabled:p},m.createElement(fv.Provider,{scope:t},m.createElement(qne,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(H=>{X(Q=>new Set(Q).add(H))},[]),onNativeOptionRemove:m.useCallback(H=>{X(Q=>{const Y=new Set(Q);return Y.delete(H),Y})},[])},n)),F?m.createElement(XM,{key:ee,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:N,onChange:H=>M(H.target.value),disabled:p},N===void 0?m.createElement("option",{value:""}):null,Array.from(z)):null))},Kne="SelectTrigger",Xne=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=q_(n),s=Dl(Kne,n),a=s.disabled||r,l=_t(t,s.onTriggerChange),c=hv(n),[u,f,p]=QM(b=>{const v=c().filter(_=>!_.disabled),w=v.find(_=>_.value===s.value),y=JM(v,b,w);y!==void 0&&s.onValueChange(y.value)}),h=()=>{a||(s.onOpenChange(!0),p())};return m.createElement(nh,de({asChild:!0},i),m.createElement(Qe.button,de({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":KM(s.value)?"":void 0},o,{ref:l,onClick:Me(o.onClick,b=>{b.currentTarget.focus()}),onPointerDown:Me(o.onPointerDown,b=>{const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&(h(),s.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)},b.preventDefault())}),onKeyDown:Me(o.onKeyDown,b=>{const v=u.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&f(b.key),!(v&&b.key===" ")&&Vne.includes(b.key)&&(h(),b.preventDefault())})})))}),Qne="SelectValue",Jne=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Dl(Qne,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=_t(t,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),m.createElement(Qe.span,de({},a,{ref:f,style:{pointerEvents:"none"}}),KM(l.value)?m.createElement(m.Fragment,null,s):i)}),Zne=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Qe.span,de({"aria-hidden":!0},o,{ref:t}),r||"▼")}),ere=e=>m.createElement(w_,de({asChild:!0},e)),uu="SelectContent",tre=m.forwardRef((e,t)=>{const n=Dl(uu,e.__scopeSelect),[r,o]=m.useState();if(ur(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Cr.createPortal(m.createElement(qM,{scope:e.__scopeSelect},m.createElement(fv.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(nre,de({},e,{ref:t}))}),Qi=10,[qM,Al]=xu(uu),nre=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:v,avoidCollisions:w,...y}=e,_=Dl(uu,n),[S,C]=m.useState(null),[E,O]=m.useState(null),T=_t(t,ue=>C(ue)),[N,M]=m.useState(null),[A,F]=m.useState(null),z=hv(n),[X,ee]=m.useState(!1),H=m.useRef(!1);m.useEffect(()=>{if(S)return ih(S)},[S]),F_();const Q=m.useCallback(ue=>{const[ie,...oe]=z().map(K=>K.ref.current),[le]=oe.slice(-1),ye=document.activeElement;for(const K of ue)if(K===ye||(K==null||K.scrollIntoView({block:"nearest"}),K===ie&&E&&(E.scrollTop=0),K===le&&E&&(E.scrollTop=E.scrollHeight),K==null||K.focus(),document.activeElement!==ye))return},[z,E]),Y=m.useCallback(()=>Q([N,S]),[Q,N,S]);m.useEffect(()=>{X&&Y()},[X,Y]);const{onOpenChange:J,triggerPointerDownPosRef:W}=_;m.useEffect(()=>{if(S){let ue={x:0,y:0};const ie=le=>{var ye,K,be,Se;ue={x:Math.abs(Math.round(le.pageX)-((ye=(K=W.current)===null||K===void 0?void 0:K.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(le.pageY)-((be=(Se=W.current)===null||Se===void 0?void 0:Se.y)!==null&&be!==void 0?be:0))}},oe=le=>{ue.x<=10&&ue.y<=10?le.preventDefault():S.contains(le.target)||J(!1),document.removeEventListener("pointermove",ie),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",oe,{capture:!0})}}},[S,J,W]),m.useEffect(()=>{const ue=()=>J(!1);return window.addEventListener("blur",ue),window.addEventListener("resize",ue),()=>{window.removeEventListener("blur",ue),window.removeEventListener("resize",ue)}},[J]);const[$,V]=QM(ue=>{const ie=z().filter(ye=>!ye.disabled),oe=ie.find(ye=>ye.ref.current===document.activeElement),le=JM(ie,ue,oe);le&&setTimeout(()=>le.ref.current.focus())}),U=m.useCallback((ue,ie,oe)=>{const le=!H.current&&!oe;(_.value!==void 0&&_.value===ie||le)&&(M(ue),le&&(H.current=!0))},[_.value]),I=m.useCallback(()=>S==null?void 0:S.focus(),[S]),te=m.useCallback((ue,ie,oe)=>{const le=!H.current&&!oe;(_.value!==void 0&&_.value===ie||le)&&F(ue)},[_.value]),fe=r==="popper"?E$:rre,ne=fe===E$?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:v,avoidCollisions:w}:{};return m.createElement(qM,{scope:n,content:S,viewport:E,onViewportChange:O,itemRefCallback:U,selectedItem:N,onItemLeave:I,itemTextRefCallback:te,focusSelectedItem:Y,selectedItemText:A,position:r,isPositioned:X,searchRef:$},m.createElement(U_,{as:FM,allowPinchZoom:!0},m.createElement(j_,{asChild:!0,trapped:_.open,onMountAutoFocus:ue=>{ue.preventDefault()},onUnmountAutoFocus:Me(o,ue=>{var ie;(ie=_.trigger)===null||ie===void 0||ie.focus({preventScroll:!0}),ue.preventDefault()})},m.createElement(Zf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ue=>ue.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(fe,de({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:ue=>ue.preventDefault()},y,ne,{onPlaced:()=>ee(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Me(y.onKeyDown,ue=>{const ie=ue.ctrlKey||ue.altKey||ue.metaKey;if(ue.key==="Tab"&&ue.preventDefault(),!ie&&ue.key.length===1&&V(ue.key),["ArrowUp","ArrowDown","Home","End"].includes(ue.key)){let le=z().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(ue.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(ue.key)){const ye=ue.target,K=le.indexOf(ye);le=le.slice(K+1)}setTimeout(()=>Q(le)),ue.preventDefault()}})}))))))}),rre=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Dl(uu,n),s=Al(uu,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=_t(t,T=>u(T)),p=hv(n),h=m.useRef(!1),b=m.useRef(!0),{viewport:v,selectedItem:w,selectedItemText:y,focusSelectedItem:_}=s,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&v&&w&&y){const T=i.trigger.getBoundingClientRect(),N=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),A=y.getBoundingClientRect();if(i.dir!=="rtl"){const ye=A.left-N.left,K=M.left-ye,be=T.left-K,Se=T.width+be,Oe=Math.max(Se,N.width),Te=window.innerWidth-Qi,Ue=u1(K,[Qi,Te-Oe]);a.style.minWidth=Se+"px",a.style.left=Ue+"px"}else{const ye=N.right-A.right,K=window.innerWidth-M.right-ye,be=window.innerWidth-T.right-K,Se=T.width+be,Oe=Math.max(Se,N.width),Te=window.innerWidth-Qi,Ue=u1(K,[Qi,Te-Oe]);a.style.minWidth=Se+"px",a.style.right=Ue+"px"}const F=p(),z=window.innerHeight-Qi*2,X=v.scrollHeight,ee=window.getComputedStyle(c),H=parseInt(ee.borderTopWidth,10),Q=parseInt(ee.paddingTop,10),Y=parseInt(ee.borderBottomWidth,10),J=parseInt(ee.paddingBottom,10),W=H+Q+X+J+Y,$=Math.min(w.offsetHeight*5,W),V=window.getComputedStyle(v),U=parseInt(V.paddingTop,10),I=parseInt(V.paddingBottom,10),te=T.top+T.height/2-Qi,fe=z-te,ne=w.offsetHeight/2,ue=w.offsetTop+ne,ie=H+Q+ue,oe=W-ie;if(ie<=te){const ye=w===F[F.length-1].ref.current;a.style.bottom="0px";const K=c.clientHeight-v.offsetTop-v.offsetHeight,be=Math.max(fe,ne+(ye?I:0)+K+Y),Se=ie+be;a.style.height=Se+"px"}else{const ye=w===F[0].ref.current;a.style.top="0px";const be=Math.max(te,H+v.offsetTop+(ye?U:0)+ne)+oe;a.style.height=be+"px",v.scrollTop=ie-te+v.offsetTop}a.style.margin=`${Qi}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,a,c,v,w,y,i.dir,r]);ur(()=>S(),[S]);const[C,E]=m.useState();ur(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const O=m.useCallback(T=>{T&&b.current===!0&&(S(),_==null||_(),b.current=!1)},[S,_]);return m.createElement(ore,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:O},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C}},m.createElement(Qe.div,de({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),E$=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Qi,...i}=e,s=q_(n);return m.createElement(rh,de({},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)"}}))}),[ore,G_]=xu(uu,{}),R$="SelectViewport",ire=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Al(R$,n),i=G_(R$,n),s=_t(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(fv.Slot,{scope:n},m.createElement(Qe.div,de({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Me(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&u){const p=Math.abs(a.current-c.scrollTop);if(p>0){const h=window.innerHeight-Qi*2,b=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),w=Math.max(b,v);if(w<h){const y=w+p,_=Math.min(h,y),S=y-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),sre="SelectGroup",[are,lre]=xu(sre),cre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Zo();return m.createElement(are,{scope:n,id:o},m.createElement(Qe.div,de({role:"group","aria-labelledby":o},r,{ref:t})))}),ure="SelectLabel",dre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=lre(ure,n);return m.createElement(Qe.div,de({id:o.id},r,{ref:t}))}),h1="SelectItem",[fre,GM]=xu(h1),hre=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Dl(h1,n),l=Al(h1,n),c=a.value===r,[u,f]=m.useState(i??""),[p,h]=m.useState(!1),b=_t(t,y=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,y,r,o)}),v=Zo(),w=()=>{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(fre,{scope:n,value:r,disabled:o,textId:v,isSelected:c,onItemTextChange:m.useCallback(y=>{f(_=>{var S;return _||((S=y==null?void 0:y.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(fv.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Qe.div,de({role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:b,onFocus:Me(s.onFocus,()=>h(!0)),onBlur:Me(s.onBlur,()=>h(!1)),onPointerUp:Me(s.onPointerUp,w),onPointerMove:Me(s.onPointerMove,y=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(s.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Me(s.onKeyDown,y=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&y.key===" "||(Hne.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})}))))}),Gp="SelectItemText",pre=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Dl(Gp,n),a=Al(Gp,n),l=GM(Gp,n),c=Gne(Gp,n),[u,f]=m.useState(null),p=_t(t,y=>f(y),l.onItemTextChange,y=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,y,l.value,l.disabled)}),h=u==null?void 0:u.textContent,b=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=c;return ur(()=>(v(b),()=>w(b)),[v,w,b]),m.createElement(m.Fragment,null,m.createElement(Qe.span,de({id:l.textId},i,{ref:p})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Cr.createPortal(i.children,s.valueNode):null)}),gre="SelectItemIndicator",mre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return GM(gre,n).isSelected?m.createElement(Qe.span,de({"aria-hidden":!0},r,{ref:t})):null}),P$="SelectScrollUpButton",vre=m.forwardRef((e,t)=>{const n=Al(P$,e.__scopeSelect),r=G_(P$,e.__scopeSelect),[o,i]=m.useState(!1),s=_t(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;i(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(YM,de({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),O$="SelectScrollDownButton",bre=m.forwardRef((e,t)=>{const n=Al(O$,e.__scopeSelect),r=G_(O$,e.__scopeSelect),[o,i]=m.useState(!1),s=_t(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<c;i(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(YM,de({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),YM=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Al("SelectScrollButton",n),s=m.useRef(null),a=hv(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),ur(()=>{var c;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(Qe.div,de({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:Me(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Me(o.onPointerMove,()=>{var c;(c=i.onItemLeave)===null||c===void 0||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Me(o.onPointerLeave,()=>{l()})}))}),yre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Qe.div,de({"aria-hidden":!0},r,{ref:t}))});function KM(e){return e===""||e===void 0}const XM=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=_t(t,o),s=av(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(aM,{asChild:!0},m.createElement("select",de({},r,{ref:i,defaultValue:n})))});XM.displayName="BubbleSelect";function QM(e){const t=jn(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(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 JM(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=xre(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function xre(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const wre=Yne,ZM=Xne,_re=Jne,Sre=Zne,Cre=ere,eI=tre,Ere=ire,Rre=cre,tI=dre,nI=hre,Pre=pre,Ore=mre,rI=vre,oI=bre,iI=yre,Vs=wre,yc=Rre,Hs=_re,Zi=L.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(ZM,{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,R.jsx(Sre,{asChild:!0,children:R.jsx(d_,{className:"h-4 w-4 opacity-50"})})]}));Zi.displayName=ZM.displayName;const sI=L.forwardRef(({className:e,...t},n)=>R.jsx(rI,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:R.jsx(OJ,{className:"h-4 w-4"})}));sI.displayName=rI.displayName;const aI=L.forwardRef(({className:e,...t},n)=>R.jsx(oI,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:R.jsx(d_,{className:"h-4 w-4"})}));aI.displayName=oI.displayName;const es=L.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>R.jsx(Cre,{children:R.jsx(yu,{children:R.jsxs(eI,{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:[R.jsx(sI,{}),R.jsx(Ere,{className:_e("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),R.jsx(aI,{})]})})}));es.displayName=eI.displayName;const Ua=L.forwardRef(({className:e,...t},n)=>R.jsx(tI,{ref:n,className:_e("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ua.displayName=tI.displayName;const Un=L.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(nI,{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:[R.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:R.jsx(Ore,{children:R.jsx(Qf,{className:"h-4 w-4"})})}),R.jsx(Pre,{children:t})]}));Un.displayName=nI.displayName;const sm=L.forwardRef(({className:e,...t},n)=>R.jsx(iI,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));sm.displayName=iI.displayName;function $re(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Tre(...e){return t=>e.forEach(n=>$re(n,t))}var pv=L.forwardRef((e,t)=>{const{children:n,...r}=e,o=L.Children.toArray(n),i=o.find(Dre);if(i){const s=i.props.children,a=o.map(l=>l===i?L.Children.count(s)>1?L.Children.only(null):L.isValidElement(s)?s.props.children:null:l);return R.jsx(p1,{...r,ref:t,children:L.isValidElement(s)?L.cloneElement(s,void 0,a):null})}return R.jsx(p1,{...r,ref:t,children:n})});pv.displayName="Slot";var p1=L.forwardRef((e,t)=>{const{children:n,...r}=e;if(L.isValidElement(n)){const o=kre(n);return L.cloneElement(n,{...Are(r,n.props),ref:t?Tre(t,o):o})}return L.Children.count(n)>1?L.Children.only(null):null});p1.displayName="SlotClone";var lI=({children:e})=>R.jsx(R.Fragment,{children:e});function Dre(e){return L.isValidElement(e)&&e.type===lI}function Are(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 kre(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const $$=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,T$=kg,Y_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return T$(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],f=i==null?void 0:i[c];if(u===null)return null;const p=$$(u)||$$(f);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,p]=u;return p===void 0||(c[f]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:p,...h}=u;return Object.entries(h).every(b=>{let[v,w]=b;return Array.isArray(w)?w.includes({...i,...a}[v]):{...i,...a}[v]===w})?[...c,f,p]:c},[]);return T$(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},ef=Y_("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"}}),xr=L.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?pv:"button";return R.jsx(s,{className:_e(ef({variant:t,size:n,className:e})),ref:i,...o})});xr.displayName="Button";const Mre=m.forwardRef((e,t)=>m.createElement(Qe.label,de({},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()}}))),cI=Mre,Ire=Y_("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Fn=L.forwardRef(({className:e,...t},n)=>R.jsx(cI,{ref:n,className:_e(Ire(),e),...t}));Fn.displayName=cI.displayName;const uI=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Lre);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(g1,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(g1,de({},r,{ref:t}),n)});uI.displayName="Slot";const g1=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Fre(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});g1.displayName="SlotClone";const Nre=({children:e})=>m.createElement(m.Fragment,null,e);function Lre(e){return m.isValidElement(e)&&e.type===Nre}function Fre(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}}const dI="Popover",[fI,_1e]=er(dI,[Di]),K_=Di(),[jre,wu]=fI(dI),zre=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=K_(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,p]=_r({prop:r,defaultProp:o,onChange:i});return m.createElement(th,a,m.createElement(jre,{scope:t,contentId:Zo(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},Bre="PopoverTrigger",Vre=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wu(Bre,n),i=K_(n),s=_t(t,o.triggerRef),a=m.createElement(Qe.button,de({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gI(o.open)},r,{ref:s,onClick:Me(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(nh,de({asChild:!0},i),a)}),hI="PopoverPortal",[Hre,Wre]=fI(hI,{forceMount:void 0}),Ure=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=wu(hI,t);return m.createElement(Hre,{scope:t,forceMount:n},m.createElement(tr,{present:n||i.open},m.createElement(w_,{asChild:!0,container:o},r)))},tf="PopoverContent",qre=m.forwardRef((e,t)=>{const n=Wre(tf,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=wu(tf,e.__scopePopover);return m.createElement(tr,{present:r||i.open},i.modal?m.createElement(Gre,de({},o,{ref:t})):m.createElement(Yre,de({},o,{ref:t})))}),Gre=m.forwardRef((e,t)=>{const n=wu(tf,e.__scopePopover),r=m.useRef(null),o=_t(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return ih(s)},[]),m.createElement(U_,{as:uI,allowPinchZoom:!0},m.createElement(pI,de({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Me(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Me(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),Yre=m.forwardRef((e,t)=>{const n=wu(tf,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(pI,de({},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()}}))}),pI=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,p=wu(tf,n),h=K_(n);return F_(),m.createElement(j_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Zf,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1)},m.createElement(rh,de({"data-state":gI(p.open),role:"dialog",id:p.contentId},h,f,{ref:t,style:{...f.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 gI(e){return e?"open":"closed"}const Kre=zre,Xre=Vre,Qre=Ure,mI=qre,gv=Kre,mv=Xre,sh=L.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>R.jsx(Qre,{children:R.jsx(yu,{children:R.jsx(mI,{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})})}));sh.displayName=mI.displayName;function Jre(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}const Dc=L.forwardRef(({className:e,type:t,...n},r)=>R.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}));Dc.displayName="Input";function vI({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return R.jsxs("div",{className:"space-y-3",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx(Fn,{children:"Color Range"}),R.jsx(xr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:R.jsx(h_,{className:"size-3"})})]}),e.map((s,a)=>R.jsxs("div",{className:"flex items-center gap-2 px-2",children:[R.jsx(Dc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:_e(`h-7 ${bg}`)}),R.jsx("span",{children:"-"}),R.jsx(Dc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:_e(`h-7 ${bg}`)}),R.jsx(Dc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:_e(`h-7 min-w-14 p-0 ${bg}`),type:"color",list:"presetColors"}),R.jsxs("datalist",{id:"presetColors",children:[R.jsx("option",{children:Bt.green[600]}),R.jsx("option",{children:Bt.red[500]}),R.jsx("option",{children:Bt.yellow[400]}),R.jsx("option",{children:Bt.orange[500]})]}),R.jsx(xr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:R.jsx(Jf,{className:"size-3"})})]},a))]})}const Zre=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=_r({prop:n,onChange:o,defaultProp:r});return m.createElement(Qe.button,de({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Me(e.onClick,()=>{e.disabled||a(!s)})}))}),bI=Zre,eoe=Y_("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"}}),X_=L.forwardRef(({className:e,variant:t,size:n,...r},o)=>R.jsx(bI,{ref:o,className:_e(eoe({variant:t,size:n,className:e})),...r}));X_.displayName=bI.displayName;function toe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function noe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function roe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function ooe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function ioe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function soe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function aoe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function loe({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=br(M=>{var A;return(A=M.card)==null?void 0:A.preferences}),[i,s]=m.useState(toe(o,e)),[a,l]=m.useState(soe(o,e)),[c,u]=m.useState(noe(o,e)),[f,p]=m.useState(roe(o,e)),[h,b]=m.useState(ooe(o,e)),[v,w]=m.useState(ioe(o,e).toString()),[y,_]=m.useState(aoe(o,e));m.useState("");const S=br(M=>M.actions.setCardPreferences);function C(){const M=[...new Set(nx.map(A=>A.currency))];return R.jsx(R.Fragment,{children:R.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),R.jsxs(Vs,{value:c,onValueChange:A=>u(A),children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Locale"}),nx.map(A=>R.jsx(Un,{value:A.locale,children:A.locale},A.locale))]})})]}),R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),R.jsxs(Vs,{value:h||"none",onValueChange:A=>b(A==="none"?void 0:A),children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Currency"}),R.jsx(Un,{value:"none",children:"None"}),M.map(A=>R.jsx(Un,{value:A,children:A},A))]})})]}),R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),R.jsxs(Vs,{value:v,onValueChange:A=>w(A),children:[R.jsx(Zi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:["0","1","2","3","4"].map(A=>R.jsx(Un,{value:A,children:A},A))})]}),!h&&R.jsx(X_,{onPressedChange:A=>_(A),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:R.jsx(AJ,{className:"size-3"})})]})})}function E(){return R.jsx(R.Fragment,{children:R.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),R.jsxs(Vs,{defaultValue:"en-US",value:c,onValueChange:M=>u(M),children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:iV.map(M=>R.jsxs(yc,{children:[R.jsx(Ua,{children:M.label}),M.locales.map(A=>R.jsx(Un,{value:A.code,children:A.name},A.code))]},M.label))})]}),R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Format"}),R.jsxs(Vs,{defaultValue:"short-date-time",value:f,onValueChange:M=>{console.log("format",M),p(M)},children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{className:"",id:"type",children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Option"}),R.jsx(Un,{value:"full-date-time",children:"Full Date-Time"}),R.jsx(Un,{value:"short-date-time",children:"Short Date-Time"}),R.jsx(Un,{value:"hours-date-time",children:"24-Hour Date-Time"}),R.jsx(Un,{value:"short-date",children:"Short Date"}),R.jsx(Un,{value:"long-date",children:"Long Date"})]})})]})]})})}function O(){S({...o,columnSettings:[]})}function T(){var M;S({...o,columnSettings:[...((M=o==null?void 0:o.columnSettings)==null?void 0:M.filter(A=>A.columnIdx!==e))||[]]})}function N(){var M,A,F;if(i==="date"){const z=Jre(c,f),X={columnIdx:e,type:i,options:z};S({...o,columnSettings:[...((M=o==null?void 0:o.columnSettings)==null?void 0:M.filter(ee=>ee.columnIdx!==e))||[],X]})}else if(i==="number"){let z;h?z={locale:c,currency:h,options:{style:"currency",currency:h,minimumFractionDigits:Number(v)},colorRanges:a.length>0?a:void 0}:z={locale:c,currency:void 0,options:{style:y?"percent":"decimal",minimumFractionDigits:Number(v)},colorRanges:a.length>0?a:void 0};const X={columnIdx:e,type:i,options:z};S({...o,columnSettings:[...((A=o==null?void 0:o.columnSettings)==null?void 0:A.filter(ee=>ee.columnIdx!==e))||[],X]})}else S({...o,columnSettings:[...((F=o==null?void 0:o.columnSettings)==null?void 0:F.filter(z=>z.columnIdx!==e))||[]]})}return R.jsxs(gv,{onOpenChange:M=>r(M),children:[R.jsx(mv,{asChild:!0,children:R.jsx(p_,{className:"size-3.5 cursor-pointer text-muted"})}),R.jsx(sh,{align:"center",className:"max-w-70",children:R.jsxs("div",{className:"grid gap-4",children:[R.jsxs("div",{className:"space-y-2",children:[R.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),R.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),R.jsxs("div",{className:"grid gap-2",children:[R.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[R.jsx(Fn,{htmlFor:"scale",children:"Type"}),R.jsxs(Vs,{value:i||"none",onValueChange:M=>s(M),children:[R.jsx(Zi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{id:"type",children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Option"}),R.jsx(Un,{value:"number",children:"Number"}),R.jsx(Un,{value:"date",children:"Date"}),R.jsx(Un,{value:"none",children:"None"})]})})]})]}),i==="number"&&C(),i==="date"&&E(),i==="number"&&R.jsxs(R.Fragment,{children:[R.jsx(sm,{}),R.jsx(vI,{colorRanges:a,setColorRanges:l})]}),R.jsx(sm,{}),R.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[R.jsx(xr,{onClick:O,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),R.jsx(xr,{onClick:T,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),R.jsx(xr,{onClick:N,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function coe(e){const t=new Date(e);return!isNaN(t.getTime())}function yI({data:e,card:t}){var C,E,O,T;const[n,r]=m.useState([]),{keys:o}=lr(e),i=$e(N=>N.filteringCards),s=$e(N=>N.themeStyle),a=$e(N=>N.isVisualEditing),l=i==null?void 0:i.find(N=>N.id===t.id),c=(C=t==null?void 0:t.preferences)==null?void 0:C.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:f,removeFilterValue:p,removeFilteringCard:h}=wr(),b=t==null?void 0:t.preferences;function v(N,M){if((M==null?void 0:M.type)==="date"&&coe(N)){const{locale:A,options:F}=M.options,z=new Date(N);return new Date(z.getTime()).toLocaleDateString(A,F)}if((M==null?void 0:M.type)==="number"){const{locale:A,currency:F,options:z}=M.options;return F?new Intl.NumberFormat(A,{style:"currency",currency:F,...z}).format(N):new Intl.NumberFormat(A,z).format(N)}return N}const w=o.map((N,M)=>({accessorKey:N,header:({column:A})=>{const F=A.getIsSorted();return R.jsxs("div",{className:"flex items-center justify-between gap-2",children:[R.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>A.toggleSorting(A.getIsSorted()==="asc"),children:[N,F==="asc"?R.jsx(u_,{className:"ml-2 h-5 w-5"}):F==="desc"?R.jsx(c_,{className:"ml-2 h-5 w-5"}):null]}),a&&R.jsx(loe,{columnName:A.id,columnIndex:M})]})},cell:({cell:A})=>{var H,Q;const F=A.getValue(),z=(H=b==null?void 0:b.columnSettings)==null?void 0:H.find(Y=>Y.columnIdx===M),X=v(F,z),ee=hM(F,(Q=z==null?void 0:z.options)==null?void 0:Q.colorRanges);return R.jsx("div",{className:"px-2 py-1",style:{backgroundColor:ee},children:X})}})),y=NM({data:e,columns:w,getCoreRowModel:kM(),getPaginationRowModel:IM(),onSortingChange:r,getSortedRowModel:MM(),manualPagination:!0,state:{sorting:n}}),_=y.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const N=t.id;p(N),h(t)}return}if(c){const{dimensionKeys:N}=lr(e),M=c.map(A=>{const F=N==null?void 0:N[A.columnIndex],z=_.map(ee=>ee.getValue(F));return{filterId:t.id+"-"+F,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:F,expression:A.expression,valueType:Bd(z[0]===void 0?"":z[0]),operation:"in",values:z}});u(M),f(t)}},[f,u,t,e,l,c,p,h,_]);function S(N){N.toggleSelected()}return R.jsxs(D_,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius,borderTopLeftRadius:(O=s==null?void 0:s.chart)==null?void 0:O.options.borderRadius},onMouseDown:N=>N.stopPropagation(),children:[R.jsx(A_,{children:y.getHeaderGroups().map(N=>R.jsx(kd,{children:N.headers.map((M,A)=>{var F,z,X,ee,H,Q,Y;return R.jsx(M_,{style:{backgroundColor:(X=(z=(F=s==null?void 0:s.chart)==null?void 0:F.dataset)==null?void 0:z.backgroundColor)==null?void 0:X[0],color:Zc((Q=(H=(ee=s==null?void 0:s.chart)==null?void 0:ee.dataset)==null?void 0:H.backgroundColor)==null?void 0:Q[0])},className:_e("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":A>0&&A<N.headers.length-1,"border-l":A===1&&N.headers.length==2},(Y=s==null?void 0:s.table)==null?void 0:Y.tableHeaderColor),children:M.isPlaceholder?null:c1(M.column.columnDef.header,M.getContext())},M.id)})},N.id))}),R.jsx(k_,{children:(T=y.getRowModel().rows)!=null&&T.length?y.getRowModel().rows.map((N,M)=>R.jsx(kd,{onClick:()=>S(N),className:_e("whitespace-nowrap p-1",{"cursor-pointer data-[state=selected]:border-2 data-[state=selected]:border-dashed":c&&(c==null?void 0:c.length)>0}),"data-state":N.getIsSelected()&&"selected",children:N.getVisibleCells().map((A,F)=>{var z;return R.jsx(om,{onClick:X=>{var H;const ee=((H=window==null?void 0:window.getSelection())==null?void 0:H.toString())||"";(ee==null?void 0:ee.length)>0&&X.stopPropagation()},className:_e("p-0",{"border-x":F>0&&F<w.length-1||F===1&&w.length==2,"border-l":F==0,"border-r":F===w.length-1,"border-b":M===((z=y.getRowModel().rows)==null?void 0:z.length)-1}),children:c1(A.column.columnDef.cell,A.getContext())},A.id)})},N.id)):R.jsx(kd,{children:R.jsx(om,{colSpan:w.length,className:"p-1 text-center",children:"No results."})})})]})}/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:xI,setPrototypeOf:D$,isFrozen:uoe,getPrototypeOf:doe,getOwnPropertyDescriptor:foe}=Object;let{freeze:Sr,seal:Io,create:wI}=Object,{apply:m1,construct:v1}=typeof Reflect<"u"&&Reflect;Sr||(Sr=function(t){return t});Io||(Io=function(t){return t});m1||(m1=function(t,n,r){return t.apply(n,r)});v1||(v1=function(t,n){return new t(...n)});const Yp=po(Array.prototype.forEach),A$=po(Array.prototype.pop),nd=po(Array.prototype.push),$g=po(String.prototype.toLowerCase),q0=po(String.prototype.toString),k$=po(String.prototype.match),rd=po(String.prototype.replace),hoe=po(String.prototype.indexOf),poe=po(String.prototype.trim),qo=po(Object.prototype.hasOwnProperty),gr=po(RegExp.prototype.test),od=goe(TypeError);function po(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return m1(e,t,r)}}function goe(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v1(e,n)}}function $t(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$g;D$&&D$(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(uoe(t)||(t[r]=i),o=i)}e[o]=!0}return e}function moe(e){for(let t=0;t<e.length;t++)qo(e,t)||(e[t]=null);return e}function Va(e){const t=wI(null);for(const[n,r]of xI(e))qo(e,n)&&(Array.isArray(r)?t[n]=moe(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Va(r):t[n]=r);return t}function id(e,t){for(;e!==null;){const r=foe(e,t);if(r){if(r.get)return po(r.get);if(typeof r.value=="function")return po(r.value)}e=doe(e)}function n(){return null}return n}const M$=Sr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),G0=Sr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Y0=Sr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),voe=Sr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),K0=Sr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),boe=Sr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),I$=Sr(["#text"]),N$=Sr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),X0=Sr(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L$=Sr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Kp=Sr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yoe=Io(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xoe=Io(/<%[\w\W]*|[\w\W]*%>/gm),woe=Io(/\${[\w\W]*}/gm),_oe=Io(/^data-[\-\w.\u00B7-\uFFFF]/),Soe=Io(/^aria-[\-\w]+$/),_I=Io(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Coe=Io(/^(?:\w+script|data):/i),Eoe=Io(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),SI=Io(/^html$/i),Roe=Io(/^[a-z][.\w]*(-[.\w]+)+$/i);var F$=Object.freeze({__proto__:null,MUSTACHE_EXPR:yoe,ERB_EXPR:xoe,TMPLIT_EXPR:woe,DATA_ATTR:_oe,ARIA_ATTR:Soe,IS_ALLOWED_URI:_I,IS_SCRIPT_OR_DATA:Coe,ATTR_WHITESPACE:Eoe,DOCTYPE_NAME:SI,CUSTOM_ELEMENT:Roe});const sd={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Poe=function(){return typeof window>"u"?null:window},Ooe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function CI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Poe();const t=Ae=>CI(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==sd.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:p,trustedTypes:h}=e,b=l.prototype,v=id(b,"cloneNode"),w=id(b,"remove"),y=id(b,"nextSibling"),_=id(b,"childNodes"),S=id(b,"parentNode");if(typeof s=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let C,E="";const{implementation:O,createNodeIterator:T,createDocumentFragment:N,getElementsByTagName:M}=n,{importNode:A}=r;let F={};t.isSupported=typeof xI=="function"&&typeof S=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:X,TMPLIT_EXPR:ee,DATA_ATTR:H,ARIA_ATTR:Q,IS_SCRIPT_OR_DATA:Y,ATTR_WHITESPACE:J,CUSTOM_ELEMENT:W}=F$;let{IS_ALLOWED_URI:$}=F$,V=null;const U=$t({},[...M$,...G0,...Y0,...K0,...I$]);let I=null;const te=$t({},[...N$,...X0,...L$,...Kp]);let fe=Object.seal(wI(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ne=null,ue=null,ie=!0,oe=!0,le=!1,ye=!0,K=!1,be=!0,Se=!1,Oe=!1,Te=!1,Ue=!1,Be=!1,Ie=!1,Ke=!0,lt=!1;const It="user-content-";let Dt=!0,Ht=!1,pe={},Ee=null;const Le=$t({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Ze=$t({},["audio","video","img","source","image","track"]);let Wt=null;const Zt=$t({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",vn="http://www.w3.org/2000/svg",ln="http://www.w3.org/1999/xhtml";let Lt=ln,tn=!1,xn=null;const nt=$t({},[Kt,vn,ln],q0);let ht=null;const At=["application/xhtml+xml","text/html"],Xt="text/html";let bt=null,On=null;const Fo=n.createElement("form"),vs=function(G){return G instanceof RegExp||G instanceof Function},jo=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(On&&On===G)){if((!G||typeof G!="object")&&(G={}),G=Va(G),ht=At.indexOf(G.PARSER_MEDIA_TYPE)===-1?Xt:G.PARSER_MEDIA_TYPE,bt=ht==="application/xhtml+xml"?q0:$g,V=qo(G,"ALLOWED_TAGS")?$t({},G.ALLOWED_TAGS,bt):U,I=qo(G,"ALLOWED_ATTR")?$t({},G.ALLOWED_ATTR,bt):te,xn=qo(G,"ALLOWED_NAMESPACES")?$t({},G.ALLOWED_NAMESPACES,q0):nt,Wt=qo(G,"ADD_URI_SAFE_ATTR")?$t(Va(Zt),G.ADD_URI_SAFE_ATTR,bt):Zt,Ge=qo(G,"ADD_DATA_URI_TAGS")?$t(Va(Ze),G.ADD_DATA_URI_TAGS,bt):Ze,Ee=qo(G,"FORBID_CONTENTS")?$t({},G.FORBID_CONTENTS,bt):Le,ne=qo(G,"FORBID_TAGS")?$t({},G.FORBID_TAGS,bt):{},ue=qo(G,"FORBID_ATTR")?$t({},G.FORBID_ATTR,bt):{},pe=qo(G,"USE_PROFILES")?G.USE_PROFILES:!1,ie=G.ALLOW_ARIA_ATTR!==!1,oe=G.ALLOW_DATA_ATTR!==!1,le=G.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=G.ALLOW_SELF_CLOSE_IN_ATTR!==!1,K=G.SAFE_FOR_TEMPLATES||!1,be=G.SAFE_FOR_XML!==!1,Se=G.WHOLE_DOCUMENT||!1,Ue=G.RETURN_DOM||!1,Be=G.RETURN_DOM_FRAGMENT||!1,Ie=G.RETURN_TRUSTED_TYPE||!1,Te=G.FORCE_BODY||!1,Ke=G.SANITIZE_DOM!==!1,lt=G.SANITIZE_NAMED_PROPS||!1,Dt=G.KEEP_CONTENT!==!1,Ht=G.IN_PLACE||!1,$=G.ALLOWED_URI_REGEXP||_I,Lt=G.NAMESPACE||ln,fe=G.CUSTOM_ELEMENT_HANDLING||{},G.CUSTOM_ELEMENT_HANDLING&&vs(G.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(fe.tagNameCheck=G.CUSTOM_ELEMENT_HANDLING.tagNameCheck),G.CUSTOM_ELEMENT_HANDLING&&vs(G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(fe.attributeNameCheck=G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),G.CUSTOM_ELEMENT_HANDLING&&typeof G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(oe=!1),Be&&(Ue=!0),pe&&(V=$t({},I$),I=[],pe.html===!0&&($t(V,M$),$t(I,N$)),pe.svg===!0&&($t(V,G0),$t(I,X0),$t(I,Kp)),pe.svgFilters===!0&&($t(V,Y0),$t(I,X0),$t(I,Kp)),pe.mathMl===!0&&($t(V,K0),$t(I,L$),$t(I,Kp))),G.ADD_TAGS&&(V===U&&(V=Va(V)),$t(V,G.ADD_TAGS,bt)),G.ADD_ATTR&&(I===te&&(I=Va(I)),$t(I,G.ADD_ATTR,bt)),G.ADD_URI_SAFE_ATTR&&$t(Wt,G.ADD_URI_SAFE_ATTR,bt),G.FORBID_CONTENTS&&(Ee===Le&&(Ee=Va(Ee)),$t(Ee,G.FORBID_CONTENTS,bt)),Dt&&(V["#text"]=!0),Se&&$t(V,["html","head","body"]),V.table&&($t(V,["tbody"]),delete ne.tbody),G.TRUSTED_TYPES_POLICY){if(typeof G.TRUSTED_TYPES_POLICY.createHTML!="function")throw od('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof G.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw od('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=G.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Ooe(h,o)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));Sr&&Sr(G),On=G}},ki=$t({},["mi","mo","mn","ms","mtext"]),ri=$t({},["foreignobject","annotation-xml"]),Mi=$t({},["title","style","font","a","script"]),bs=$t({},[...G0,...Y0,...voe]),oi=$t({},[...K0,...boe]),Ii=function(G){let me=S(G);(!me||!me.tagName)&&(me={namespaceURI:Lt,tagName:"template"});const ke=$g(G.tagName),st=$g(me.tagName);return xn[G.namespaceURI]?G.namespaceURI===vn?me.namespaceURI===ln?ke==="svg":me.namespaceURI===Kt?ke==="svg"&&(st==="annotation-xml"||ki[st]):!!bs[ke]:G.namespaceURI===Kt?me.namespaceURI===ln?ke==="math":me.namespaceURI===vn?ke==="math"&&ri[st]:!!oi[ke]:G.namespaceURI===ln?me.namespaceURI===vn&&!ri[st]||me.namespaceURI===Kt&&!ki[st]?!1:!oi[ke]&&(Mi[ke]||!bs[ke]):!!(ht==="application/xhtml+xml"&&xn[G.namespaceURI]):!1},Bn=function(G){nd(t.removed,{element:G});try{S(G).removeChild(G)}catch{w(G)}},ii=function(G,me){try{nd(t.removed,{attribute:me.getAttributeNode(G),from:me})}catch{nd(t.removed,{attribute:null,from:me})}if(me.removeAttribute(G),G==="is"&&!I[G])if(Ue||Be)try{Bn(me)}catch{}else try{me.setAttribute(G,"")}catch{}},ys=function(G){let me=null,ke=null;if(Te)G="<remove></remove>"+G;else{const ft=k$(G,/^[\r\n\t ]+/);ke=ft&&ft[0]}ht==="application/xhtml+xml"&&Lt===ln&&(G='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+G+"</body></html>");const st=C?C.createHTML(G):G;if(Lt===ln)try{me=new p().parseFromString(st,ht)}catch{}if(!me||!me.documentElement){me=O.createDocument(Lt,"template",null);try{me.documentElement.innerHTML=tn?E:st}catch{}}const bn=me.body||me.documentElement;return G&&ke&&bn.insertBefore(n.createTextNode(ke),bn.childNodes[0]||null),Lt===ln?M.call(me,Se?"html":"body")[0]:Se?me.documentElement:bn},xs=function(G){return T.call(G.ownerDocument||G,G,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},D=function(G){return G instanceof f&&(typeof G.nodeName!="string"||typeof G.textContent!="string"||typeof G.removeChild!="function"||!(G.attributes instanceof u)||typeof G.removeAttribute!="function"||typeof G.setAttribute!="function"||typeof G.namespaceURI!="string"||typeof G.insertBefore!="function"||typeof G.hasChildNodes!="function")},re=function(G){return typeof a=="function"&&G instanceof a},he=function(G,me,ke){F[G]&&Yp(F[G],st=>{st.call(t,me,ke,On)})},Pe=function(G){let me=null;if(he("beforeSanitizeElements",G,null),D(G))return Bn(G),!0;const ke=bt(G.nodeName);if(he("uponSanitizeElement",G,{tagName:ke,allowedTags:V}),G.hasChildNodes()&&!re(G.firstElementChild)&&gr(/<[/\w]/g,G.innerHTML)&&gr(/<[/\w]/g,G.textContent)||G.nodeType===sd.progressingInstruction||be&&G.nodeType===sd.comment&&gr(/<[/\w]/g,G.data))return Bn(G),!0;if(!V[ke]||ne[ke]){if(!ne[ke]&&qe(ke)&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,ke)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ke)))return!1;if(Dt&&!Ee[ke]){const st=S(G)||G.parentNode,bn=_(G)||G.childNodes;if(bn&&st){const ft=bn.length;for(let nr=ft-1;nr>=0;--nr){const vo=v(bn[nr],!0);vo.__removalCount=(G.__removalCount||0)+1,st.insertBefore(vo,y(G))}}}return Bn(G),!0}return G instanceof l&&!Ii(G)||(ke==="noscript"||ke==="noembed"||ke==="noframes")&&gr(/<\/no(script|embed|frames)/i,G.innerHTML)?(Bn(G),!0):(K&&G.nodeType===sd.text&&(me=G.textContent,Yp([z,X,ee],st=>{me=rd(me,st," ")}),G.textContent!==me&&(nd(t.removed,{element:G.cloneNode()}),G.textContent=me)),he("afterSanitizeElements",G,null),!1)},He=function(G,me,ke){if(Ke&&(me==="id"||me==="name")&&(ke in n||ke in Fo))return!1;if(!(oe&&!ue[me]&&gr(H,me))){if(!(ie&&gr(Q,me))){if(!I[me]||ue[me]){if(!(qe(G)&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,G)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(G))&&(fe.attributeNameCheck instanceof RegExp&&gr(fe.attributeNameCheck,me)||fe.attributeNameCheck instanceof Function&&fe.attributeNameCheck(me))||me==="is"&&fe.allowCustomizedBuiltInElements&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,ke)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ke))))return!1}else if(!Wt[me]){if(!gr($,rd(ke,J,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&G!=="script"&&hoe(ke,"data:")===0&&Ge[G])){if(!(le&&!gr(Y,rd(ke,J,"")))){if(ke)return!1}}}}}}return!0},qe=function(G){return G!=="annotation-xml"&&k$(G,W)},ze=function(G){he("beforeSanitizeAttributes",G,null);const{attributes:me}=G;if(!me)return;const ke={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I};let st=me.length;for(;st--;){const bn=me[st],{name:ft,namespaceURI:nr,value:vo}=bn,wa=bt(ft);let Vn=ft==="value"?vo:poe(vo);if(ke.attrName=wa,ke.attrValue=Vn,ke.keepAttr=!0,ke.forceKeepAttr=void 0,he("uponSanitizeAttribute",G,ke),Vn=ke.attrValue,be&&gr(/((--!?|])>)|<\/(style|title)/i,Vn)){ii(ft,G);continue}if(ke.forceKeepAttr||(ii(ft,G),!ke.keepAttr))continue;if(!ye&&gr(/\/>/i,Vn)){ii(ft,G);continue}K&&Yp([z,X,ee],Pu=>{Vn=rd(Vn,Pu," ")});const Ru=bt(G.nodeName);if(He(Ru,wa,Vn)){if(lt&&(wa==="id"||wa==="name")&&(ii(ft,G),Vn=It+Vn),C&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!nr)switch(h.getAttributeType(Ru,wa)){case"TrustedHTML":{Vn=C.createHTML(Vn);break}case"TrustedScriptURL":{Vn=C.createScriptURL(Vn);break}}try{nr?G.setAttributeNS(nr,ft,Vn):G.setAttribute(ft,Vn),D(G)?Bn(G):A$(t.removed)}catch{}}}he("afterSanitizeAttributes",G,null)},Fe=function Ae(G){let me=null;const ke=xs(G);for(he("beforeSanitizeShadowDOM",G,null);me=ke.nextNode();)he("uponSanitizeShadowNode",me,null),!Pe(me)&&(me.content instanceof i&&Ae(me.content),ze(me));he("afterSanitizeShadowDOM",G,null)};return t.sanitize=function(Ae){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,ke=null,st=null,bn=null;if(tn=!Ae,tn&&(Ae="<!-->"),typeof Ae!="string"&&!re(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw od("dirty is not a string, aborting")}else throw od("toString is not a function");if(!t.isSupported)return Ae;if(Oe||jo(G),t.removed=[],typeof Ae=="string"&&(Ht=!1),Ht){if(Ae.nodeName){const vo=bt(Ae.nodeName);if(!V[vo]||ne[vo])throw od("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof a)me=ys("<!---->"),ke=me.ownerDocument.importNode(Ae,!0),ke.nodeType===sd.element&&ke.nodeName==="BODY"||ke.nodeName==="HTML"?me=ke:me.appendChild(ke);else{if(!Ue&&!K&&!Se&&Ae.indexOf("<")===-1)return C&&Ie?C.createHTML(Ae):Ae;if(me=ys(Ae),!me)return Ue?null:Ie?E:""}me&&Te&&Bn(me.firstChild);const ft=xs(Ht?Ae:me);for(;st=ft.nextNode();)Pe(st)||(st.content instanceof i&&Fe(st.content),ze(st));if(Ht)return Ae;if(Ue){if(Be)for(bn=N.call(me.ownerDocument);me.firstChild;)bn.appendChild(me.firstChild);else bn=me;return(I.shadowroot||I.shadowrootmode)&&(bn=A.call(r,bn,!0)),bn}let nr=Se?me.outerHTML:me.innerHTML;return Se&&V["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&gr(SI,me.ownerDocument.doctype.name)&&(nr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
|
|
326
|
-
`+nr),K&&Yp([z,X,ee],vo=>{nr=rd(nr,vo," ")}),C&&Ie?C.createHTML(nr):nr},t.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jo(Ae),Oe=!0},t.clearConfig=function(){On=null,Oe=!1},t.isValidAttribute=function(Ae,G,me){On||jo({});const ke=bt(Ae),st=bt(G);return He(ke,st,me)},t.addHook=function(Ae,G){typeof G=="function"&&(F[Ae]=F[Ae]||[],nd(F[Ae],G))},t.removeHook=function(Ae){if(F[Ae])return A$(F[Ae])},t.removeHooks=function(Ae){F[Ae]&&(F[Ae]=[])},t.removeAllHooks=function(){F={}},t}var j$=CI();function EI({card:e,isLoading:t}){var f,p;const n=(e==null?void 0:e.data)||[],{keys:r}=lr(n),o=$e(h=>h.selectedSheetId),i=$e(h=>h.isVisualEditing),s=(p=(f=e==null?void 0:e.preferences)==null?void 0:f.textVisualOptions)==null?void 0:p.isDynamicText,{setCardDescription:a}=wr(),{setCard:l}=Zm();function c(){var w;if(t)return R.jsx(Tm,{className:"h-7 animate-pulse bg-muted"});const h=(w=n==null?void 0:n[0])==null?void 0:w[r[0]],b=j$.sanitize(h),v=R.jsx("div",{dangerouslySetInnerHTML:{__html:b}});return R.jsx("div",{className:"hover:cursor-text",onMouseDown:y=>y.stopPropagation(),children:v})}function u(){return R.jsx("div",{onMouseDown:h=>h.stopPropagation(),children:R.jsx(xi,{type:"textarea",className:"w-full",text:(e==null?void 0:e.description)||"Double click to add description",onSave:h=>{i===!1&&a(o,e.id,h),i===!0&&l({...e,description:h})},children:R.jsx("div",{dangerouslySetInnerHTML:{__html:j$.sanitize((e==null?void 0:e.description)||"")}})})})}return R.jsxs("div",{className:"break-words p-6",children:[!s&&u(),s===!0&&c()]})}const b1="horizontal",$oe=["horizontal","vertical"],RI=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=b1,...o}=e,i=PI(r)?r:b1,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(Qe.div,de({"data-orientation":i},a,o,{ref:t}))});RI.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!PI(r)?new Error(Toe(o,n)):null}};function Toe(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
|
|
327
|
-
- horizontal
|
|
328
|
-
- vertical
|
|
329
|
-
|
|
330
|
-
Defaulting to \`${b1}\`.`}function PI(e){return $oe.includes(e)}const OI=RI,ah=L.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>R.jsx(OI,{ref:o,decorative:n,orientation:t,className:_e("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ah.displayName=OI.displayName;function Doe(){var p,h;const e=$e(b=>b.themeStyle),t=$e(b=>b.filterValues),n=$e(b=>b.dashboard.filters),r=$e(b=>b.filteringCards),{removeFilterValue:o,removeFilteringCard:i,setFilterValues:s,setFilteringCards:a}=wr();if(!t||t.length===0)return null;const l=t.map(b=>{const v=n==null?void 0:n.find(w=>w.id===b.filterId);return{filterId:b.filterId,name:(v==null?void 0:v.title)||b.name,values:b.values}});function c(b){return b instanceof Date?b.toLocaleDateString():b}function u(b){const v=r==null?void 0:r.find(w=>b.filterId.startsWith(w.id));v&&i(v),o(b.filterId)}function f(b){var v,w;return R.jsxs("div",{className:"space-y-2",children:[R.jsxs("div",{style:{borderRadius:(w=(v=e==null?void 0:e.chart)==null?void 0:v.options)==null?void 0:w.borderRadius},className:"flex w-fit items-center gap-2 bg-muted-foreground px-2 py-1 font-semibold text-muted",children:[R.jsx("span",{className:"break-words",children:b.name}),R.jsx(Jf,{onClick:()=>u(b),className:"size-3.5 text-muted hover:cursor-pointer hover:text-background"})]}),R.jsx("div",{className:"flex flex-wrap gap-1",children:b.values.map(y=>{var _,S;return R.jsx("span",{style:{borderRadius:(S=(_=e==null?void 0:e.chart)==null?void 0:_.options)==null?void 0:S.borderRadius},className:"inline-block",children:c(y)},y.toString())})})]},b.name)}return R.jsxs(iv,{openDelay:100,children:[R.jsx(sv,{children:R.jsx(Hk,{className:"z-100 size-3.5 text-muted-foreground/40"})}),R.jsxs(oh,{style:{borderRadius:(h=(p=e==null?void 0:e.chart)==null?void 0:p.options)==null?void 0:h.borderRadius},className:"relative flex min-h-fit w-[300px] flex-col px-0 text-xs",align:"start",children:[R.jsx(Vk,{onClick:()=>{a([]),s([])},className:"absolute right-4 size-3.5 text-muted-foreground/40 hover:cursor-pointer"}),R.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:l==null?void 0:l.map(b=>R.jsxs("div",{className:"px-5",children:[f(b),R.jsx(ah,{className:"my-2"})]}))})]})]})}function Aoe({frame:e,footer:t,className:n,...r}){var $,V,U,I,te,fe;const{customCards:o}=ba(),i=m.useRef(null),s=$e(ne=>ne.themeStyle),a=$e(ne=>ne.selectedSheetId),l=$e(ne=>ne.selectedFrameId),c=$e(ne=>ne.isDashboardEditing),u=$e(ne=>ne.dashboard.filters);$e(ne=>ne.filteringCards);const f=u==null?void 0:u.find(ne=>ne.id===e.filterId);$e(ne=>ne.filterValues);const{updateFrame:p}=wr(),h=e.cards.find(ne=>ne.id===e.activeCardId);nte(e,i);const{isError:b,isLoading:v,isFetching:w,cfg:y,visualKey:_,handleDatapointClick:S}=O_(h),{setCardTitle:C,setCardDescription:E,setSelectedFrameId:O,updateFilter:T,getCardFrame:N}=wr(),{setSelectedConnectionId:M,setSelectedDatabaseName:A,setSelectedSchemaName:F,setSelectedTableName:z}=Zm();function X(ne){ne.stopPropagation(),O(e.id),h!=null&&h.connectionId&&M(h==null?void 0:h.connectionId),h!=null&&h.lastSelectedDatabase&&A(h==null?void 0:h.lastSelectedDatabase),h!=null&&h.lastSelectedSchema&&F(h==null?void 0:h.lastSelectedSchema),h!=null&&h.lastSelectedTable&&z(h==null?void 0:h.lastSelectedTable)}function ee(){if(o&&o.length>0){const ne=o.find(ue=>ue.cardId===h.id);if(ne&&ne.replaceDefault){const ue=ne.content;if(ue)return R.jsx(ue,{card:h})}}return h.type==="kpi"?R.jsx(pM,{isLoading:v||w,card:h}):h.type==="text"?R.jsx(EI,{isLoading:v||w,card:h}):W}function H(){return["{{ filters | where }}","{{ filters | and }}"].some(ue=>{var ie;return(ie=h.sql)==null?void 0:ie.includes(ue)})?R.jsx(Doe,{}):null}function Q(){if(b)return R.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(h.type==="table"&&h.data&&h.data.length>0)return R.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:R.jsx(yI,{card:h,data:h.data})});if(o&&o.length>0){const ne=o.find(ue=>ue.cardId===h.id);if(ne&&ne.content){const ue=ne.content;return R.jsx(ue,{card:h})}}if(y)return R.jsx(l_,{cfg:y,onDatapointClick:S},_)}function Y(){if(o&&o.length>0){const ne=o.find(ue=>ue.cardId===h.id);if(ne&&ne.footer){const ue=ne.footer;if(ue)return R.jsx(ue,{card:h})}}return t||null}if(!h.id)return null;function J(){var ne,ue;return R.jsx(yw,{value:e.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:ie=>{const oe={...e,activeCardId:ie};p(a,oe)},children:R.jsx(Mm,{style:{borderRadius:(ue=(ne=s==null?void 0:s.chart)==null?void 0:ne.options)==null?void 0:ue.borderRadius},className:"flex-end flex-wrap items-center",children:e.cards.map(ie=>{var oe,le;return R.jsx(Im,{style:{borderRadius:(le=(oe=s==null?void 0:s.chart)==null?void 0:oe.options)==null?void 0:le.borderRadius},value:ie.id,children:ie.tabTitle||ie.title},ie.id)})})})}const W=R.jsxs(R.Fragment,{children:[R.jsx(Dm,{children:R.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[R.jsxs("div",{children:[R.jsxs("div",{role:"carc-title-container",className:"flex items-center gap-3",children:[R.jsx(xi,{text:h.title,onSave:ne=>C(a,h.id,ne),children:R.jsx(Wf,{className:_e("text-base",{}),children:h.title})}),(c||h.info)&&R.jsx(pte,{card:h}),h.refreshInterval&&R.jsxs(dM,{children:[R.jsx(fM,{className:"pr-1",children:R.jsx("div",{className:_e("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":v||w})})}),R.jsx(E_,{side:"right",align:"center",children:R.jsx("p",{className:"text-xs",children:`Realtime (${h==null?void 0:h.refreshInterval})`})})]}),H()]}),R.jsx("div",{role:"card-description-container",children:R.jsx(xi,{text:(h==null?void 0:h.description)||"",onSave:ne=>E(a,h.id,ne),children:R.jsxs(hw,{className:_e("",{}),children:[" ",h.description]})})})]}),R.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.cards.length>1&&J(),R.jsx("div",{children:f&&R.jsxs("div",{style:{borderRadius:(V=($=s==null?void 0:s.chart)==null?void 0:$.options)==null?void 0:V.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[R.jsx(xi,{className:"my-1",text:f.title||f.column,onSave:ne=>T({...f,title:ne}),children:R.jsx(Fn,{className:"px-3",children:f.title})}),yS(f)]})})]})]})}),R.jsx(Am,{className:"relative flex grow flex-col",children:Q()}),R.jsx(pw,{children:Y()})]});return R.jsxs(fw,{tabIndex:-1,ref:i,role:"card-frame",onClick:X,style:{borderRadius:(I=(U=s==null?void 0:s.chart)==null?void 0:U.options)==null?void 0:I.borderRadius,fontFamily:(fe=(te=s==null?void 0:s.chart)==null?void 0:te.font)==null?void 0:fe.family},className:_e("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":l===e.id&&c,"animate-pulse":v},s==null?void 0:s.dashboardCard,n,"semaphor-card-frame"),...r,children:[R.jsx(FJ,{frame:e}),ee()]})}function Nt(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 go(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function yr(e,t){const n=Nt(e);return isNaN(t)?go(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function ei(e,t){const n=Nt(e);if(isNaN(t))return go(e,NaN);if(!t)return n;const r=n.getDate(),o=go(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 Q_=6048e5,koe=864e5;let Moe={};function lh(){return Moe}function Ri(e,t){var a,l,c,u;const n=lh(),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??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Nt(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 wl(e){return Ri(e,{weekStartsOn:1})}function $I(e){const t=Nt(e),n=t.getFullYear(),r=go(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=wl(r),i=go(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=wl(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function du(e){const t=Nt(e);return t.setHours(0,0,0,0),t}function am(e){const t=Nt(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 yi(e,t){const n=du(e),r=du(t),o=+n-am(n),i=+r-am(r);return Math.round((o-i)/koe)}function Ioe(e){const t=$I(e),n=go(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),wl(n)}function y1(e,t){const n=t*7;return yr(e,n)}function Noe(e,t){return ei(e,t*12)}function Loe(e){let t;return e.forEach(function(n){const r=Nt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function Foe(e){let t;return e.forEach(n=>{const r=Nt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function jr(e,t){const n=du(e),r=du(t);return+n==+r}function J_(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function joe(e){if(!J_(e)&&typeof e!="number")return!1;const t=Nt(e);return!isNaN(Number(t))}function nf(e,t){const n=Nt(e),r=Nt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function zoe(e,t,n){const r=Ri(e,n),o=Ri(t,n),i=+r-am(r),s=+o-am(o);return Math.round((i-s)/Q_)}function Z_(e){const t=Nt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function zr(e){const t=Nt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function TI(e){const t=Nt(e),n=go(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function eS(e,t){var a,l,c,u;const n=lh(),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??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Nt(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 DI(e){return eS(e,{weekStartsOn:1})}const Boe={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"}},Voe=(e,t,n)=>{let r;const o=Boe[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 Q0(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Hoe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Woe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uoe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qoe={date:Q0({formats:Hoe,defaultWidth:"full"}),time:Q0({formats:Woe,defaultWidth:"full"}),dateTime:Q0({formats:Uoe,defaultWidth:"full"})},Goe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Yoe=(e,t,n,r)=>Goe[e];function ad(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 Koe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xoe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qoe={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"]},Joe={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"]},Zoe={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"}},eie={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"}},tie=(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"},nie={ordinalNumber:tie,era:ad({values:Koe,defaultWidth:"wide"}),quarter:ad({values:Xoe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ad({values:Qoe,defaultWidth:"wide"}),day:ad({values:Joe,defaultWidth:"wide"}),dayPeriod:ad({values:Zoe,defaultWidth:"wide",formattingValues:eie,defaultFormattingWidth:"wide"})};function ld(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)?oie(a,f=>f.test(s)):rie(a,f=>f.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function rie(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function oie(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function iie(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 sie=/^(\d+)(th|st|nd|rd)?/i,aie=/\d+/i,lie={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},cie={any:[/^b/i,/^(a|c)/i]},uie={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},die={any:[/1/i,/2/i,/3/i,/4/i]},fie={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},hie={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]},pie={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},gie={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]},mie={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},vie={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}},bie={ordinalNumber:iie({matchPattern:sie,parsePattern:aie,valueCallback:e=>parseInt(e,10)}),era:ld({matchPatterns:lie,defaultMatchWidth:"wide",parsePatterns:cie,defaultParseWidth:"any"}),quarter:ld({matchPatterns:uie,defaultMatchWidth:"wide",parsePatterns:die,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ld({matchPatterns:fie,defaultMatchWidth:"wide",parsePatterns:hie,defaultParseWidth:"any"}),day:ld({matchPatterns:pie,defaultMatchWidth:"wide",parsePatterns:gie,defaultParseWidth:"any"}),dayPeriod:ld({matchPatterns:mie,defaultMatchWidth:"any",parsePatterns:vie,defaultParseWidth:"any"})},AI={code:"en-US",formatDistance:Voe,formatLong:qoe,formatRelative:Yoe,localize:nie,match:bie,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yie(e){const t=Nt(e);return yi(t,TI(t))+1}function kI(e){const t=Nt(e),n=+wl(t)-+Ioe(t);return Math.round(n/Q_)+1}function MI(e,t){var u,f,p,h;const n=Nt(e),r=n.getFullYear(),o=lh(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(p=o.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=go(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=Ri(s,t),l=go(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Ri(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function xie(e,t){var a,l,c,u;const n=lh(),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??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=MI(e,t),i=go(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Ri(i,t)}function II(e,t){const n=Nt(e),r=+Ri(n,t)-+xie(n,t);return Math.round(r/Q_)+1}function Jt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ms={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Jt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Jt(n+1,2)},d(e,t){return Jt(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 Jt(e.getHours()%12||12,t.length)},H(e,t){return Jt(e.getHours(),t.length)},m(e,t){return Jt(e.getMinutes(),t.length)},s(e,t){return Jt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Jt(o,t.length)}},lc={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},z$={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 Ms.y(e,t)},Y:function(e,t,n,r){const o=MI(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return Jt(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Jt(i,t.length)},R:function(e,t){const n=$I(e);return Jt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Jt(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 Jt(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 Jt(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 Ms.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 Jt(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=II(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Jt(o,t.length)},I:function(e,t,n){const r=kI(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Jt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ms.d(e,t)},D:function(e,t,n){const r=yie(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Jt(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 Jt(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 Jt(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 Jt(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=lc.noon:r===0?o=lc.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=lc.evening:r>=12?o=lc.afternoon:r>=4?o=lc.morning:o=lc.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 Ms.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ms.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Jt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Jt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ms.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ms.s(e,t)},S:function(e,t){return Ms.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return V$(r);case"XXXX":case"XX":return Ha(r);case"XXXXX":case"XXX":default:return Ha(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return V$(r);case"xxxx":case"xx":return Ha(r);case"xxxxx":case"xxx":default:return Ha(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+B$(r,":");case"OOOO":default:return"GMT"+Ha(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+B$(r,":");case"zzzz":default:return"GMT"+Ha(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Jt(r,t.length)},T:function(e,t,n){const r=e.getTime();return Jt(r,t.length)}};function B$(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+Jt(i,2)}function V$(e,t){return e%60===0?(e>0?"-":"+")+Jt(Math.abs(e)/60,2):Ha(e,t)}function Ha(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Jt(Math.trunc(r/60),2),i=Jt(r%60,2);return n+o+t+i}const H$=(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"})}},NI=(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"})}},wie=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return H$(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}}",H$(r,t)).replace("{{time}}",NI(o,t))},_ie={p:NI,P:wie},Sie=/^D+$/,Cie=/^Y+$/,Eie=["D","DD","YY","YYYY"];function Rie(e){return Sie.test(e)}function Pie(e){return Cie.test(e)}function Oie(e,t,n){const r=$ie(e,t,n);if(console.warn(r),Eie.includes(e))throw new RangeError(r)}function $ie(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 Tie=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Die=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Aie=/^'([^]*?)'?$/,kie=/''/g,Mie=/[a-zA-Z]/;function _i(e,t,n){var u,f,p,h,b,v,w,y;const r=lh(),o=(n==null?void 0:n.locale)??r.locale??AI,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((v=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((y=(w=r.locale)==null?void 0:w.options)==null?void 0:y.weekStartsOn)??0,a=Nt(e);if(!joe(a))throw new RangeError("Invalid time value");let l=t.match(Die).map(_=>{const S=_[0];if(S==="p"||S==="P"){const C=_ie[S];return C(_,o.formatLong)}return _}).join("").match(Tie).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const S=_[0];if(S==="'")return{isToken:!1,value:Iie(_)};if(z$[S])return{isToken:!0,value:_};if(S.match(Mie))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:_}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(_=>{if(!_.isToken)return _.value;const S=_.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Pie(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Rie(S))&&Oie(S,t,String(e));const C=z$[S[0]];return C(a,S,o.localize,c)}).join("")}function Iie(e){const t=e.match(Aie);return t?t[1].replace(kie,"'"):e}function Nie(e){const t=Nt(e),n=t.getFullYear(),r=t.getMonth(),o=go(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function Lie(e){return Math.trunc(+Nt(e)/1e3)}function Fie(e){const t=Nt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function jie(e,t){return zoe(Fie(e),zr(e),t)+1}function x1(e,t){const n=Nt(e),r=Nt(t);return n.getTime()>r.getTime()}function LI(e,t){const n=Nt(e),r=Nt(t);return+n<+r}function tS(e,t){const n=Nt(e),r=Nt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function zie(e,t){const n=Nt(e),r=Nt(t);return n.getFullYear()===r.getFullYear()}function J0(e,t){return yr(e,-t)}function Z0(e,t){const n=Nt(e),r=n.getFullYear(),o=n.getDate(),i=go(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=Nie(i);return n.setMonth(t,Math.min(o,s)),n}function W$(e,t){const n=Nt(e);return isNaN(+n)?go(e,NaN):(n.setFullYear(t),n)}var rt=function(){return rt=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},rt.apply(this,arguments)};function Bie(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 FI(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 w1={exports:{}},cd={};/**
|
|
331
|
-
* @license React
|
|
332
|
-
* react-jsx-runtime.development.js
|
|
333
|
-
*
|
|
334
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
335
|
-
*
|
|
336
|
-
* This source code is licensed under the MIT license found in the
|
|
337
|
-
* LICENSE file in the root directory of this source tree.
|
|
338
|
-
*/var U$;function Vie(){return U$||(U$=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"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),b=Symbol.iterator,v="@@iterator";function w(D){if(D===null||typeof D!="object")return null;var re=b&&D[b]||D[v];return typeof re=="function"?re:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(D){{for(var re=arguments.length,he=new Array(re>1?re-1:0),Pe=1;Pe<re;Pe++)he[Pe-1]=arguments[Pe];S("error",D,he)}}function S(D,re,he){{var Pe=y.ReactDebugCurrentFrame,He=Pe.getStackAddendum();He!==""&&(re+="%s",he=he.concat([He]));var qe=he.map(function(ze){return String(ze)});qe.unshift("Warning: "+re),Function.prototype.apply.call(console[D],console,qe)}}var C=!1,E=!1,O=!1,T=!1,N=!1,M;M=Symbol.for("react.module.reference");function A(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===i||N||D===o||D===c||D===u||T||D===h||C||E||O||typeof D=="object"&&D!==null&&(D.$$typeof===p||D.$$typeof===f||D.$$typeof===s||D.$$typeof===a||D.$$typeof===l||D.$$typeof===M||D.getModuleId!==void 0))}function F(D,re,he){var Pe=D.displayName;if(Pe)return Pe;var He=re.displayName||re.name||"";return He!==""?he+"("+He+")":he}function z(D){return D.displayName||"Context"}function X(D){if(D==null)return null;if(typeof D.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case a:var re=D;return z(re)+".Consumer";case s:var he=D;return z(he._context)+".Provider";case l:return F(D,D.render,"ForwardRef");case f:var Pe=D.displayName||null;return Pe!==null?Pe:X(D.type)||"Memo";case p:{var He=D,qe=He._payload,ze=He._init;try{return X(ze(qe))}catch{return null}}}return null}var ee=Object.assign,H=0,Q,Y,J,W,$,V,U;function I(){}I.__reactDisabledLog=!0;function te(){{if(H===0){Q=console.log,Y=console.info,J=console.warn,W=console.error,$=console.group,V=console.groupCollapsed,U=console.groupEnd;var D={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}H++}}function fe(){{if(H--,H===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},D,{value:Q}),info:ee({},D,{value:Y}),warn:ee({},D,{value:J}),error:ee({},D,{value:W}),group:ee({},D,{value:$}),groupCollapsed:ee({},D,{value:V}),groupEnd:ee({},D,{value:U})})}H<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=y.ReactCurrentDispatcher,ue;function ie(D,re,he){{if(ue===void 0)try{throw Error()}catch(He){var Pe=He.stack.trim().match(/\n( *(at )?)/);ue=Pe&&Pe[1]||""}return`
|
|
339
|
-
`+ue+D}}var oe=!1,le;{var ye=typeof WeakMap=="function"?WeakMap:Map;le=new ye}function K(D,re){if(!D||oe)return"";{var he=le.get(D);if(he!==void 0)return he}var Pe;oe=!0;var He=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qe;qe=ne.current,ne.current=null,te();try{if(re){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(ft){Pe=ft}Reflect.construct(D,[],ze)}else{try{ze.call()}catch(ft){Pe=ft}D.call(ze.prototype)}}else{try{throw Error()}catch(ft){Pe=ft}D()}}catch(ft){if(ft&&Pe&&typeof ft.stack=="string"){for(var Fe=ft.stack.split(`
|
|
340
|
-
`),Ae=Pe.stack.split(`
|
|
341
|
-
`),G=Fe.length-1,me=Ae.length-1;G>=1&&me>=0&&Fe[G]!==Ae[me];)me--;for(;G>=1&&me>=0;G--,me--)if(Fe[G]!==Ae[me]){if(G!==1||me!==1)do if(G--,me--,me<0||Fe[G]!==Ae[me]){var ke=`
|
|
342
|
-
`+Fe[G].replace(" at new "," at ");return D.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",D.displayName)),typeof D=="function"&&le.set(D,ke),ke}while(G>=1&&me>=0);break}}}finally{oe=!1,ne.current=qe,fe(),Error.prepareStackTrace=He}var st=D?D.displayName||D.name:"",bn=st?ie(st):"";return typeof D=="function"&&le.set(D,bn),bn}function be(D,re,he){return K(D,!1)}function Se(D){var re=D.prototype;return!!(re&&re.isReactComponent)}function Oe(D,re,he){if(D==null)return"";if(typeof D=="function")return K(D,Se(D));if(typeof D=="string")return ie(D);switch(D){case c:return ie("Suspense");case u:return ie("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return be(D.render);case f:return Oe(D.type,re,he);case p:{var Pe=D,He=Pe._payload,qe=Pe._init;try{return Oe(qe(He),re,he)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Ue={},Be=y.ReactDebugCurrentFrame;function Ie(D){if(D){var re=D._owner,he=Oe(D.type,D._source,re?re.type:null);Be.setExtraStackFrame(he)}else Be.setExtraStackFrame(null)}function Ke(D,re,he,Pe,He){{var qe=Function.call.bind(Te);for(var ze in D)if(qe(D,ze)){var Fe=void 0;try{if(typeof D[ze]!="function"){var Ae=Error((Pe||"React class")+": "+he+" type `"+ze+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[ze]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ae.name="Invariant Violation",Ae}Fe=D[ze](re,ze,Pe,he,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(G){Fe=G}Fe&&!(Fe instanceof Error)&&(Ie(He),_("%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).",Pe||"React class",he,ze,typeof Fe),Ie(null)),Fe instanceof Error&&!(Fe.message in Ue)&&(Ue[Fe.message]=!0,Ie(He),_("Failed %s type: %s",he,Fe.message),Ie(null))}}}var lt=Array.isArray;function It(D){return lt(D)}function Dt(D){{var re=typeof Symbol=="function"&&Symbol.toStringTag,he=re&&D[Symbol.toStringTag]||D.constructor.name||"Object";return he}}function Ht(D){try{return pe(D),!1}catch{return!0}}function pe(D){return""+D}function Ee(D){if(Ht(D))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dt(D)),pe(D)}var Le=y.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Ze,Wt,Zt;Zt={};function Kt(D){if(Te.call(D,"ref")){var re=Object.getOwnPropertyDescriptor(D,"ref").get;if(re&&re.isReactWarning)return!1}return D.ref!==void 0}function vn(D){if(Te.call(D,"key")){var re=Object.getOwnPropertyDescriptor(D,"key").get;if(re&&re.isReactWarning)return!1}return D.key!==void 0}function ln(D,re){if(typeof D.ref=="string"&&Le.current&&re&&Le.current.stateNode!==re){var he=X(Le.current.type);Zt[he]||(_('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',X(Le.current.type),D.ref),Zt[he]=!0)}}function Lt(D,re){{var he=function(){Ze||(Ze=!0,_("%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)",re))};he.isReactWarning=!0,Object.defineProperty(D,"key",{get:he,configurable:!0})}}function tn(D,re){{var he=function(){Wt||(Wt=!0,_("%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)",re))};he.isReactWarning=!0,Object.defineProperty(D,"ref",{get:he,configurable:!0})}}var xn=function(D,re,he,Pe,He,qe,ze){var Fe={$$typeof:t,type:D,key:re,ref:he,props:ze,_owner:qe};return Fe._store={},Object.defineProperty(Fe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Fe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Pe}),Object.defineProperty(Fe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:He}),Object.freeze&&(Object.freeze(Fe.props),Object.freeze(Fe)),Fe};function nt(D,re,he,Pe,He){{var qe,ze={},Fe=null,Ae=null;he!==void 0&&(Ee(he),Fe=""+he),vn(re)&&(Ee(re.key),Fe=""+re.key),Kt(re)&&(Ae=re.ref,ln(re,He));for(qe in re)Te.call(re,qe)&&!Ge.hasOwnProperty(qe)&&(ze[qe]=re[qe]);if(D&&D.defaultProps){var G=D.defaultProps;for(qe in G)ze[qe]===void 0&&(ze[qe]=G[qe])}if(Fe||Ae){var me=typeof D=="function"?D.displayName||D.name||"Unknown":D;Fe&&Lt(ze,me),Ae&&tn(ze,me)}return xn(D,Fe,Ae,He,Pe,Le.current,ze)}}var ht=y.ReactCurrentOwner,At=y.ReactDebugCurrentFrame;function Xt(D){if(D){var re=D._owner,he=Oe(D.type,D._source,re?re.type:null);At.setExtraStackFrame(he)}else At.setExtraStackFrame(null)}var bt;bt=!1;function On(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Fo(){{if(ht.current){var D=X(ht.current.type);if(D)return`
|
|
343
|
-
|
|
344
|
-
Check the render method of \``+D+"`."}return""}}function vs(D){{if(D!==void 0){var re=D.fileName.replace(/^.*[\\\/]/,""),he=D.lineNumber;return`
|
|
345
|
-
|
|
346
|
-
Check your code at `+re+":"+he+"."}return""}}var jo={};function ki(D){{var re=Fo();if(!re){var he=typeof D=="string"?D:D.displayName||D.name;he&&(re=`
|
|
347
|
-
|
|
348
|
-
Check the top-level render call using <`+he+">.")}return re}}function ri(D,re){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var he=ki(re);if(jo[he])return;jo[he]=!0;var Pe="";D&&D._owner&&D._owner!==ht.current&&(Pe=" It was passed a child from "+X(D._owner.type)+"."),Xt(D),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',he,Pe),Xt(null)}}function Mi(D,re){{if(typeof D!="object")return;if(It(D))for(var he=0;he<D.length;he++){var Pe=D[he];On(Pe)&&ri(Pe,re)}else if(On(D))D._store&&(D._store.validated=!0);else if(D){var He=w(D);if(typeof He=="function"&&He!==D.entries)for(var qe=He.call(D),ze;!(ze=qe.next()).done;)On(ze.value)&&ri(ze.value,re)}}}function bs(D){{var re=D.type;if(re==null||typeof re=="string")return;var he;if(typeof re=="function")he=re.propTypes;else if(typeof re=="object"&&(re.$$typeof===l||re.$$typeof===f))he=re.propTypes;else return;if(he){var Pe=X(re);Ke(he,D.props,"prop",Pe,D)}else if(re.PropTypes!==void 0&&!bt){bt=!0;var He=X(re);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof re.getDefaultProps=="function"&&!re.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function oi(D){{for(var re=Object.keys(D.props),he=0;he<re.length;he++){var Pe=re[he];if(Pe!=="children"&&Pe!=="key"){Xt(D),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Pe),Xt(null);break}}D.ref!==null&&(Xt(D),_("Invalid attribute `ref` supplied to `React.Fragment`."),Xt(null))}}function Ii(D,re,he,Pe,He,qe){{var ze=A(D);if(!ze){var Fe="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(Fe+=" 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 Ae=vs(He);Ae?Fe+=Ae:Fe+=Fo();var G;D===null?G="null":It(D)?G="array":D!==void 0&&D.$$typeof===t?(G="<"+(X(D.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):G=typeof D,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",G,Fe)}var me=nt(D,re,he,He,qe);if(me==null)return me;if(ze){var ke=re.children;if(ke!==void 0)if(Pe)if(It(ke)){for(var st=0;st<ke.length;st++)Mi(ke[st],D);Object.freeze&&Object.freeze(ke)}else _("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 Mi(ke,D)}return D===r?oi(me):bs(me),me}}function Bn(D,re,he){return Ii(D,re,he,!0)}function ii(D,re,he){return Ii(D,re,he,!1)}var ys=ii,xs=Bn;cd.Fragment=r,cd.jsx=ys,cd.jsxs=xs}()),cd}var ud={};/**
|
|
349
|
-
* @license React
|
|
350
|
-
* react-jsx-runtime.production.min.js
|
|
351
|
-
*
|
|
352
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
353
|
-
*
|
|
354
|
-
* This source code is licensed under the MIT license found in the
|
|
355
|
-
* LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/var q$;function Hie(){if(q$)return ud;q$=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,c){var u,f={},p=null,h=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:p,ref:h,props:f,_owner:o.current}}return ud.Fragment=n,ud.jsx=s,ud.jsxs=s,ud}process.env.NODE_ENV==="production"?w1.exports=Hie():w1.exports=Vie();var Ce=w1.exports;function ch(e){return e.mode==="multiple"}function uh(e){return e.mode==="range"}function vv(e){return e.mode==="single"}var Wie={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 Uie(e,t){return _i(e,"LLLL y",t)}function qie(e,t){return _i(e,"d",t)}function Gie(e,t){return _i(e,"LLLL",t)}function Yie(e){return"".concat(e)}function Kie(e,t){return _i(e,"cccccc",t)}function Xie(e,t){return _i(e,"yyyy",t)}var Qie=Object.freeze({__proto__:null,formatCaption:Uie,formatDay:qie,formatMonthCaption:Gie,formatWeekNumber:Yie,formatWeekdayName:Kie,formatYearCaption:Xie}),Jie=function(e,t,n){return _i(e,"do MMMM (EEEE)",n)},Zie=function(){return"Month: "},ese=function(){return"Go to next month"},tse=function(){return"Go to previous month"},nse=function(e,t){return _i(e,"cccc",t)},rse=function(e){return"Week n. ".concat(e)},ose=function(){return"Year: "},ise=Object.freeze({__proto__:null,labelDay:Jie,labelMonthDropdown:Zie,labelNext:ese,labelPrevious:tse,labelWeekNumber:rse,labelWeekday:nse,labelYearDropdown:ose});function sse(){var e="buttons",t=Wie,n=AI,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:Qie,labels:ise,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function ase(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=zr(r):t&&(i=new Date(t,0,1)),o?s=Z_(o):n&&(s=new Date(n,11,31)),{fromDate:i?du(i):void 0,toDate:s?du(s):void 0}}var jI=m.createContext(void 0);function lse(e){var t,n=e.initialProps,r=sse(),o=ase(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;(vv(n)||ch(n)||uh(n))&&(l=n.onSelect);var c=rt(rt(rt({},r),n),{captionLayout:a,classNames:rt(rt({},r.classNames),n.classNames),components:rt({},n.components),formatters:rt(rt({},r.formatters),n.formatters),fromDate:i,labels:rt(rt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:rt(rt({},r.modifiers),n.modifiers),modifiersClassNames:rt(rt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:rt(rt({},r.styles),n.styles),toDate:s});return Ce.jsx(jI.Provider,{value:c,children:e.children})}function an(){var e=m.useContext(jI);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function zI(e){var t=an(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return Ce.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 cse(e){return Ce.jsx("svg",rt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:Ce.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 BI(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=an(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:cse;return Ce.jsxs("div",{className:a,style:l,children:[Ce.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),Ce.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),Ce.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,Ce.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function use(e){var t,n=an(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return Ce.jsx(Ce.Fragment,{});if(!o)return Ce.jsx(Ce.Fragment,{});var f=[];if(zie(r,o))for(var p=zr(r),h=r.getMonth();h<=o.getMonth();h++)f.push(Z0(p,h));else for(var p=zr(new Date),h=0;h<=11;h++)f.push(Z0(p,h));var b=function(w){var y=Number(w.target.value),_=Z0(zr(e.displayMonth),y);e.onChange(_)},v=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:BI;return Ce.jsx(v,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:b,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(w){return Ce.jsx("option",{value:w.getMonth(),children:a(w,{locale:s})},w.getMonth())})})}function dse(e){var t,n=e.displayMonth,r=an(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,p=[];if(!o)return Ce.jsx(Ce.Fragment,{});if(!i)return Ce.jsx(Ce.Fragment,{});for(var h=o.getFullYear(),b=i.getFullYear(),v=h;v<=b;v++)p.push(W$(TI(new Date),v));var w=function(_){var S=W$(zr(n),Number(_.target.value));e.onChange(S)},y=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:BI;return Ce.jsx(y,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:w,value:n.getFullYear(),caption:u(n,{locale:s}),children:p.map(function(_){return Ce.jsx("option",{value:_.getFullYear(),children:u(_,{locale:s})},_.getFullYear())})})}function fse(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function hse(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&&nf(i,o)<0){var c=-1*(l-1);o=ei(i,c)}return s&&nf(o,s)<0&&(o=s),zr(o)}function pse(){var e=an(),t=hse(e),n=fse(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=zr(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function gse(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=zr(e),i=zr(ei(o,r)),s=nf(i,o),a=[],l=0;l<s;l++){var c=ei(o,l);a.push(c)}return n&&(a=a.reverse()),a}function mse(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=zr(e);if(!n)return ei(a,s);var l=nf(n,e);if(!(l<i))return ei(a,s)}}function vse(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=zr(e);if(!n)return ei(a,-s);var l=nf(a,n);if(!(l<=0))return ei(a,-s)}}var VI=m.createContext(void 0);function bse(e){var t=an(),n=pse(),r=n[0],o=n[1],i=gse(r,t),s=mse(r,t),a=vse(r,t),l=function(f){return i.some(function(p){return tS(f,p)})},c=function(f,p){l(f)||(p&&LI(f,p)?o(ei(f,1+t.numberOfMonths*-1)):o(f))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return Ce.jsx(VI.Provider,{value:u,children:e.children})}function dh(){var e=m.useContext(VI);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function G$(e){var t,n=an(),r=n.classNames,o=n.styles,i=n.components,s=dh().goToMonth,a=function(u){s(ei(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:zI,c=Ce.jsx(l,{id:e.id,displayMonth:e.displayMonth});return Ce.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[Ce.jsx("div",{className:r.vhidden,children:c}),Ce.jsx(use,{onChange:a,displayMonth:e.displayMonth}),Ce.jsx(dse,{onChange:a,displayMonth:e.displayMonth})]})}function yse(e){return Ce.jsx("svg",rt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Ce.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 xse(e){return Ce.jsx("svg",rt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Ce.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 lm=m.forwardRef(function(e,t){var n=an(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=rt(rt({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),Ce.jsx("button",rt({},e,{ref:t,type:"button",className:s,style:a}))});function wse(e){var t,n,r=an(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return Ce.jsx(Ce.Fragment,{});var p=c(e.previousMonth,{locale:i}),h=[s.nav_button,s.nav_button_previous].join(" "),b=u(e.nextMonth,{locale:i}),v=[s.nav_button,s.nav_button_next].join(" "),w=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:xse,y=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:yse;return Ce.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&Ce.jsx(lm,{name:"previous-month","aria-label":p,className:h,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?Ce.jsx(w,{className:s.nav_icon,style:a.nav_icon}):Ce.jsx(y,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&Ce.jsx(lm,{name:"next-month","aria-label":b,className:v,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?Ce.jsx(y,{className:s.nav_icon,style:a.nav_icon}):Ce.jsx(w,{className:s.nav_icon,style:a.nav_icon})})]})}function Y$(e){var t=an().numberOfMonths,n=dh(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(b){return tS(e.displayMonth,b)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),f=t>1&&(c||!l),p=function(){r&&i(r)},h=function(){o&&i(o)};return Ce.jsx(wse,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:f,nextMonth:o,previousMonth:r,onPreviousClick:p,onNextClick:h})}function _se(e){var t,n=an(),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:zI,c;return o?c=Ce.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=Ce.jsx(G$,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=Ce.jsxs(Ce.Fragment,{children:[Ce.jsx(G$,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),Ce.jsx(Y$,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=Ce.jsxs(Ce.Fragment,{children:[Ce.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Ce.jsx(Y$,{displayMonth:e.displayMonth,id:e.id})]}),Ce.jsx("div",{className:r.caption,style:i.caption,children:c})}function Sse(e){var t=an(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?Ce.jsx("tfoot",{className:o,style:r.tfoot,children:Ce.jsx("tr",{children:Ce.jsx("td",{colSpan:8,children:n})})}):Ce.jsx(Ce.Fragment,{})}function Cse(e,t,n){for(var r=n?wl(new Date):Ri(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=yr(r,i);o.push(s)}return o}function Ese(){var e=an(),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,c=Cse(o,i,s);return Ce.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&Ce.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,f){return Ce.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:a(u,{locale:o})},f)})]})}function Rse(){var e,t=an(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:Ese;return Ce.jsx("thead",{style:r.head,className:n.head,children:Ce.jsx(i,{})})}function Pse(e){var t=an(),n=t.locale,r=t.formatters.formatDay;return Ce.jsx(Ce.Fragment,{children:r(e.date,{locale:n})})}var nS=m.createContext(void 0);function Ose(e){if(!ch(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return Ce.jsx(nS.Provider,{value:t,children:e.children})}return Ce.jsx($se,{initialProps:e.initialProps,children:e.children})}function $se(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,f){var p,h;(p=t.onDayClick)===null||p===void 0||p.call(t,c,u,f);var b=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!b){var v=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var w=r?FI([],r,!0):[];if(u.selected){var y=w.findIndex(function(_){return jr(c,_)});w.splice(y,1)}else w.push(c);(h=t.onSelect)===null||h===void 0||h.call(t,w,c,u,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=i&&r.length>i-1,f=r.some(function(p){return jr(p,c)});return!!(u&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return Ce.jsx(nS.Provider,{value:l,children:n})}function rS(){var e=m.useContext(nS);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Tse(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?jr(o,e)&&jr(r,e)?void 0:jr(o,e)?{from:o,to:void 0}:jr(r,e)?void 0:x1(r,e)?{from:e,to:o}:{from:r,to:e}:o?x1(e,o)?{from:o,to:e}:{from:e,to:o}:r?LI(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var oS=m.createContext(void 0);function Dse(e){if(!uh(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return Ce.jsx(oS.Provider,{value:t,children:e.children})}return Ce.jsx(Ase,{initialProps:e.initialProps,children:e.children})}function Ase(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,c=function(h,b,v){var w,y;(w=t.onDayClick)===null||w===void 0||w.call(t,h,b,v);var _=Tse(h,r);(y=t.onSelect)===null||y===void 0||y.call(t,_,h,b,v)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],jr(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),a&&(i&&!s&&u.disabled.push({after:J0(i,a-1),before:yr(i,a-1)}),i&&s&&u.disabled.push({after:i,before:yr(i,a-1)}),!i&&s&&u.disabled.push({after:J0(s,a-1),before:yr(s,a-1)})),l){if(i&&!s&&(u.disabled.push({before:yr(i,-l+1)}),u.disabled.push({after:yr(i,l-1)})),i&&s){var f=yi(s,i)+1,p=l-f;u.disabled.push({before:J0(i,p)}),u.disabled.push({after:yr(s,p)})}!i&&s&&(u.disabled.push({before:yr(s,-l+1)}),u.disabled.push({after:yr(s,l-1)}))}return Ce.jsx(oS.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function iS(){var e=m.useContext(oS);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Tg(e){return Array.isArray(e)?FI([],e,!0):e!==void 0?[e]:[]}function kse(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=Tg(o)}),t}var ti;(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"})(ti||(ti={}));var Mse=ti.Selected,Gi=ti.Disabled,Ise=ti.Hidden,Nse=ti.Today,ey=ti.RangeEnd,ty=ti.RangeMiddle,ny=ti.RangeStart,Lse=ti.Outside;function Fse(e,t,n){var r,o=(r={},r[Mse]=Tg(e.selected),r[Gi]=Tg(e.disabled),r[Ise]=Tg(e.hidden),r[Nse]=[e.today],r[ey]=[],r[ty]=[],r[ny]=[],r[Lse]=[],r);return e.fromDate&&o[Gi].push({before:e.fromDate}),e.toDate&&o[Gi].push({after:e.toDate}),ch(e)?o[Gi]=o[Gi].concat(t.modifiers[Gi]):uh(e)&&(o[Gi]=o[Gi].concat(n.modifiers[Gi]),o[ny]=n.modifiers[ny],o[ty]=n.modifiers[ty],o[ey]=n.modifiers[ey]),o}var HI=m.createContext(void 0);function jse(e){var t=an(),n=rS(),r=iS(),o=Fse(t,n,r),i=kse(t.modifiers),s=rt(rt({},o),i);return Ce.jsx(HI.Provider,{value:s,children:e.children})}function WI(){var e=m.useContext(HI);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function zse(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Bse(e){return!!(e&&typeof e=="object"&&"from"in e)}function Vse(e){return!!(e&&typeof e=="object"&&"after"in e)}function Hse(e){return!!(e&&typeof e=="object"&&"before"in e)}function Wse(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Use(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=yi(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=yi(e,r)>=0&&yi(o,e)>=0;return s}return o?jr(o,e):r?jr(r,e):!1}function qse(e){return J_(e)}function Gse(e){return Array.isArray(e)&&e.every(J_)}function Yse(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(qse(n))return jr(e,n);if(Gse(n))return n.includes(e);if(Bse(n))return Use(e,n);if(Wse(n))return n.dayOfWeek.includes(e.getDay());if(zse(n)){var r=yi(n.before,e),o=yi(n.after,e),i=r>0,s=o<0,a=x1(n.before,n.after);return a?s&&i:i||s}return Vse(n)?yi(e,n.after)>0:Hse(n)?yi(n.before,e)>0:typeof n=="function"?n(e):!1})}function sS(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return Yse(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!tS(e,n)&&(o.outside=!0),o}function Kse(e,t){for(var n=zr(e[0]),r=Z_(e[e.length-1]),o,i,s=n;s<=r;){var a=sS(s,t),l=!a.disabled&&!a.hidden;if(!l){s=yr(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=yr(s,1)}return i||o}var Xse=365;function UI(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,c=o.fromDate,u=o.toDate,f=o.locale,p={day:yr,week:y1,month:ei,year:Noe,startOfWeek:function(w){return o.ISOWeek?wl(w):Ri(w,{locale:f,weekStartsOn:l})},endOfWeek:function(w){return o.ISOWeek?DI(w):eS(w,{locale:f,weekStartsOn:l})}},h=p[n](e,r==="after"?1:-1);r==="before"&&c?h=Loe([c,h]):r==="after"&&u&&(h=Foe([u,h]));var b=!0;if(i){var v=sS(h,i);b=!v.disabled&&!v.hidden}return b?h:a.count>Xse?a.lastFocused:UI(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:rt(rt({},a),{count:a.count+1})})}var qI=m.createContext(void 0);function Qse(e){var t=dh(),n=WI(),r=m.useState(),o=r[0],i=r[1],s=m.useState(),a=s[0],l=s[1],c=Kse(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(o),i(void 0)},p=function(w){i(w)},h=an(),b=function(w,y){if(o){var _=UI(o,{moveBy:w,direction:y,context:h,modifiers:n});jr(o,_)||(t.goToDate(_,o),p(_))}},v={focusedDay:o,focusTarget:u,blur:f,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 Ce.jsx(qI.Provider,{value:v,children:e.children})}function aS(){var e=m.useContext(qI);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Jse(e,t){var n=WI(),r=sS(e,n,t);return r}var lS=m.createContext(void 0);function Zse(e){if(!vv(e.initialProps)){var t={selected:void 0};return Ce.jsx(lS.Provider,{value:t,children:e.children})}return Ce.jsx(eae,{initialProps:e.initialProps,children:e.children})}function eae(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return Ce.jsx(lS.Provider,{value:o,children:n})}function GI(){var e=m.useContext(lS);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function tae(e,t){var n=an(),r=GI(),o=rS(),i=iS(),s=aS(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,f=s.blur,p=s.focus,h=s.focusMonthBefore,b=s.focusMonthAfter,v=s.focusYearBefore,w=s.focusYearAfter,y=s.focusStartOfWeek,_=s.focusEndOfWeek,S=function(Y){var J,W,$,V;vv(n)?(J=r.onDayClick)===null||J===void 0||J.call(r,e,t,Y):ch(n)?(W=o.onDayClick)===null||W===void 0||W.call(o,e,t,Y):uh(n)?($=i.onDayClick)===null||$===void 0||$.call(i,e,t,Y):(V=n.onDayClick)===null||V===void 0||V.call(n,e,t,Y)},C=function(Y){var J;p(e),(J=n.onDayFocus)===null||J===void 0||J.call(n,e,t,Y)},E=function(Y){var J;f(),(J=n.onDayBlur)===null||J===void 0||J.call(n,e,t,Y)},O=function(Y){var J;(J=n.onDayMouseEnter)===null||J===void 0||J.call(n,e,t,Y)},T=function(Y){var J;(J=n.onDayMouseLeave)===null||J===void 0||J.call(n,e,t,Y)},N=function(Y){var J;(J=n.onDayPointerEnter)===null||J===void 0||J.call(n,e,t,Y)},M=function(Y){var J;(J=n.onDayPointerLeave)===null||J===void 0||J.call(n,e,t,Y)},A=function(Y){var J;(J=n.onDayTouchCancel)===null||J===void 0||J.call(n,e,t,Y)},F=function(Y){var J;(J=n.onDayTouchEnd)===null||J===void 0||J.call(n,e,t,Y)},z=function(Y){var J;(J=n.onDayTouchMove)===null||J===void 0||J.call(n,e,t,Y)},X=function(Y){var J;(J=n.onDayTouchStart)===null||J===void 0||J.call(n,e,t,Y)},ee=function(Y){var J;(J=n.onDayKeyUp)===null||J===void 0||J.call(n,e,t,Y)},H=function(Y){var J;switch(Y.key){case"ArrowLeft":Y.preventDefault(),Y.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":Y.preventDefault(),Y.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":Y.preventDefault(),Y.stopPropagation(),c();break;case"ArrowUp":Y.preventDefault(),Y.stopPropagation(),u();break;case"PageUp":Y.preventDefault(),Y.stopPropagation(),Y.shiftKey?v():h();break;case"PageDown":Y.preventDefault(),Y.stopPropagation(),Y.shiftKey?w():b();break;case"Home":Y.preventDefault(),Y.stopPropagation(),y();break;case"End":Y.preventDefault(),Y.stopPropagation(),_();break}(J=n.onDayKeyDown)===null||J===void 0||J.call(n,e,t,Y)},Q={onClick:S,onFocus:C,onBlur:E,onKeyDown:H,onKeyUp:ee,onMouseEnter:O,onMouseLeave:T,onPointerEnter:N,onPointerLeave:M,onTouchCancel:A,onTouchEnd:F,onTouchMove:z,onTouchStart:X};return Q}function nae(){var e=an(),t=GI(),n=rS(),r=iS(),o=vv(e)?t.selected:ch(e)?n.selected:uh(e)?r.selected:void 0;return o}function rae(e){return Object.values(ti).includes(e)}function oae(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(rae(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function iae(e,t){var n=rt({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=rt(rt({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function sae(e,t,n){var r,o,i,s=an(),a=aS(),l=Jse(e,t),c=tae(e,l),u=nae(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var O;l.outside||a.focusedDay&&f&&jr(a.focusedDay,e)&&((O=n.current)===null||O===void 0||O.focus())},[a.focusedDay,e,n,f,l.outside]);var p=oae(s,l).join(" "),h=iae(s,l),b=!!(l.outside&&!s.showOutsideDays||l.hidden),v=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:Pse,w=Ce.jsx(v,{date:e,displayMonth:t,activeModifiers:l}),y={style:h,className:p,children:w,role:"gridcell"},_=a.focusTarget&&jr(a.focusTarget,e)&&!l.outside,S=a.focusedDay&&jr(a.focusedDay,e),C=rt(rt(rt({},y),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=S||_?0:-1,r)),c),E={isButton:f,isHidden:b,activeModifiers:l,selectedDays:u,buttonProps:C,divProps:y};return E}function aae(e){var t=m.useRef(null),n=sae(e.date,e.displayMonth,t);return n.isHidden?Ce.jsx("div",{role:"gridcell"}):n.isButton?Ce.jsx(lm,rt({name:"day",ref:t},n.buttonProps)):Ce.jsx("div",rt({},n.divProps))}function lae(e){var t=e.number,n=e.dates,r=an(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!o)return Ce.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var f=l(Number(t),{locale:a}),p=function(h){o(t,n,h)};return Ce.jsx(lm,{name:"week-number","aria-label":f,className:s.weeknumber,style:i.weeknumber,onClick:p,children:u})}function cae(e){var t,n,r=an(),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:aae,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:lae,u;return s&&(u=Ce.jsx("td",{className:i.cell,style:o.cell,children:Ce.jsx(c,{number:e.weekNumber,dates:e.dates})})),Ce.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(f){return Ce.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:Ce.jsx(l,{displayMonth:e.displayMonth,date:f})},Lie(f))})]})}function K$(e,t,n){for(var r=n!=null&&n.ISOWeek?DI(t):eS(t,n),o=n!=null&&n.ISOWeek?wl(e):Ri(e,n),i=yi(r,o),s=[],a=0;a<=i;a++)s.push(yr(o,a));var l=s.reduce(function(c,u){var f=n!=null&&n.ISOWeek?kI(u):II(u,n),p=c.find(function(h){return h.weekNumber===f});return p?(p.dates.push(u),c):(c.push({weekNumber:f,dates:[u]}),c)},[]);return l}function uae(e,t){var n=K$(zr(e),Z_(e),t);if(t!=null&&t.useFixedWeeks){var r=jie(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=y1(i,6-r),a=K$(y1(i,1),s,t);n.push.apply(n,a)}}return n}function dae(e){var t,n,r,o=an(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,f=o.weekStartsOn,p=o.firstWeekContainsDate,h=o.ISOWeek,b=uae(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:h,locale:i,weekStartsOn:f,firstWeekContainsDate:p}),v=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:Rse,w=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:cae,y=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:Sse;return Ce.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&Ce.jsx(v,{}),Ce.jsx("tbody",{className:s.tbody,style:a.tbody,children:b.map(function(_){return Ce.jsx(w,{displayMonth:e.displayMonth,dates:_.dates,weekNumber:_.weekNumber},_.weekNumber)})}),Ce.jsx(y,{displayMonth:e.displayMonth})]})}function fae(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var hae=fae()?m.useLayoutEffect:m.useEffect,ry=!1,pae=0;function X$(){return"react-day-picker-".concat(++pae)}function gae(e){var t,n=e??(ry?X$():null),r=m.useState(n),o=r[0],i=r[1];return hae(function(){o===null&&i(X$())},[]),m.useEffect(function(){ry===!1&&(ry=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function mae(e){var t,n,r=an(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=dh().displayMonths,c=gae(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],p=s.month,h=e.displayIndex===0,b=e.displayIndex===l.length-1,v=!h&&!b;o==="rtl"&&(t=[h,b],b=t[0],h=t[1]),h&&(f.push(i.caption_start),p=rt(rt({},p),s.caption_start)),b&&(f.push(i.caption_end),p=rt(rt({},p),s.caption_end)),v&&(f.push(i.caption_between),p=rt(rt({},p),s.caption_between));var w=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:_se;return Ce.jsxs("div",{className:f.join(" "),style:p,children:[Ce.jsx(w,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Ce.jsx(dae,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function vae(e){var t=an(),n=t.classNames,r=t.styles;return Ce.jsx("div",{className:n.months,style:r.months,children:e.children})}function bae(e){var t,n,r=e.initialProps,o=an(),i=aS(),s=dh(),a=m.useState(!1),l=a[0],c=a[1];m.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var f=rt(rt({},o.styles.root),o.style),p=Object.keys(r).filter(function(b){return b.startsWith("data-")}).reduce(function(b,v){var w;return rt(rt({},b),(w={},w[v]=r[v],w))},{}),h=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:vae;return Ce.jsx("div",rt({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:Ce.jsx(h,{children:s.displayMonths.map(function(b,v){return Ce.jsx(mae,{displayIndex:v,displayMonth:b},v)})})}))}function yae(e){var t=e.children,n=Bie(e,["children"]);return Ce.jsx(lse,{initialProps:n,children:Ce.jsx(bse,{children:Ce.jsx(Zse,{initialProps:n,children:Ce.jsx(Ose,{initialProps:n,children:Ce.jsx(Dse,{initialProps:n,children:Ce.jsx(jse,{children:Ce.jsx(Qse,{children:t})})})})})})})}function xae(e){return Ce.jsx(yae,rt({},e,{children:Ce.jsx(bae,{initialProps:e})}))}function YI({className:e,classNames:t,showOutsideDays:n=!0,...r}){return R.jsx(xae,{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(ef({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(ef({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})=>R.jsx(zk,{...o,className:"h-4 w-4"}),IconRight:({...o})=>R.jsx(f_,{...o,className:"h-4 w-4"})},...r})}YI.displayName="Calendar";function wae({filter:e,className:t}){const[n,r]=m.useState(!1),[o,i]=m.useState(),[s,a]=m.useState(),l=$e(S=>S.filterValues),{authToken:c}=ba(),u=$e(S=>S.actions.addOrUpdateFilterValue),f=$e(S=>S.actions.removeFilterValue),{data:p,isLoading:h,isFetching:b,isError:v,refetch:w}=Hf({queryKey:[e.sql],queryFn:()=>zf("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId});m.useEffect(()=>{var S;if(((S=p==null?void 0:p.records)==null?void 0:S.length)>0){const C=p.records[0];if(!C.min||!C.max)return;i({from:new Date(C.min),to:new Date(C.max)}),a({from:new Date(C.min),to:new Date(C.max)})}},[p]),m.useEffect(()=>{if(l&&!l.find(C=>C.filterId===e.id)){i(s);return}},[l,e.id,s]);function y(){f(e.id),i(s),r(!1)}function _(){if(!o)return;console.log(o);const S=[o==null?void 0:o.from,o==null?void 0:o.to];console.log(S);const C={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Ng(e),name:e.column,operation:"between",values:S};u(C),r(!1)}return h?R.jsx("div",{children:R.jsx(Tm,{className:"h-8 w-full bg-foreground/10"})}):v?R.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):p?R.jsx("div",{className:_e("grid gap-2",t),children:R.jsxs(gv,{open:n,onOpenChange:r,children:[R.jsx(mv,{asChild:!0,children:R.jsxs(xr,{size:"sm",id:"date",variant:"outline",className:_e("h-[34px] w-full justify-start rounded-sm text-left font-normal",!o&&"text-muted-foreground"),children:[R.jsx(jk,{className:"mr-2 h-4 w-4"}),o!=null&&o.from?o.to?R.jsxs(R.Fragment,{children:[_i(o.from,"LLL dd, y")," -"," ",_i(o.to,"LLL dd, y")]}):_i(o.from,"LLL dd, y"):R.jsx("span",{children:"Pick a date"})]})}),R.jsxs(sh,{className:"w-auto p-0",align:"start",children:[R.jsx(YI,{initialFocus:!0,mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:i,numberOfMonths:2}),R.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[R.jsx(xr,{size:"sm",variant:"outline",onClick:_,children:"Apply"}),R.jsx(xr,{size:"sm",variant:"outline",onClick:y,children:"Clear"})]})]})]})}):R.jsxs(Fn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}/**
|
|
357
|
-
* react-virtual
|
|
358
|
-
*
|
|
359
|
-
* Copyright (c) TanStack
|
|
360
|
-
*
|
|
361
|
-
* This source code is licensed under the MIT license found in the
|
|
362
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
363
|
-
*
|
|
364
|
-
* @license MIT
|
|
365
|
-
*/function cm(){return cm=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},cm.apply(this,arguments)}/**
|
|
366
|
-
* virtual-core
|
|
367
|
-
*
|
|
368
|
-
* Copyright (c) TanStack
|
|
369
|
-
*
|
|
370
|
-
* This source code is licensed under the MIT license found in the
|
|
371
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
372
|
-
*
|
|
373
|
-
* @license MIT
|
|
374
|
-
*/function um(){return um=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},um.apply(this,arguments)}/**
|
|
375
|
-
* virtual-core
|
|
376
|
-
*
|
|
377
|
-
* Copyright (c) TanStack
|
|
378
|
-
*
|
|
379
|
-
* This source code is licensed under the MIT license found in the
|
|
380
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
381
|
-
*
|
|
382
|
-
* @license MIT
|
|
383
|
-
*/function cc(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,v){return o[v]!==b});if(!l)return i;o=a;var c;if(n.key&&n.debug!=null&&n.debug()&&(c=Date.now()),i=t.apply(void 0,a),n.key&&n.debug!=null&&n.debug()){var u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,p=f/16,h=function(v,w){for(v=String(v);v.length<w;)v=" "+v;return v};console.info("%c⏱ "+h(f,5)+" /"+h(u,5)+" ms",`
|
|
384
|
-
font-size: .6rem;
|
|
385
|
-
font-weight: bold;
|
|
386
|
-
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 oy(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var _ae=function(t,n){return Math.abs(t-n)<1};/**
|
|
387
|
-
* virtual-core
|
|
388
|
-
*
|
|
389
|
-
* Copyright (c) TanStack
|
|
390
|
-
*
|
|
391
|
-
* This source code is licensed under the MIT license found in the
|
|
392
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
393
|
-
*
|
|
394
|
-
* @license MIT
|
|
395
|
-
*/var Sae=function(t){return t},Cae=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},Eae=function(t,n){var r=t.scrollElement;if(r){var o=function(a){var l=a.width,c=a.height;n({width:Math.round(l),height:Math.round(c)})};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)}}},Rae=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)}}},Pae=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"])},Oae=function(t,n,r){var o,i,s=n.adjustments,a=s===void 0?0:s,l=n.behavior,c=t+a;(o=r.scrollElement)==null||o.scrollTo==null||o.scrollTo((i={},i[r.options.horizontal?"left":"top"]=c,i.behavior=l,i))},$ae=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=um({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Sae,rangeExtractor:Cae,onChange:function(){},measureElement:Pae,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=cc(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=cc(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 c=s.get(l.lane);if(c==null||l.end>c.end?s.set(l.lane,l):l.end<c.end&&i.set(l.lane,!0),i.size===n.options.lanes)break}}return s.size===n.options.lanes?Array.from(s.values()).sort(function(u,f){return u.end-f.end})[0]:void 0},this.getMeasurements=cc(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,o){var i=r.count,s=r.paddingStart,a=r.scrollMargin,l=r.getItemKey,c=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var u=n.measurementsCache.slice(0,c),f=c;f<i;f++){var p=l(f),h=n.options.lanes===1?u[f-1]:n.getFurthestMeasurement(u,f),b=h?h.end:s+a,v=o.get(p),w=typeof v=="number"?v:n.options.estimateSize(f),y=b+w,_=h?h.lane:f%n.options.lanes;u[f]={index:f,start:b,size:w,end:y,key:p,lane:_}}return n.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return n.options.debug}}),this.calculateRange=cc(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,o,i){return n.range=r.length>0&&o>0?Tae({measurements:r,outerSize:o,scrollOffset:i}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=cc(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,o,i,s){return o===null?[]:r(um({},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,c){l===r&&(n.observer.unobserve(r),n.measureElementCache.delete(c))});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=cc(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,o){for(var i=[],s=0,a=r.length;s<a;s++){var l=r[s],c=o[l];i.push(c)}return i},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.getVirtualItemForOffset=function(r){var o=n.getMeasurements();return oy(o[KI(0,o.length-1,function(i){return oy(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=oy(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 c=n.getOffsetForIndex(r,a),u=c[0],f=c[1];n._scrollToOffset(u,{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 h=n.getOffsetForIndex(r,f),b=h[0];_ae(b,n.scrollOffset)||n.scrollToIndex(r,{align:f,behavior:l})}else n.scrollToIndex(r,{align:f,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()},KI=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 Tae(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,o=t.length-1,i=function(c){return t[c].start},s=KI(0,o,i,r),a=s;a<o&&t[a].end<r+n;)a++;return{startIndex:s,endIndex:a}}/**
|
|
396
|
-
* react-virtual
|
|
397
|
-
*
|
|
398
|
-
* Copyright (c) TanStack
|
|
399
|
-
*
|
|
400
|
-
* This source code is licensed under the MIT license found in the
|
|
401
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
402
|
-
*
|
|
403
|
-
* @license MIT
|
|
404
|
-
*/var Dae=typeof document<"u"?L.useLayoutEffect:L.useEffect;function Aae(e){var t=L.useReducer(function(){return{}},{})[1],n=cm({},e,{onChange:function(s,a){a?Cr.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=L.useState(function(){return new $ae(n)}),o=r[0];return o.setOptions(n),L.useEffect(function(){return o._didMount()},[]),Dae(function(){return o._willUpdate()}),o}function kae(e){return Aae(cm({observeElementRect:Eae,observeElementOffset:Rae,scrollToFn:Oae},e))}var Mae=Object.defineProperty,Iae=(e,t,n)=>t in e?Mae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iy=(e,t,n)=>(Iae(e,typeof t!="symbol"?t+"":t,n),n);let Nae=class{constructor(){iy(this,"current",this.detect()),iy(this,"handoffState","pending"),iy(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"}},fl=new Nae,zn=(e,t)=>{fl.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Si(e){let t=m.useRef(e);return zn(()=>{t.current=e},[e]),t}function cS(e,t){let[n,r]=m.useState(e),o=Si(e);return zn(()=>r(o.current),[o,r,...t]),n}let Et=function(e){let t=Si(e);return m.useCallback((...n)=>t.current(...n),[t])};function Lae(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,Et(c=>(i||o(c),t==null?void 0:t(c)))]}function Fae(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function _l(){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 Fae(()=>{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=_l();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 fh(){let[e]=m.useState(_l);return m.useEffect(()=>()=>e.dispose(),[e]),e}function jae(){let e=typeof document>"u";return"useSyncExternalStore"in L?(t=>t.useSyncExternalStore)(L)(()=>()=>{},()=>!1,()=>!e):!1}function uS(){let e=jae(),[t,n]=L.useState(fl.isHandoffComplete);return t&&fl.isHandoffComplete===!1&&n(!1),L.useEffect(()=>{t!==!0&&n(!0)},[t]),L.useEffect(()=>fl.handoff(),[]),e?!1:t}var Q$;let hh=(Q$=m.useId)!=null?Q$:function(){let e=uS(),[t,n]=m.useState(e?()=>fl.nextId():null);return zn(()=>{t===null&&n(fl.nextId())},[t]),t!=null?""+t:void 0};function Jn(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,Jn),r}function dS(e){return fl.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let J$=["[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 zae=(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))(zae||{}),Bae=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Bae||{}),Vae=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Vae||{}),XI=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(XI||{});function Hae(e,t=0){var n;return e===((n=dS(e))==null?void 0:n.body)?!1:Jn(t,{0(){return e.matches(J$)},1(){let r=e;for(;r!==null;){if(r.matches(J$))return!0;r=r.parentElement}return!1}})}var Wae=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Wae||{});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 Uae(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 qae(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Gae(){return/Android/gi.test(window.navigator.userAgent)}function QI(){return qae()||Gae()}function Xp(e,t,n){let r=Si(t);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function Yae(e,t,n){let r=Si(t);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function Kae(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 c=function u(f){return typeof f=="function"?u(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let u of c){if(u===null)continue;let f=u instanceof HTMLElement?u:u.current;if(f!=null&&f.contains(l)||s.composed&&s.composedPath().includes(f))return}return!Hae(l,XI.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let i=m.useRef(null);Xp("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),Xp("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),Xp("click",s=>{QI()||i.current&&(o(s,()=>i.current),i.current=null)},!0),Xp("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),Yae("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Xae(...e){return m.useMemo(()=>dS(...e),[...e])}function Z$(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 Qae(e,t){let[n,r]=m.useState(()=>Z$(e));return zn(()=>{r(Z$(e))},[e.type,e.as]),zn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let Jae=Symbol();function kl(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=Et(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[Jae]))?void 0:n}function e2(e){return[e.screenX,e.screenY]}function Zae(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=e2(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=e2(t)}}}function ele({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]),zn(()=>{if(!e||!r)return;let s=dS(e);if(!s)return;let a=o.current,l=i.current,c=Object.assign(f=>a(f),{acceptNode:a}),u=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[e,r,o,i])}function t2(e,t){let n=m.useRef([]),r=Et(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 dm(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var fm=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(fm||{}),ra=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ra||{});function hs({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??tle;let l=JI(t,e);if(i)return Qp(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...f}=l;if(u)return Qp(f,n,r,s,a)}if(c&1){let{unmount:u=!0,...f}=l;return Jn(u?0:1,{0(){return null},1(){return Qp({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Qp(l,n,r,s,a)}function Qp(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=sy(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let f={};if(t){let p=!1,h=[];for(let[b,v]of Object.entries(t))typeof v=="boolean"&&(p=!0),v===!0&&h.push(b);p&&(f["data-headlessui-state"]=h.join(" "))}if(i===m.Fragment&&Object.keys(_1(l)).length>0){if(!m.isValidElement(u)||Array.isArray(u)&&u.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(v=>` - ${v}`).join(`
|
|
405
|
-
`),"","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(v=>` - ${v}`).join(`
|
|
406
|
-
`)].join(`
|
|
407
|
-
`));let p=u.props,h=typeof(p==null?void 0:p.className)=="function"?(...v)=>dm(p==null?void 0:p.className(...v),l.className):dm(p==null?void 0:p.className,l.className),b=h?{className:h}:{};return m.cloneElement(u,Object.assign({},JI(u.props,_1(sy(l,["ref"]))),f,c,{ref:o(u.ref,c.ref)},b))}return m.createElement(i,Object.assign({},sy(l,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&f),u)}function tle(...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 JI(...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 Ai(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function _1(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function sy(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let nle="div";var ZI=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ZI||{});function rle(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 hs({ourProps:i,theirProps:o,slot:{},defaultTag:nle,name:"Hidden"})}let ole=Ai(rle),fS=m.createContext(null);fS.displayName="OpenClosedContext";var so=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(so||{});function hS(){return m.useContext(fS)}function eN({value:e,children:t}){return m.createElement(fS.Provider,{value:e},t)}function ile(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let qa=[];ile(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&qa[0]!==t.target&&(qa.unshift(t.target),qa=qa.filter(n=>n!=null&&n.isConnected),qa.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 sle(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&&ale(n)?!1:r}function ale(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function lle(e){throw new Error("Unexpected object: "+e)}var Ln=(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))(Ln||{});function n2(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:lle(e)}}function tN(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))rN(n,nN(t,r),o);return n}function nN(e,t){return e?e+"["+t+"]":t}function rN(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())rN(e,nN(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,""]):tN(n,t,e)}var to=(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))(to||{}),cle=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(cle||{}),ule=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(ule||{}),dle=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(dle||{}),fle=(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))(fle||{});function ay(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):Uae(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let hle={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 u=t.focus===Ln.Specific?t.idx:n2(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var p,h;return(h=(p=e.activeOptionIndex)!=null?p:e.virtual.options.findIndex(b=>!e.virtual.disabled(b)))!=null?h:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===u&&e.activationTrigger===f?e:{...e,activeOptionIndex:u,activationTrigger:f}}let a=ay(e);if(a.activeOptionIndex===null){let u=a.options.findIndex(f=>!f.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=t.focus===Ln.Specific?t.idx:n2(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...a,activeOptionIndex:l,activationTrigger:c}},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=ay(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=ay(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})}}},pS=m.createContext(null);pS.displayName="ComboboxActionsContext";function ph(e){let t=m.useContext(pS);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ph),n}return t}let oN=m.createContext(null);function ple(e){var t;let n=Ml("VirtualProvider"),[r,o]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),i=kae({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 zn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(oN.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 c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.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 gS=m.createContext(null);gS.displayName="ComboboxDataContext";function Ml(e){let t=m.useContext(gS);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ml),n}return t}function gle(e,t){return Jn(t.type,hle,e,t)}let mle=m.Fragment;function vle(e,t){let{value:n,defaultValue:r,onChange:o,form:i,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:f=!1,immediate:p=!1,virtual:h=null,...b}=e,v=!1,w=null,[y=f?[]:void 0,_]=Lae(n,o,r),[S,C]=m.useReducer(gle,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=m.useRef(!1),O=m.useRef({static:!1,hold:!1}),T=m.useRef(null),N=m.useRef(null),M=m.useRef(null),A=m.useRef(null),F=Et(typeof a=="string"?(oe,le)=>{let ye=a;return(oe==null?void 0:oe[ye])===(le==null?void 0:le[ye])}:a??((oe,le)=>oe===le)),z=Et(oe=>S.options.findIndex(le=>F(le.dataRef.current.value,oe))),X=m.useCallback(oe=>Jn(H.mode,{1:()=>y.some(le=>F(le,oe)),0:()=>F(y,oe)}),[y]),ee=Et(oe=>S.activeOptionIndex===z(oe)),H=m.useMemo(()=>({...S,immediate:v,optionsPropsRef:O,labelRef:T,inputRef:N,buttonRef:M,optionsRef:A,value:y,defaultValue:r,disabled:l,mode:f?1:0,virtual:S.virtual,get activeOptionIndex(){if(E.current&&S.activeOptionIndex===null&&S.options.length>0){let oe=S.options.findIndex(le=>!le.dataRef.current.disabled);if(oe!==-1)return oe}return S.activeOptionIndex},calculateIndex:z,compare:F,isSelected:X,isActive:ee,nullable:u,__demoMode:c}),[y,r,l,f,u,c,S,w]);zn(()=>{},[w,void 0]),zn(()=>{S.dataRef.current=H},[H]),Kae([H.buttonRef,H.inputRef,H.optionsRef],()=>fe.closeCombobox(),H.comboboxState===0);let Q=m.useMemo(()=>{var oe,le,ye;return{open:H.comboboxState===0,disabled:l,activeIndex:H.activeOptionIndex,activeOption:H.activeOptionIndex===null?null:H.virtual?H.virtual.options[(oe=H.activeOptionIndex)!=null?oe:0]:(ye=(le=H.options[H.activeOptionIndex])==null?void 0:le.dataRef.current.value)!=null?ye:null,value:y}},[H,l,y]),Y=Et(()=>{if(H.activeOptionIndex!==null){if(H.virtual)I(H.virtual.options[H.activeOptionIndex]);else{let{dataRef:oe}=H.options[H.activeOptionIndex];I(oe.current.value)}fe.goToOption(Ln.Specific,H.activeOptionIndex)}}),J=Et(()=>{C({type:0}),E.current=!0}),W=Et(()=>{C({type:1}),E.current=!1}),$=Et((oe,le,ye)=>(E.current=!1,oe===Ln.Specific?C({type:2,focus:Ln.Specific,idx:le,trigger:ye}):C({type:2,focus:oe,trigger:ye}))),V=Et((oe,le)=>(C({type:3,payload:{id:oe,dataRef:le}}),()=>{H.isActive(le.current.value)&&(E.current=!0),C({type:4,id:oe})})),U=Et(oe=>(C({type:5,id:oe}),()=>C({type:5,id:null}))),I=Et(oe=>Jn(H.mode,{0(){return _==null?void 0:_(oe)},1(){let le=H.value.slice(),ye=le.findIndex(K=>F(K,oe));return ye===-1?le.push(oe):le.splice(ye,1),_==null?void 0:_(le)}})),te=Et(oe=>{C({type:6,trigger:oe})}),fe=m.useMemo(()=>({onChange:I,registerOption:V,registerLabel:U,goToOption:$,closeCombobox:W,openCombobox:J,setActivationTrigger:te,selectActiveOption:Y}),[]),ne=t===null?{}:{ref:t},ue=m.useRef(null),ie=fh();return m.useEffect(()=>{ue.current&&r!==void 0&&ie.addEventListener(ue.current,"reset",()=>{_==null||_(r)})},[ue,_]),m.createElement(pS.Provider,{value:fe},m.createElement(gS.Provider,{value:H},m.createElement(eN,{value:Jn(H.comboboxState,{0:so.Open,1:so.Closed})},s!=null&&y!=null&&tN({[s]:y}).map(([oe,le],ye)=>m.createElement(ole,{features:ZI.Hidden,ref:ye===0?K=>{var be;ue.current=(be=K==null?void 0:K.closest("form"))!=null?be:null}:void 0,..._1({key:oe,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:oe,value:le})})),hs({ourProps:ne,theirProps:b,slot:Q,defaultTag:mle,name:"Combobox"}))))}let ble="input";function yle(e,t){var n,r,o,i,s;let a=hh(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:f="text",...p}=e,h=Ml("Combobox.Input"),b=ph("Combobox.Input"),v=kl(h.inputRef,t),w=Xae(h.inputRef),y=m.useRef(!1),_=fh(),S=Et(()=>{b.onChange(null),h.optionsRef.current&&(h.optionsRef.current.scrollTop=0),b.goToOption(Ln.Nothing)}),C=function(){var H;return typeof u=="function"&&h.value!==void 0?(H=u(h.value))!=null?H:"":typeof h.value=="string"?h.value:""}();t2(([H,Q],[Y,J])=>{if(y.current)return;let W=h.inputRef.current;W&&((J===0&&Q===1||H!==Y)&&(W.value=H),requestAnimationFrame(()=>{if(y.current||!W||(w==null?void 0:w.activeElement)!==W)return;let{selectionStart:$,selectionEnd:V}=W;Math.abs((V??0)-($??0))===0&&$===0&&W.setSelectionRange(W.value.length,W.value.length)}))},[C,h.comboboxState,w]),t2(([H],[Q])=>{if(H===0&&Q===1){if(y.current)return;let Y=h.inputRef.current;if(!Y)return;let J=Y.value,{selectionStart:W,selectionEnd:$,selectionDirection:V}=Y;Y.value="",Y.value=J,V!==null?Y.setSelectionRange(W,$,V):Y.setSelectionRange(W,$)}},[h.comboboxState]);let E=m.useRef(!1),O=Et(()=>{E.current=!0}),T=Et(()=>{_.nextFrame(()=>{E.current=!1})}),N=Et(H=>{switch(y.current=!0,H.key){case to.Enter:if(y.current=!1,h.comboboxState!==0||E.current)return;if(H.preventDefault(),H.stopPropagation(),h.activeOptionIndex===null){b.closeCombobox();return}b.selectActiveOption(),h.mode===0&&b.closeCombobox();break;case to.ArrowDown:return y.current=!1,H.preventDefault(),H.stopPropagation(),Jn(h.comboboxState,{0:()=>b.goToOption(Ln.Next),1:()=>b.openCombobox()});case to.ArrowUp:return y.current=!1,H.preventDefault(),H.stopPropagation(),Jn(h.comboboxState,{0:()=>b.goToOption(Ln.Previous),1:()=>{b.openCombobox(),_.nextFrame(()=>{h.value||b.goToOption(Ln.Last)})}});case to.Home:if(H.shiftKey)break;return y.current=!1,H.preventDefault(),H.stopPropagation(),b.goToOption(Ln.First);case to.PageUp:return y.current=!1,H.preventDefault(),H.stopPropagation(),b.goToOption(Ln.First);case to.End:if(H.shiftKey)break;return y.current=!1,H.preventDefault(),H.stopPropagation(),b.goToOption(Ln.Last);case to.PageDown:return y.current=!1,H.preventDefault(),H.stopPropagation(),b.goToOption(Ln.Last);case to.Escape:return y.current=!1,h.comboboxState!==0?void 0:(H.preventDefault(),h.optionsRef.current&&!h.optionsPropsRef.current.static&&H.stopPropagation(),h.nullable&&h.mode===0&&h.value===null&&S(),b.closeCombobox());case to.Tab:if(y.current=!1,h.comboboxState!==0)return;h.mode===0&&h.activationTrigger!==1&&b.selectActiveOption(),b.closeCombobox();break}}),M=Et(H=>{c==null||c(H),h.nullable&&h.mode===0&&H.target.value===""&&S(),b.openCombobox()}),A=Et(H=>{var Q,Y,J;let W=(Q=H.relatedTarget)!=null?Q:qa.find($=>$!==H.currentTarget);if(y.current=!1,!((Y=h.optionsRef.current)!=null&&Y.contains(W))&&!((J=h.buttonRef.current)!=null&&J.contains(W))&&h.comboboxState===0)return H.preventDefault(),h.mode===0&&(h.nullable&&h.value===null?S():h.activationTrigger!==1&&b.selectActiveOption()),b.closeCombobox()}),F=Et(H=>{var Q,Y,J;let W=(Q=H.relatedTarget)!=null?Q:qa.find($=>$!==H.currentTarget);(Y=h.buttonRef.current)!=null&&Y.contains(W)||(J=h.optionsRef.current)!=null&&J.contains(W)||h.disabled||h.immediate&&h.comboboxState!==0&&(b.openCombobox(),_.nextFrame(()=>{b.setActivationTrigger(1)}))}),z=cS(()=>{if(h.labelId)return[h.labelId].join(" ")},[h.labelId]),X=m.useMemo(()=>({open:h.comboboxState===0,disabled:h.disabled}),[h]),ee={ref:v,id:l,role:"combobox",type:f,"aria-controls":(n=h.optionsRef.current)==null?void 0:n.id,"aria-expanded":h.comboboxState===0,"aria-activedescendant":h.activeOptionIndex===null?void 0:h.virtual?(r=h.options.find(H=>{var Q;return!((Q=h.virtual)!=null&&Q.disabled(H.dataRef.current.value))&&h.compare(H.dataRef.current.value,h.virtual.options[h.activeOptionIndex])}))==null?void 0:r.id:(o=h.options[h.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":z,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:h.defaultValue!==void 0?u==null?void 0:u(h.defaultValue):null)!=null?s:h.defaultValue,disabled:h.disabled,onCompositionStart:O,onCompositionEnd:T,onKeyDown:N,onChange:M,onFocus:F,onBlur:A};return hs({ourProps:ee,theirProps:p,slot:X,defaultTag:ble,name:"Combobox.Input"})}let xle="button";function wle(e,t){var n;let r=Ml("Combobox.Button"),o=ph("Combobox.Button"),i=kl(r.buttonRef,t),s=hh(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=fh(),u=Et(v=>{switch(v.key){case to.ArrowDown:return v.preventDefault(),v.stopPropagation(),r.comboboxState===1&&o.openCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case to.ArrowUp:return v.preventDefault(),v.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),c.nextFrame(()=>{r.value||o.goToOption(Ln.Last)})),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case to.Escape:return r.comboboxState!==0?void 0:(v.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&v.stopPropagation(),o.closeCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})}));default:return}}),f=Et(v=>{if(sle(v.currentTarget))return v.preventDefault();r.comboboxState===0?o.closeCombobox():(v.preventDefault(),o.openCombobox()),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})})}),p=cS(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),h=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),b={ref:i,id:a,type:Qae(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:f,onKeyDown:u};return hs({ourProps:b,theirProps:l,slot:h,defaultTag:xle,name:"Combobox.Button"})}let _le="label";function Sle(e,t){let n=hh(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Ml("Combobox.Label"),s=ph("Combobox.Label"),a=kl(i.labelRef,t);zn(()=>s.registerLabel(r),[r]);let l=Et(()=>{var u;return(u=i.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return hs({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:c,defaultTag:_le,name:"Combobox.Label"})}let Cle="ul",Ele=fm.RenderStrategy|fm.Static;function Rle(e,t){let n=hh(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=Ml("Combobox.Options"),a=kl(s.optionsRef,t),l=hS(),c=l!==null?(l&so.Open)===so.Open:s.comboboxState===0;zn(()=>{var h;s.optionsPropsRef.current.static=(h=e.static)!=null?h:!1},[s.optionsPropsRef,e.static]),zn(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),ele({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(h){return h.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:h.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(h){h.setAttribute("role","none")}});let u=cS(()=>{var h,b;return(b=s.labelId)!=null?b:(h=s.buttonRef.current)==null?void 0:h.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),p={"aria-labelledby":u,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(ple,null,i.children)}),hs({ourProps:p,theirProps:i,slot:f,defaultTag:Cle,features:Ele,visible:c,name:"Combobox.Options"})}let Ple="li";function Ole(e,t){var n;let r=hh(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,c=Ml("Combobox.Option"),u=ph("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===o,p=c.isSelected(s),h=m.useRef(null),b=Si({disabled:i,value:s,domRef:h,order:a}),v=m.useContext(oN),w=kl(t,h,v?v.measureElement:null),y=Et(()=>u.onChange(s));zn(()=>u.registerOption(o,b),[b,o]);let _=m.useRef(!(c.virtual||c.__demoMode));zn(()=>{if(!c.virtual||!c.__demoMode)return;let A=_l();return A.requestAnimationFrame(()=>{_.current=!0}),A.dispose},[c.virtual,c.__demoMode]),zn(()=>{if(!_.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let A=_l();return A.requestAnimationFrame(()=>{var F,z;(z=(F=h.current)==null?void 0:F.scrollIntoView)==null||z.call(F,{block:"nearest"})}),A.dispose},[h,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let S=Et(A=>{var F;if(i||(F=c.virtual)!=null&&F.disabled(s))return A.preventDefault();y(),QI()||requestAnimationFrame(()=>{var z;return(z=c.inputRef.current)==null?void 0:z.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),C=Et(()=>{var A;if(i||(A=c.virtual)!=null&&A.disabled(s))return u.goToOption(Ln.Nothing);let F=c.calculateIndex(s);u.goToOption(Ln.Specific,F)}),E=Zae(),O=Et(A=>E.update(A)),T=Et(A=>{var F;if(!E.wasMoved(A)||i||(F=c.virtual)!=null&&F.disabled(s)||f)return;let z=c.calculateIndex(s);u.goToOption(Ln.Specific,z,0)}),N=Et(A=>{var F;E.wasMoved(A)&&(i||(F=c.virtual)!=null&&F.disabled(s)||f&&(c.optionsPropsRef.current.hold||u.goToOption(Ln.Nothing)))}),M=m.useMemo(()=>({active:f,selected:p,disabled:i}),[f,p,i]);return hs({ourProps:{id:o,ref:w,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":p,disabled:void 0,onClick:S,onFocus:C,onPointerEnter:O,onMouseEnter:O,onPointerMove:T,onMouseMove:T,onPointerLeave:N,onMouseLeave:N},theirProps:l,slot:M,defaultTag:Ple,name:"Combobox.Option"})}let $le=Ai(vle),Tle=Ai(wle),Dle=Ai(yle),Ale=Ai(Sle),kle=Ai(Rle),Mle=Ai(Ole),uc=Object.assign($le,{Input:Dle,Button:Tle,Label:Ale,Options:kle,Option:Mle});function mS(){let e=m.useRef(!1);return zn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ile(e=0){let[t,n]=m.useState(e),r=mS(),o=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),i=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}function Nle(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function ly(e,...t){e&&t.length>0&&e.classList.add(...t)}function cy(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Lle(e,t){let n=_l();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,s]=[r,o].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,f)=>f-u);return c}),a=i+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function Fle(e,t,n,r){let o=n?"enter":"leave",i=_l(),s=r!==void 0?Nle(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Jn(o,{enter:()=>t.enter,leave:()=>t.leave}),l=Jn(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Jn(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return cy(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),ly(e,...t.base,...a,...c),i.nextFrame(()=>{cy(e,...t.base,...a,...c),ly(e,...t.base,...a,...l),Lle(e,()=>(cy(e,...t.base,...a),ly(e,...t.base,...t.entered),s()))}),i.dispose}function jle({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=mS(),a=fh(),l=Si(n);zn(()=>{e&&(l.current="enter")},[e]),zn(()=>{let c=_l();a.add(c.dispose);let u=t.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),o.current(l.current),c.add(Fle(u,r.current,l.current==="enter",()=>{c.dispose(),i.current(l.current)})),c.dispose},[n])}function Is(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let bv=m.createContext(null);bv.displayName="TransitionContext";var zle=(e=>(e.Visible="visible",e.Hidden="hidden",e))(zle||{});function Ble(){let e=m.useContext(bv);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Vle(){let e=m.useContext(yv);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let yv=m.createContext(null);yv.displayName="NestingContext";function xv(e){return"children"in e?xv(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function iN(e,t){let n=Si(e),r=m.useRef([]),o=mS(),i=fh(),s=Et((h,b=ra.Hidden)=>{let v=r.current.findIndex(({el:w})=>w===h);v!==-1&&(Jn(b,{[ra.Unmount](){r.current.splice(v,1)},[ra.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var w;!xv(r)&&o.current&&((w=n.current)==null||w.call(n))}))}),a=Et(h=>{let b=r.current.find(({el:v})=>v===h);return b?b.state!=="visible"&&(b.state="visible"):r.current.push({el:h,state:"visible"}),()=>s(h,ra.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),u=m.useRef({enter:[],leave:[],idle:[]}),f=Et((h,b,v)=>{l.current.splice(0),t&&(t.chains.current[b]=t.chains.current[b].filter(([w])=>w!==h)),t==null||t.chains.current[b].push([h,new Promise(w=>{l.current.push(w)})]),t==null||t.chains.current[b].push([h,new Promise(w=>{Promise.all(u.current[b].map(([y,_])=>_)).then(()=>w())})]),b==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(b)):v(b)}),p=Et((h,b,v)=>{Promise.all(u.current[b].splice(0).map(([w,y])=>y)).then(()=>{var w;(w=l.current.shift())==null||w()}).then(()=>v(b))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:p,wait:c,chains:u}),[a,s,r,f,p,u,c])}function Hle(){}let Wle=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function r2(e){var t;let n={};for(let r of Wle)n[r]=(t=e[r])!=null?t:Hle;return n}function Ule(e){let t=m.useRef(r2(e));return m.useEffect(()=>{t.current=r2(e)},[e]),t}let qle="div",sN=fm.RenderStrategy;function Gle(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:f,leave:p,leaveFrom:h,leaveTo:b,...v}=e,w=m.useRef(null),y=kl(w,t),_=(n=v.unmount)==null||n?ra.Unmount:ra.Hidden,{show:S,appear:C,initial:E}=Ble(),[O,T]=m.useState(S?"visible":"hidden"),N=Vle(),{register:M,unregister:A}=N;m.useEffect(()=>M(w),[M,w]),m.useEffect(()=>{if(_===ra.Hidden&&w.current){if(S&&O!=="visible"){T("visible");return}return Jn(O,{hidden:()=>A(w),visible:()=>M(w)})}},[O,w,M,A,S,_]);let F=Si({base:Is(v.className),enter:Is(l),enterFrom:Is(c),enterTo:Is(u),entered:Is(f),leave:Is(p),leaveFrom:Is(h),leaveTo:Is(b)}),z=Ule({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),X=uS();m.useEffect(()=>{if(X&&O==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,O,X]);let ee=E&&!C,H=C&&S&&E,Q=!X||ee?"idle":S?"enter":"leave",Y=Ile(0),J=Et(te=>Jn(te,{enter:()=>{Y.addFlag(so.Opening),z.current.beforeEnter()},leave:()=>{Y.addFlag(so.Closing),z.current.beforeLeave()},idle:()=>{}})),W=Et(te=>Jn(te,{enter:()=>{Y.removeFlag(so.Opening),z.current.afterEnter()},leave:()=>{Y.removeFlag(so.Closing),z.current.afterLeave()},idle:()=>{}})),$=iN(()=>{T("hidden"),A(w)},N),V=m.useRef(!1);jle({immediate:H,container:w,classes:F,direction:Q,onStart:Si(te=>{V.current=!0,$.onStart(w,te,J)}),onStop:Si(te=>{V.current=!1,$.onStop(w,te,W),te==="leave"&&!xv($)&&(T("hidden"),A(w))})});let U=v,I={ref:y};return H?U={...U,className:dm(v.className,...F.current.enter,...F.current.enterFrom)}:V.current&&(U.className=dm(v.className,(r=w.current)==null?void 0:r.className),U.className===""&&delete U.className),m.createElement(yv.Provider,{value:$},m.createElement(eN,{value:Jn(O,{visible:so.Open,hidden:so.Closed})|Y.flags},hs({ourProps:I,theirProps:U,defaultTag:qle,features:sN,visible:O==="visible",name:"Transition.Child"})))}function Yle(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=kl(s,t);uS();let l=hS();if(n===void 0&&l!==null&&(n=(l&so.Open)===so.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=m.useState(n?"visible":"hidden"),f=iN(()=>{u("hidden")}),[p,h]=m.useState(!0),b=m.useRef([n]);zn(()=>{p!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),h(!1))},[b,n]);let v=m.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);m.useEffect(()=>{if(n)u("visible");else if(!xv(f))u("hidden");else{let S=s.current;if(!S)return;let C=S.getBoundingClientRect();C.x===0&&C.y===0&&C.width===0&&C.height===0&&u("hidden")}},[n,f]);let w={unmount:o},y=Et(()=>{var S;p&&h(!1),(S=e.beforeEnter)==null||S.call(e)}),_=Et(()=>{var S;p&&h(!1),(S=e.beforeLeave)==null||S.call(e)});return m.createElement(yv.Provider,{value:f},m.createElement(bv.Provider,{value:v},hs({ourProps:{...w,as:m.Fragment,children:m.createElement(aN,{ref:a,...w,...i,beforeEnter:y,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:sN,visible:c==="visible",name:"Transition"})))}function Kle(e,t){let n=m.useContext(bv)!==null,r=hS()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(S1,{ref:t,...e}):m.createElement(aN,{ref:t,...e}))}let S1=Ai(Yle),aN=Ai(Gle),Xle=Ai(Kle),Qle=Object.assign(S1,{Child:Xle,Root:S1});function Jle(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 Zle(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 Bf.includes(e)?o:r}function ece({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null),{authToken:l}=ba(),c=$e(A=>A.filterValues),u=$e(A=>A.selectedSheetId),f=$e(A=>A.actions.addOrUpdateFilterValue),p=$e(A=>A.actions.removeFilterValue),h=C(c),{data:b,isLoading:v,isFetching:w,isError:y,refetch:_}=Hf({queryKey:["filter",e.id,e.sql,JSON.stringify(h)],queryFn:()=>zf("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:h}),enabled:!!e.sql&&!!e.connectionId}),S=m.useMemo(()=>{var A;return(A=b==null?void 0:b.records)==null?void 0:A.map(F=>{let z=e.column.split(".").slice(-1)[0].replace(/"/g,"");return F[z]===void 0&&(z=z.toLowerCase()),{id:F[z],value:F[z]}})},[b,e.column]);m.useEffect(()=>{if(c){const A=c.find(F=>F.filterId===e.id);if(!A){n([]);return}if(A.operation==="in"){const F=S==null?void 0:S.filter(z=>A.values.includes(z.value));F&&n(F)}else o(`${A.operation} ${A.values[0]}`)}},[b,u]),m.useEffect(()=>{if(c&&!c.find(F=>F.filterId===e.id)){n([]);return}},[c,e.id]);function C(A){return A?A.filter(F=>{const X=F.name.split(".");if(X.slice(0,X.length-1).join(".")===e.table&&F.name!==e.column)return!0}):[]}function E(A){const F=Jle(A[0].toString());if(!(F!=null&&F.value)||!(F!=null&&F.operation))return;const z={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Ng(e),name:e.column,operation:F.operation,values:[Number(F.value)]};f(z)}function O(A){if(Array.isArray(A)||(A=[A]),console.log("onComboBoxChange",A),A.length===1&&S.find(z=>z.value===A[0].value)===void 0){E(A);return}if(n(A),A.length===0){p(e.id);return}const F={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Ng(e),operation:e.operation,values:A.map(z=>z.value)};f(F)}function T(){var A;o(""),p(e.id),console.log(e.id),(A=a.current)==null||A.click()}if(v)return R.jsx("div",{children:R.jsx(Tm,{className:"h-8 w-full bg-foreground/10"})});if(y)return R.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let N=[];eu.includes(e.dataType)?N=S:N=i===""?S:S==null?void 0:S.filter(A=>A.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,"")));const M=e.type==="single";return R.jsx("div",{className:"w-full",children:R.jsx(uc,{value:t,multiple:!M,onChange:O,children:R.jsxs("div",{className:"relative",children:[R.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:[R.jsx(uc.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(z=>z.value).join(", ")||r,onChange:A=>{o(A.target.value),s(A.target.value)}}),R.jsx(uc.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:R.jsx(YQ,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),R.jsx(Qle,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:R.jsxs(uc.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:[eu.includes(e.dataType)&&R.jsxs(uc.Option,{value:r,className:"flex items-center justify-between gap-2 px-3 py-2",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("span",{className:"font-thin",children:"#"}),R.jsx("span",{children:r})]}),r&&R.jsx(xr,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:A=>{A.stopPropagation(),T()},children:"Clear"})]},"custom"),(N==null?void 0:N.length)===0&&i!==""?R.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):N==null?void 0:N.map(A=>R.jsx(uc.Option,{className:({active:F})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${F?"bg-muted":"text-foreground-900"}`,value:A,children:({selected:F,active:z})=>R.jsxs("div",{className:"",children:[R.jsx("span",{className:`block ${F?"font-medium":"font-normal"}`,children:typeof A.value=="boolean"?A.value?"True":"False":A.value}),F?R.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:R.jsx(Ik,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},A.value))]})})]})})})}const vS=L.forwardRef(({className:e,...t},n)=>R.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}));vS.displayName="Textarea";const lN="Radio",[tce,cN]=er(lN),[nce,rce]=tce(lN),oce=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...c}=e,[u,f]=m.useState(null),p=_t(t,v=>f(v)),h=m.useRef(!1),b=u?!!u.closest("form"):!0;return m.createElement(nce,{scope:n,checked:o,disabled:s},m.createElement(Qe.button,de({type:"button",role:"radio","aria-checked":o,"data-state":uN(o),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:p,onClick:Me(e.onClick,v=>{o||l==null||l(),b&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})})),b&&m.createElement(ace,{control:u,bubbles:!h.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),ice="RadioIndicator",sce=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=rce(ice,n);return m.createElement(tr,{present:r||i.checked},m.createElement(Qe.span,de({"data-state":uN(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),ace=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=av(n),a=nv(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",de({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 uN(e){return e?"checked":"unchecked"}const lce=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dN="RadioGroup",[cce,C1e]=er(dN,[mu,cN]),fN=mu(),hN=cN(),[uce,dce]=cce(dN),fce=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:f,...p}=e,h=fN(n),b=Pl(c),[v,w]=_r({prop:i,defaultProp:o,onChange:f});return m.createElement(uce,{scope:n,name:r,required:s,disabled:a,value:v,onValueChange:w},m.createElement(mw,de({asChild:!0},h,{orientation:l,dir:b,loop:u}),m.createElement(Qe.div,de({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:b},p,{ref:t}))))}),hce="RadioGroupItem",pce=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=dce(hce,n),s=i.disabled||r,a=fN(n),l=hN(n),c=m.useRef(null),u=_t(t,c),f=i.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const h=v=>{lce.includes(v.key)&&(p.current=!0)},b=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",b)}},[]),m.createElement(vw,de({asChild:!0},a,{focusable:!s,active:f}),m.createElement(oce,de({disabled:s,required:i.required,checked:f},l,o,{name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Me(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Me(o.onFocus,()=>{var h;p.current&&((h=c.current)===null||h===void 0||h.click())})})))}),gce=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=hN(n);return m.createElement(sce,de({},o,r,{ref:t}))}),pN=fce,gN=pce,mce=gce,bS=L.forwardRef(({className:e,...t},n)=>R.jsx(pN,{className:_e("grid gap-2",e),...t,ref:n}));bS.displayName=pN.displayName;const hm=L.forwardRef(({className:e,...t},n)=>R.jsx(gN,{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:R.jsx(mce,{className:"flex items-center justify-center",children:R.jsx(Bk,{className:"h-2.5 w-2.5 fill-current text-current"})})}));hm.displayName=gN.displayName;function vce({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),{updateFilter:i}=wr();function s(){const c={...e,sql:t};i(c),o(!1)}function a(c){console.log("operation",c);const u={...e,operation:c};i(u)}function l(c){const u={...e,type:c};i(u)}return R.jsxs(gv,{open:r,onOpenChange:o,children:[R.jsx(mv,{children:R.jsx(p_,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),R.jsxs(sh,{onDoubleClick:c=>c.stopPropagation(),className:"m-2 w-full min-w-[350px] space-y-4",children:[R.jsxs("div",{className:"space-y-2",children:[R.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),R.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),R.jsx(ah,{}),R.jsxs("div",{className:"space-y-2",children:[R.jsx("div",{children:"Type"}),R.jsxs(bS,{onValueChange:l,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[R.jsxs("div",{className:"flex items-center space-x-2",children:[R.jsx(hm,{value:"multiple",id:"r1"}),R.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),R.jsxs("div",{className:"flex items-center space-x-2",children:[R.jsx(hm,{value:"single",id:"r2"}),R.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),R.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[R.jsxs("div",{className:"col-span-2 space-y-1",children:[R.jsx(Fn,{children:"Table Column"}),R.jsx(Fn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),R.jsxs("div",{className:"col-span-2 space-y-1",children:[R.jsx(Fn,{children:"Data Type"}),R.jsx(Fn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),R.jsxs("div",{className:"col-span-2 space-y-1",children:[R.jsx(Fn,{className:"text-sm",children:"Filter Operation"}),R.jsx(bce,{updateFilterOperation:a,value:e.operation})]})]}),R.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[R.jsx(Fn,{className:"text-sm",children:"Values SQL"}),R.jsx(vS,{value:t,onChange:c=>n(c.target.value),className:`min-w-full grow resize font-mono text-xs ${bg}`})]}),R.jsx("div",{className:"flex justify-end gap-2",children:R.jsxs(xr,{onClick:s,size:"sm",variant:"outline",children:[R.jsx(Qf,{className:"mr-2 size-4"}),"Save SQL"]})})]})]})}function bce({value:e,updateFilterOperation:t}){return R.jsxs(Vs,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[R.jsx(Zi,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:R.jsx(Hs,{placeholder:"Operation"})}),R.jsxs(es,{children:[R.jsx(Un,{value:"=",children:"Equals"}),R.jsx(Un,{value:"in",children:"Contains"}),R.jsx(Un,{value:"like",children:"Like"})]})]})}function mN({filter:e}){const t=$e(i=>i.isDashboardEditing),{removeFilterValue:n,removeFilter:r,updateFilter:o}=wr();return R.jsx(xi,{className:"my-1",text:e.title||e.column,onSave:i=>o({...e,title:i}),children:R.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[R.jsxs("div",{className:"flex grow items-center gap-2",children:[R.jsx(Fn,{className:"inline-block text-sm",children:e.title}),t&&R.jsx(vce,{filter:e})]}),R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("div",{onClick:()=>n(e.id),className:"invisible cursor-pointer text-xs text-muted-foreground hover:text-foreground hover:underline group-hover:visible",children:R.jsx(Vk,{className:"size-3.5"})}),t&&R.jsx(IJ,{onClick:()=>{n(e.id),r(e.id)},className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})]})]})})}const yce=RP.WidthProvider(RP.Responsive),yS=e=>Bf.includes(e.dataType)?R.jsx(wae,{filter:e}):R.jsx(ece,{filter:e});function xce(){var E,O;const e=$e(T=>T.isDashboardEditing);$e(T=>T.currentBreakpoint);const t=$e(T=>T.themeStyle),n=$e(T=>T.selectedSheetId),r=(E=$e(T=>{var N,M;return(M=(N=T.dashboard)==null?void 0:N.sheets)==null?void 0:M.filter(A=>A.id===n)}))==null?void 0:E[0].layouts,o=$e(T=>T.dashboard.filters),i=$e(T=>{var N,M,A;return(A=(M=(N=T.dashboard)==null?void 0:N.sheets)==null?void 0:M.find(F=>F.id===n))==null?void 0:A.frames}),{getSelectedSheet:s,getSelectedSheetLayout:a,getSelectedSheetLayouts:l,setSheetLayout:c,setSheetLayouts:u,setCurrentBreakpoint:f,removeFilter:p,updateFilter:h,removeFilterValue:b}=$e(T=>T.actions),v=s(),w=m.useCallback(T=>{f(T)},[]),y=m.useCallback((T,N)=>{v!=null&&v.id&&u(v.id,N)},[v==null?void 0:v.id,u]);if(!n)return null;const _=(T,N)=>R.jsx(vN,{className:"after:content-none",ref:N,handleAxis:T});function S(){return o==null?void 0:o.map(T=>{var N,M,A,F;return T.location==="frame"?null:R.jsxs("div",{style:{borderRadius:(M=(N=t==null?void 0:t.chart)==null?void 0:N.options)==null?void 0:M.borderRadius,fontFamily:(F=(A=t==null?void 0:t.chart)==null?void 0:A.font)==null?void 0:F.family},className:_e("z-50 flex w-full flex-col rounded-md border bg-background px-3 py-2"),children:[R.jsx(mN,{filter:T}),yS(T)]},T.id)})}function C(){return i==null?void 0:i.map(T=>R.jsx("div",{role:"dashboard-frame-container",className:_e("group overflow-hidden",t==null?void 0:t.dashboardCardContainer),children:R.jsx(Aoe,{frame:T})},T.id))}return R.jsx(R.Fragment,{children:R.jsxs(yce,{margin:[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],className:_e((O=t==null?void 0:t.gridLayout)==null?void 0:O.className),layouts:r,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:w,onLayoutChange:y,resizeHandle:_,children:[S(),C()]})})}const vN=m.forwardRef(({className:e,handleAxis:t,...n},r)=>($e(o=>o.themeStyle),R.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})));vN.displayName="ResizeHandle";let wce=(e,t=21)=>(n=t)=>{let r="",o=n;for(;o--;)r+=e[Math.random()*e.length|0];return r};var _u={exports:{}};const _ce=typeof Buffer<"u",o2=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i2=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function bN(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),_ce&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(o2.test(e)===!1&&i2.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(o2.test(e)===!1)return r}else if(i2.test(e)===!1)return r;return yN(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function yN(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const i=o;o=[];for(const s of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(const a in s){const l=s[a];l&&typeof l=="object"&&o.push(l)}}}return e}function xS(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return bN(e,t,n)}finally{Error.stackTraceLimit=r}}function Sce(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return bN(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}_u.exports=xS;_u.exports.default=xS;_u.exports.parse=xS;_u.exports.safeParse=Sce;_u.exports.scan=yN;var Cce=_u.exports;const s2=Rl(Cce);var xN=wce("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function Ece(e){const t=["ROOT"];let n=-1,r=null;function o(l,c,u){switch(l){case'"':{n=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const f=e.substring(r,l+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l)):n=l;break}}}let a=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?a+="true".slice(u.length):"false".startsWith(u)?a+="false".slice(u.length):"null".startsWith(u)&&(a+="null".slice(u.length))}}return a}function Rce(e){if(e!=null)try{return s2.parse(e)}catch{try{const n=Ece(e);return s2.parse(n)}catch{}}}var rf={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},of={code:"1",name:"function_call",parse:e=>{if(e==null||typeof e!="object"||!("function_call"in e)||typeof e.function_call!="object"||e.function_call==null||!("name"in e.function_call)||!("arguments"in e.function_call)||typeof e.function_call.name!="string"||typeof e.function_call.arguments!="string")throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},sf={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},af={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},lf={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},cf={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},uf={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},df={code:"7",name:"tool_calls",parse:e=>{if(e==null||typeof e!="object"||!("tool_calls"in e)||typeof e.tool_calls!="object"||e.tool_calls==null||!Array.isArray(e.tool_calls)||e.tool_calls.some(t=>t==null||typeof t!="object"||!("id"in t)||typeof t.id!="string"||!("type"in t)||typeof t.type!="string"||!("function"in t)||t.function==null||typeof t.function!="object"||!("arguments"in t.function)||typeof t.function.name!="string"||typeof t.function.arguments!="string"))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},ff={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},hf={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},pf={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},gf={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},mf={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},vf={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string"||!("usage"in e)||e.usage==null||typeof e.usage!="object"||!("promptTokens"in e.usage)||!("completionTokens"in e.usage))throw new Error('"finish_message" parts expect an object with a "finishReason" and "usage" property.');return typeof e.usage.promptTokens!="number"&&(e.usage.promptTokens=Number.NaN),typeof e.usage.completionTokens!="number"&&(e.usage.completionTokens=Number.NaN),{type:"finish_message",value:e}}},Pce=[rf,of,sf,af,lf,cf,uf,df,ff,hf,pf,gf,mf,vf],Oce={[rf.code]:rf,[of.code]:of,[sf.code]:sf,[af.code]:af,[lf.code]:lf,[cf.code]:cf,[uf.code]:uf,[df.code]:df,[ff.code]:ff,[hf.code]:hf,[pf.code]:pf,[gf.code]:gf,[mf.code]:mf,[vf.code]:vf};rf.name+"",rf.code,of.name+"",of.code,sf.name+"",sf.code,af.name+"",af.code,lf.name+"",lf.code,cf.name+"",cf.code,uf.name+"",uf.code,df.name+"",df.code,ff.name+"",ff.code,hf.name+"",hf.code,pf.name+"",pf.code,gf.name+"",gf.code,mf.name+"",mf.code,vf.name+"",vf.code;var $ce=Pce.map(e=>e.code),wN=e=>{const t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!$ce.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return Oce[r].parse(i)},Tce=10;function Dce(e,t){const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function*Ace(e,{isAborted:t}={}){const n=new TextDecoder,r=[];let o=0;for(;;){const{value:i}=await e.read();if(i&&(r.push(i),o+=i.length,i[i.length-1]!==Tce))continue;if(r.length===0)break;const s=Dce(r,o);o=0;const a=n.decode(s,{stream:!0}).split(`
|
|
408
|
-
`).filter(l=>l!=="").map(wN);for(const l of a)yield l;if(t!=null&&t()){e.cancel();break}}}function Jp(e,t){return!e||!t||!t.length?e:{...e,annotations:[...t]}}async function kce({reader:e,abortControllerRef:t,update:n,onToolCall:r,onFinish:o,generateId:i=xN,getCurrentDate:s=()=>new Date}){var a;const l=s(),c={data:[]};let u;const f={};let p={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},h="unknown";for await(const{type:b,value:v}of Ace(e,{isAborted:()=>(t==null?void 0:t.current)===null})){if(b==="text"&&(c.text?c.text={...c.text,content:(c.text.content||"")+v}:c.text={id:i(),role:"assistant",content:v,createdAt:l}),b==="finish_message"){const{completionTokens:C,promptTokens:E}=v.usage;h=v.finishReason,p={completionTokens:C,promptTokens:E,totalTokens:C+E}}if(b==="tool_call_streaming_start")c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),f[v.toolCallId]={text:"",toolName:v.toolName,prefixMapIndex:c.text.toolInvocations.length},c.text.toolInvocations.push({state:"partial-call",toolCallId:v.toolCallId,toolName:v.toolName,args:void 0});else if(b==="tool_call_delta"){const C=f[v.toolCallId];C.text+=v.argsTextDelta,c.text.toolInvocations[C.prefixMapIndex]={state:"partial-call",toolCallId:v.toolCallId,toolName:C.toolName,args:Rce(C.text)},c.text.internalUpdateId=i()}else if(b==="tool_call"){if(f[v.toolCallId]!=null?c.text.toolInvocations[f[v.toolCallId].prefixMapIndex]={state:"call",...v}:(c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),c.text.toolInvocations.push({state:"call",...v})),c.text.internalUpdateId=i(),r){const C=await r({toolCall:v});C!=null&&(c.text.toolInvocations[c.text.toolInvocations.length-1]={state:"result",...v,result:C})}}else if(b==="tool_result"){const C=(a=c.text)==null?void 0:a.toolInvocations;if(C==null)throw new Error("tool_result must be preceded by a tool_call");const E=C.findIndex(O=>O.toolCallId===v.toolCallId);if(E===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");C[E]={...C[E],state:"result",...v}}let w=null;b==="function_call"&&(c.function_call={id:i(),role:"assistant",content:"",function_call:v.function_call,name:v.function_call.name,createdAt:l},w=c.function_call);let y=null;b==="tool_calls"&&(c.tool_calls={id:i(),role:"assistant",content:"",tool_calls:v.tool_calls,createdAt:l},y=c.tool_calls),b==="data"&&c.data.push(...v);let _=c.text;b==="message_annotations"&&(u?u.push(...v):u=[...v],w=Jp(c.function_call,u),y=Jp(c.tool_calls,u),_=Jp(c.text,u)),u!=null&&u.length&&["text","function_call","tool_calls"].forEach(E=>{c[E]&&(c[E].annotations=[...u])});const S=[w,y,_].filter(Boolean).map(C=>({...Jp(C,u)}));n(S,[...c.data])}return o==null||o({prefixMap:c,finishReason:h,usage:p}),{messages:[c.text,c.function_call,c.tool_calls].filter(Boolean),data:c.data}}var Mce=()=>fetch;async function Ice({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:f,fetch:p=Mce()}){var h,b;const v=await p(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(h=i==null?void 0:i())==null?void 0:h.signal,credentials:r}).catch(y=>{throw s(),y});if(a)try{await a(v)}catch(y){throw y}if(!v.ok)throw s(),new Error((b=await v.text())!=null?b:"Failed to fetch the chat response.");if(!v.body)throw new Error("The response body is empty.");const w=v.body.getReader();switch(n){case"text":{const y=Nce(),_={id:f(),createdAt:new Date,role:"assistant",content:""};for(;;){const{done:S,value:C}=await w.read();if(S)break;if(_.content+=y(C),l([{..._}],[]),(i==null?void 0:i())===null){w.cancel();break}}return c==null||c(_,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"}),{messages:[_],data:[]}}case"data":return await kce({reader:w,abortControllerRef:i!=null?{current:i()}:void 0,update:l,onToolCall:u,onFinish({prefixMap:y,finishReason:_,usage:S}){c&&y.text!=null&&c(y.text,{usage:S,finishReason:_})},generateId:f});default:{const y=n;throw new Error(`Unknown stream protocol: ${y}`)}}}function Nce(e){const t=new TextDecoder;return e?function(n){return t.decode(n,{stream:!0}).split(`
|
|
409
|
-
`).filter(o=>o!=="").map(wN).filter(Boolean)}:function(n){return n?t.decode(n,{stream:!0}):""}}async function Lce({getStreamedResponse:e,experimental_onFunctionCall:t,experimental_onToolCall:n,updateChatRequest:r,getCurrentMessages:o}){for(;;){const i=await e();if("messages"in i){let s=!1;for(const a of i.messages)if(!((a.function_call===void 0||typeof a.function_call=="string")&&(a.tool_calls===void 0||typeof a.tool_calls=="string"))){if(s=!0,t){const l=a.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0){s=!1;break}r(c)}if(n){const l=a.tool_calls;if(!Array.isArray(l)||l.some(u=>typeof u!="object")){console.warn("experimental_onToolCall should not be defined when using tools");continue}const c=await n(o(),l);if(c===void 0){s=!1;break}r(c)}}if(!s)break}else{let s=function(l){for(const c of l.messages){if(c.tool_calls!==void 0)for(const u of c.tool_calls)typeof u=="object"&&u.function.arguments&&typeof u.function.arguments!="string"&&(u.function.arguments=JSON.stringify(u.function.arguments));c.function_call!==void 0&&typeof c.function_call=="object"&&c.function_call.arguments&&typeof c.function_call.arguments!="string"&&(c.function_call.arguments=JSON.stringify(c.function_call.arguments))}};const a=i;if((a.function_call===void 0||typeof a.function_call=="string")&&(a.tool_calls===void 0||typeof a.tool_calls=="string"))break;if(t){const l=a.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0)break;s(c),r(c)}if(n){const l=a.tool_calls;if(typeof l!="object"){console.warn("experimental_onToolCall should not be defined when using functions");continue}const c=await n(o(),l);if(c===void 0)break;s(c),r(c)}}}}var Fce=rw();const oa=()=>{},Nr=oa(),uy=Object,Ft=e=>e===Nr,vi=e=>typeof e=="function",ga=(e,t)=>({...e,...t}),jce=e=>vi(e.then),Zp=new WeakMap;let zce=0;const bf=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(uy(e)===e&&!r&&n!=RegExp){if(o=Zp.get(e),o)return o;if(o=++zce+"~",Zp.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=bf(e[i])+",";Zp.set(e,o)}if(n==uy){o="#";const s=uy.keys(e).sort();for(;!Ft(i=s.pop());)Ft(e[i])||(o+=i+":"+bf(e[i])+",");Zp.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},ts=new WeakMap,dy={},eg={},wS="undefined",wv=typeof window!=wS,C1=typeof document!=wS,Bce=()=>wv&&typeof window.requestAnimationFrame!=wS,_N=(e,t)=>{const n=ts.get(e);return[()=>!Ft(t)&&e.get(t)||dy,r=>{if(!Ft(t)){const o=e.get(t);t in eg||(eg[t]=o),n[5](t,ga(o,r),o||dy)}},n[6],()=>!Ft(t)&&t in eg?eg[t]:!Ft(t)&&e.get(t)||dy]};let E1=!0;const Vce=()=>E1,[R1,P1]=wv&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[oa,oa],Hce=()=>{const e=C1&&document.visibilityState;return Ft(e)||e!=="hidden"},Wce=e=>(C1&&document.addEventListener("visibilitychange",e),R1("focus",e),()=>{C1&&document.removeEventListener("visibilitychange",e),P1("focus",e)}),Uce=e=>{const t=()=>{E1=!0,e()},n=()=>{E1=!1};return R1("online",t),R1("offline",n),()=>{P1("online",t),P1("offline",n)}},qce={isOnline:Vce,isVisible:Hce},Gce={initFocus:Wce,initReconnect:Uce},a2=!m.useId,yf=!wv||"Deno"in window,Yce=e=>Bce()?window.requestAnimationFrame(e):setTimeout(e,1),fy=yf?m.useEffect:m.useLayoutEffect,hy=typeof navigator<"u"&&navigator.connection,l2=!yf&&hy&&(["slow-2g","2g"].includes(hy.effectiveType)||hy.saveData),_S=e=>{if(vi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?bf(e):"",[e,t]};let Kce=0;const O1=()=>++Kce,SN=0,CN=1,EN=2,Xce=3;var dd={__proto__:null,ERROR_REVALIDATE_EVENT:Xce,FOCUS_EVENT:SN,MUTATE_EVENT:EN,RECONNECT_EVENT:CN};async function RN(...e){const[t,n,r,o]=e,i=ga({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=p=>typeof a=="function"?a(p):a!==!1,u=i.throwOnError;if(vi(n)){const p=n,h=[],b=t.keys();for(const v of b)!/^\$(inf|sub)\$/.test(v)&&p(t.get(v)._k)&&h.push(v);return Promise.all(h.map(f))}return f(n);async function f(p){const[h]=_S(p);if(!h)return;const[b,v]=_N(t,h),[w,y,_,S]=ts.get(t),C=()=>{const X=w[h];return(vi(i.revalidate)?i.revalidate(b().data,p):i.revalidate!==!1)&&(delete _[h],delete S[h],X&&X[0])?X[0](EN).then(()=>b().data):b().data};if(e.length<3)return C();let E=r,O;const T=O1();y[h]=[T,0];const N=!Ft(l),M=b(),A=M.data,F=M._c,z=Ft(F)?A:F;if(N&&(l=vi(l)?l(z,A):l,v({data:l,_c:z})),vi(E))try{E=E(z)}catch(X){O=X}if(E&&jce(E))if(E=await E.catch(X=>{O=X}),T!==y[h][0]){if(O)throw O;return E}else O&&N&&c(O)&&(s=!0,v({data:z,_c:Nr}));if(s&&!O)if(vi(s)){const X=s(E,z);v({data:X,error:Nr,_c:Nr})}else v({data:E,error:Nr,_c:Nr});if(y[h][1]=O1(),Promise.resolve(C()).then(()=>{v({_c:Nr})}),O){if(u)throw O;return}return E}}const c2=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Qce=(e,t)=>{if(!ts.has(e)){const n=ga(Gce,t),r={},o=RN.bind(Nr,e);let i=oa;const s={},a=(u,f)=>{const p=s[u]||[];return s[u]=p,p.push(f),()=>p.splice(p.indexOf(f),1)},l=(u,f,p)=>{e.set(u,f);const h=s[u];if(h)for(const b of h)b(f,p)},c=()=>{if(!ts.has(e)&&(ts.set(e,[r,{},{},{},o,l,a]),!yf)){const u=n.initFocus(setTimeout.bind(Nr,c2.bind(Nr,r,SN))),f=n.initReconnect(setTimeout.bind(Nr,c2.bind(Nr,r,CN)));i=()=>{u&&u(),f&&f(),ts.delete(e)}}};return c(),[e,o,c,i]}return[e,ts.get(e)[4]]},Jce=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Ft(i)&&s>i||setTimeout(r,a,o)},Zce=(e,t)=>bf(e)==bf(t),[PN,eue]=Qce(new Map),tue=ga({onLoadingSlow:oa,onSuccess:oa,onError:oa,onErrorRetry:Jce,onDiscarded:oa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:l2?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:l2?5e3:3e3,compare:Zce,isPaused:()=>!1,cache:PN,mutate:eue,fallback:{}},qce),nue=(e,t)=>{const n=ga(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=ga(o,s))}return n},rue=m.createContext({}),oue="$inf$",ON=wv&&window.__SWR_DEVTOOLS_USE__,iue=ON?window.__SWR_DEVTOOLS_USE__:[],sue=()=>{ON&&(window.__SWR_DEVTOOLS_REACT__=m)},aue=e=>vi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],lue=()=>ga(tue,m.useContext(rue)),cue=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=_S(t),[,,,a]=ts.get(PN);if(s.startsWith(oue))return n(...i);const l=a[s];return Ft(l)?n(...i):(delete a[s],l)}),r),uue=iue.concat(cue),due=e=>function(...n){const r=lue(),[o,i,s]=aue(n),a=nue(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(uue);for(let f=u.length;f--;)l=u[f](l);return l(o,i||a.fetcher||null,a)},fue=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};sue();const u2=m.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),py={dedupe:!0},hue=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:f,keepPreviousData:p}=n,[h,b,v,w]=ts.get(r),[y,_]=_S(e),S=m.useRef(!1),C=m.useRef(!1),E=m.useRef(y),O=m.useRef(t),T=m.useRef(n),N=()=>T.current,M=()=>N().isVisible()&&N().isOnline(),[A,F,z,X]=_N(r,y),ee=m.useRef({}).current,H=Ft(s)?n.fallback[y]:s,Q=(K,be)=>{for(const Se in ee){const Oe=Se;if(Oe==="data"){if(!o(K[Oe],be[Oe])&&(!Ft(K[Oe])||!o(fe,be[Oe])))return!1}else if(be[Oe]!==K[Oe])return!1}return!0},Y=m.useMemo(()=>{const K=!y||!t?!1:Ft(a)?N().isPaused()||i?!1:Ft(l)?!0:l:a,be=Ie=>{const Ke=ga(Ie);return delete Ke._k,K?{isValidating:!0,isLoading:!0,...Ke}:Ke},Se=A(),Oe=X(),Te=be(Se),Ue=Se===Oe?Te:be(Oe);let Be=Te;return[()=>{const Ie=be(A());return Q(Ie,Be)?(Be.data=Ie.data,Be.isLoading=Ie.isLoading,Be.isValidating=Ie.isValidating,Be.error=Ie.error,Be):(Be=Ie,Ie)},()=>Ue]},[r,y]),J=Fce.useSyncExternalStore(m.useCallback(K=>z(y,(be,Se)=>{Q(Se,be)||K()}),[r,y]),Y[0],Y[1]),W=!S.current,$=h[y]&&h[y].length>0,V=J.data,U=Ft(V)?H:V,I=J.error,te=m.useRef(U),fe=p?Ft(V)?te.current:V:U,ne=$&&!Ft(I)?!1:W&&!Ft(a)?a:N().isPaused()?!1:i?Ft(U)?!1:l:Ft(U)||l,ue=!!(y&&t&&W&&ne),ie=Ft(J.isValidating)?ue:J.isValidating,oe=Ft(J.isLoading)?ue:J.isLoading,le=m.useCallback(async K=>{const be=O.current;if(!y||!be||C.current||N().isPaused())return!1;let Se,Oe,Te=!0;const Ue=K||{},Be=!v[y]||!Ue.dedupe,Ie=()=>a2?!C.current&&y===E.current&&S.current:y===E.current,Ke={isValidating:!1,isLoading:!1},lt=()=>{F(Ke)},It=()=>{const Ht=v[y];Ht&&Ht[1]===Oe&&delete v[y]},Dt={isValidating:!0};Ft(A().data)&&(Dt.isLoading=!0);try{if(Be&&(F(Dt),n.loadingTimeout&&Ft(A().data)&&setTimeout(()=>{Te&&Ie()&&N().onLoadingSlow(y,n)},n.loadingTimeout),v[y]=[be(_),O1()]),[Se,Oe]=v[y],Se=await Se,Be&&setTimeout(It,n.dedupingInterval),!v[y]||v[y][1]!==Oe)return Be&&Ie()&&N().onDiscarded(y),!1;Ke.error=Nr;const Ht=b[y];if(!Ft(Ht)&&(Oe<=Ht[0]||Oe<=Ht[1]||Ht[1]===0))return lt(),Be&&Ie()&&N().onDiscarded(y),!1;const pe=A().data;Ke.data=o(pe,Se)?pe:Se,Be&&Ie()&&N().onSuccess(Se,y,n)}catch(Ht){It();const pe=N(),{shouldRetryOnError:Ee}=pe;pe.isPaused()||(Ke.error=Ht,Be&&Ie()&&(pe.onError(Ht,y,pe),(Ee===!0||vi(Ee)&&Ee(Ht))&&(!N().revalidateOnFocus||!N().revalidateOnReconnect||M())&&pe.onErrorRetry(Ht,y,pe,Le=>{const Ge=h[y];Ge&&Ge[0]&&Ge[0](dd.ERROR_REVALIDATE_EVENT,Le)},{retryCount:(Ue.retryCount||0)+1,dedupe:!0})))}return Te=!1,lt(),!0},[y,r]),ye=m.useCallback((...K)=>RN(r,E.current,...K),[]);if(fy(()=>{O.current=t,T.current=n,Ft(V)||(te.current=V)}),fy(()=>{if(!y)return;const K=le.bind(Nr,py);let be=0;const Oe=fue(y,h,(Te,Ue={})=>{if(Te==dd.FOCUS_EVENT){const Be=Date.now();N().revalidateOnFocus&&Be>be&&M()&&(be=Be+N().focusThrottleInterval,K())}else if(Te==dd.RECONNECT_EVENT)N().revalidateOnReconnect&&M()&&K();else{if(Te==dd.MUTATE_EVENT)return le();if(Te==dd.ERROR_REVALIDATE_EVENT)return le(Ue)}});return C.current=!1,E.current=y,S.current=!0,F({_k:_}),ne&&(Ft(U)||yf?K():Yce(K)),()=>{C.current=!0,Oe()}},[y]),fy(()=>{let K;function be(){const Oe=vi(c)?c(A().data):c;Oe&&K!==-1&&(K=setTimeout(Se,Oe))}function Se(){!A().error&&(u||N().isVisible())&&(f||N().isOnline())?le(py).then(be):be()}return be(),()=>{K&&(clearTimeout(K),K=-1)}},[c,u,f,y]),m.useDebugValue(fe),i&&Ft(U)&&y){if(!a2&&yf)throw new Error("Fallback data is required when using suspense in SSR.");O.current=t,T.current=n,C.current=!1;const K=w[y];if(!Ft(K)){const be=ye(K);u2(be)}if(Ft(I)){const be=le(py);Ft(fe)||(be.status="fulfilled",be.value=!0),u2(be)}else throw I}return{mutate:ye,get data(){return ee.data=!0,fe},get error(){return ee.error=!0,I},get isValidating(){return ee.isValidating=!0,ie},get isLoading(){return ee.isLoading=!0,oe}}},tg=due(hue);var pue=async(e,t,n,r,o,i,s,a,l,c,u,f,p,h,b,v,w)=>{var y;const _=s.current;n(t.messages,!1);const S=h?t.messages:t.messages.map(({role:C,content:E,experimental_attachments:O,name:T,data:N,annotations:M,toolInvocations:A,function_call:F,tool_calls:z,tool_call_id:X})=>({role:C,content:E,...O!==void 0&&{experimental_attachments:O},...T!==void 0&&{name:T},...N!==void 0&&{data:N},...M!==void 0&&{annotations:M},...A!==void 0&&{toolInvocations:A},tool_call_id:X,...F!==void 0&&{function_call:F},...z!==void 0&&{tool_calls:z}}));return await Ice({api:e,body:(y=b==null?void 0:b({messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?y:{messages:S,data:t.data,...i.current.body,...t.body,...t.functions!==void 0&&{functions:t.functions},...t.function_call!==void 0&&{function_call:t.function_call},...t.tools!==void 0&&{tools:t.tools},...t.tool_choice!==void 0&&{tool_choice:t.tool_choice}},streamProtocol:c,credentials:i.current.credentials,headers:{...i.current.headers,...t.headers},abortController:()=>a.current,restoreMessagesOnFailure(){w||n(_,!1)},onResponse:f,onUpdate(C,E){n([...t.messages,...C],!1),r([...o||[],...E||[]],!1)},onToolCall:p,onFinish:u,generateId:l,fetch:v})};function gue({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,experimental_onFunctionCall:i,experimental_onToolCall:s,onToolCall:a,experimental_prepareRequestBody:l,experimental_maxAutomaticRoundtrips:c=0,maxAutomaticRoundtrips:u=c,maxToolRoundtrips:f=u,streamMode:p,streamProtocol:h,onResponse:b,onFinish:v,onError:w,credentials:y,headers:_,body:S,generateId:C=xN,fetch:E,keepLastMessageOnError:O=!1}={}){p&&(h??(h=p==="text"?"text":void 0));const T=m.useId(),N=t??T,M=typeof e=="string"?[e,N]:N,[A]=m.useState([]),{data:F,mutate:z}=tg([M,"messages"],null,{fallbackData:n??A}),{data:X=!1,mutate:ee}=tg([M,"loading"],null),{data:H,mutate:Q}=tg([M,"streamData"],null),{data:Y=void 0,mutate:J}=tg([M,"error"],null),W=m.useRef(F||[]);m.useEffect(()=>{W.current=F||[]},[F]);const $=m.useRef(null),V=m.useRef({credentials:y,headers:_,body:S});m.useEffect(()=>{V.current={credentials:y,headers:_,body:S}},[y,_,S]);const U=m.useCallback(async K=>{const be=W.current.length;try{ee(!0),J(void 0);const Te=new AbortController;$.current=Te,await Lce({getStreamedResponse:()=>pue(e,K,z,Q,H,V,W,$,C,h,v,b,a,o,l,E,O),experimental_onFunctionCall:i,experimental_onToolCall:s,updateChatRequest:Ue=>{K=Ue},getCurrentMessages:()=>W.current}),$.current=null}catch(Te){if(Te.name==="AbortError")return $.current=null,null;w&&Te instanceof Error&&w(Te),J(Te)}finally{ee(!1)}const Se=W.current,Oe=Se[Se.length-1];Se.length>be&&Oe!=null&&f>0&&d2(Oe)&&mue(Se)<=f&&await U({messages:Se})},[z,ee,e,V,b,v,w,J,Q,H,h,o,i,s,l,a,f,W,$,C,E,O]),I=m.useCallback(async(K,{options:be,functions:Se,function_call:Oe,tools:Te,tool_choice:Ue,data:Be,headers:Ie,body:Ke}={})=>{K.id||(K.id=C());const lt={headers:Ie??(be==null?void 0:be.headers),body:Ke??(be==null?void 0:be.body)},It={messages:W.current.concat(K),options:lt,headers:lt.headers,body:lt.body,data:Be,...Se!==void 0&&{functions:Se},...Oe!==void 0&&{function_call:Oe},...Te!==void 0&&{tools:Te},...Ue!==void 0&&{tool_choice:Ue}};return U(It)},[U,C]),te=m.useCallback(async({options:K,functions:be,function_call:Se,tools:Oe,tool_choice:Te,data:Ue,headers:Be,body:Ie}={})=>{if(W.current.length===0)return null;const Ke={headers:Be??(K==null?void 0:K.headers),body:Ie??(K==null?void 0:K.body)};if(W.current[W.current.length-1].role==="assistant"){const Dt={messages:W.current.slice(0,-1),options:Ke,headers:Ke.headers,body:Ke.body,data:Ue,...be!==void 0&&{functions:be},...Se!==void 0&&{function_call:Se},...Oe!==void 0&&{tools:Oe},...Te!==void 0&&{tool_choice:Te}};return U(Dt)}const It={messages:W.current,options:Ke,headers:Ke.headers,body:Ke.body,data:Ue,...be!==void 0&&{functions:be},...Se!==void 0&&{function_call:Se},...Oe!==void 0&&{tools:Oe},...Te!==void 0&&{tool_choice:Te}};return U(It)},[U]),fe=m.useCallback(()=>{$.current&&($.current.abort(),$.current=null)},[]),ne=m.useCallback(K=>{typeof K=="function"&&(K=K(W.current)),z(K,!1),W.current=K},[z]),[ue,ie]=m.useState(r),oe=m.useCallback(async(K,be={},Se)=>{var Oe,Te,Ue,Be,Ie;if((Oe=K==null?void 0:K.preventDefault)==null||Oe.call(K),!ue&&!be.allowEmptySubmit)return;Se&&(V.current={...V.current,...Se});const Ke=[],lt=be.experimental_attachments;if(lt)if(lt instanceof FileList)for(const pe of Array.from(lt)){const{name:Ee,type:Le}=pe,Ge=await new Promise((Ze,Wt)=>{const Zt=new FileReader;Zt.onload=Kt=>{var vn;Ze((vn=Kt.target)==null?void 0:vn.result)},Zt.onerror=Kt=>Wt(Kt),Zt.readAsDataURL(pe)});Ke.push({name:Ee,contentType:Le,url:Ge})}else if(Array.isArray(lt))for(const pe of lt){const{name:Ee,url:Le,contentType:Ge}=pe;Ke.push({name:Ee,contentType:Ge,url:Le})}else throw new Error("Invalid attachments type");const It={headers:(Ue=be.headers)!=null?Ue:(Te=be.options)==null?void 0:Te.headers,body:(Ie=be.body)!=null?Ie:(Be=be.options)==null?void 0:Be.body},Ht={messages:!ue&&be.allowEmptySubmit?W.current:W.current.concat({id:C(),createdAt:new Date,role:"user",content:ue,experimental_attachments:Ke.length>0?Ke:void 0}),options:It,headers:It.headers,body:It.body,data:be.data};U(Ht),ie("")},[ue,C,U]),le=K=>{ie(K.target.value)},ye=({toolCallId:K,result:be})=>{const Se=W.current.map((Te,Ue,Be)=>Ue===Be.length-1&&Te.role==="assistant"&&Te.toolInvocations?{...Te,toolInvocations:Te.toolInvocations.map(Ie=>Ie.toolCallId===K?{...Ie,result:be}:Ie)}:Te);z(Se,!1);const Oe=Se[Se.length-1];d2(Oe)&&U({messages:Se})};return{messages:F||[],error:Y,append:I,reload:te,stop:fe,setMessages:ne,input:ue,setInput:ie,handleInputChange:le,handleSubmit:oe,isLoading:X,data:H,addToolResult:ye,experimental_addToolResult:ye}}function d2(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function mue(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}function vue(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const $N="ScrollArea",[TN,E1e]=er($N),[bue,No]=TN($N),DN=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=m.useState(null),[c,u]=m.useState(null),[f,p]=m.useState(null),[h,b]=m.useState(null),[v,w]=m.useState(null),[y,_]=m.useState(0),[S,C]=m.useState(0),[E,O]=m.useState(!1),[T,N]=m.useState(!1),M=_t(t,F=>l(F)),A=Pl(o);return m.createElement(bue,{scope:n,type:r,dir:A,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:f,onContentChange:p,scrollbarX:h,onScrollbarXChange:b,scrollbarXEnabled:E,onScrollbarXEnabledChange:O,scrollbarY:v,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:N,onCornerWidthChange:_,onCornerHeightChange:C},m.createElement(Qe.div,de({dir:A},s,{ref:M,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})))}),yue="ScrollAreaViewport",xue=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=No(yue,n),s=m.useRef(null),a=_t(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(Qe.div,de({"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)))}),ps="ScrollAreaScrollbar",AN=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=No(ps,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(wue,de({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(_ue,de({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(kN,de({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(SS,de({},r,{ref:t})):null}),wue=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=No(ps,e.__scopeScrollArea),[i,s]=m.useState(!1);return m.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),m.createElement(tr,{present:n||i},m.createElement(kN,de({"data-state":i?"visible":"hidden"},r,{ref:t})))}),_ue=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=No(ps,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Sv(()=>l("SCROLL_END"),100),[a,l]=vue("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 c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),m.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let f=c[u];const p=()=>{const h=c[u];f!==h&&(l("SCROLL"),s()),f=h};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),m.createElement(tr,{present:n||a!=="hidden"},m.createElement(SS,de({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Me(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Me(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),kN=m.forwardRef((e,t)=>{const n=No(ps,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=m.useState(!1),a=e.orientation==="horizontal",l=Sv(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return fu(n.viewport,l),fu(n.content,l),m.createElement(tr,{present:r||i},m.createElement(SS,de({"data-state":i?"visible":"hidden"},o,{ref:t})))}),SS=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=No(ps,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}}),c=LN(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function f(p,h){return Tue(p,s.current,a,h)}return n==="horizontal"?m.createElement(Sue,de({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,h=f2(p,a,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}})):n==="vertical"?m.createElement(Cue,de({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,h=f2(p,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}})):null}),Sue=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=No(ps,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=_t(t,l,i.onScrollbarXChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(IN,de({"data-orientation":"horizontal"},o,{ref:c,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":_v(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),jN(p,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:pm(s.paddingLeft),paddingEnd:pm(s.paddingRight)}})}}))}),Cue=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=No(ps,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=_t(t,l,i.onScrollbarYChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(IN,de({"data-orientation":"vertical"},o,{ref:c,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":_v(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),jN(p,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:pm(s.paddingTop),paddingEnd:pm(s.paddingBottom)}})}}))}),[Eue,MN]=TN(ps),IN=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:f,...p}=e,h=No(ps,n),[b,v]=m.useState(null),w=_t(t,M=>v(M)),y=m.useRef(null),_=m.useRef(""),S=h.viewport,C=r.content-r.viewport,E=jn(u),O=jn(l),T=Sv(f,10);function N(M){if(y.current){const A=M.clientX-y.current.left,F=M.clientY-y.current.top;c({x:A,y:F})}}return m.useEffect(()=>{const M=A=>{const F=A.target;(b==null?void 0:b.contains(F))&&E(A,C)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[S,b,C,E]),m.useEffect(O,[r,O]),fu(b,T),fu(h.content,T),m.createElement(Eue,{scope:n,scrollbar:b,hasThumb:o,onThumbChange:jn(i),onThumbPointerUp:jn(s),onThumbPositionChange:O,onThumbPointerDown:jn(a)},m.createElement(Qe.div,de({},p,{ref:w,style:{position:"absolute",...p.style},onPointerDown:Me(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),y.current=b.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),N(M))}),onPointerMove:Me(e.onPointerMove,N),onPointerUp:Me(e.onPointerUp,M=>{const A=M.target;A.hasPointerCapture(M.pointerId)&&A.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=_.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})))}),$1="ScrollAreaThumb",Rue=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=MN($1,e.__scopeScrollArea);return m.createElement(tr,{present:n||o.hasThumb},m.createElement(Pue,de({ref:t},r)))}),Pue=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=No($1,n),s=MN($1,n),{onThumbPositionChange:a}=s,l=_t(t,f=>s.onThumbChange(f)),c=m.useRef(),u=Sv(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(u(),!c.current){const h=Due(f,a);c.current=h,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,u,a]),m.createElement(Qe.div,de({"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:Me(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),b=f.clientX-h.left,v=f.clientY-h.top;s.onThumbPointerDown({x:b,y:v})}),onPointerUp:Me(e.onPointerUp,s.onThumbPointerUp)}))}),NN="ScrollAreaCorner",Oue=m.forwardRef((e,t)=>{const n=No(NN,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement($ue,de({},e,{ref:t})):null}),$ue=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=No(NN,n),[i,s]=m.useState(0),[a,l]=m.useState(0),c=!!(i&&a);return fu(o.scrollbarX,()=>{var u;const f=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(f),l(f)}),fu(o.scrollbarY,()=>{var u;const f=((u=o.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;o.onCornerWidthChange(f),s(f)}),c?m.createElement(Qe.div,de({},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 pm(e){return e?parseInt(e,10):0}function LN(e,t){const n=e/t;return isNaN(n)?0:n}function _v(e){const t=LN(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Tue(e,t,n,r="ltr"){const o=_v(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return FN([l,c],f)(e)}function f2(e,t,n="ltr"){const r=_v(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],c=u1(e,l);return FN([0,s],[0,a])(c)}function FN(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 jN(e,t){return e>0&&e<t}const Due=(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 Sv(e,t){const n=jn(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 fu(e,t){const n=jn(t);ur(()=>{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 zN=DN,Aue=xue,kue=Oue,CS=L.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(zN,{ref:r,className:_e("relative overflow-hidden",e),...n,children:[R.jsx(Aue,{className:"h-full w-full rounded-[inherit]",children:t}),R.jsx(Cv,{}),R.jsx(kue,{})]}));CS.displayName=zN.displayName;const Cv=L.forwardRef(({className:e,orientation:t="vertical",...n},r)=>R.jsx(AN,{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:R.jsx(Rue,{className:"relative flex-1 rounded-full bg-border"})}));Cv.displayName=AN.displayName;const BN="Switch",[Mue,R1e]=er(BN),[Iue,Nue]=Mue(BN),Lue=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,p]=m.useState(null),h=_t(t,_=>p(_)),b=m.useRef(!1),v=f?!!f.closest("form"):!0,[w=!1,y]=_r({prop:o,defaultProp:i,onChange:c});return m.createElement(Iue,{scope:n,checked:w,disabled:a},m.createElement(Qe.button,de({type:"button",role:"switch","aria-checked":w,"aria-required":s,"data-state":VN(w),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:h,onClick:Me(e.onClick,_=>{y(S=>!S),v&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})})),v&&m.createElement(zue,{control:f,bubbles:!b.current,name:r,value:l,checked:w,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Fue="SwitchThumb",jue=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Nue(Fue,n);return m.createElement(Qe.span,de({"data-state":VN(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),zue=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=av(n),a=nv(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",de({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 VN(e){return e?"checked":"unchecked"}const Ev=Lue,HN=jue,WN=L.forwardRef(({className:e,...t},n)=>R.jsx(Ev,{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:R.jsx(HN,{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")})}));WN.displayName=Ev.displayName;const Bue=L.forwardRef(({className:e,...t},n)=>R.jsx(Ev,{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:R.jsx(HN,{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")})}));Bue.displayName=Ev.displayName;function Vue(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Hue=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wue=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uue={};function h2(e,t){return((t||Uue).jsx?Wue:Hue).test(e)}const que=/[ \t\n\f\r]/g;function Gue(e){return typeof e=="object"?e.type==="text"?p2(e.value):!1:p2(e)}function p2(e){return e.replace(que,"")===""}class gh{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}gh.prototype.property={};gh.prototype.normal={};gh.prototype.space=null;function UN(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new gh(n,r,t)}function T1(e){return e.toLowerCase()}class Lo{constructor(t,n){this.property=t,this.attribute=n}}Lo.prototype.space=null;Lo.prototype.boolean=!1;Lo.prototype.booleanish=!1;Lo.prototype.overloadedBoolean=!1;Lo.prototype.number=!1;Lo.prototype.commaSeparated=!1;Lo.prototype.spaceSeparated=!1;Lo.prototype.commaOrSpaceSeparated=!1;Lo.prototype.mustUseProperty=!1;Lo.prototype.defined=!1;let Yue=0;const mt=Il(),An=Il(),qN=Il(),De=Il(),on=Il(),Ac=Il(),Xr=Il();function Il(){return 2**++Yue}const D1=Object.freeze(Object.defineProperty({__proto__:null,boolean:mt,booleanish:An,commaOrSpaceSeparated:Xr,commaSeparated:Ac,number:De,overloadedBoolean:qN,spaceSeparated:on},Symbol.toStringTag,{value:"Module"})),gy=Object.keys(D1);class ES extends Lo{constructor(t,n,r,o){let i=-1;if(super(t,n),g2(this,"space",o),typeof r=="number")for(;++i<gy.length;){const s=gy[i];g2(this,gy[i],(r&D1[s])===D1[s])}}}ES.prototype.defined=!0;function g2(e,t,n){n&&(e[t]=n)}const Kue={}.hasOwnProperty;function Su(e){const t={},n={};let r;for(r in e.properties)if(Kue.call(e.properties,r)){const o=e.properties[r],i=new ES(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[T1(r)]=r,n[T1(i.attribute)]=r}return new gh(t,n,e.space)}const GN=Su({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),YN=Su({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function KN(e,t){return t in e?e[t]:t}function XN(e,t){return KN(e,t.toLowerCase())}const QN=Su({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:XN,properties:{xmlns:null,xmlnsXLink:null}}),JN=Su({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:An,ariaAutoComplete:null,ariaBusy:An,ariaChecked:An,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:on,ariaCurrent:null,ariaDescribedBy:on,ariaDetails:null,ariaDisabled:An,ariaDropEffect:on,ariaErrorMessage:null,ariaExpanded:An,ariaFlowTo:on,ariaGrabbed:An,ariaHasPopup:null,ariaHidden:An,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:on,ariaLevel:De,ariaLive:null,ariaModal:An,ariaMultiLine:An,ariaMultiSelectable:An,ariaOrientation:null,ariaOwns:on,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:An,ariaReadOnly:An,ariaRelevant:null,ariaRequired:An,ariaRoleDescription:on,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:An,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null}}),Xue=Su({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:XN,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ac,acceptCharset:on,accessKey:on,action:null,allow:null,allowFullScreen:mt,allowPaymentRequest:mt,allowUserMedia:mt,alt:null,as:null,async:mt,autoCapitalize:null,autoComplete:on,autoFocus:mt,autoPlay:mt,blocking:on,capture:null,charSet:null,checked:mt,cite:null,className:on,cols:De,colSpan:null,content:null,contentEditable:An,controls:mt,controlsList:on,coords:De|Ac,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mt,defer:mt,dir:null,dirName:null,disabled:mt,download:qN,draggable:An,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mt,formTarget:null,headers:on,height:De,hidden:mt,high:De,href:null,hrefLang:null,htmlFor:on,httpEquiv:on,id:null,imageSizes:null,imageSrcSet:null,inert:mt,inputMode:null,integrity:null,is:null,isMap:mt,itemId:null,itemProp:on,itemRef:on,itemScope:mt,itemType:on,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mt,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:mt,muted:mt,name:null,nonce:null,noModule:mt,noValidate:mt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:mt,optimum:De,pattern:null,ping:on,placeholder:null,playsInline:mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mt,referrerPolicy:null,rel:on,required:mt,reversed:mt,rows:De,rowSpan:De,sandbox:on,scope:null,scoped:mt,seamless:mt,selected:mt,shadowRootDelegatesFocus:mt,shadowRootMode:null,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:An,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:mt,useMap:null,value:An,width:De,wrap:null,align:null,aLink:null,archive:on,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:mt,declare:mt,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:mt,noHref:mt,noShade:mt,noWrap:mt,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:An,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:mt,disableRemotePlayback:mt,prefix:null,property:null,results:De,security:null,unselectable:null}}),Que=Su({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:KN,properties:{about:Xr,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:on,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ac,g2:Ac,glyphName:Ac,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:Xr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:De,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:on,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xr,rev:Xr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xr,requiredFeatures:Xr,requiredFonts:Xr,requiredFormats:Xr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:Xr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xr,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Jue=/^data[-\w.:]+$/i,m2=/-[a-z]/g,Zue=/[A-Z]/g;function ede(e,t){const n=T1(t);let r=t,o=Lo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Jue.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(m2,nde);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!m2.test(i)){let s=i.replace(Zue,tde);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=ES}return new o(r,t)}function tde(e){return"-"+e.toLowerCase()}function nde(e){return e.charAt(1).toUpperCase()}const rde={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ode=UN([YN,GN,QN,JN,Xue],"html"),RS=UN([YN,GN,QN,JN,Que],"svg");function ide(e){return e.join(" ").trim()}var ZN={},v2=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,sde=/\n/g,ade=/^\s*/,lde=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,cde=/^:\s*/,ude=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,dde=/^[;\s]*/,fde=/^\s+|\s+$/g,hde=`
|
|
410
|
-
`,b2="/",y2="*",Ga="",pde="comment",gde="declaration",mde=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(b){var v=b.match(sde);v&&(n+=v.length);var w=b.lastIndexOf(hde);r=~w?b.length-w:r+b.length}function i(){var b={line:n,column:r};return function(v){return v.position=new s(b),c(),v}}function s(b){this.start=b,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(b){var v=new Error(t.source+":"+n+":"+r+": "+b);if(v.reason=b,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function l(b){var v=b.exec(e);if(v){var w=v[0];return o(w),e=e.slice(w.length),v}}function c(){l(ade)}function u(b){var v;for(b=b||[];v=f();)v!==!1&&b.push(v);return b}function f(){var b=i();if(!(b2!=e.charAt(0)||y2!=e.charAt(1))){for(var v=2;Ga!=e.charAt(v)&&(y2!=e.charAt(v)||b2!=e.charAt(v+1));)++v;if(v+=2,Ga===e.charAt(v-1))return a("End of comment missing");var w=e.slice(2,v-2);return r+=2,o(w),e=e.slice(v),r+=2,b({type:pde,comment:w})}}function p(){var b=i(),v=l(lde);if(v){if(f(),!l(cde))return a("property missing ':'");var w=l(ude),y=b({type:gde,property:x2(v[0].replace(v2,Ga)),value:w?x2(w[0].replace(v2,Ga)):Ga});return l(dde),y}}function h(){var b=[];u(b);for(var v;v=p();)v!==!1&&(b.push(v),u(b));return b}return c(),h()};function x2(e){return e?e.replace(fde,Ga):Ga}var vde=Ws&&Ws.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ZN,"__esModule",{value:!0});var bde=vde(mde);function yde(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,bde.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var s=i.property,a=i.value;o?t(s,a,i):a&&(n=n||{},n[s]=a)}}),n}var w2=ZN.default=yde;const xde=w2.default||w2,e5=t5("end"),PS=t5("start");function t5(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function wde(e){const t=PS(e),n=e5(e);if(t&&n)return{start:t,end:n}}function Md(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_2(e.position):"start"in e||"end"in e?_2(e):"line"in e||"column"in e?A1(e):""}function A1(e){return S2(e&&e.line)+":"+S2(e&&e.column)}function _2(e){return A1(e&&e.start)+"-"+A1(e&&e.end)}function S2(e){return e&&typeof e=="number"?e:1}class dr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=a?a.line:void 0,this.name=Md(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}dr.prototype.file="";dr.prototype.name="";dr.prototype.reason="";dr.prototype.message="";dr.prototype.stack="";dr.prototype.column=void 0;dr.prototype.line=void 0;dr.prototype.ancestors=void 0;dr.prototype.cause=void 0;dr.prototype.fatal=void 0;dr.prototype.place=void 0;dr.prototype.ruleId=void 0;dr.prototype.source=void 0;const OS={}.hasOwnProperty,_de=new Map,Sde=/[A-Z]/g,Cde=/-([a-z])/g,Ede=new Set(["table","tbody","thead","tfoot","tr"]),Rde=new Set(["td","th"]),n5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Pde(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Ide(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Mde(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?RS:ode,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=r5(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function r5(e,t,n){if(t.type==="element")return Ode(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $de(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Dde(e,t,n);if(t.type==="mdxjsEsm")return Tde(e,t);if(t.type==="root")return Ade(e,t,n);if(t.type==="text")return kde(e,t)}function Ode(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=RS,e.schema=o),e.ancestors.push(t);const i=i5(e,t.tagName,!1),s=Nde(e,t);let a=TS(e,t);return Ede.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Gue(l):!0})),o5(e,s,i,t),$S(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function $de(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}xf(e,t.position)}function Tde(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xf(e,t.position)}function Dde(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=RS,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:i5(e,t.name,!0),s=Lde(e,t),a=TS(e,t);return o5(e,s,i,t),$S(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Ade(e,t,n){const r={};return $S(r,TS(e,t)),e.create(t,e.Fragment,r,n)}function kde(e,t){return t.value}function o5(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $S(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Mde(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function Ide(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=PS(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Nde(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&OS.call(t.properties,o)){const i=Fde(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Rde.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Lde(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else xf(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else xf(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function TS(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:_de;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=r5(e,i,s);a!==void 0&&n.push(a)}return n}function Fde(e,t,n){const r=ede(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Vue(n):ide(n)),r.property==="style"){let o=typeof n=="object"?n:jde(e,String(n));return e.stylePropertyNameCase==="css"&&(o=zde(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?rde[r.property]||r.property:r.attribute,n]}}function jde(e,t){const n={};try{xde(t,r)}catch(o){if(!e.ignoreInvalidStyle){const i=o,s=new dr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=n5+"#cannot-parse-style-attribute",s}}return n;function r(o,i){let s=o;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(Cde,Vde)),n[s]=i}}function i5(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=h2(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=h2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return OS.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);xf(e)}function xf(e,t){const n=new dr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=n5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function zde(e){const t={};let n;for(n in e)OS.call(e,n)&&(t[Bde(n)]=e[n]);return t}function Bde(e){let t=e.replace(Sde,Hde);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Vde(e,t){return t.toUpperCase()}function Hde(e){return"-"+e.toLowerCase()}const my={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Wde={};function Ude(e,t){const n=t||Wde,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return s5(e,r,o)}function s5(e,t,n){if(qde(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return C2(e.children,t,n)}return Array.isArray(e)?C2(e,t,n):""}function C2(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=s5(e[o],t,n);return r.join("")}function qde(e){return!!(e&&typeof e=="object")}const E2=document.createElement("i");function DS(e){const t="&"+e+";";E2.innerHTML=t;const n=E2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Pi(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function Ao(e,t){return e.length>0?(Pi(e,e.length,0,t),e):t}const R2={}.hasOwnProperty;function Gde(e){const t={};let n=-1;for(;++n<e.length;)Yde(t,e[n]);return t}function Yde(e,t){let n;for(n in t){const o=(R2.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){R2.call(o,s)||(o[s]=[]);const a=i[s];Kde(o[s],Array.isArray(a)?a:a?[a]:[])}}}function Kde(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Pi(e,0,0,r)}function a5(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function kc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Xde=ya(new RegExp("\\p{P}","u")),bi=ya(/[A-Za-z]/),ao=ya(/[\dA-Za-z]/),Qde=ya(/[#-'*+\--9=?A-Z^-~]/);function k1(e){return e!==null&&(e<32||e===127)}const M1=ya(/\d/),Jde=ya(/[\dA-Fa-f]/),l5=ya(/[!-/:-@[-`{-~]/);function ot(e){return e!==null&&e<-2}function Br(e){return e!==null&&(e<0||e===32)}function Vt(e){return e===-2||e===-1||e===32}function Zde(e){return l5(e)||Xde(e)}const efe=ya(/\s/);function ya(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Cu(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&ao(e.charCodeAt(n+1))&&ao(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function sn(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Vt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Vt(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const tfe={tokenize:nfe};function nfe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),sn(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ot(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const rfe={tokenize:ofe},P2={tokenize:ife};function ofe(e){const t=this,n=[];let r=0,o,i,s;return a;function a(S){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(S)}return c(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&_();const C=t.events.length;let E=C,O;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){O=t.events[E][1].end;break}y(r);let T=C;for(;T<t.events.length;)t.events[T][1].end=Object.assign({},O),T++;return Pi(t.events,E+1,0,t.events.slice(C)),t.events.length=T,c(S)}return a(S)}function c(S){if(r===n.length){if(!o)return p(S);if(o.currentConstruct&&o.currentConstruct.concrete)return b(S);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(P2,u,f)(S)}function u(S){return o&&_(),y(r),p(S)}function f(S){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,b(S)}function p(S){return t.containerState={},e.attempt(P2,h,b)(S)}function h(S){return r++,n.push([t.currentConstruct,t.containerState]),p(S)}function b(S){if(S===null){o&&_(),y(0),e.consume(S);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:o}),v(S)}function v(S){if(S===null){w(e.exit("chunkFlow"),!0),y(0),e.consume(S);return}return ot(S)?(e.consume(S),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(S),v)}function w(S,C){const E=t.sliceStream(S);if(C&&E.push(null),S.previous=i,i&&(i.next=S),i=S,o.defineSkip(S.start),o.write(E),t.parser.lazy[S.start.line]){let O=o.events.length;for(;O--;)if(o.events[O][1].start.offset<s&&(!o.events[O][1].end||o.events[O][1].end.offset>s))return;const T=t.events.length;let N=T,M,A;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(M){A=t.events[N][1].end;break}M=!0}for(y(r),O=T;O<t.events.length;)t.events[O][1].end=Object.assign({},A),O++;Pi(t.events,N+1,0,t.events.slice(T)),t.events.length=O}}function y(S){let C=n.length;for(;C-- >S;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=S}function _(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function ife(e,t,n){return sn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function O2(e){if(e===null||Br(e)||efe(e))return 1;if(Zde(e))return 2}function AS(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const I1={name:"attention",tokenize:afe,resolveAll:sfe};function sfe(e,t){let n=-1,r,o,i,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),p=Object.assign({},e[n][1].start);$2(f,-l),$2(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:p},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ao(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ao(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=Ao(c,AS(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ao(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Ao(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Pi(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function afe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=O2(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=O2(l),f=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(o||!p)),c._close=!!(i===42?p:p&&(u||!f)),t(l)}}function $2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const lfe={name:"autolink",tokenize:cfe};function cfe(e,t,n){let r=0;return o;function o(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return bi(h)?(e.consume(h),s):c(h)}function s(h){return h===43||h===45||h===46||ao(h)?(r=1,a(h)):c(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||ao(h))&&r++<32?(e.consume(h),a):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||k1(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):Qde(h)?(e.consume(h),c):n(h)}function u(h){return ao(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||ao(h))&&r++<63){const b=h===45?p:f;return e.consume(h),b}return n(h)}}const Rv={tokenize:ufe,partial:!0};function ufe(e,t,n){return r;function r(i){return Vt(i)?sn(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ot(i)?t(i):n(i)}}const c5={name:"blockQuote",tokenize:dfe,continuation:{tokenize:ffe},exit:hfe};function dfe(e,t,n){const r=this;return o;function o(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Vt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function ffe(e,t,n){const r=this;return o;function o(s){return Vt(s)?sn(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(c5,t,n)(s)}}function hfe(e){e.exit("blockQuote")}const u5={name:"characterEscape",tokenize:pfe};function pfe(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return l5(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const d5={name:"characterReference",tokenize:gfe};function gfe(e,t,n){const r=this;let o=0,i,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=ao,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=Jde,u):(e.enter("characterReferenceValue"),i=7,s=M1,u(f))}function u(f){if(f===59&&o){const p=e.exit("characterReferenceValue");return s===ao&&!DS(r.sliceSerialize(p))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&o++<i?(e.consume(f),u):n(f)}}const T2={tokenize:vfe,partial:!0},D2={name:"codeFenced",tokenize:mfe,concrete:!0};function mfe(e,t,n){const r=this,o={tokenize:E,partial:!0};let i=0,s=0,a;return l;function l(O){return c(O)}function c(O){const T=r.events[r.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(O)}function u(O){return O===a?(s++,e.consume(O),u):s<3?n(O):(e.exit("codeFencedFenceSequence"),Vt(O)?sn(e,f,"whitespace")(O):f(O))}function f(O){return O===null||ot(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(T2,v,C)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===null||ot(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(O)):Vt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),sn(e,h,"whitespace")(O)):O===96&&O===a?n(O):(e.consume(O),p)}function h(O){return O===null||ot(O)?f(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||ot(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(O)):O===96&&O===a?n(O):(e.consume(O),b)}function v(O){return e.attempt(o,C,w)(O)}function w(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),y}function y(O){return i>0&&Vt(O)?sn(e,_,"linePrefix",i+1)(O):_(O)}function _(O){return O===null||ot(O)?e.check(T2,v,C)(O):(e.enter("codeFlowValue"),S(O))}function S(O){return O===null||ot(O)?(e.exit("codeFlowValue"),_(O)):(e.consume(O),S)}function C(O){return e.exit("codeFenced"),t(O)}function E(O,T,N){let M=0;return A;function A(H){return O.enter("lineEnding"),O.consume(H),O.exit("lineEnding"),F}function F(H){return O.enter("codeFencedFence"),Vt(H)?sn(O,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):z(H)}function z(H){return H===a?(O.enter("codeFencedFenceSequence"),X(H)):N(H)}function X(H){return H===a?(M++,O.consume(H),X):M>=s?(O.exit("codeFencedFenceSequence"),Vt(H)?sn(O,ee,"whitespace")(H):ee(H)):N(H)}function ee(H){return H===null||ot(H)?(O.exit("codeFencedFence"),T(H)):N(H)}}}function vfe(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const vy={name:"codeIndented",tokenize:yfe},bfe={tokenize:xfe,partial:!0};function yfe(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),sn(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):ot(c)?e.attempt(bfe,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||ot(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function xfe(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):ot(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):sn(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ot(s)?o(s):n(s)}}const wfe={name:"codeText",tokenize:Cfe,resolve:_fe,previous:Sfe};function _fe(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function Sfe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Cfe(e,t,n){let r=0,o,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),o=0,u(f)):ot(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||ot(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}function f5(e){const t={};let n=-1,r,o,i,s,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Efe(e,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--&&(s=e[i],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(o&&(e[o][1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);o&&(r[1].end=Object.assign({},e[o][1].start),a=e.slice(o,n),a.unshift(r),Pi(e,o,n-o+1,a))}}return!c}function Efe(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,f,p=-1,h=n,b=0,v=0;const w=[v];for(;h;){for(;e[++o][1]!==h;);i.push(o),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),f&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(v=p+1,w.push(v),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):w.pop(),p=w.length;p--;){const y=a.slice(w[p],w[p+1]),_=i.pop();l.unshift([_,_+y.length-1]),Pi(e,_,2,y)}for(p=-1;++p<l.length;)c[b+l[p][0]]=b+l[p][1],b+=l[p][1]-l[p][0]-1;return c}const Rfe={tokenize:$fe,resolve:Ofe},Pfe={tokenize:Tfe,partial:!0};function Ofe(e){return f5(e),e}function $fe(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):ot(a)?e.check(Pfe,s,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function Tfe(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),sn(e,i,"linePrefix")}function i(s){if(s===null||ot(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function h5(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(y){return y===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(y),e.exit(i),p):y===null||y===32||y===41||k1(y)?n(y):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(y))}function p(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||ot(y)?n(y):(e.consume(y),y===92?b:h)}function b(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function v(y){return!u&&(y===null||y===41||Br(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,v):y===41?(e.consume(y),u--,v):y===null||y===32||y===40||k1(y)?n(y):(e.consume(y),y===92?w:v)}function w(y){return y===40||y===41||y===92?(e.consume(y),v):v(y)}}function p5(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(h){return e.enter(r),e.enter(o),e.consume(h),e.exit(o),e.enter(i),u}function u(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(i),e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):ot(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||ot(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!Vt(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function g5(e,t,n,r,o,i){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===s?(e.exit(i),l(s)):p===null?n(p):ot(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),sn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||ot(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:u)}function f(p){return p===s||p===92?(e.consume(p),u):u(p)}}function Id(e,t){let n;return r;function r(o){return ot(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Vt(o)?sn(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Dfe={name:"definition",tokenize:kfe},Afe={tokenize:Mfe,partial:!0};function kfe(e,t,n){const r=this;let o;return i;function i(h){return e.enter("definition"),s(h)}function s(h){return p5.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return o=kc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return Br(h)?Id(e,c)(h):c(h)}function c(h){return h5(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(Afe,f,f)(h)}function f(h){return Vt(h)?sn(e,p,"whitespace")(h):p(h)}function p(h){return h===null||ot(h)?(e.exit("definition"),r.parser.defined.push(o),t(h)):n(h)}}function Mfe(e,t,n){return r;function r(a){return Br(a)?Id(e,o)(a):n(a)}function o(a){return g5(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Vt(a)?sn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ot(a)?t(a):n(a)}}const Ife={name:"hardBreakEscape",tokenize:Nfe};function Nfe(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return ot(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const Lfe={name:"headingAtx",tokenize:jfe,resolve:Ffe};function Ffe(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Pi(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function jfe(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||Br(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ot(u)?(e.exit("atxHeading"),t(u)):Vt(u)?sn(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Br(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const zfe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],A2=["pre","script","style","textarea"],Bfe={name:"htmlFlow",tokenize:Ufe,resolveTo:Wfe,concrete:!0},Vfe={tokenize:Gfe,partial:!0},Hfe={tokenize:qfe,partial:!0};function Wfe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ufe(e,t,n){const r=this;let o,i,s,a,l;return c;function c(I){return u(I)}function u(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),p):I===47?(e.consume(I),i=!0,v):I===63?(e.consume(I),o=3,r.interrupt?t:$):bi(I)?(e.consume(I),s=String.fromCharCode(I),w):n(I)}function p(I){return I===45?(e.consume(I),o=2,h):I===91?(e.consume(I),o=5,a=0,b):bi(I)?(e.consume(I),o=4,r.interrupt?t:$):n(I)}function h(I){return I===45?(e.consume(I),r.interrupt?t:$):n(I)}function b(I){const te="CDATA[";return I===te.charCodeAt(a++)?(e.consume(I),a===te.length?r.interrupt?t:z:b):n(I)}function v(I){return bi(I)?(e.consume(I),s=String.fromCharCode(I),w):n(I)}function w(I){if(I===null||I===47||I===62||Br(I)){const te=I===47,fe=s.toLowerCase();return!te&&!i&&A2.includes(fe)?(o=1,r.interrupt?t(I):z(I)):zfe.includes(s.toLowerCase())?(o=6,te?(e.consume(I),y):r.interrupt?t(I):z(I)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):i?_(I):S(I))}return I===45||ao(I)?(e.consume(I),s+=String.fromCharCode(I),w):n(I)}function y(I){return I===62?(e.consume(I),r.interrupt?t:z):n(I)}function _(I){return Vt(I)?(e.consume(I),_):A(I)}function S(I){return I===47?(e.consume(I),A):I===58||I===95||bi(I)?(e.consume(I),C):Vt(I)?(e.consume(I),S):A(I)}function C(I){return I===45||I===46||I===58||I===95||ao(I)?(e.consume(I),C):E(I)}function E(I){return I===61?(e.consume(I),O):Vt(I)?(e.consume(I),E):S(I)}function O(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),l=I,T):Vt(I)?(e.consume(I),O):N(I)}function T(I){return I===l?(e.consume(I),l=null,M):I===null||ot(I)?n(I):(e.consume(I),T)}function N(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Br(I)?E(I):(e.consume(I),N)}function M(I){return I===47||I===62||Vt(I)?S(I):n(I)}function A(I){return I===62?(e.consume(I),F):n(I)}function F(I){return I===null||ot(I)?z(I):Vt(I)?(e.consume(I),F):n(I)}function z(I){return I===45&&o===2?(e.consume(I),Q):I===60&&o===1?(e.consume(I),Y):I===62&&o===4?(e.consume(I),V):I===63&&o===3?(e.consume(I),$):I===93&&o===5?(e.consume(I),W):ot(I)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Vfe,U,X)(I)):I===null||ot(I)?(e.exit("htmlFlowData"),X(I)):(e.consume(I),z)}function X(I){return e.check(Hfe,ee,U)(I)}function ee(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),H}function H(I){return I===null||ot(I)?X(I):(e.enter("htmlFlowData"),z(I))}function Q(I){return I===45?(e.consume(I),$):z(I)}function Y(I){return I===47?(e.consume(I),s="",J):z(I)}function J(I){if(I===62){const te=s.toLowerCase();return A2.includes(te)?(e.consume(I),V):z(I)}return bi(I)&&s.length<8?(e.consume(I),s+=String.fromCharCode(I),J):z(I)}function W(I){return I===93?(e.consume(I),$):z(I)}function $(I){return I===62?(e.consume(I),V):I===45&&o===2?(e.consume(I),$):z(I)}function V(I){return I===null||ot(I)?(e.exit("htmlFlowData"),U(I)):(e.consume(I),V)}function U(I){return e.exit("htmlFlow"),t(I)}}function qfe(e,t,n){const r=this;return o;function o(s){return ot(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Gfe(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Rv,t,n)}}const Yfe={name:"htmlText",tokenize:Kfe};function Kfe(e,t,n){const r=this;let o,i,s;return a;function a($){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume($),l}function l($){return $===33?(e.consume($),c):$===47?(e.consume($),E):$===63?(e.consume($),S):bi($)?(e.consume($),N):n($)}function c($){return $===45?(e.consume($),u):$===91?(e.consume($),i=0,b):bi($)?(e.consume($),_):n($)}function u($){return $===45?(e.consume($),h):n($)}function f($){return $===null?n($):$===45?(e.consume($),p):ot($)?(s=f,Y($)):(e.consume($),f)}function p($){return $===45?(e.consume($),h):f($)}function h($){return $===62?Q($):$===45?p($):f($)}function b($){const V="CDATA[";return $===V.charCodeAt(i++)?(e.consume($),i===V.length?v:b):n($)}function v($){return $===null?n($):$===93?(e.consume($),w):ot($)?(s=v,Y($)):(e.consume($),v)}function w($){return $===93?(e.consume($),y):v($)}function y($){return $===62?Q($):$===93?(e.consume($),y):v($)}function _($){return $===null||$===62?Q($):ot($)?(s=_,Y($)):(e.consume($),_)}function S($){return $===null?n($):$===63?(e.consume($),C):ot($)?(s=S,Y($)):(e.consume($),S)}function C($){return $===62?Q($):S($)}function E($){return bi($)?(e.consume($),O):n($)}function O($){return $===45||ao($)?(e.consume($),O):T($)}function T($){return ot($)?(s=T,Y($)):Vt($)?(e.consume($),T):Q($)}function N($){return $===45||ao($)?(e.consume($),N):$===47||$===62||Br($)?M($):n($)}function M($){return $===47?(e.consume($),Q):$===58||$===95||bi($)?(e.consume($),A):ot($)?(s=M,Y($)):Vt($)?(e.consume($),M):Q($)}function A($){return $===45||$===46||$===58||$===95||ao($)?(e.consume($),A):F($)}function F($){return $===61?(e.consume($),z):ot($)?(s=F,Y($)):Vt($)?(e.consume($),F):M($)}function z($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),o=$,X):ot($)?(s=z,Y($)):Vt($)?(e.consume($),z):(e.consume($),ee)}function X($){return $===o?(e.consume($),o=void 0,H):$===null?n($):ot($)?(s=X,Y($)):(e.consume($),X)}function ee($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||Br($)?M($):(e.consume($),ee)}function H($){return $===47||$===62||Br($)?M($):n($)}function Q($){return $===62?(e.consume($),e.exit("htmlTextData"),e.exit("htmlText"),t):n($)}function Y($){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),J}function J($){return Vt($)?sn(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):W($)}function W($){return e.enter("htmlTextData"),s($)}}const kS={name:"labelEnd",tokenize:the,resolveTo:ehe,resolveAll:Zfe},Xfe={tokenize:nhe},Qfe={tokenize:rhe},Jfe={tokenize:ohe};function Zfe(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function ehe(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[s][1].end)},u={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=Ao(a,e.slice(i+1,i+r+3)),a=Ao(a,[["enter",u,t]]),a=Ao(a,AS(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=Ao(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=Ao(a,e.slice(s+1)),a=Ao(a,[["exit",l,t]]),Pi(e,i,e.length,a),e}function the(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(p){return i?i._inactive?f(p):(s=r.parser.defined.includes(kc(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(Xfe,u,s?u:f)(p):p===91?e.attempt(Qfe,u,s?c:f)(p):s?u(p):f(p)}function c(p){return e.attempt(Jfe,u,f)(p)}function u(p){return t(p)}function f(p){return i._balanced=!0,n(p)}}function nhe(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return Br(f)?Id(e,i)(f):i(f)}function i(f){return f===41?u(f):h5(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Br(f)?Id(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?g5(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Br(f)?Id(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function rhe(e,t,n){const r=this;return o;function o(a){return p5.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(kc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function ohe(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const ihe={name:"labelStartImage",tokenize:she,resolveAll:kS.resolveAll};function she(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ahe={name:"labelStartLink",tokenize:lhe,resolveAll:kS.resolveAll};function lhe(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const by={name:"lineEnding",tokenize:che};function che(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),sn(e,t,"linePrefix")}}const Dg={name:"thematicBreak",tokenize:uhe};function uhe(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ot(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Vt(c)?sn(e,a,"whitespace")(c):a(c))}}const kr={name:"list",tokenize:hhe,continuation:{tokenize:phe},exit:mhe},dhe={tokenize:vhe,partial:!0},fhe={tokenize:ghe,partial:!0};function hhe(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(h){const b=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:M1(h)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Dg,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return M1(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Rv,r.interrupt?n:u,e.attempt(dhe,p,f))}function u(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function f(h){return Vt(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function phe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Rv,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,sn(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Vt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(fhe,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,sn(e,e.attempt(kr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function ghe(e,t,n){const r=this;return sn(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function mhe(e){e.exit(this.containerState.type)}function vhe(e,t,n){const r=this;return sn(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Vt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const k2={name:"setextUnderline",tokenize:yhe,resolveTo:bhe};function bhe(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function yhe(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Vt(c)?sn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ot(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const xhe={tokenize:whe};function whe(e){const t=this,n=e.attempt(Rv,r,e.attempt(this.parser.constructs.flowInitial,o,sn(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Rfe,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const _he={resolveAll:v5()},She=m5("string"),Che=m5("text");function m5(e){return{tokenize:t,resolveAll:v5(e==="text"?Ehe:void 0)};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=o[u];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function v5(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function Ehe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+i,_bufferIndex:i?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function Rhe(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},i=[];let s=[],a=[];const l={consume:_,enter:S,exit:C,attempt:T(E),check:T(O),interrupt:T(O,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:h,sliceSerialize:p,now:b,defineSkip:v,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(F){return s=Ao(s,F),w(),s[s.length-1]!==null?[]:(N(t,0),c.events=AS(i,c.events,c),c.events)}function p(F,z){return Ohe(h(F),z)}function h(F){return Phe(s,F)}function b(){const{line:F,column:z,offset:X,_index:ee,_bufferIndex:H}=r;return{line:F,column:z,offset:X,_index:ee,_bufferIndex:H}}function v(F){o[F.line]=F.column,A()}function w(){let F;for(;r._index<s.length;){const z=s[r._index];if(typeof z=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<z.length;)y(z.charCodeAt(r._bufferIndex));else y(z)}}function y(F){u=u(F)}function _(F){ot(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,A()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=F}function S(F,z){const X=z||{};return X.type=F,X.start=b(),c.events.push(["enter",X,c]),a.push(X),X}function C(F){const z=a.pop();return z.end=b(),c.events.push(["exit",z,c]),z}function E(F,z){N(F,z.from)}function O(F,z){z.restore()}function T(F,z){return X;function X(ee,H,Q){let Y,J,W,$;return Array.isArray(ee)?U(ee):"tokenize"in ee?U([ee]):V(ee);function V(ne){return ue;function ue(ie){const oe=ie!==null&&ne[ie],le=ie!==null&&ne.null,ye=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(le)?le:le?[le]:[]];return U(ye)(ie)}}function U(ne){return Y=ne,J=0,ne.length===0?Q:I(ne[J])}function I(ne){return ue;function ue(ie){return $=M(),W=ne,ne.partial||(c.currentConstruct=ne),ne.name&&c.parser.constructs.disable.null.includes(ne.name)?fe():ne.tokenize.call(z?Object.assign(Object.create(c),z):c,l,te,fe)(ie)}}function te(ne){return F(W,$),H}function fe(ne){return $.restore(),++J<Y.length?I(Y[J]):Q}}}function N(F,z){F.resolveAll&&!i.includes(F)&&i.push(F),F.resolve&&Pi(c.events,z,c.events.length-z,F.resolve(c.events.slice(z),c)),F.resolveTo&&(c.events=F.resolveTo(c.events,c))}function M(){const F=b(),z=c.previous,X=c.currentConstruct,ee=c.events.length,H=Array.from(a);return{restore:Q,from:ee};function Q(){r=F,c.previous=z,c.currentConstruct=X,c.events.length=ee,a=H,A()}}function A(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function Phe(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function Ohe(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
411
|
-
`;break}case-3:{s=`\r
|
|
412
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}const $he={42:kr,43:kr,45:kr,48:kr,49:kr,50:kr,51:kr,52:kr,53:kr,54:kr,55:kr,56:kr,57:kr,62:c5},The={91:Dfe},Dhe={[-2]:vy,[-1]:vy,32:vy},Ahe={35:Lfe,42:Dg,45:[k2,Dg],60:Bfe,61:k2,95:Dg,96:D2,126:D2},khe={38:d5,92:u5},Mhe={[-5]:by,[-4]:by,[-3]:by,33:ihe,38:d5,42:I1,60:[lfe,Yfe],91:ahe,92:[Ife,u5],93:kS,95:I1,96:wfe},Ihe={null:[I1,_he]},Nhe={null:[42,95]},Lhe={null:[]},Fhe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Nhe,contentInitial:The,disable:Lhe,document:$he,flow:Ahe,flowInitial:Dhe,insideSpan:Ihe,string:khe,text:Mhe},Symbol.toStringTag,{value:"Module"}));function jhe(e){const n=Gde([Fhe,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(tfe),document:o(rfe),flow:o(xhe),string:o(She),text:o(Che)};return r;function o(i){return s;function s(a){return Rhe(r,i,a)}}}function zhe(e){for(;!f5(e););return e}const M2=/[\0\t\n\r]/g;function Bhe(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,f,p,h;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(M2.lastIndex=f,c=M2.exec(i),p=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(p),!c){t=i.slice(f);break}if(h===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),e+=p-f),h){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Vhe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Hhe(e){return e.replace(Vhe,Whe)}function Whe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return a5(n.slice(i?2:1),i?16:10)}return DS(n)||e}const b5={}.hasOwnProperty;function Uhe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),qhe(n)(zhe(jhe(n).document().write(Bhe()(e,t,!0))))}function qhe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Be),autolinkProtocol:M,autolinkEmail:M,atxHeading:i(Se),blockQuote:i(oe),characterEscape:M,characterReference:M,codeFenced:i(le),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(le,s),codeText:i(ye,s),codeTextData:M,data:M,codeFlowValue:M,definition:i(K),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(be),hardBreakEscape:i(Oe),hardBreakTrailing:i(Oe),htmlFlow:i(Te,s),htmlFlowData:M,htmlText:i(Te,s),htmlTextData:M,image:i(Ue),label:s,link:i(Be),listItem:i(Ke),listItemValue:p,listOrdered:i(Ie,f),listUnordered:i(Ie),paragraph:i(lt),reference:I,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Se),strong:i(It),thematicBreak:i(Ht)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:ie,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ne,codeFenced:l(w),codeFencedFence:v,codeFencedFenceInfo:h,codeFencedFenceMeta:b,codeFlowValue:A,codeIndented:l(y),codeText:l(H),codeTextData:A,data:A,definition:l(),definitionDestinationString:C,definitionLabelString:_,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(z),hardBreakTrailing:l(z),htmlFlow:l(X),htmlFlowData:A,htmlText:l(ee),htmlTextData:A,image:l(Y),label:W,labelText:J,lineEnding:F,link:l(Q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:$,resourceTitleString:V,resource:U,setextHeading:l(N),setextHeadingLineSequence:T,setextHeadingText:O,strong:l(),thematicBreak:l()}};y5(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(pe){let Ee={type:"root",children:[]};const Le={stack:[Ee],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},Ge=[];let Ze=-1;for(;++Ze<pe.length;)if(pe[Ze][1].type==="listOrdered"||pe[Ze][1].type==="listUnordered")if(pe[Ze][0]==="enter")Ge.push(Ze);else{const Wt=Ge.pop();Ze=o(pe,Wt,Ze)}for(Ze=-1;++Ze<pe.length;){const Wt=t[pe[Ze][0]];b5.call(Wt,pe[Ze][1].type)&&Wt[pe[Ze][1].type].call(Object.assign({sliceSerialize:pe[Ze][2].sliceSerialize},Le),pe[Ze][1])}if(Le.tokenStack.length>0){const Wt=Le.tokenStack[Le.tokenStack.length-1];(Wt[1]||I2).call(Le,void 0,Wt[0])}for(Ee.position={start:Ns(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:Ns(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ze=-1;++Ze<t.transforms.length;)Ee=t.transforms[Ze](Ee)||Ee;return Ee}function o(pe,Ee,Le){let Ge=Ee-1,Ze=-1,Wt=!1,Zt,Kt,vn,ln;for(;++Ge<=Le;){const Lt=pe[Ge];switch(Lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Lt[0]==="enter"?Ze++:Ze--,ln=void 0;break}case"lineEndingBlank":{Lt[0]==="enter"&&(Zt&&!ln&&!Ze&&!vn&&(vn=Ge),ln=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ln=void 0}if(!Ze&&Lt[0]==="enter"&&Lt[1].type==="listItemPrefix"||Ze===-1&&Lt[0]==="exit"&&(Lt[1].type==="listUnordered"||Lt[1].type==="listOrdered")){if(Zt){let tn=Ge;for(Kt=void 0;tn--;){const xn=pe[tn];if(xn[1].type==="lineEnding"||xn[1].type==="lineEndingBlank"){if(xn[0]==="exit")continue;Kt&&(pe[Kt][1].type="lineEndingBlank",Wt=!0),xn[1].type="lineEnding",Kt=tn}else if(!(xn[1].type==="linePrefix"||xn[1].type==="blockQuotePrefix"||xn[1].type==="blockQuotePrefixWhitespace"||xn[1].type==="blockQuoteMarker"||xn[1].type==="listItemIndent"))break}vn&&(!Kt||vn<Kt)&&(Zt._spread=!0),Zt.end=Object.assign({},Kt?pe[Kt][1].start:Lt[1].end),pe.splice(Kt||Ge,0,["exit",Zt,Lt[2]]),Ge++,Le++}if(Lt[1].type==="listItemPrefix"){const tn={type:"listItem",_spread:!1,start:Object.assign({},Lt[1].start),end:void 0};Zt=tn,pe.splice(Ge,0,["enter",tn,Lt[2]]),Ge++,Le++,vn=void 0,ln=!0}}}return pe[Ee][1]._spread=Wt,Le}function i(pe,Ee){return Le;function Le(Ge){a.call(this,pe(Ge),Ge),Ee&&Ee.call(this,Ge)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(pe,Ee,Le){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Ee,Le]),pe.position={start:Ns(Ee.start),end:void 0}}function l(pe){return Ee;function Ee(Le){pe&&pe.call(this,Le),c.call(this,Le)}}function c(pe,Ee){const Le=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==pe.type&&(Ee?Ee.call(this,pe,Ge[0]):(Ge[1]||I2).call(this,pe,Ge[0]));else throw new Error("Cannot close `"+pe.type+"` ("+Md({start:pe.start,end:pe.end})+"): it’s not open");Le.position.end=Ns(pe.end)}function u(){return Ude(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(pe){if(this.data.expectingFirstListItemValue){const Ee=this.stack[this.stack.length-2];Ee.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function h(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.lang=pe}function b(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.meta=pe}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=pe.replace(/(\r?\n|\r)$/g,"")}function _(pe){const Ee=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Ee,Le.identifier=kc(this.sliceSerialize(pe)).toLowerCase()}function S(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=pe}function C(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=pe}function E(pe){const Ee=this.stack[this.stack.length-1];if(!Ee.depth){const Le=this.sliceSerialize(pe).length;Ee.depth=Le}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function T(pe){const Ee=this.stack[this.stack.length-1];Ee.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function M(pe){const Le=this.stack[this.stack.length-1].children;let Ge=Le[Le.length-1];(!Ge||Ge.type!=="text")&&(Ge=Dt(),Ge.position={start:Ns(pe.start),end:void 0},Le.push(Ge)),this.stack.push(Ge)}function A(pe){const Ee=this.stack.pop();Ee.value+=this.sliceSerialize(pe),Ee.position.end=Ns(pe.end)}function F(pe){const Ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=Ee.children[Ee.children.length-1];Le.position.end=Ns(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ee.type)&&(M.call(this,pe),A.call(this,pe))}function z(){this.data.atHardBreak=!0}function X(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=pe}function ee(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=pe}function H(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=pe}function Q(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Ee,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function Y(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Ee,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function J(pe){const Ee=this.sliceSerialize(pe),Le=this.stack[this.stack.length-2];Le.label=Hhe(Ee),Le.identifier=kc(Ee).toLowerCase()}function W(){const pe=this.stack[this.stack.length-1],Ee=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Ge=pe.children;Le.children=Ge}else Le.alt=Ee}function $(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=pe}function V(){const pe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=pe}function U(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function te(pe){const Ee=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Ee,Le.identifier=kc(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function fe(pe){this.data.characterReferenceType=pe.type}function ne(pe){const Ee=this.sliceSerialize(pe),Le=this.data.characterReferenceType;let Ge;Le?(Ge=a5(Ee,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=DS(Ee);const Ze=this.stack.pop();Ze.value+=Ge,Ze.position.end=Ns(pe.end)}function ue(pe){A.call(this,pe);const Ee=this.stack[this.stack.length-1];Ee.url=this.sliceSerialize(pe)}function ie(pe){A.call(this,pe);const Ee=this.stack[this.stack.length-1];Ee.url="mailto:"+this.sliceSerialize(pe)}function oe(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function ye(){return{type:"inlineCode",value:""}}function K(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function Se(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function Te(){return{type:"html",value:""}}function Ue(){return{type:"image",title:null,url:"",alt:null}}function Be(){return{type:"link",title:null,url:"",children:[]}}function Ie(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function Ke(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function lt(){return{type:"paragraph",children:[]}}function It(){return{type:"strong",children:[]}}function Dt(){return{type:"text",value:""}}function Ht(){return{type:"thematicBreak"}}}function Ns(e){return{line:e.line,column:e.column,offset:e.offset}}function y5(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?y5(e,r):Ghe(e,r)}}function Ghe(e,t){let n;for(n in t)if(b5.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function I2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Md({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Md({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Md({start:t.start,end:t.end})+") is still open")}function Yhe(e){const t=this;t.parser=n;function n(r){return Uhe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Khe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Xhe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
413
|
-
`}]}function Qhe(e,t){const n=t.value?t.value+`
|
|
414
|
-
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Jhe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zhe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function epe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Cu(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function tpe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function npe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function x5(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function rpe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return x5(e,t);const o={src:Cu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function ope(e,t){const n={src:Cu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ipe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function spe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return x5(e,t);const o={href:Cu(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function ape(e,t){const n={href:Cu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lpe(e,t,n){const r=e.all(t),o=n?cpe(n):w5(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(o||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
415
|
-
`}),u.type==="element"&&u.tagName==="p"&&!o?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
416
|
-
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function cpe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=w5(n[r])}return t}function w5(e){const t=e.spread;return t??e.children.length>1}function upe(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function dpe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fpe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function hpe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ppe(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=PS(t.children[1]),l=e5(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function gpe(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],p={},h=s?s[l]:void 0;h&&(p.align=h);let b={type:"element",tagName:i,properties:p,children:[]};f&&(b.children=e.all(f),e.patch(f,b),b=e.applyData(f,b)),c.push(b)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function mpe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const N2=9,L2=32;function vpe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(F2(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(F2(t.slice(o),o>0,!1)),i.join("")}function F2(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===N2||i===L2;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===N2||i===L2;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function bpe(e,t){const n={type:"text",value:vpe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ype(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const xpe={blockquote:Khe,break:Xhe,code:Qhe,delete:Jhe,emphasis:Zhe,footnoteReference:epe,heading:tpe,html:npe,imageReference:rpe,image:ope,inlineCode:ipe,linkReference:spe,link:ape,listItem:lpe,list:upe,paragraph:dpe,root:fpe,strong:hpe,table:ppe,tableCell:mpe,tableRow:gpe,text:bpe,thematicBreak:ype,toml:ng,yaml:ng,definition:ng,footnoteDefinition:ng};function ng(){}const _5=-1,Pv=0,gm=1,mm=2,MS=3,IS=4,NS=5,LS=6,S5=7,C5=8,j2=typeof self=="object"?self:globalThis,wpe=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case Pv:case _5:return n(s,o);case gm:{const a=n([],o);for(const l of s)a.push(r(l));return a}case mm:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case MS:return n(new Date(s),o);case IS:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case NS:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case LS:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case S5:{const{name:a,message:l}=s;return n(new j2[a](l),o)}case C5:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o)}return n(new j2[i](s),o)};return r},z2=e=>wpe(new Map,e)(0),dc="",{toString:_pe}={},{keys:Spe}=Object,fd=e=>{const t=typeof e;if(t!=="object"||!e)return[Pv,t];const n=_pe.call(e).slice(8,-1);switch(n){case"Array":return[gm,dc];case"Object":return[mm,dc];case"Date":return[MS,dc];case"RegExp":return[IS,dc];case"Map":return[NS,dc];case"Set":return[LS,dc]}return n.includes("Array")?[gm,n]:n.includes("Error")?[S5,n]:[mm,n]},rg=([e,t])=>e===Pv&&(t==="function"||t==="symbol"),Cpe=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=fd(s);switch(a){case Pv:{let u=s;switch(l){case"bigint":a=C5,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([_5],s)}return o([a,u],s)}case gm:{if(l)return o([l,[...s]],s);const u=[],f=o([a,u],s);for(const p of s)u.push(i(p));return f}case mm:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],f=o([a,u],s);for(const p of Spe(s))(e||!rg(fd(s[p])))&&u.push([i(p),i(s[p])]);return f}case MS:return o([a,s.toISOString()],s);case IS:{const{source:u,flags:f}=s;return o([a,{source:u,flags:f}],s)}case NS:{const u=[],f=o([a,u],s);for(const[p,h]of s)(e||!(rg(fd(p))||rg(fd(h))))&&u.push([i(p),i(h)]);return f}case LS:{const u=[],f=o([a,u],s);for(const p of s)(e||!rg(fd(p)))&&u.push(i(p));return f}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},B2=(e,{json:t,lossy:n}={})=>{const r=[];return Cpe(!(t||n),!!t,new Map,r)(e),r},vm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?z2(B2(e,t)):structuredClone(e):(e,t)=>z2(B2(e,t));function Epe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Rpe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ppe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Epe,r=e.options.footnoteBackLabel||Rpe,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),p=Cu(f.toLowerCase());let h=0;const b=[],v=e.footnoteCounts.get(f);for(;v!==void 0&&++h<=v;){b.length>0&&b.push({type:"text",value:" "});let _=typeof n=="string"?n:n(l,h);typeof _=="string"&&(_={type:"text",value:_}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const w=u[u.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const _=w.children[w.children.length-1];_&&_.type==="text"?_.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...b)}else u.push(...b);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...vm(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
417
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
418
|
-
`}]}}const E5=function(e){if(e==null)return Dpe;if(typeof e=="function")return Ov(e);if(typeof e=="object")return Array.isArray(e)?Ope(e):$pe(e);if(typeof e=="string")return Tpe(e);throw new Error("Expected function, string, or object as test")};function Ope(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=E5(e[n]);return Ov(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function $pe(e){const t=e;return Ov(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function Tpe(e){return Ov(t);function t(n){return n&&n.type===e}}function Ov(e){return t;function t(n,r,o){return!!(Ape(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function Dpe(){return!0}function Ape(e){return e!==null&&typeof e=="object"&&"type"in e}const R5=[],kpe=!0,V2=!1,Mpe="skip";function Ipe(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=E5(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=R5,b,v,w;if((!t||i(l,c,u[u.length-1]||void 0))&&(h=Npe(n(l,u)),h[0]===V2))return h;if("children"in l&&l.children){const y=l;if(y.children&&h[0]!==Mpe)for(v=(r?y.children.length:-1)+s,w=u.concat(y);v>-1&&v<y.children.length;){const _=y.children[v];if(b=a(_,v,w)(),b[0]===V2)return b;v=typeof b[1]=="number"?b[1]:v+s}}return h}}}function Npe(e){return Array.isArray(e)?e:typeof e=="number"?[kpe,e]:e==null?R5:[e]}function P5(e,t,n,r){let o,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),Ipe(e,i,a,o);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return s(l,f,u)}}const N1={}.hasOwnProperty,Lpe={};function Fpe(e,t){const n=t||Lpe,r=new Map,o=new Map,i=new Map,s={...xpe,...n.handlers},a={all:c,applyData:zpe,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:jpe,wrap:Vpe};return P5(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:o,p=String(u.identifier).toUpperCase();f.has(p)||f.set(p,u)}}),a;function l(u,f){const p=u.type,h=a.handlers[p];if(N1.call(a.handlers,p)&&h)return h(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:v,...w}=u,y=vm(w);return y.children=a.all(u),y}return vm(u)}return(a.options.unknownHandler||Bpe)(a,u,f)}function c(u){const f=[];if("children"in u){const p=u.children;let h=-1;for(;++h<p.length;){const b=a.one(p[h],u);if(b){if(h&&p[h-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=H2(b.value)),!Array.isArray(b)&&b.type==="element")){const v=b.children[0];v&&v.type==="text"&&(v.value=H2(v.value))}Array.isArray(b)?f.push(...b):f.push(b)}}}return f}}function jpe(e,t){e.position&&(t.position=wde(e))}function zpe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,vm(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function Bpe(e,t){const n=t.data||{},r="value"in t&&!(N1.call(n,"hProperties")||N1.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Vpe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
419
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
420
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
421
|
-
`}),n}function H2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function W2(e,t){const n=Fpe(e,t),r=n.one(e,void 0),o=Ppe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
|
|
422
|
-
`},o),i}function Hpe(e,t){return e&&"run"in e?async function(n,r){const o=W2(n,{file:r,...t});await e.run(o,r)}:function(n,r){return W2(n,{file:r,...t||e})}}function U2(e){if(e)throw e}var Ag=Object.prototype.hasOwnProperty,O5=Object.prototype.toString,q2=Object.defineProperty,G2=Object.getOwnPropertyDescriptor,Y2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):O5.call(t)==="[object Array]"},K2=function(t){if(!t||O5.call(t)!=="[object Object]")return!1;var n=Ag.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ag.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||Ag.call(t,o)},X2=function(t,n){q2&&n.name==="__proto__"?q2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Q2=function(t,n){if(n==="__proto__")if(Ag.call(t,n)){if(G2)return G2(t,n).value}else return;return t[n]},Wpe=function e(){var t,n,r,o,i,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=Q2(a,n),o=Q2(t,n),a!==o&&(u&&o&&(K2(o)||(i=Y2(o)))?(i?(i=!1,s=r&&Y2(r)?r:[]):s=r&&K2(r)?r:{},X2(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&X2(a,{name:n,newValue:o}));return a};const yy=Rl(Wpe);function L1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Upe(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let f=-1;if(l){s(l);return}for(;++f<o.length;)(c[f]===null||c[f]===void 0)&&(c[f]=o[f]);o=c,u?qpe(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function qpe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l instanceof Promise?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const fi={basename:Gpe,dirname:Ype,extname:Kpe,join:Xpe,sep:"/"};function Gpe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');mh(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Ype(e){if(mh(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Kpe(e){mh(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function Xpe(...e){let t=-1,n;for(;++t<e.length;)mh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Qpe(n)}function Qpe(e){mh(e);const t=e.codePointAt(0)===47;let n=Jpe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Jpe(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function mh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Zpe={cwd:ege};function ege(){return"/"}function F1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tge(e){if(typeof e=="string")e=new URL(e);else if(!F1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return nge(e)}function nge(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const xy=["history","path","basename","stem","extname","dirname"];class $5{constructor(t){let n;t?F1(t)?n={path:t}:typeof t=="string"||rge(t)?n={value:t}:n=t:n={},this.cwd=Zpe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<xy.length;){const i=xy[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)xy.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?fi.basename(this.path):void 0}set basename(t){_y(t,"basename"),wy(t,"basename"),this.path=fi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fi.dirname(this.path):void 0}set dirname(t){J2(this.basename,"dirname"),this.path=fi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fi.extname(this.path):void 0}set extname(t){if(wy(t,"extname"),J2(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){F1(t)&&(t=tge(t)),_y(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fi.basename(this.path,this.extname):void 0}set stem(t){_y(t,"stem"),wy(t,"stem"),this.path=fi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new dr(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function wy(e,t){if(e&&e.includes(fi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fi.sep+"`")}function _y(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function J2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function rge(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oge=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};Object.setPrototypeOf(i,r);const s=Object.getOwnPropertyNames(o);for(const a of s){const l=Object.getOwnPropertyDescriptor(o,a);l&&Object.defineProperty(i,a,l)}return i},ige={}.hasOwnProperty;class FS extends oge{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Upe()}copy(){const t=new FS;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(yy(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ey("data",this.frozen),this.namespace[t]=n,this):ige.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ey("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=og(t),r=this.parser||this.Parser;return Sy("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Sy("process",this.parser||this.Parser),Cy("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=og(t),l=r.parse(a);r.run(l,a,function(u,f,p){if(u||!f||!p)return c(u);const h=f,b=r.stringify(h,p);lge(b)?p.value=b:p.result=b,c(u,p)});function c(u,f){u||!f?s(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Sy("processSync",this.parser||this.Parser),Cy("processSync",this.compiler||this.Compiler),this.process(t,o),eT("processSync","process",n),r;function o(i,s){n=!0,U2(i),r=s}}run(t,n,r){Z2(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=og(n);o.run(t,l,c);function c(u,f,p){const h=f||t;u?a(u):s?s(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),eT("runSync","run",r),o;function i(s,a){U2(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=og(n),o=this.compiler||this.Compiler;return Cy("stringify",o),Z2(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Ey("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=yy(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===c){p=f;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[h,...b]=u;const v=r[p][1];L1(v)&&L1(h)&&(h=yy(!0,v,h)),r[p]=[c,h,...b]}}}}const sge=new FS().freeze();function Sy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ey(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Z2(e){if(!L1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function eT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function og(e){return age(e)?e:new $5(e)}function age(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lge(e){return typeof e=="string"||cge(e)}function cge(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uge="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",tT=[],nT={allowDangerousHtml:!0},dge=/^(https?|ircs?|mailto|xmpp)$/i,fge=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function T5(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||tT,l=e.remarkPlugins||tT,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nT}:nT,u=e.skipHtml,f=e.unwrapDisallowed,p=e.urlTransform||hge,h=sge().use(Yhe).use(l).use(Hpe,c).use(a),b=new $5;typeof r=="string"&&(b.value=r);for(const _ of fge)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+uge+_.id,void 0);const v=h.parse(b);let w=h.runSync(v,b);return o&&(w={type:"element",tagName:"div",properties:{className:o},children:w.type==="root"?w.children:[w]}),P5(w,y),Pde(w,{Fragment:R.Fragment,components:i,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function y(_,S,C){if(_.type==="raw"&&C&&typeof S=="number")return u?C.children.splice(S,1):C.children[S]={type:"text",value:_.value},S;if(_.type==="element"){let E;for(E in my)if(Object.hasOwn(my,E)&&Object.hasOwn(_.properties,E)){const O=_.properties[E],T=my[E];(T===null||T.includes(_.tagName))&&(_.properties[E]=p(String(O||""),E,_))}}if(_.type==="element"){let E=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!E&&n&&typeof S=="number"&&(E=!n(_,S,C)),E&&C&&typeof S=="number")return f&&_.children?C.children.splice(S,1,..._.children):C.children.splice(S,1),S}}}function hge(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t<0||o>-1&&t>o||n>-1&&t>n||r>-1&&t>r||dge.test(e.slice(0,t))?e:""}function pge(){const e=m.useRef(null),[t,n]=m.useState(""),[r,o]=m.useState(!1),i=$e(M=>M.dashboard.aiScopeTables);Zm();const s=$e(M=>M.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=wr(),{authToken:u}=ba(),f=ED(),{messages:p,input:h,handleInputChange:b,handleSubmit:v,addToolResult:w,stop:y,isLoading:_}=gue({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxToolRoundtrips:5,async onToolCall({toolCall:M}){if(C(M.toolName),M.toolName==="getLocation"){const A=["New York","Los Angeles","Chicago","San Francisco"];return A[Math.floor(Math.random()*A.length)]}if(M.toolName==="getTables")return JSON.stringify(i||[]);if(M.toolName==="getData"){console.log(M.args);const A=M.args;if(!(A!=null&&A.sql)||!(A!=null&&A.connectionId))return"Please provide sql, connectionId and table";const F=await f.fetchQuery({queryKey:["chat",A.connectionId,A.sql],queryFn:()=>zf("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:A.connectionId,sql:A.sql})});return n("Summarizing"),JSON.stringify(F)}},onFinish(M,A){console.log("onFinish",M,A),M.content&&n("")}}),S=()=>{var M;(M=e.current)==null||M.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{S()},[p]);function C(M){M==="getTables"&&n("Initializing"),M==="getSchemas"&&n("Analyzing"),M==="getData"&&n("Fetching")}function E(M){const A=M.toolInvocations||[];return A.length===0||A.find(z=>z.toolName==="getData"&&"result"in z)?!0:r}function O(M){return M==null?void 0:M.map(A=>{var z;const F=A.role==="user";return E(A)?R.jsxs("div",{className:_e("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":F}),children:[R.jsx("div",{className:"space-y-2",children:R.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[R.jsx("div",{className:"text-muted-foreground",children:F?R.jsx(NJ,{className:"size-5 shrink-0"}):R.jsx(Xx,{className:"size-5 shrink-0"})}),R.jsx("div",{children:R.jsx(T5,{components:gge,children:A.content})})]})}),(z=A.toolInvocations)==null?void 0:z.map(X=>{const ee=X.toolCallId;return"result"in X?R.jsx("div",{children:T(X)},ee):R.jsxs("div",{children:["Calling ",X.toolName,"..."]},ee)})]},A.id):null})}function T(M){if("result"in M){let A;try{const F=JSON.parse(M.result);if(A=R.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(F,null,2)}),M.toolName==="getData"){const z=P_({cardType:M.args.chartType,data:F.records});return R.jsxs("div",{className:"space-y-2",children:[r&&R.jsxs("div",{children:[R.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${M.toolName}: `,A]}),R.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[R.jsx(xr,{onClick:()=>{const X=M.args.chartTitle,ee=M.args.connectionId;N({sql:M.args.sql,data:F.records,cardType:M.args.chartType,cardCfg:z,cardTitle:X,connectionId:ee})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),z&&R.jsx(l_,{cfg:z})]})]})}}catch{A=R.jsx("span",{children:M.result})}return R.jsxs("div",{children:[R.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${M.toolName}: `,A]})}return`Calling ${M.toolName}...`}function N({sql:M,data:A,cardCfg:F,cardTitle:z,connectionId:X,cardType:ee}){if(!s)return;const H={id:ua(),title:z||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:ee==="horizontalBar"?"y":"x"}},type:F.type,cfg:F,sql:M,data:A,connectionId:X},Q={id:ua(),cards:[H],activeCardId:H.id};c(!0),a(s,Q,"start"),l(Q.id)}return R.jsxs("div",{role:"chat-box",className:"flex h-full grow flex-col justify-between break-words rounded-md bg-muted/30 px-6 py-8",children:[R.jsxs("div",{className:"flex items-center gap-3",children:[R.jsx(Fn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),R.jsxs(iv,{openDelay:700,children:[R.jsx(sv,{children:R.jsx(kJ,{className:"size-4 text-muted-foreground"})}),R.jsx(oh,{className:"w-70",children:R.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[R.jsx(Xx,{className:"size-5"}),R.jsxs("div",{className:"space-y-1",children:[R.jsx("p",{className:"text-sm",children:i&&(i==null?void 0:i.length)>0?"I can analyze following datasets":"No datasets in scope"}),R.jsx("div",{className:"space-y-2 pt-2",children:i==null?void 0:i.map((M,A)=>R.jsxs("div",{className:"flex gap-2 text-xs",children:[R.jsx(Wk,{className:"size-4 opacity-70"}),R.jsx("span",{children:M.tableName})]},A))})]})]})})]}),!1]}),R.jsx(ah,{className:"my-4"}),R.jsx("div",{className:"",children:R.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:v,children:[R.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[R.jsx(Dc,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:h,disabled:_,placeholder:"What can I help you with?",onChange:b}),R.jsx("button",{className:"mr-3",children:R.jsx(Lk,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),_&&R.jsx(xr,{size:"sm",className:"rounded-full",onClick:()=>y(),children:R.jsx(fJ,{className:"size-2.5 bg-background"})})]})}),R.jsxs(CS,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[R.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[_&&t!==""&&R.jsx(ZQ,{className:"size-10 animate-pulse"}),t]}),R.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:O(p)}),R.jsx(Cv,{orientation:"vertical"})]})]})}const gge={li:({node:e,...t})=>R.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>R.jsx("pre",{className:"word my-2 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-xs text-foreground/80",...t})},{createElement:hu,createContext:mge,createRef:P1e,forwardRef:D5,useCallback:Qr,useContext:A5,useEffect:hl,useImperativeHandle:k5,useLayoutEffect:vge,useMemo:bge,useRef:ko,useState:bm}=L,rT=L.useId,$v=mge(null);$v.displayName="PanelGroupContext";const wf=vge,yge=typeof rT=="function"?rT:()=>null;let xge=0;function jS(e=null){const t=yge(),n=ko(e||t||null);return n.current===null&&(n.current=""+xge++),e??n.current}function M5({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:p,style:h,tagName:b="div",...v}){const w=A5($v);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:_,getPanelSize:S,getPanelStyle:C,groupId:E,isPanelCollapsed:O,registerPanel:T,resizePanel:N,unregisterPanel:M}=w,A=jS(s),F=ko({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:A,idIsFromProps:s!==void 0,order:p});ko({didLogMissingDefaultSizeWarning:!1}),wf(()=>{const{callbacks:X,constraints:ee}=F.current;F.current.id=A,F.current.idIsFromProps=s!==void 0,F.current.order=p,X.onCollapse=c,X.onExpand=u,X.onResize=f,ee.collapsedSize=n,ee.collapsible=r,ee.defaultSize=o,ee.maxSize=a,ee.minSize=l}),wf(()=>{const X=F.current;return T(X),()=>{M(X)}},[p,A,T,M]),k5(i,()=>({collapse:()=>{y(F.current)},expand:()=>{_(F.current)},getId(){return A},getSize(){return S(F.current)},isCollapsed(){return O(F.current)},isExpanded(){return!O(F.current)},resize:X=>{N(F.current,X)}}),[y,_,S,O,A,N]);const z=C(F.current,o);return hu(b,{...v,children:e,className:t,style:{...z,...h},"data-panel":"","data-panel-id":A,"data-panel-group-id":E,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const I5=D5((e,t)=>hu(M5,{...e,forwardedRef:t}));M5.displayName="Panel";I5.displayName="forwardRef(Panel)";function vt(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const N5=10;function _f(e,t,n=N5){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function no(e,t,n){return _f(e,t,n)===0}function Cc({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];vt(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(_f(n,a)<0)if(i){const l=(o+a)/2;_f(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(N5)),n}function wd({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(no(e,0))return t;const i=[...t],[s,a]=r;vt(s!=null),vt(a!=null);let l=0;if(o==="keyboard"){{const u=e<0?a:s,f=n[u];if(vt(f),f.collapsible){const p=t[u];vt(p!=null);const h=n[u];vt(h);const{collapsedSize:b=0,minSize:v=0}=h;if(no(p,b)){const w=v-p;_f(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}{const u=e<0?s:a,f=n[u];vt(f);const{collapsible:p}=f;if(p){const h=t[u];vt(h!=null);const b=n[u];vt(b);const{collapsedSize:v=0,minSize:w=0}=b;if(no(h,w)){const y=h-v;_f(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}}{const u=e<0?1:-1;let f=e<0?a:s,p=0;for(;;){const b=t[f];vt(b!=null);const w=Cc({panelConstraints:n,panelIndex:f,size:100})-b;if(p+=w,f+=u,f<0||f>=n.length)break}const h=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-h:h}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const p=Math.abs(e)-Math.abs(l),h=t[f];vt(h!=null);const b=h-p,v=Cc({panelConstraints:n,panelIndex:f,size:b});if(!no(h,v)&&(l+=h-v,i[f]=v,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(no(l,0))return t;{const u=e<0?a:s,f=t[u];vt(f!=null);const p=f+l,h=Cc({panelConstraints:n,panelIndex:u,size:p});if(i[u]=h,!no(h,p)){let b=p-h,w=e<0?a:s;for(;w>=0&&w<n.length;){const y=i[w];vt(y!=null);const _=y+b,S=Cc({panelConstraints:n,panelIndex:w,size:_});if(no(y,S)||(b-=S-y,i[w]=S),no(b,0))break;e>0?w--:w++}}}const c=i.reduce((u,f)=>f+u,0);return no(c,100)?i:t}function wge({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];vt(a!=null),t.forEach((f,p)=>{const{constraints:h}=f,{maxSize:b=100,minSize:v=0}=h;p===a?(r=v,o=b):(i+=v,s+=b)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function Sf(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function L5(e,t){const r=Sf(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function F5(e,t){const n=L5(e,t);return n!=null?[n,n+1]:[-1,-1]}function j5(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Tv(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function _ge(e,t,n){var r,o,i,s;const a=Tv(t),l=Sf(e),c=a?l.indexOf(a):-1,u=(r=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,f=(i=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null;return[u,f]}function Sge({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){ko({didWarnAboutMissingResizeHandle:!1}),wf(()=>{const s=Sf(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:c,valueNow:u}=wge({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const p=o[a];vt(p),f.setAttribute("aria-controls",p.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,o]),hl(()=>{const s=t.current;vt(s);const{panelDataArray:a}=s,l=j5(n);vt(l!=null,`No group found for id "${n}"`);const c=Sf(n);vt(c);const u=c.map(f=>{const p=f.getAttribute("data-panel-resize-handle-id");vt(p);const[h,b]=_ge(n,p,a);if(h==null||b==null)return()=>{};const v=w=>{if(!w.defaultPrevented)switch(w.key){case"Enter":{w.preventDefault();const y=a.findIndex(_=>_.id===h);if(y>=0){const _=a[y];vt(_);const S=r[y],{collapsedSize:C=0,collapsible:E,minSize:O=0}=_.constraints;if(S!=null&&E){const T=wd({delta:no(S,C)?O-C:C-S,layout:r,panelConstraints:a.map(N=>N.constraints),pivotIndices:F5(n,p),trigger:"keyboard"});r!==T&&i(T)}}break}}};return f.addEventListener("keydown",v),()=>{f.removeEventListener("keydown",v)}});return()=>{u.forEach(f=>f())}},[e,t,n,r,o,i])}function oT(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 z5(e){return e.type==="keydown"}function B5(e){return e.type.startsWith("mouse")}function V5(e){return e.type.startsWith("touch")}function H5(e,t){const n=e==="horizontal";if(B5(t))return n?t.clientX:t.clientY;if(V5(t)){const r=t.touches[0];return vt(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function Cge(e,t,n,r){const o=n==="horizontal",i=Tv(t);vt(i);const s=i.getAttribute("data-panel-group-id");vt(s);let{initialCursorPosition:a}=r;const l=H5(n,e),c=j5(s);vt(c);const u=c.getBoundingClientRect(),f=o?u.width:u.height;return(l-a)/f*100}function Ege(e,t,n,r,o){if(z5(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:Cge(e,t,n,r)}function Rge({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];vt(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];vt(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function fc(e,t,n){t.forEach((r,o)=>{const i=e[o];vt(i);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:p,onExpand:h,onResize:b}=s;b&&b(r,f),u&&(p||h)&&(h&&(f==null||f===c)&&r!==c&&h(),p&&(f==null||f!==c)&&r===c&&p())}})}function ig(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 Pge({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 j1=null,Ja=null;function W5(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 Oge(){Ja!==null&&(document.head.removeChild(Ja),j1=null,Ja=null)}function Ry(e){if(j1===e)return;j1=e;const t=W5(e);Ja===null&&(Ja=document.createElement("style"),document.head.appendChild(Ja)),Ja.innerHTML=`*{cursor: ${t}!important;}`}function $ge(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function iT(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 U5(e){return`react-resizable-panels:${e}`}function q5(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 G5(e,t){try{const n=U5(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Tge(e,t,n){var r,o;const i=(r=G5(e,n))!==null&&r!==void 0?r:{},s=q5(t);return(o=i[s])!==null&&o!==void 0?o:null}function Dge(e,t,n,r,o){var i;const s=U5(e),a=q5(t),l=(i=G5(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function sT({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(!no(r,100))for(let i=0;i<t.length;i++){const s=n[i];vt(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];vt(s!=null);const a=Cc({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!no(o,0))for(let i=0;i<t.length;i++){const s=n[i];vt(s!=null);const a=s+o,l=Cc({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,no(o,0)))break}return n}const Age=100,_d={getItem:e=>(iT(_d),_d.getItem(e)),setItem:(e,t)=>{iT(_d),_d.setItem(e,t)}},aT={};function Y5({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=_d,style:c,tagName:u="div",...f}){const p=jS(i),[h,b]=bm(null),[v,w]=bm([]),y=ko({}),_=ko(new Map),S=ko(0),C=ko({autoSaveId:e,direction:r,dragState:h,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),E=ko({layout:v,panelDataArray:[],panelDataArrayChanged:!1});ko({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),k5(o,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:$}=E.current;return $},setLayout:$=>{const{onLayout:V}=C.current,{layout:U,panelDataArray:I}=E.current,te=sT({layout:$,panelConstraints:I.map(fe=>fe.constraints)});oT(U,te)||(w(te),E.current.layout=te,V&&V(te),fc(I,te,y.current))}}),[]),wf(()=>{C.current.autoSaveId=e,C.current.direction=r,C.current.dragState=h,C.current.id=p,C.current.onLayout=s,C.current.storage=l}),Sge({committedValuesRef:C,eagerValuesRef:E,groupId:p,layout:v,panelDataArray:E.current.panelDataArray,setLayout:w}),hl(()=>{const{panelDataArray:$}=E.current;if(e){if(v.length===0||v.length!==$.length)return;let V=aT[e];V==null&&(V=$ge(Dge,Age),aT[e]=V);const U=[...$],I=new Map(_.current);V(e,U,I,v,l)}},[e,v,l]),hl(()=>{});const O=Qr($=>{const{onLayout:V}=C.current,{layout:U,panelDataArray:I}=E.current;if($.constraints.collapsible){const te=I.map(ie=>ie.constraints),{collapsedSize:fe=0,panelSize:ne,pivotIndices:ue}=hc(I,$,U);if(vt(ne!=null),ne!==fe){_.current.set($.id,ne);const oe=xc(I,$)===I.length-1?ne-fe:fe-ne,le=wd({delta:oe,layout:U,panelConstraints:te,pivotIndices:ue,trigger:"imperative-api"});ig(U,le)||(w(le),E.current.layout=le,V&&V(le),fc(I,le,y.current))}}},[]),T=Qr($=>{const{onLayout:V}=C.current,{layout:U,panelDataArray:I}=E.current;if($.constraints.collapsible){const te=I.map(oe=>oe.constraints),{collapsedSize:fe=0,panelSize:ne,minSize:ue=0,pivotIndices:ie}=hc(I,$,U);if(ne===fe){const oe=_.current.get($.id),le=oe!=null&&oe>=ue?oe:ue,K=xc(I,$)===I.length-1?ne-le:le-ne,be=wd({delta:K,layout:U,panelConstraints:te,pivotIndices:ie,trigger:"imperative-api"});ig(U,be)||(w(be),E.current.layout=be,V&&V(be),fc(I,be,y.current))}}},[]),N=Qr($=>{const{layout:V,panelDataArray:U}=E.current,{panelSize:I}=hc(U,$,V);return vt(I!=null),I},[]),M=Qr(($,V)=>{const{panelDataArray:U}=E.current,I=xc(U,$);return Pge({defaultSize:V,dragState:h,layout:v,panelData:U,panelIndex:I})},[h,v]),A=Qr($=>{const{layout:V,panelDataArray:U}=E.current,{collapsedSize:I=0,collapsible:te,panelSize:fe}=hc(U,$,V);return te===!0&&fe===I},[]),F=Qr($=>{const{layout:V,panelDataArray:U}=E.current,{collapsedSize:I=0,collapsible:te,panelSize:fe}=hc(U,$,V);return vt(fe!=null),!te||fe>I},[]),z=Qr($=>{const{panelDataArray:V}=E.current;V.push($),V.sort((U,I)=>{const te=U.order,fe=I.order;return te==null&&fe==null?0:te==null?-1:fe==null?1:te-fe}),E.current.panelDataArrayChanged=!0},[]);wf(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:$,onLayout:V,storage:U}=C.current,{layout:I,panelDataArray:te}=E.current;let fe=null;if($){const ue=Tge($,te,U);ue&&(_.current=new Map(Object.entries(ue.expandToSizes)),fe=ue.layout)}fe==null&&(fe=Rge({panelDataArray:te}));const ne=sT({layout:fe,panelConstraints:te.map(ue=>ue.constraints)});oT(I,ne)||(w(ne),E.current.layout=ne,V&&V(ne),fc(te,ne,y.current))}});const X=Qr($=>function(U){U.preventDefault();const{direction:I,dragState:te,id:fe,keyboardResizeBy:ne,onLayout:ue}=C.current,{layout:ie,panelDataArray:oe}=E.current,{initialLayout:le}=te??{},ye=F5(fe,$);let K=Ege(U,$,I,te,ne);if(K===0)return;const be=I==="horizontal";document.dir==="rtl"&&be&&(K=-K);const Se=oe.map(Ue=>Ue.constraints),Oe=wd({delta:K,layout:le??ie,panelConstraints:Se,pivotIndices:ye,trigger:z5(U)?"keyboard":"mouse-or-touch"}),Te=!ig(ie,Oe);(B5(U)||V5(U))&&S.current!=K&&(S.current=K,Ry(Te?be?"horizontal":"vertical":be?K<0?"horizontal-min":"horizontal-max":K<0?"vertical-min":"vertical-max")),Te&&(w(Oe),E.current.layout=Oe,ue&&ue(Oe),fc(oe,Oe,y.current))},[]),ee=Qr(($,V)=>{const{onLayout:U}=C.current,{layout:I,panelDataArray:te}=E.current,fe=te.map(ye=>ye.constraints),{panelSize:ne,pivotIndices:ue}=hc(te,$,I);vt(ne!=null);const oe=xc(te,$)===te.length-1?ne-V:V-ne,le=wd({delta:oe,layout:I,panelConstraints:fe,pivotIndices:ue,trigger:"imperative-api"});ig(I,le)||(w(le),E.current.layout=le,U&&U(le),fc(te,le,y.current))},[]),H=Qr(($,V)=>{const{direction:U}=C.current,{layout:I}=E.current,te=Tv($);vt(te);const fe=H5(U,V);b({dragHandleId:$,dragHandleRect:te.getBoundingClientRect(),initialCursorPosition:fe,initialLayout:I})},[]),Q=Qr(()=>{Oge(),b(null)},[]),Y=Qr($=>{const{panelDataArray:V}=E.current,U=xc(V,$);U>=0&&(V.splice(U,1),delete y.current[$.id],E.current.panelDataArrayChanged=!0)},[]),J=bge(()=>({collapsePanel:O,direction:r,dragState:h,expandPanel:T,getPanelSize:N,getPanelStyle:M,groupId:p,isPanelCollapsed:A,isPanelExpanded:F,registerPanel:z,registerResizeHandle:X,resizePanel:ee,startDragging:H,stopDragging:Q,unregisterPanel:Y}),[O,h,r,T,N,M,p,A,F,z,X,ee,H,Q,Y]),W={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return hu($v.Provider,{value:J},hu(u,{...f,children:t,className:n,style:{...W,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const K5=D5((e,t)=>hu(Y5,{...e,forwardedRef:t}));Y5.displayName="PanelGroup";K5.displayName="forwardRef(PanelGroup)";function xc(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function hc(e,t,n){const r=e.map(c=>c.constraints),o=xc(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 kge({disabled:e,handleId:t,resizeHandler:n}){hl(()=>{if(e||n==null)return;const r=Tv(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");vt(s);const a=Sf(s),l=L5(s,t);vt(l!==null);const c=i.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function zS({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const c=ko(null),u=ko({onDragging:o});hl(()=>{u.current.onDragging=o});const f=A5($v);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:p,dragState:h,groupId:b,registerResizeHandle:v,startDragging:w,stopDragging:y}=f,_=jS(r),S=(h==null?void 0:h.dragHandleId)===_,[C,E]=bm(!1),[O,T]=bm(null),N=Qr(()=>{const A=c.current;vt(A),A.blur(),y();const{onDragging:F}=u.current;F&&F(!1)},[y]);hl(()=>{if(n)T(null);else{const A=v(_);T(()=>A)}},[n,_,v]),hl(()=>{if(n||O==null||!S)return;const A=ee=>{O(ee)},F=ee=>{O(ee)},z=c.current;vt(z);const X=z.ownerDocument;return X.body.addEventListener("contextmenu",N),X.body.addEventListener("mousemove",A),X.body.addEventListener("touchmove",A),X.body.addEventListener("mouseleave",F),window.addEventListener("mouseup",N),window.addEventListener("touchend",N),()=>{X.body.removeEventListener("contextmenu",N),X.body.removeEventListener("mousemove",A),X.body.removeEventListener("touchmove",A),X.body.removeEventListener("mouseleave",F),window.removeEventListener("mouseup",N),window.removeEventListener("touchend",N)}},[p,n,S,O,N]),kge({disabled:n,handleId:_,resizeHandler:O});const M={cursor:W5(p),touchAction:"none",userSelect:"none"};return hu(a,{...l,children:e,className:t,onBlur:()=>E(!1),onFocus:()=>E(!0),onMouseDown:A=>{w(_,A.nativeEvent);const F=u.current;vt(F);const{onDragging:z}=F;z&&z(!0)},onMouseUp:N,onTouchCancel:N,onTouchEnd:N,onTouchStart:A=>{w(_,A.nativeEvent);const F=u.current;vt(F);const{onDragging:z}=F;z&&z(!0)},ref:c,role:"separator",style:{...M,...i},tabIndex:s,"data-panel-group-direction":p,"data-panel-group-id":b,"data-resize-handle":"","data-resize-handle-active":S?"pointer":C?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}zS.displayName="PanelResizeHandle";const X5=({className:e,...t})=>R.jsx(K5,{className:_e("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),z1=I5,Mge=({withHandle:e,className:t,...n})=>R.jsx(zS,{className:_e("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&R.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:R.jsx(TJ,{className:"h-2.5 w-2.5"})})}),Ige=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>R.jsx(zS,{className:_e("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...o,children:e&&R.jsx("div",{className:_e("z-50 flex items-center justify-start",{"border-l":r}),children:R.jsx(xr,{variant:"secondary",className:_e("h-7 p-1",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-2 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?R.jsx(f_,{className:"size-4"}):R.jsx(zk,{className:"size-4"})})})});function Nge(e,t=[]){let n=[];function r(i,s){const a=L.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:p,children:h,...b}=f,v=(p==null?void 0:p[e][l])||a,w=L.useMemo(()=>b,Object.values(b));return R.jsx(v.Provider,{value:w,children:h})}function u(f,p){const h=(p==null?void 0:p[e][l])||a,b=L.useContext(h);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>L.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return L.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Lge(o,...t)]}function Lge(...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:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return L.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Fge(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function jge(...e){return t=>e.forEach(n=>Fge(n,t))}function Q5(...e){return L.useCallback(jge(...e),e)}function sa(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 zge(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Bge(...e){return t=>e.forEach(n=>zge(n,t))}function Nl(...e){return L.useCallback(Bge(...e),e)}function Vge(e,t){const n=L.createContext(t);function r(i){const{children:s,...a}=i,l=L.useMemo(()=>a,Object.values(a));return R.jsx(n.Provider,{value:l,children:s})}function o(i){const s=L.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,o]}function Hge(e,t=[]){let n=[];function r(i,s){const a=L.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:p,children:h,...b}=f,v=(p==null?void 0:p[e][l])||a,w=L.useMemo(()=>b,Object.values(b));return R.jsx(v.Provider,{value:w,children:h})}function u(f,p){const h=(p==null?void 0:p[e][l])||a,b=L.useContext(h);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>L.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return L.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Wge(o,...t)]}function Wge(...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:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return L.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ym=globalThis!=null&&globalThis.document?L.useLayoutEffect:()=>{},Uge=L.useId||(()=>{}),qge=0;function Py(e){const[t,n]=L.useState(Uge());return ym(()=>{e||n(r=>r??String(qge++))},[e]),e||(t?`radix-${t}`:"")}function Sl(e){const t=L.useRef(e);return L.useEffect(()=>{t.current=e}),L.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Gge({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Yge({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Sl(n),l=L.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function Yge({defaultProp:e,onChange:t}){const n=L.useState(e),[r]=n,o=L.useRef(r),i=Sl(t);return L.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var Kge=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],gs=Kge.reduce((e,t)=>{const n=L.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?pv:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Xge(e,t){e&&ew.flushSync(()=>e.dispatchEvent(t))}function Qge(e,t=globalThis==null?void 0:globalThis.document){const n=Sl(e);L.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Jge="DismissableLayer",B1="dismissableLayer.update",Zge="dismissableLayer.pointerDownOutside",eme="dismissableLayer.focusOutside",lT,J5=L.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Z5=L.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=L.useContext(J5),[u,f]=L.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=L.useState({}),b=Nl(t,T=>f(T)),v=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(w),_=u?v.indexOf(u):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,C=_>=y,E=rme(T=>{const N=T.target,M=[...c.branches].some(A=>A.contains(N));!C||M||(o==null||o(T),s==null||s(T),T.defaultPrevented||a==null||a())},p),O=ome(T=>{const N=T.target;[...c.branches].some(A=>A.contains(N))||(i==null||i(T),s==null||s(T),T.defaultPrevented||a==null||a())},p);return Qge(T=>{_===c.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},p),L.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(lT=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),cT(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=lT)}},[u,p,n,c]),L.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),cT())},[u,c]),L.useEffect(()=>{const T=()=>h({});return document.addEventListener(B1,T),()=>document.removeEventListener(B1,T)},[]),R.jsx(gs.div,{...l,ref:b,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:sa(e.onFocusCapture,O.onFocusCapture),onBlurCapture:sa(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:sa(e.onPointerDownCapture,E.onPointerDownCapture)})});Z5.displayName=Jge;var tme="DismissableLayerBranch",nme=L.forwardRef((e,t)=>{const n=L.useContext(J5),r=L.useRef(null),o=Nl(t,r);return L.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),R.jsx(gs.div,{...e,ref:o})});nme.displayName=tme;function rme(e,t=globalThis==null?void 0:globalThis.document){const n=Sl(e),r=L.useRef(!1),o=L.useRef(()=>{});return L.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){eL(Zge,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}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 ome(e,t=globalThis==null?void 0:globalThis.document){const n=Sl(e),r=L.useRef(!1);return L.useEffect(()=>{const o=i=>{i.target&&!r.current&&eL(eme,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 cT(){const e=new CustomEvent(B1);document.dispatchEvent(e)}function eL(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?Xge(o,i):o.dispatchEvent(i)}var Oy="focusScope.autoFocusOnMount",$y="focusScope.autoFocusOnUnmount",uT={bubbles:!1,cancelable:!0},ime="FocusScope",tL=L.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=L.useState(null),c=Sl(o),u=Sl(i),f=L.useRef(null),p=Nl(t,v=>l(v)),h=L.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;L.useEffect(()=>{if(r){let v=function(S){if(h.paused||!a)return;const C=S.target;a.contains(C)?f.current=C:zs(f.current,{select:!0})},w=function(S){if(h.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||zs(f.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&zs(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const _=new MutationObserver(y);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),_.disconnect()}}},[r,a,h.paused]),L.useEffect(()=>{if(a){fT.add(h);const v=document.activeElement;if(!a.contains(v)){const y=new CustomEvent(Oy,uT);a.addEventListener(Oy,c),a.dispatchEvent(y),y.defaultPrevented||(sme(dme(nL(a)),{select:!0}),document.activeElement===v&&zs(a))}return()=>{a.removeEventListener(Oy,c),setTimeout(()=>{const y=new CustomEvent($y,uT);a.addEventListener($y,u),a.dispatchEvent(y),y.defaultPrevented||zs(v??document.body,{select:!0}),a.removeEventListener($y,u),fT.remove(h)},0)}}},[a,c,u,h]);const b=L.useCallback(v=>{if(!n&&!r||h.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(w&&y){const _=v.currentTarget,[S,C]=ame(_);S&&C?!v.shiftKey&&y===C?(v.preventDefault(),n&&zs(S,{select:!0})):v.shiftKey&&y===S&&(v.preventDefault(),n&&zs(C,{select:!0})):y===_&&v.preventDefault()}},[n,r,h.paused]);return R.jsx(gs.div,{tabIndex:-1,...s,ref:p,onKeyDown:b})});tL.displayName=ime;function sme(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zs(r,{select:t}),document.activeElement!==n)return}function ame(e){const t=nL(e),n=dT(t,e),r=dT(t.reverse(),e);return[n,r]}function nL(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 dT(e,t){for(const n of e)if(!lme(n,{upTo:t}))return n}function lme(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 cme(e){return e instanceof HTMLInputElement&&"select"in e}function zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cme(e)&&t&&e.select()}}var fT=ume();function ume(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=hT(e,t),e.unshift(t)},remove(t){var n;e=hT(e,t),(n=e[0])==null||n.resume()}}}function hT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dme(e){return e.filter(t=>t.tagName!=="A")}var fme="Portal",rL=L.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=L.useState(!1);ym(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Cr.createPortal(R.jsx(gs.div,{...r,ref:t}),s):null});rL.displayName=fme;function hme(e,t){return L.useReducer((n,r)=>t[n][r]??n,e)}var Dv=e=>{const{present:t,children:n}=e,r=pme(t),o=typeof n=="function"?n({present:r.isPresent}):L.Children.only(n),i=Nl(r.ref,gme(o));return typeof n=="function"||r.isPresent?L.cloneElement(o,{ref:i}):null};Dv.displayName="Presence";function pme(e){const[t,n]=L.useState(),r=L.useRef({}),o=L.useRef(e),i=L.useRef("none"),s=e?"mounted":"unmounted",[a,l]=hme(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return L.useEffect(()=>{const c=sg(r.current);i.current=a==="mounted"?c:"none"},[a]),ym(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,h=sg(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ym(()=>{if(t){const c=f=>{const h=sg(r.current).includes(f.animationName);f.target===t&&h&&ew.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=sg(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:L.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function sg(e){return(e==null?void 0:e.animationName)||"none"}function gme(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ty=0;function mme(){L.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pT()),document.body.insertAdjacentElement("beforeend",e[1]??pT()),Ty++,()=>{Ty===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ty--}},[])}function pT(){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}var oL=V_(),Dy=function(){},Av=L.forwardRef(function(e,t){var n=L.useRef(null),r=L.useState({onScrollCapture:Dy,onWheelCapture:Dy,onTouchMoveCapture:Dy}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,h=e.noIsolation,b=e.inert,v=e.allowPinchZoom,w=e.as,y=w===void 0?"div":w,_=e.gapMode,S=lv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,E=B_([n,t]),O=En(En({},S),o);return L.createElement(L.Fragment,null,u&&L.createElement(C,{sideCar:oL,removeScrollBar:c,shards:f,noIsolation:h,inert:b,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:_}),s?L.cloneElement(L.Children.only(a),En(En({},O),{ref:E})):L.createElement(y,En({},O,{className:l,ref:E}),a))});Av.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Av.classNames={fullWidth:Tc,zeroRight:$c};var V1=!1;if(typeof window<"u")try{var ag=Object.defineProperty({},"passive",{get:function(){return V1=!0,!0}});window.addEventListener("test",ag,ag),window.removeEventListener("test",ag,ag)}catch{V1=!1}var pc=V1?{passive:!1}:!1,vme=function(e){return e.tagName==="TEXTAREA"},iL=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vme(e)&&n[t]==="visible")},bme=function(e){return iL(e,"overflowY")},yme=function(e){return iL(e,"overflowX")},gT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=sL(e,r);if(o){var i=aL(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xme=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},wme=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},sL=function(e,t){return e==="v"?bme(t):yme(t)},aL=function(e,t){return e==="v"?xme(t):wme(t)},_me=function(e,t){return e==="h"&&t==="rtl"?-1:1},Sme=function(e,t,n,r,o){var i=_me(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,p=0;do{var h=aL(e,a),b=h[0],v=h[1],w=h[2],y=v-w-i*b;(b||y)&&sL(e,a)&&(f+=y,p+=b),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&Math.abs(f)<1||!o&&s>f)||!u&&(o&&Math.abs(p)<1||!o&&-s>p))&&(c=!0),c},lg=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mT=function(e){return[e.deltaX,e.deltaY]},vT=function(e){return e&&"current"in e?e.current:e},Cme=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Eme=function(e){return`
|
|
423
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
424
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
425
|
-
`)},Rme=0,gc=[];function Pme(e){var t=L.useRef([]),n=L.useRef([0,0]),r=L.useRef(),o=L.useState(Rme++)[0],i=L.useState(uv)[0],s=L.useRef(e);L.useEffect(function(){s.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=z_([e.lockRef.current],(e.shards||[]).map(vT),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=L.useCallback(function(v,w){if("touches"in v&&v.touches.length===2)return!s.current.allowPinchZoom;var y=lg(v),_=n.current,S="deltaX"in v?v.deltaX:_[0]-y[0],C="deltaY"in v?v.deltaY:_[1]-y[1],E,O=v.target,T=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in v&&T==="h"&&O.type==="range")return!1;var N=gT(T,O);if(!N)return!0;if(N?E=T:(E=T==="v"?"h":"v",N=gT(T,O)),!N)return!1;if(!r.current&&"changedTouches"in v&&(S||C)&&(r.current=E),!E)return!0;var M=r.current||E;return Sme(M,w,v,M==="h"?S:C,!0)},[]),l=L.useCallback(function(v){var w=v;if(!(!gc.length||gc[gc.length-1]!==i)){var y="deltaY"in w?mT(w):lg(w),_=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Cme(E.delta,y)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(vT).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=S.length>0?a(w,S[0]):!s.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),c=L.useCallback(function(v,w,y,_){var S={name:v,delta:w,target:y,should:_,shadowParent:Ome(y)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=L.useCallback(function(v){n.current=lg(v),r.current=void 0},[]),f=L.useCallback(function(v){c(v.type,mT(v),v.target,a(v,e.lockRef.current))},[]),p=L.useCallback(function(v){c(v.type,lg(v),v.target,a(v,e.lockRef.current))},[]);L.useEffect(function(){return gc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,pc),document.addEventListener("touchmove",l,pc),document.addEventListener("touchstart",u,pc),function(){gc=gc.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,pc),document.removeEventListener("touchmove",l,pc),document.removeEventListener("touchstart",u,pc)}},[]);var h=e.removeScrollBar,b=e.inert;return L.createElement(L.Fragment,null,b?L.createElement(i,{styles:Eme(o)}):null,h?L.createElement(W_,{gapMode:e.gapMode}):null)}function Ome(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $me=H_(oL,Pme);var lL=L.forwardRef(function(e,t){return L.createElement(Av,En({},e,{ref:t,sideCar:$me}))});lL.classNames=Av.classNames;const Tme=lL;var BS="Dialog",[cL,uL]=Hge(BS),[Dme,ni]=cL(BS),dL=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=L.useRef(null),l=L.useRef(null),[c=!1,u]=Gge({prop:r,defaultProp:o,onChange:i});return R.jsx(Dme,{scope:t,triggerRef:a,contentRef:l,contentId:Py(),titleId:Py(),descriptionId:Py(),open:c,onOpenChange:u,onOpenToggle:L.useCallback(()=>u(f=>!f),[u]),modal:s,children:n})};dL.displayName=BS;var fL="DialogTrigger",hL=L.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ni(fL,n),i=Nl(t,o.triggerRef);return R.jsx(gs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":WS(o.open),...r,ref:i,onClick:sa(e.onClick,o.onOpenToggle)})});hL.displayName=fL;var VS="DialogPortal",[Ame,pL]=cL(VS,{forceMount:void 0}),gL=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=ni(VS,t);return R.jsx(Ame,{scope:t,forceMount:n,children:L.Children.map(r,s=>R.jsx(Dv,{present:n||i.open,children:R.jsx(rL,{asChild:!0,container:o,children:s})}))})};gL.displayName=VS;var xm="DialogOverlay",mL=L.forwardRef((e,t)=>{const n=pL(xm,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ni(xm,e.__scopeDialog);return i.modal?R.jsx(Dv,{present:r||i.open,children:R.jsx(kme,{...o,ref:t})}):null});mL.displayName=xm;var kme=L.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ni(xm,n);return R.jsx(Tme,{as:pv,allowPinchZoom:!0,shards:[o.contentRef],children:R.jsx(gs.div,{"data-state":WS(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Cl="DialogContent",vL=L.forwardRef((e,t)=>{const n=pL(Cl,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ni(Cl,e.__scopeDialog);return R.jsx(Dv,{present:r||i.open,children:i.modal?R.jsx(Mme,{...o,ref:t}):R.jsx(Ime,{...o,ref:t})})});vL.displayName=Cl;var Mme=L.forwardRef((e,t)=>{const n=ni(Cl,e.__scopeDialog),r=L.useRef(null),o=Nl(t,n.contentRef,r);return L.useEffect(()=>{const i=r.current;if(i)return ih(i)},[]),R.jsx(bL,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:sa(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:sa(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:sa(e.onFocusOutside,i=>i.preventDefault())})}),Ime=L.forwardRef((e,t)=>{const n=ni(Cl,e.__scopeDialog),r=L.useRef(!1),o=L.useRef(!1);return R.jsx(bL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),bL=L.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=ni(Cl,n),l=L.useRef(null),c=Nl(t,l);return mme(),R.jsxs(R.Fragment,{children:[R.jsx(tL,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:R.jsx(Z5,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":WS(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),R.jsxs(R.Fragment,{children:[R.jsx(Lme,{titleId:a.titleId}),R.jsx(jme,{contentRef:l,descriptionId:a.descriptionId})]})]})}),HS="DialogTitle",yL=L.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ni(HS,n);return R.jsx(gs.h2,{id:o.titleId,...r,ref:t})});yL.displayName=HS;var xL="DialogDescription",wL=L.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ni(xL,n);return R.jsx(gs.p,{id:o.descriptionId,...r,ref:t})});wL.displayName=xL;var _L="DialogClose",SL=L.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ni(_L,n);return R.jsx(gs.button,{type:"button",...r,ref:t,onClick:sa(e.onClick,()=>o.onOpenChange(!1))})});SL.displayName=_L;function WS(e){return e?"open":"closed"}var CL="DialogTitleWarning",[Nme,EL]=Vge(CL,{contentName:Cl,titleName:HS,docsSlug:"dialog"}),Lme=({titleId:e})=>{const t=EL(CL),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
426
|
-
|
|
427
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
428
|
-
|
|
429
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return L.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Fme="DialogDescriptionWarning",jme=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${EL(Fme).contentName}}.`;return L.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},RL=dL,PL=hL,OL=gL,US=mL,qS=vL,GS=yL,YS=wL,KS=SL;function zme(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var $L="AlertDialog",[Bme,O1e]=Nge($L,[uL]),ms=uL(),TL=e=>{const{__scopeAlertDialog:t,...n}=e,r=ms(t);return R.jsx(RL,{...r,...n,modal:!0})};TL.displayName=$L;var Vme="AlertDialogTrigger",Hme=L.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ms(n);return R.jsx(PL,{...o,...r,ref:t})});Hme.displayName=Vme;var Wme="AlertDialogPortal",DL=e=>{const{__scopeAlertDialog:t,...n}=e,r=ms(t);return R.jsx(OL,{...r,...n})};DL.displayName=Wme;var Ume="AlertDialogOverlay",AL=L.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ms(n);return R.jsx(US,{...o,...r,ref:t})});AL.displayName=Ume;var Mc="AlertDialogContent",[qme,Gme]=Bme(Mc),kL=L.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=ms(n),s=L.useRef(null),a=Q5(t,s),l=L.useRef(null);return R.jsx(Nme,{contentName:Mc,titleName:ML,docsSlug:"alert-dialog",children:R.jsx(qme,{scope:n,cancelRef:l,children:R.jsxs(qS,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:zme(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[R.jsx(lI,{children:r}),R.jsx(Kme,{contentRef:s})]})})})});kL.displayName=Mc;var ML="AlertDialogTitle",IL=L.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ms(n);return R.jsx(GS,{...o,...r,ref:t})});IL.displayName=ML;var NL="AlertDialogDescription",LL=L.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ms(n);return R.jsx(YS,{...o,...r,ref:t})});LL.displayName=NL;var Yme="AlertDialogAction",FL=L.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ms(n);return R.jsx(KS,{...o,...r,ref:t})});FL.displayName=Yme;var jL="AlertDialogCancel",zL=L.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=Gme(jL,n),i=ms(n),s=Q5(t,o);return R.jsx(KS,{...i,...r,ref:s})});zL.displayName=jL;var Kme=({contentRef:e})=>{const t=`\`${Mc}\` requires a description for the component to be accessible for screen reader users.
|
|
430
|
-
|
|
431
|
-
You can add a description to the \`${Mc}\` by passing a \`${NL}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
432
|
-
|
|
433
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Mc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
434
|
-
|
|
435
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return L.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Xme=TL,Qme=DL,BL=AL,VL=kL,HL=FL,WL=zL,UL=IL,qL=LL;const Jme=Xme,Zme=Qme,GL=L.forwardRef(({className:e,...t},n)=>R.jsx(BL,{className:_e("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));GL.displayName=BL.displayName;const YL=L.forwardRef(({className:e,...t},n)=>R.jsx(Zme,{children:R.jsxs(yu,{children:[R.jsx(GL,{}),R.jsx(VL,{ref:n,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),...t})]})}));YL.displayName=VL.displayName;const KL=({className:e,...t})=>R.jsx("div",{className:_e("flex flex-col space-y-2 text-center sm:text-left",e),...t});KL.displayName="AlertDialogHeader";const XL=({className:e,...t})=>R.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});XL.displayName="AlertDialogFooter";const QL=L.forwardRef(({className:e,...t},n)=>R.jsx(UL,{ref:n,className:_e("text-lg font-semibold",e),...t}));QL.displayName=UL.displayName;const JL=L.forwardRef(({className:e,...t},n)=>R.jsx(qL,{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));JL.displayName=qL.displayName;const ZL=L.forwardRef(({className:e,...t},n)=>R.jsx(HL,{ref:n,className:_e(ef(),e),...t}));ZL.displayName=HL.displayName;const e3=L.forwardRef(({className:e,...t},n)=>R.jsx(WL,{ref:n,className:_e(ef({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));e3.displayName=WL.displayName;function eve({open:e,setOpen:t}){const n=$e(i=>i.selectedSheetId),{deleteSheet:r}=wr();function o(){n&&(r(n),t(!1))}return R.jsx(Jme,{open:e,onOpenChange:t,children:R.jsxs(YL,{children:[R.jsxs(KL,{children:[R.jsx(QL,{children:"Delete Sheet"}),R.jsx(JL,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),R.jsxs(XL,{children:[R.jsx(e3,{children:"Cancel"}),R.jsx(ZL,{onClick:o,children:"Delete"})]})]})})}function t3(){var v,w;const[e,t]=m.useState(!1),n=$e(y=>{var _;return(_=y.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=ba(),o=m.useRef(null),[i,s]=m.useState(!1),a=$e(y=>y.isDashboardEditing),l=$e(y=>y.themeStyle);$e(y=>y.isVisualEditing);const c=$e(y=>y.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:f,addSheet:p}=wr();if(!n)return null;function h(y){var _,S;y?((_=o.current)==null||_.resize(35),s(!0)):(s(!1),(S=o.current)==null||S.resize(0))}function b(){const y={id:ua(),title:"New Sheet"};p(y)}return R.jsxs(yw,{role:"dashboard-tabs-container",className:_e("relative flex grow flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:y=>{u(y)},value:c||n[0].id,children:[R.jsx("div",{children:(n.length>1||a)&&R.jsxs(Mm,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(y=>{var _,S;return R.jsx(xi,{text:y.title,onSave:C=>f(y.id,C),children:R.jsxs(Im,{style:{borderRadius:(S=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:S.borderRadius},onClick:()=>u(y.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:y.id,children:[y.title,a&&c===y.id&&n.length>1&&R.jsx(Jf,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},y.id)}),a&&R.jsx("div",{style:{borderRadius:(w=(v=l==null?void 0:l.chart)==null?void 0:v.options)==null?void 0:w.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:b,children:R.jsx(h_,{className:"size-3"})})]})}),R.jsxs(X5,{className:"grow",direction:"horizontal",children:[R.jsx(z1,{children:R.jsx("div",{style:{},children:n==null?void 0:n.map(y=>R.jsx(xw,{className:_e("mt-0",{"bg-muted":(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)}),value:y.id,children:R.jsx(xce,{})},y.id))})}),r===!0&&R.jsxs(R.Fragment,{children:[R.jsx(Ige,{open:i,onTabClick:h,withHandle:!0}),R.jsx(z1,{onResize:y=>{y<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:R.jsx(pge,{})})]})]}),R.jsx(eve,{open:e,setOpen:t})]})}function n3({children:e}){return R.jsx(qV,{defaultTheme:"system",storageKey:"vite-ui-theme",children:R.jsx(see,{delayDuration:0,children:e})})}function r3(e){return R.jsx(vM,{dashboardProps:e,children:R.jsx(n3,{children:R.jsx(TD,{...e,children:R.jsx(t3,{})})})})}const o3=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(nve);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(H1,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(H1,de({},r,{ref:t}),n)});o3.displayName="Slot";const H1=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...rve(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});H1.displayName="SlotClone";const tve=({children:e})=>m.createElement(m.Fragment,null,e);function nve(e){return m.isValidElement(e)&&e.type===tve}function rve(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}}const W1=["Enter"," "],ove=["ArrowDown","PageUp","Home"],i3=["ArrowUp","PageDown","End"],ive=[...ove,...i3],sve={ltr:[...W1,"ArrowRight"],rtl:[...W1,"ArrowLeft"]},ave={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kv="Menu",[Cf,lve,cve]=km(kv),[Ll,s3]=er(kv,[cve,Di,mu]),XS=Di(),a3=mu(),[uve,Fl]=Ll(kv),[dve,vh]=Ll(kv),fve=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=XS(t),[l,c]=m.useState(null),u=m.useRef(!1),f=jn(i),p=Pl(o);return m.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),m.createElement(th,a,m.createElement(uve,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(dve,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:s},r)))},l3=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=XS(n);return m.createElement(nh,de({},o,r,{ref:t}))}),c3="MenuPortal",[hve,u3]=Ll(c3,{forceMount:void 0}),pve=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Fl(c3,t);return m.createElement(hve,{scope:t,forceMount:n},m.createElement(tr,{present:n||i.open},m.createElement(w_,{asChild:!0,container:o},r)))},Jo="MenuContent",[gve,QS]=Ll(Jo),mve=m.forwardRef((e,t)=>{const n=u3(Jo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Fl(Jo,e.__scopeMenu),s=vh(Jo,e.__scopeMenu);return m.createElement(Cf.Provider,{scope:e.__scopeMenu},m.createElement(tr,{present:r||i.open},m.createElement(Cf.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(vve,de({},o,{ref:t})):m.createElement(bve,de({},o,{ref:t})))))}),vve=m.forwardRef((e,t)=>{const n=Fl(Jo,e.__scopeMenu),r=m.useRef(null),o=_t(t,r);return m.useEffect(()=>{const i=r.current;if(i)return ih(i)},[]),m.createElement(JS,de({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),bve=m.forwardRef((e,t)=>{const n=Fl(Jo,e.__scopeMenu);return m.createElement(JS,de({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),JS=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:h,disableOutsideScroll:b,...v}=e,w=Fl(Jo,n),y=vh(Jo,n),_=XS(n),S=a3(n),C=lve(n),[E,O]=m.useState(null),T=m.useRef(null),N=_t(t,T,w.onContentChange),M=m.useRef(0),A=m.useRef(""),F=m.useRef(0),z=m.useRef(null),X=m.useRef("right"),ee=m.useRef(0),H=b?U_:m.Fragment,Q=b?{as:o3,allowPinchZoom:!0}:void 0,Y=W=>{var $,V;const U=A.current+W,I=C().filter(oe=>!oe.disabled),te=document.activeElement,fe=($=I.find(oe=>oe.ref.current===te))===null||$===void 0?void 0:$.textValue,ne=I.map(oe=>oe.textValue),ue=Lve(ne,U,fe),ie=(V=I.find(oe=>oe.textValue===ue))===null||V===void 0?void 0:V.ref.current;(function oe(le){A.current=le,window.clearTimeout(M.current),le!==""&&(M.current=window.setTimeout(()=>oe(""),1e3))})(U),ie&&setTimeout(()=>ie.focus())};m.useEffect(()=>()=>window.clearTimeout(M.current),[]),F_();const J=m.useCallback(W=>{var $,V;return X.current===(($=z.current)===null||$===void 0?void 0:$.side)&&jve(W,(V=z.current)===null||V===void 0?void 0:V.area)},[]);return m.createElement(gve,{scope:n,searchRef:A,onItemEnter:m.useCallback(W=>{J(W)&&W.preventDefault()},[J]),onItemLeave:m.useCallback(W=>{var $;J(W)||(($=T.current)===null||$===void 0||$.focus(),O(null))},[J]),onTriggerLeave:m.useCallback(W=>{J(W)&&W.preventDefault()},[J]),pointerGraceTimerRef:F,onPointerGraceIntentChange:m.useCallback(W=>{z.current=W},[])},m.createElement(H,Q,m.createElement(j_,{asChild:!0,trapped:o,onMountAutoFocus:Me(i,W=>{var $;W.preventDefault(),($=T.current)===null||$===void 0||$.focus()}),onUnmountAutoFocus:s},m.createElement(Zf,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:h},m.createElement(mw,de({asChild:!0},S,{dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:O,onEntryFocus:Me(l,W=>{y.isUsingKeyboardRef.current||W.preventDefault()})}),m.createElement(rh,de({role:"menu","aria-orientation":"vertical","data-state":g3(w.open),"data-radix-menu-content":"",dir:y.dir},_,v,{ref:N,style:{outline:"none",...v.style},onKeyDown:Me(v.onKeyDown,W=>{const V=W.target.closest("[data-radix-menu-content]")===W.currentTarget,U=W.ctrlKey||W.altKey||W.metaKey,I=W.key.length===1;V&&(W.key==="Tab"&&W.preventDefault(),!U&&I&&Y(W.key));const te=T.current;if(W.target!==te||!ive.includes(W.key))return;W.preventDefault();const ne=C().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);i3.includes(W.key)&&ne.reverse(),Ive(ne)}),onBlur:Me(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(M.current),A.current="")}),onPointerMove:Me(e.onPointerMove,Ef(W=>{const $=W.target,V=ee.current!==W.clientX;if(W.currentTarget.contains($)&&V){const U=W.clientX>ee.current?"right":"left";X.current=U,ee.current=W.clientX}}))})))))))}),yve=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,de({role:"group"},r,{ref:t}))}),xve=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,de({},r,{ref:t}))}),U1="MenuItem",bT="menu.itemSelect",ZS=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=vh(U1,e.__scopeMenu),a=QS(U1,e.__scopeMenu),l=_t(t,i),c=m.useRef(!1),u=()=>{const f=i.current;if(!n&&f){const p=new CustomEvent(bT,{bubbles:!0,cancelable:!0});f.addEventListener(bT,h=>r==null?void 0:r(h),{once:!0}),AD(f,p),p.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(d3,de({},o,{ref:l,disabled:n,onClick:Me(e.onClick,u),onPointerDown:f=>{var p;(p=e.onPointerDown)===null||p===void 0||p.call(e,f),c.current=!0},onPointerUp:Me(e.onPointerUp,f=>{var p;c.current||(p=f.currentTarget)===null||p===void 0||p.click()}),onKeyDown:Me(e.onKeyDown,f=>{const p=a.searchRef.current!=="";n||p&&f.key===" "||W1.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),d3=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=QS(U1,n),a=a3(n),l=m.useRef(null),c=_t(t,l),[u,f]=m.useState(!1),[p,h]=m.useState("");return m.useEffect(()=>{const b=l.current;if(b){var v;h(((v=b.textContent)!==null&&v!==void 0?v:"").trim())}},[i.children]),m.createElement(Cf.ItemSlot,{scope:n,disabled:r,textValue:o??p},m.createElement(vw,de({asChild:!0},a,{focusable:!r}),m.createElement(Qe.div,de({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:Me(e.onPointerMove,Ef(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:Me(e.onPointerLeave,Ef(b=>s.onItemLeave(b))),onFocus:Me(e.onFocus,()=>f(!0)),onBlur:Me(e.onBlur,()=>f(!1))}))))}),wve=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(h3,{scope:e.__scopeMenu,checked:n},m.createElement(ZS,de({role:"menuitemcheckbox","aria-checked":wm(n)?"mixed":n},o,{ref:t,"data-state":eC(n),onSelect:Me(o.onSelect,()=>r==null?void 0:r(wm(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),_ve="MenuRadioGroup",[Sve,Cve]=Ll(_ve,{value:void 0,onValueChange:()=>{}}),Eve=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=jn(r);return m.createElement(Sve,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(yve,de({},o,{ref:t})))}),Rve="MenuRadioItem",Pve=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Cve(Rve,e.__scopeMenu),i=n===o.value;return m.createElement(h3,{scope:e.__scopeMenu,checked:i},m.createElement(ZS,de({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":eC(i),onSelect:Me(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),f3="MenuItemIndicator",[h3,Ove]=Ll(f3,{checked:!1}),$ve=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Ove(f3,n);return m.createElement(tr,{present:r||wm(i.checked)||i.checked===!0},m.createElement(Qe.span,de({},o,{ref:t,"data-state":eC(i.checked)})))}),Tve=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,de({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),Dve="MenuSub",[$1e,p3]=Ll(Dve),cg="MenuSubTrigger",Ave=m.forwardRef((e,t)=>{const n=Fl(cg,e.__scopeMenu),r=vh(cg,e.__scopeMenu),o=p3(cg,e.__scopeMenu),i=QS(cg,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(l3,de({asChild:!0},c),m.createElement(d3,de({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":g3(n.open)},e,{ref:us(t,o.onTriggerChange),onClick:f=>{var p;(p=e.onClick)===null||p===void 0||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Me(e.onPointerMove,Ef(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Me(e.onPointerLeave,Ef(f=>{var p;u();const h=(p=n.content)===null||p===void 0?void 0:p.getBoundingClientRect();if(h){var b;const v=(b=n.content)===null||b===void 0?void 0:b.dataset.side,w=v==="right",y=w?-5:5,_=h[w?"left":"right"],S=h[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x:_,y:h.top},{x:S,y:h.top},{x:S,y:h.bottom},{x:_,y:h.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Me(e.onKeyDown,f=>{const p=i.searchRef.current!=="";if(!(e.disabled||p&&f.key===" ")&&sve[r.dir].includes(f.key)){var h;n.onOpenChange(!0),(h=n.content)===null||h===void 0||h.focus(),f.preventDefault()}})})))}),kve="MenuSubContent",Mve=m.forwardRef((e,t)=>{const n=u3(Jo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Fl(Jo,e.__scopeMenu),s=vh(Jo,e.__scopeMenu),a=p3(kve,e.__scopeMenu),l=m.useRef(null),c=_t(t,l);return m.createElement(Cf.Provider,{scope:e.__scopeMenu},m.createElement(tr,{present:r||i.open},m.createElement(Cf.Slot,{scope:e.__scopeMenu},m.createElement(JS,de({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Me(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Me(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Me(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),p=ave[s.dir].includes(u.key);if(f&&p){var h;i.onOpenChange(!1),(h=a.trigger)===null||h===void 0||h.focus(),u.preventDefault()}})})))))});function g3(e){return e?"open":"closed"}function wm(e){return e==="indeterminate"}function eC(e){return wm(e)?"indeterminate":e?"checked":"unchecked"}function Ive(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Nve(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Lve(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Nve(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Fve(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,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function jve(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Fve(n,t)}function Ef(e){return t=>t.pointerType==="mouse"?e(t):void 0}const zve=fve,Bve=l3,Vve=pve,Hve=mve,Wve=xve,Uve=ZS,qve=wve,Gve=Eve,Yve=Pve,Kve=$ve,Xve=Tve,Qve=Ave,Jve=Mve,m3="DropdownMenu",[Zve,T1e]=er(m3,[s3]),mo=s3(),[ebe,v3]=Zve(m3),tbe=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=mo(t),c=m.useRef(null),[u=!1,f]=_r({prop:o,defaultProp:i,onChange:s});return m.createElement(ebe,{scope:t,triggerId:Zo(),triggerRef:c,contentId:Zo(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),modal:a},m.createElement(zve,de({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},nbe="DropdownMenuTrigger",rbe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=v3(nbe,n),s=mo(n);return m.createElement(Bve,de({asChild:!0},s),m.createElement(Qe.button,de({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:us(t,i.triggerRef),onPointerDown:Me(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Me(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),obe=e=>{const{__scopeDropdownMenu:t,...n}=e,r=mo(t);return m.createElement(Vve,de({},r,n))},ibe="DropdownMenuContent",sbe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=v3(ibe,n),i=mo(n),s=m.useRef(!1);return m.createElement(Hve,de({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:Me(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Me(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(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)"}}))}),abe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mo(n);return m.createElement(Wve,de({},o,r,{ref:t}))}),lbe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mo(n);return m.createElement(Uve,de({},o,r,{ref:t}))}),cbe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mo(n);return m.createElement(qve,de({},o,r,{ref:t}))}),ube=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mo(n);return m.createElement(Gve,de({},o,r,{ref:t}))}),dbe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mo(n);return m.createElement(Yve,de({},o,r,{ref:t}))}),fbe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mo(n);return m.createElement(Kve,de({},o,r,{ref:t}))}),hbe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mo(n);return m.createElement(Xve,de({},o,r,{ref:t}))}),pbe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mo(n);return m.createElement(Qve,de({},o,r,{ref:t}))}),gbe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mo(n);return m.createElement(Jve,de({},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)"}}))}),mbe=tbe,vbe=rbe,bbe=obe,b3=sbe,y3=abe,x3=lbe,w3=cbe,ybe=ube,_3=dbe,S3=fbe,C3=hbe,E3=pbe,R3=gbe,xbe=mbe,wbe=vbe,_be=ybe,Sbe=L.forwardRef(({className:e,inset:t,children:n,...r},o)=>R.jsxs(E3,{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,R.jsx(f_,{className:"ml-auto h-4 w-4"})]}));Sbe.displayName=E3.displayName;const Cbe=L.forwardRef(({className:e,...t},n)=>R.jsx(R3,{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}));Cbe.displayName=R3.displayName;const P3=L.forwardRef(({className:e,sideOffset:t=4,...n},r)=>R.jsx(bbe,{children:R.jsx(yu,{children:R.jsx(b3,{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})})}));P3.displayName=b3.displayName;const Ebe=L.forwardRef(({className:e,inset:t,...n},r)=>R.jsx(x3,{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}));Ebe.displayName=x3.displayName;const Rbe=L.forwardRef(({className:e,children:t,checked:n,...r},o)=>R.jsxs(w3,{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:[R.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:R.jsx(S3,{children:R.jsx(Qf,{className:"h-4 w-4"})})}),t]}));Rbe.displayName=w3.displayName;const O3=L.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(_3,{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:[R.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:R.jsx(S3,{children:R.jsx(Bk,{className:"h-2 w-2 fill-current"})})}),t]}));O3.displayName=_3.displayName;const $3=L.forwardRef(({className:e,inset:t,...n},r)=>R.jsx(y3,{ref:r,className:_e("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));$3.displayName=y3.displayName;const T3=L.forwardRef(({className:e,...t},n)=>R.jsx(C3,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));T3.displayName=C3.displayName;function Pbe(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=>D3(s))}})}})}}function D3(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:Obe(e.customCfg),data:[]}}function Obe(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 A3(e){return`semaphor:bookmark:${e}`}const $be=RL,Tbe=PL,Dbe=OL,k3=L.forwardRef(({className:e,...t},n)=>R.jsx(US,{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}));k3.displayName=US.displayName;const M3=L.forwardRef(({className:e,children:t,...n},r)=>R.jsx(Dbe,{children:R.jsxs(yu,{children:[R.jsx(k3,{}),R.jsxs(qS,{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,R.jsxs(KS,{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:[R.jsx(Jf,{className:"h-4 w-4"}),R.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));M3.displayName=qS.displayName;const I3=({className:e,...t})=>R.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});I3.displayName="DialogHeader";const N3=({className:e,...t})=>R.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});N3.displayName="DialogFooter";const L3=L.forwardRef(({className:e,...t},n)=>R.jsx(GS,{ref:n,className:_e("text-lg font-semibold leading-none tracking-tight",e),...t}));L3.displayName=GS.displayName;const F3=L.forwardRef(({className:e,...t},n)=>R.jsx(YS,{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));F3.displayName=YS.displayName;const j3="Checkbox",[Abe,D1e]=er(j3),[kbe,Mbe]=Abe(j3),Ibe=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,p]=m.useState(null),h=_t(t,S=>p(S)),b=m.useRef(!1),v=f?!!f.closest("form"):!0,[w=!1,y]=_r({prop:o,defaultProp:i,onChange:c}),_=m.useRef(w);return m.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const C=()=>y(_.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[f,y]),m.createElement(kbe,{scope:n,state:w,disabled:a},m.createElement(Qe.button,de({type:"button",role:"checkbox","aria-checked":pl(w)?"mixed":w,"aria-required":s,"data-state":z3(w),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:h,onKeyDown:Me(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Me(e.onClick,S=>{y(C=>pl(C)?!0:!C),v&&(b.current=S.isPropagationStopped(),b.current||S.stopPropagation())})})),v&&m.createElement(Fbe,{control:f,bubbles:!b.current,name:r,value:l,checked:w,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Nbe="CheckboxIndicator",Lbe=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Mbe(Nbe,n);return m.createElement(tr,{present:r||pl(i.state)||i.state===!0},m.createElement(Qe.span,de({"data-state":z3(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Fbe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=av(n),a=nv(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});l.indeterminate=pl(n),f.call(l,pl(n)?!1:n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",de({type:"checkbox","aria-hidden":!0,defaultChecked:pl(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function pl(e){return e==="indeterminate"}function z3(e){return pl(e)?"indeterminate":e?"checked":"unchecked"}const B3=Ibe,jbe=Lbe,V3=L.forwardRef(({className:e,...t},n)=>R.jsx(B3,{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:R.jsx(jbe,{className:_e("flex items-center justify-center text-current"),children:R.jsx(Qf,{className:"h-4 w-4"})})}));V3.displayName=B3.displayName;const H3=m.forwardRef(({className:e,...t},n)=>R.jsx("div",{role:"editor-panel",ref:n,className:_e("flex grow h-full",e),...t}));H3.displayName="EditorPanel";const W3=m.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e(" flex flex-col space-y-2 w-[270px]",e),...t}));W3.displayName="EditorAside";const U3=m.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e(" grow",e),...t}));U3.displayName="EditorMain";function zbe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yT(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 xT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yT(Object(n),!0).forEach(function(r){zbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bbe(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 Vbe(e,t){if(e==null)return{};var n=Bbe(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 Hbe(e,t){return Wbe(e)||Ube(e,t)||qbe(e,t)||Gbe()}function Wbe(e){if(Array.isArray(e))return e}function Ube(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 qbe(e,t){if(e){if(typeof e=="string")return wT(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 wT(e,t)}}function wT(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 Gbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
436
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ybe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _T(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 ST(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_T(Object(n),!0).forEach(function(r){Ybe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kbe(){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 Sd(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 _m(e){return{}.toString.call(e).includes("Object")}function Xbe(e){return!Object.keys(e).length}function Rf(e){return typeof e=="function"}function Qbe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Jbe(e,t){return _m(t)||aa("changeType"),Object.keys(t).some(function(n){return!Qbe(e,n)})&&aa("changeField"),t}function Zbe(e){Rf(e)||aa("selectorType")}function e0e(e){Rf(e)||_m(e)||aa("handlerType"),_m(e)&&Object.values(e).some(function(t){return!Rf(t)})&&aa("handlersType")}function t0e(e){e||aa("initialIsRequired"),_m(e)||aa("initialType"),Xbe(e)&&aa("initialContent")}function n0e(e,t){throw new Error(e[t]||e.default)}var r0e={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"},aa=Sd(n0e)(r0e),ug={changes:Jbe,selector:Zbe,handler:e0e,initial:t0e};function o0e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ug.initial(e),ug.handler(t);var n={current:e},r=Sd(a0e)(n,t),o=Sd(s0e)(n),i=Sd(ug.changes)(e),s=Sd(i0e)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return ug.selector(c),c(n.current)}function l(c){Kbe(r,o,i,s)(c)}return[a,l]}function i0e(e,t){return Rf(t)?t(e.current):t}function s0e(e,t){return e.current=ST(ST({},e.current),t),t}function a0e(e,t,n){return Rf(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 l0e={create:o0e},c0e={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function u0e(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 d0e(e){return{}.toString.call(e).includes("Object")}function f0e(e){return e||CT("configIsRequired"),d0e(e)||CT("configType"),e.urls?(h0e(),{paths:{vs:e.urls.monacoBase}}):e}function h0e(){console.warn(q3.deprecation)}function p0e(e,t){throw new Error(e[t]||e.default)}var q3={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!
|
|
437
|
-
You are using deprecated way of configuration.
|
|
438
|
-
|
|
439
|
-
Instead of using
|
|
440
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
441
|
-
use
|
|
442
|
-
monaco.config({ paths: { vs: '...' } })
|
|
443
|
-
|
|
444
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
445
|
-
`},CT=u0e(p0e)(q3),g0e={config:f0e},m0e=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 G3(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],G3(e[n],t[n]))}),xT(xT({},e),t)}var v0e={type:"cancelation",msg:"operation is manually canceled"};function Ay(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(v0e):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var b0e=l0e.create({config:c0e,isInitialized:!1,resolve:null,reject:null,monaco:null}),Y3=Hbe(b0e,2),bh=Y3[0],Mv=Y3[1];function y0e(e){var t=g0e.config(e),n=t.monaco,r=Vbe(t,["monaco"]);Mv(function(o){return{config:G3(o.config,r),monaco:n}})}function x0e(){var e=bh(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Mv({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Ay(ky);if(window.monaco&&window.monaco.editor)return K3(window.monaco),e.resolve(window.monaco),Ay(ky);m0e(w0e,S0e)(C0e)}return Ay(ky)}function w0e(e){return document.body.appendChild(e)}function _0e(e){var t=document.createElement("script");return e&&(t.src=e),t}function S0e(e){var t=bh(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=_0e("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function C0e(){var e=bh(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){K3(n),e.resolve(n)},function(n){e.reject(n)})}function K3(e){bh().monaco||Mv({monaco:e})}function E0e(){return bh(function(e){var t=e.monaco;return t})}var ky=new Promise(function(e,t){return Mv({resolve:e,reject:t})}),X3={config:y0e,init:x0e,__getMonacoInstance:E0e},R0e={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},My=R0e,P0e={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},O0e=P0e;function $0e({children:e}){return m.createElement("div",{style:O0e.container},e)}var T0e=$0e,D0e=T0e;function A0e({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...My.wrapper,width:e,height:t},...s},!n&&m.createElement(D0e,null,r),m.createElement("div",{ref:o,style:{...My.fullWidth,...!n&&My.hide},className:i}))}var k0e=A0e,Q3=m.memo(k0e);function M0e(e){m.useEffect(e,[])}var J3=M0e;function I0e(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var oo=I0e;function Nd(){}function Ec(e,t,n,r){return N0e(e,r)||L0e(e,t,n,r)}function N0e(e,t){return e.editor.getModel(Z3(e,t))}function L0e(e,t,n,r){return e.editor.createModel(t,n,r?Z3(e,r):void 0)}function Z3(e,t){return e.Uri.parse(t)}function F0e({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:f={},height:p="100%",width:h="100%",className:b,wrapperProps:v={},beforeMount:w=Nd,onMount:y=Nd}){let[_,S]=m.useState(!1),[C,E]=m.useState(!0),O=m.useRef(null),T=m.useRef(null),N=m.useRef(null),M=m.useRef(y),A=m.useRef(w),F=m.useRef(!1);J3(()=>{let H=X3.init();return H.then(Q=>(T.current=Q)&&E(!1)).catch(Q=>(Q==null?void 0:Q.type)!=="cancelation"&&console.error("Monaco initialization: error:",Q)),()=>O.current?ee():H.cancel()}),oo(()=>{if(O.current&&T.current){let H=O.current.getOriginalEditor(),Q=Ec(T.current,e||"",r||n||"text",i||"");Q!==H.getModel()&&H.setModel(Q)}},[i],_),oo(()=>{if(O.current&&T.current){let H=O.current.getModifiedEditor(),Q=Ec(T.current,t||"",o||n||"text",s||"");Q!==H.getModel()&&H.setModel(Q)}},[s],_),oo(()=>{let H=O.current.getModifiedEditor();H.getOption(T.current.editor.EditorOption.readOnly)?H.setValue(t||""):t!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[t],_),oo(()=>{var H,Q;(Q=(H=O.current)==null?void 0:H.getModel())==null||Q.original.setValue(e||"")},[e],_),oo(()=>{let{original:H,modified:Q}=O.current.getModel();T.current.editor.setModelLanguage(H,r||n||"text"),T.current.editor.setModelLanguage(Q,o||n||"text")},[n,r,o],_),oo(()=>{var H;(H=T.current)==null||H.editor.setTheme(c)},[c],_),oo(()=>{var H;(H=O.current)==null||H.updateOptions(f)},[f],_);let z=m.useCallback(()=>{var Y;if(!T.current)return;A.current(T.current);let H=Ec(T.current,e||"",r||n||"text",i||""),Q=Ec(T.current,t||"",o||n||"text",s||"");(Y=O.current)==null||Y.setModel({original:H,modified:Q})},[n,t,o,e,r,i,s]),X=m.useCallback(()=>{var H;!F.current&&N.current&&(O.current=T.current.editor.createDiffEditor(N.current,{automaticLayout:!0,...f}),z(),(H=T.current)==null||H.editor.setTheme(c),S(!0),F.current=!0)},[f,c,z]);m.useEffect(()=>{_&&M.current(O.current,T.current)},[_]),m.useEffect(()=>{!C&&!_&&X()},[C,_,X]);function ee(){var Q,Y,J,W;let H=(Q=O.current)==null?void 0:Q.getModel();a||((Y=H==null?void 0:H.original)==null||Y.dispose()),l||((J=H==null?void 0:H.modified)==null||J.dispose()),(W=O.current)==null||W.dispose()}return m.createElement(Q3,{width:h,height:p,isEditorReady:_,loading:u,_ref:N,className:b,wrapperProps:v})}var j0e=F0e;m.memo(j0e);function z0e(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var B0e=z0e,dg=new Map;function V0e({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:f=!0,keepCurrentModel:p=!1,width:h="100%",height:b="100%",className:v,wrapperProps:w={},beforeMount:y=Nd,onMount:_=Nd,onChange:S,onValidate:C=Nd}){let[E,O]=m.useState(!1),[T,N]=m.useState(!0),M=m.useRef(null),A=m.useRef(null),F=m.useRef(null),z=m.useRef(_),X=m.useRef(y),ee=m.useRef(),H=m.useRef(r),Q=B0e(i),Y=m.useRef(!1),J=m.useRef(!1);J3(()=>{let V=X3.init();return V.then(U=>(M.current=U)&&N(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>A.current?$():V.cancel()}),oo(()=>{var U,I,te,fe;let V=Ec(M.current,e||r||"",t||o||"",i||n||"");V!==((U=A.current)==null?void 0:U.getModel())&&(f&&dg.set(Q,(I=A.current)==null?void 0:I.saveViewState()),(te=A.current)==null||te.setModel(V),f&&((fe=A.current)==null||fe.restoreViewState(dg.get(i))))},[i],E),oo(()=>{var V;(V=A.current)==null||V.updateOptions(c)},[c],E),oo(()=>{!A.current||r===void 0||(A.current.getOption(M.current.editor.EditorOption.readOnly)?A.current.setValue(r):r!==A.current.getValue()&&(J.current=!0,A.current.executeEdits("",[{range:A.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),A.current.pushUndoStop(),J.current=!1))},[r],E),oo(()=>{var U,I;let V=(U=A.current)==null?void 0:U.getModel();V&&o&&((I=M.current)==null||I.editor.setModelLanguage(V,o))},[o],E),oo(()=>{var V;a!==void 0&&((V=A.current)==null||V.revealLine(a))},[a],E),oo(()=>{var V;(V=M.current)==null||V.editor.setTheme(s)},[s],E);let W=m.useCallback(()=>{var V;if(!(!F.current||!M.current)&&!Y.current){X.current(M.current);let U=i||n,I=Ec(M.current,r||e||"",t||o||"",U||"");A.current=(V=M.current)==null?void 0:V.editor.create(F.current,{model:I,automaticLayout:!0,...c},u),f&&A.current.restoreViewState(dg.get(U)),M.current.editor.setTheme(s),a!==void 0&&A.current.revealLine(a),O(!0),Y.current=!0}},[e,t,n,r,o,i,c,u,f,s,a]);m.useEffect(()=>{E&&z.current(A.current,M.current)},[E]),m.useEffect(()=>{!T&&!E&&W()},[T,E,W]),H.current=r,m.useEffect(()=>{var V,U;E&&S&&((V=ee.current)==null||V.dispose(),ee.current=(U=A.current)==null?void 0:U.onDidChangeModelContent(I=>{J.current||S(A.current.getValue(),I)}))},[E,S]),m.useEffect(()=>{if(E){let V=M.current.editor.onDidChangeMarkers(U=>{var te;let I=(te=A.current.getModel())==null?void 0:te.uri;if(I&&U.find(fe=>fe.path===I.path)){let fe=M.current.editor.getModelMarkers({resource:I});C==null||C(fe)}});return()=>{V==null||V.dispose()}}return()=>{}},[E,C]);function $(){var V,U;(V=ee.current)==null||V.dispose(),p?f&&dg.set(i,A.current.saveViewState()):(U=A.current.getModel())==null||U.dispose(),A.current.dispose()}return m.createElement(Q3,{width:h,height:b,isEditorReady:E,loading:l,_ref:F,className:v,wrapperProps:w})}var H0e=V0e,eF=m.memo(H0e),W0e=eF;const tF="Collapsible",[U0e,nF]=er(tF),[q0e,tC]=U0e(tF),G0e=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=_r({prop:r,defaultProp:o,onChange:s});return m.createElement(q0e,{scope:n,disabled:i,contentId:Zo(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(Qe.div,de({"data-state":nC(l),"data-disabled":i?"":void 0},a,{ref:t})))}),Y0e="CollapsibleTrigger",K0e=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=tC(Y0e,n);return m.createElement(Qe.button,de({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":nC(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:Me(e.onClick,o.onOpenToggle)}))}),rF="CollapsibleContent",X0e=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=tC(rF,e.__scopeCollapsible);return m.createElement(tr,{present:n||o.open},({present:i})=>m.createElement(Q0e,de({},r,{ref:t,present:i})))}),Q0e=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=tC(rF,n),[a,l]=m.useState(r),c=m.useRef(null),u=_t(t,c),f=m.useRef(0),p=f.current,h=m.useRef(0),b=h.current,v=s.open||a,w=m.useRef(v),y=m.useRef();return m.useEffect(()=>{const _=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(_)},[]),ur(()=>{const _=c.current;if(_){y.current=y.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const S=_.getBoundingClientRect();f.current=S.height,h.current=S.width,w.current||(_.style.transitionDuration=y.current.transitionDuration,_.style.animationName=y.current.animationName),l(r)}},[s.open,r]),m.createElement(Qe.div,de({"data-state":nC(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!v},i,{ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style}}),v&&o)});function nC(e){return e?"open":"closed"}const J0e=G0e,Z0e=K0e,eye=X0e,xa="Accordion",tye=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[rC,nye,rye]=km(xa),[Iv,A1e]=er(xa,[rye,nF]),oC=nF(),oF=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(rC.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(aye,de({},i,{ref:t})):m.createElement(sye,de({},o,{ref:t})))});oF.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[iF,oye]=Iv(xa),[sF,iye]=Iv(xa,{collapsible:!1}),sye=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=_r({prop:n,defaultProp:r,onChange:o});return m.createElement(iF,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(sF,{scope:e.__scopeAccordion,collapsible:i},m.createElement(aF,de({},s,{ref:t}))))}),aye=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=_r({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(u=>a((f=[])=>[...f,u]),[a]),c=m.useCallback(u=>a((f=[])=>f.filter(p=>p!==u)),[a]);return m.createElement(iF,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(sF,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(aF,de({},i,{ref:t}))))}),[lye,Nv]=Iv(xa),aF=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=m.useRef(null),l=_t(a,t),c=nye(n),f=Pl(o)==="ltr",p=Me(e.onKeyDown,h=>{var b;if(!tye.includes(h.key))return;const v=h.target,w=c().filter(M=>{var A;return!((A=M.ref.current)!==null&&A!==void 0&&A.disabled)}),y=w.findIndex(M=>M.ref.current===v),_=w.length;if(y===-1)return;h.preventDefault();let S=y;const C=0,E=_-1,O=()=>{S=y+1,S>E&&(S=C)},T=()=>{S=y-1,S<C&&(S=E)};switch(h.key){case"Home":S=C;break;case"End":S=E;break;case"ArrowRight":i==="horizontal"&&(f?O():T());break;case"ArrowDown":i==="vertical"&&O();break;case"ArrowLeft":i==="horizontal"&&(f?T():O());break;case"ArrowUp":i==="vertical"&&T();break}const N=S%_;(b=w[N].ref.current)===null||b===void 0||b.focus()});return m.createElement(lye,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(rC.Slot,{scope:n},m.createElement(Qe.div,de({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:p}))))}),q1="AccordionItem",[cye,iC]=Iv(q1),uye=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Nv(q1,n),s=oye(q1,n),a=oC(n),l=Zo(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return m.createElement(cye,{scope:n,open:c,disabled:u,triggerId:l},m.createElement(J0e,de({"data-orientation":i.orientation,"data-state":lF(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),dye="AccordionHeader",fye=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Nv(xa,n),i=iC(dye,n);return m.createElement(Qe.h3,de({"data-orientation":o.orientation,"data-state":lF(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),ET="AccordionTrigger",hye=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Nv(xa,n),i=iC(ET,n),s=iye(ET,n),a=oC(n);return m.createElement(rC.ItemSlot,{scope:n},m.createElement(Z0e,de({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),pye="AccordionContent",gye=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Nv(xa,n),i=iC(pye,n),s=oC(n);return m.createElement(eye,de({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 lF(e){return e?"open":"closed"}const mye=oF,vye=uye,bye=fye,cF=hye,uF=gye,yye=mye,dF=L.forwardRef(({className:e,...t},n)=>R.jsx(vye,{ref:n,className:_e("border-b",e),...t}));dF.displayName="AccordionItem";const fF=L.forwardRef(({className:e,children:t,...n},r)=>R.jsx(bye,{className:"flex",children:R.jsxs(cF,{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,R.jsx(d_,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));fF.displayName=cF.displayName;const hF=L.forwardRef(({className:e,children:t,...n},r)=>R.jsx(uF,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:R.jsx("div",{className:_e("pb-4 pt-0",e),children:t})}));hF.displayName=uF.displayName;function Ic(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 xye(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function pF(...e){return t=>e.forEach(n=>xye(n,t))}function yh(...e){return m.useCallback(pF(...e),e)}function wye(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:p,children:h,...b}=f,v=(p==null?void 0:p[e][l])||a,w=m.useMemo(()=>b,Object.values(b));return m.createElement(v.Provider,{value:w},h)}function u(f,p){const h=(p==null?void 0:p[e][l])||a,b=m.useContext(h);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}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,_ye(o,...t)]}function _ye(...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:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const G1=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Sye=L.useId||(()=>{});let Cye=0;function Iy(e){const[t,n]=L.useState(Sye());return G1(()=>{e||n(r=>r??String(Cye++))},[e]),e||(t?`radix-${t}`:"")}function El(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 Eye({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Rye({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=El(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function Rye({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=El(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const sC=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Oye);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(Y1,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Y1,de({},r,{ref:t}),n)});sC.displayName="Slot";const Y1=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...$ye(r,n.props),ref:pF(t,n.ref)}):m.Children.count(n)>1?m.Children.only(null):null});Y1.displayName="SlotClone";const Pye=({children:e})=>m.createElement(m.Fragment,null,e);function Oye(e){return m.isValidElement(e)&&e.type===Pye}function $ye(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?n[r]=(...a)=>{i==null||i(...a),o==null||o(...a)}:r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const Tye=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],Lv=Tye.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?sC:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,de({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Dye(e,t){e&&Cr.flushSync(()=>e.dispatchEvent(t))}function Aye(e){const t=El(e);m.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const K1="dismissableLayer.update",kye="dismissableLayer.pointerDownOutside",Mye="dismissableLayer.focusOutside";let RT;const Iye=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Nye=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=m.useContext(Iye),[u,f]=m.useState(null),[,p]=m.useState({}),h=yh(t,O=>f(O)),b=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(v),y=u?b.indexOf(u):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=w,C=Lye(O=>{const T=O.target,N=[...c.branches].some(M=>M.contains(T));!S||N||(o==null||o(O),s==null||s(O),O.defaultPrevented||a==null||a())}),E=Fye(O=>{const T=O.target;[...c.branches].some(M=>M.contains(T))||(i==null||i(O),s==null||s(O),O.defaultPrevented||a==null||a())});return Aye(O=>{y===c.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))}),m.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(RT=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),PT(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=RT)}},[u,n,c]),m.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),PT())},[u,c]),m.useEffect(()=>{const O=()=>p({});return document.addEventListener(K1,O),()=>document.removeEventListener(K1,O)},[]),m.createElement(Lv.div,de({},l,{ref:h,style:{pointerEvents:_?S?"auto":"none":void 0,...e.style},onFocusCapture:Ic(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Ic(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ic(e.onPointerDownCapture,C.onPointerDownCapture)}))});function Lye(e){const t=El(e),n=m.useRef(!1),r=m.useRef(()=>{});return m.useEffect(()=>{const o=s=>{if(s.target&&!n.current){let l=function(){gF(kye,t,a,{discrete:!0})};const a={originalEvent:s};s.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=l,document.addEventListener("click",r.current,{once:!0})):l()}n.current=!1},i=window.setTimeout(()=>{document.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),document.removeEventListener("pointerdown",o),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function Fye(e){const t=El(e),n=m.useRef(!1);return m.useEffect(()=>{const r=o=>{o.target&&!n.current&&gF(Mye,t,{originalEvent:o},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function PT(){const e=new CustomEvent(K1);document.dispatchEvent(e)}function gF(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?Dye(o,i):o.dispatchEvent(i)}const Ny="focusScope.autoFocusOnMount",Ly="focusScope.autoFocusOnUnmount",OT={bubbles:!1,cancelable:!0},jye=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=m.useState(null),c=El(o),u=El(i),f=m.useRef(null),p=yh(t,v=>l(v)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=function(y){if(h.paused||!a)return;const _=y.target;a.contains(_)?f.current=_:Wa(f.current,{select:!0})},w=function(y){h.paused||!a||a.contains(y.relatedTarget)||Wa(f.current,{select:!0})};return document.addEventListener("focusin",v),document.addEventListener("focusout",w),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w)}}},[r,a,h.paused]),m.useEffect(()=>{if(a){TT.add(h);const v=document.activeElement;if(!a.contains(v)){const y=new CustomEvent(Ny,OT);a.addEventListener(Ny,c),a.dispatchEvent(y),y.defaultPrevented||(zye(Uye(mF(a)),{select:!0}),document.activeElement===v&&Wa(a))}return()=>{a.removeEventListener(Ny,c),setTimeout(()=>{const y=new CustomEvent(Ly,OT);a.addEventListener(Ly,u),a.dispatchEvent(y),y.defaultPrevented||Wa(v??document.body,{select:!0}),a.removeEventListener(Ly,u),TT.remove(h)},0)}}},[a,c,u,h]);const b=m.useCallback(v=>{if(!n&&!r||h.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(w&&y){const _=v.currentTarget,[S,C]=Bye(_);S&&C?!v.shiftKey&&y===C?(v.preventDefault(),n&&Wa(S,{select:!0})):v.shiftKey&&y===S&&(v.preventDefault(),n&&Wa(C,{select:!0})):y===_&&v.preventDefault()}},[n,r,h.paused]);return m.createElement(Lv.div,de({tabIndex:-1},s,{ref:p,onKeyDown:b}))});function zye(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Wa(r,{select:t}),document.activeElement!==n)return}function Bye(e){const t=mF(e),n=$T(t,e),r=$T(t.reverse(),e);return[n,r]}function mF(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 $T(e,t){for(const n of e)if(!Vye(n,{upTo:t}))return n}function Vye(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 Hye(e){return e instanceof HTMLInputElement&&"select"in e}function Wa(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Hye(e)&&t&&e.select()}}const TT=Wye();function Wye(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=DT(e,t),e.unshift(t)},remove(t){var n;e=DT(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function DT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Uye(e){return e.filter(t=>t.tagName!=="A")}const qye=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?Cr.createPortal(m.createElement(Lv.div,de({},o,{ref:t})),r):null});function Gye(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Fv=e=>{const{present:t,children:n}=e,r=Yye(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=yh(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};Fv.displayName="Presence";function Yye(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Gye(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=fg(r.current);i.current=a==="mounted"?c:"none"},[a]),G1(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,h=fg(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),G1(()=>{if(t){const c=f=>{const h=fg(r.current).includes(f.animationName);f.target===t&&h&&Cr.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=fg(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function fg(e){return(e==null?void 0:e.animationName)||"none"}let Fy=0;function Kye(){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:AT()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:AT()),Fy++,()=>{Fy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Fy--}},[])}function AT(){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}var vF=V_(),jy=function(){},jv=L.forwardRef(function(e,t){var n=L.useRef(null),r=L.useState({onScrollCapture:jy,onWheelCapture:jy,onTouchMoveCapture:jy}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,h=e.noIsolation,b=e.inert,v=e.allowPinchZoom,w=e.as,y=w===void 0?"div":w,_=lv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=p,C=B_([n,t]),E=En(En({},_),o);return L.createElement(L.Fragment,null,u&&L.createElement(S,{sideCar:vF,removeScrollBar:c,shards:f,noIsolation:h,inert:b,setCallbacks:i,allowPinchZoom:!!v,lockRef:n}),s?L.cloneElement(L.Children.only(a),En(En({},E),{ref:C})):L.createElement(y,En({},E,{className:l,ref:C}),a))});jv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};jv.classNames={fullWidth:Tc,zeroRight:$c};var X1=!1;if(typeof window<"u")try{var hg=Object.defineProperty({},"passive",{get:function(){return X1=!0,!0}});window.addEventListener("test",hg,hg),window.removeEventListener("test",hg,hg)}catch{X1=!1}var mc=X1?{passive:!1}:!1,Xye=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},Qye=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},kT=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=bF(e,n);if(r){var o=yF(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Jye=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Zye=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},bF=function(e,t){return e==="v"?Xye(t):Qye(t)},yF=function(e,t){return e==="v"?Jye(t):Zye(t)},exe=function(e,t){return e==="h"&&t==="rtl"?-1:1},txe=function(e,t,n,r,o){var i=exe(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,p=0;do{var h=yF(e,a),b=h[0],v=h[1],w=h[2],y=v-w-i*b;(b||y)&&bF(e,a)&&(f+=y,p+=b),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&f===0||!o&&s>f)||!u&&(o&&p===0||!o&&-s>p))&&(c=!0),c},pg=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},MT=function(e){return[e.deltaX,e.deltaY]},IT=function(e){return e&&"current"in e?e.current:e},nxe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rxe=function(e){return`
|
|
446
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
447
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
448
|
-
`)},oxe=0,vc=[];function ixe(e){var t=L.useRef([]),n=L.useRef([0,0]),r=L.useRef(),o=L.useState(oxe++)[0],i=L.useState(function(){return uv()})[0],s=L.useRef(e);L.useEffect(function(){s.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=z_([e.lockRef.current],(e.shards||[]).map(IT),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=L.useCallback(function(v,w){if("touches"in v&&v.touches.length===2)return!s.current.allowPinchZoom;var y=pg(v),_=n.current,S="deltaX"in v?v.deltaX:_[0]-y[0],C="deltaY"in v?v.deltaY:_[1]-y[1],E,O=v.target,T=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in v&&T==="h"&&O.type==="range")return!1;var N=kT(T,O);if(!N)return!0;if(N?E=T:(E=T==="v"?"h":"v",N=kT(T,O)),!N)return!1;if(!r.current&&"changedTouches"in v&&(S||C)&&(r.current=E),!E)return!0;var M=r.current||E;return txe(M,w,v,M==="h"?S:C,!0)},[]),l=L.useCallback(function(v){var w=v;if(!(!vc.length||vc[vc.length-1]!==i)){var y="deltaY"in w?MT(w):pg(w),_=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&nxe(E.delta,y)})[0];if(_&&_.should){w.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(IT).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=S.length>0?a(w,S[0]):!s.current.noIsolation;C&&w.preventDefault()}}},[]),c=L.useCallback(function(v,w,y,_){var S={name:v,delta:w,target:y,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=L.useCallback(function(v){n.current=pg(v),r.current=void 0},[]),f=L.useCallback(function(v){c(v.type,MT(v),v.target,a(v,e.lockRef.current))},[]),p=L.useCallback(function(v){c(v.type,pg(v),v.target,a(v,e.lockRef.current))},[]);L.useEffect(function(){return vc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,mc),document.addEventListener("touchmove",l,mc),document.addEventListener("touchstart",u,mc),function(){vc=vc.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,mc),document.removeEventListener("touchmove",l,mc),document.removeEventListener("touchstart",u,mc)}},[]);var h=e.removeScrollBar,b=e.inert;return L.createElement(L.Fragment,null,b?L.createElement(i,{styles:rxe(o)}):null,h?L.createElement(W_,{gapMode:"margin"}):null)}const sxe=H_(vF,ixe);var xF=L.forwardRef(function(e,t){return L.createElement(jv,En({},e,{ref:t,sideCar:sxe}))});xF.classNames=jv.classNames;const axe=xF,wF="Dialog",[_F,k1e]=wye(wF),[lxe,jl]=_F(wF),cxe=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,u]=Eye({prop:r,defaultProp:o,onChange:i});return m.createElement(lxe,{scope:t,triggerRef:a,contentRef:l,contentId:Iy(),titleId:Iy(),descriptionId:Iy(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(f=>!f),[u]),modal:s},n)},SF="DialogPortal",[uxe,CF]=_F(SF,{forceMount:void 0}),dxe=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=jl(SF,t);return m.createElement(uxe,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(Fv,{present:n||i.open},m.createElement(qye,{asChild:!0,container:o},s))))},Q1="DialogOverlay",fxe=m.forwardRef((e,t)=>{const n=CF(Q1,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=jl(Q1,e.__scopeDialog);return i.modal?m.createElement(Fv,{present:r||i.open},m.createElement(hxe,de({},o,{ref:t}))):null}),hxe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jl(Q1,n);return m.createElement(axe,{as:sC,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(Lv.div,de({"data-state":RF(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Pf="DialogContent",pxe=m.forwardRef((e,t)=>{const n=CF(Pf,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=jl(Pf,e.__scopeDialog);return m.createElement(Fv,{present:r||i.open},i.modal?m.createElement(gxe,de({},o,{ref:t})):m.createElement(mxe,de({},o,{ref:t})))}),gxe=m.forwardRef((e,t)=>{const n=jl(Pf,e.__scopeDialog),r=m.useRef(null),o=yh(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return ih(i)},[]),m.createElement(EF,de({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ic(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Ic(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:Ic(e.onFocusOutside,i=>i.preventDefault())}))}),mxe=m.forwardRef((e,t)=>{const n=jl(Pf,e.__scopeDialog),r=m.useRef(!1);return m.createElement(EF,de({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,o),!o.defaultPrevented){var s;r.current||(s=n.triggerRef.current)===null||s===void 0||s.focus(),o.preventDefault()}r.current=!1},onInteractOutside:o=>{var i,s;(i=e.onInteractOutside)===null||i===void 0||i.call(e,o),o.defaultPrevented||(r.current=!0);const a=o.target;((s=n.triggerRef.current)===null||s===void 0?void 0:s.contains(a))&&o.preventDefault()}}))}),EF=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=jl(Pf,n),l=m.useRef(null),c=yh(t,l);return Kye(),m.createElement(m.Fragment,null,m.createElement(jye,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Nye,de({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":RF(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)});function RF(e){return e?"open":"closed"}const vxe=cxe,bxe=dxe,yxe=fxe,xxe=pxe;var NT=1,wxe=.9,_xe=.3,zy=.1,Sxe=0,By=.999,Cxe=.9999,Exe=.99,LT=/[\\\/\-_+.# \t"@\[\(\{&]/,Rxe=/[\\\/\-_+.# \t"@\[\(\{&]/g;function J1(e,t,n,r,o,i){if(i===t.length)return o===e.length?NT:Exe;for(var s=r.charAt(i),a=n.indexOf(s,o),l=0,c,u,f;a>=0;)c=J1(e,t,n,r,a+1,i+1),c>l&&(a===o?c*=NT:LT.test(e.charAt(a-1))?(c*=wxe,f=e.slice(o,a-1).match(Rxe),f&&o>0&&(c*=Math.pow(By,f.length))):LT.test(e.slice(o,a-1))?(c*=Sxe,o>0&&(c*=Math.pow(By,a-o))):(c*=_xe,o>0&&(c*=Math.pow(By,a-o))),e.charAt(a)!==t.charAt(i)&&(c*=Cxe)),c<zy&&n.charAt(a-1)===r.charAt(i+1)&&n.charAt(a-1)!==r.charAt(i)&&(u=J1(e,t,n,r,a+1,i+2),u*zy>c&&(c=u*zy)),c>l&&(l=c),a=n.indexOf(s,a+1);return l}function Pxe(e,t){return J1(e,t,e.toLowerCase(),t.toLowerCase(),0,0)}var Oxe=Pxe;const $xe=Rl(Oxe);var Txe='[cmdk-list-sizer=""]',hd='[cmdk-group=""]',Vy='[cmdk-group-items=""]',Dxe='[cmdk-group-heading=""]',PF='[cmdk-item=""]',FT=`${PF}:not([aria-disabled="true"])`,Z1="cmdk-item-select",Bs="data-value",Axe=(e,t)=>$xe(e,t),OF=L.createContext(void 0),xh=()=>L.useContext(OF),$F=L.createContext(void 0),aC=()=>L.useContext($F),TF=L.createContext(void 0),DF=L.forwardRef((e,t)=>{let n=L.useRef(null),r=wc(()=>({search:"",value:"",filtered:{count:0,items:new Map,groups:new Set}})),o=wc(()=>new Set),i=wc(()=>new Map),s=wc(()=>new Map),a=wc(()=>new Set),l=AF(e),{label:c,children:u,value:f,onValueChange:p,filter:h,shouldFilter:b,...v}=e,w=L.useId(),y=L.useId(),_=L.useId(),S=Hxe();Eu(()=>{if(f!==void 0){let W=f.trim().toLowerCase();r.current.value=W,S(6,A),C.emit()}},[f]);let C=L.useMemo(()=>({subscribe:W=>(a.current.add(W),()=>a.current.delete(W)),snapshot:()=>r.current,setState:(W,$,V)=>{var U,I,te;if(!Object.is(r.current[W],$)){if(r.current[W]=$,W==="search")M(),T(),S(1,N);else if(W==="value")if(((U=l.current)==null?void 0:U.value)!==void 0){(te=(I=l.current).onValueChange)==null||te.call(I,$);return}else V||S(5,A);C.emit()}},emit:()=>{a.current.forEach(W=>W())}}),[]),E=L.useMemo(()=>({value:(W,$)=>{$!==s.current.get(W)&&(s.current.set(W,$),r.current.filtered.items.set(W,O($)),S(2,()=>{T(),C.emit()}))},item:(W,$)=>(o.current.add(W),$&&(i.current.has($)?i.current.get($).add(W):i.current.set($,new Set([W]))),S(3,()=>{M(),T(),r.current.value||N(),C.emit()}),()=>{s.current.delete(W),o.current.delete(W),r.current.filtered.items.delete(W),S(4,()=>{M(),N(),C.emit()})}),group:W=>(i.current.has(W)||i.current.set(W,new Set),()=>{s.current.delete(W),i.current.delete(W)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],listId:w,inputId:_,labelId:y}),[]);function O(W){var $;let V=(($=l.current)==null?void 0:$.filter)??Axe;return W?V(W,r.current.search):0}function T(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let W=r.current.filtered.items,$=[];r.current.filtered.groups.forEach(U=>{let I=i.current.get(U),te=0;I.forEach(fe=>{let ne=W.get(fe);te=Math.max(ne,te)}),$.push([U,te])});let V=n.current.querySelector(Txe);z().sort((U,I)=>{let te=U.getAttribute(Bs),fe=I.getAttribute(Bs);return(W.get(fe)??0)-(W.get(te)??0)}).forEach(U=>{let I=U.closest(Vy);I?I.appendChild(U.parentElement===I?U:U.closest(`${Vy} > *`)):V.appendChild(U.parentElement===V?U:U.closest(`${Vy} > *`))}),$.sort((U,I)=>I[1]-U[1]).forEach(U=>{let I=n.current.querySelector(`${hd}[${Bs}="${U[0]}"]`);I==null||I.parentElement.appendChild(I)})}function N(){let W=z().find(V=>!V.ariaDisabled),$=W==null?void 0:W.getAttribute(Bs);C.setState("value",$||void 0)}function M(){if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let W=0;for(let $ of o.current){let V=s.current.get($),U=O(V);r.current.filtered.items.set($,U),U>0&&W++}for(let[$,V]of i.current)for(let U of V)if(r.current.filtered.items.get(U)>0){r.current.filtered.groups.add($);break}r.current.filtered.count=W}function A(){var W,$,V;let U=F();U&&(((W=U.parentElement)==null?void 0:W.firstChild)===U&&((V=($=U.closest(hd))==null?void 0:$.querySelector(Dxe))==null||V.scrollIntoView({block:"nearest"})),U.scrollIntoView({block:"nearest"}))}function F(){return n.current.querySelector(`${PF}[aria-selected="true"]`)}function z(){return Array.from(n.current.querySelectorAll(FT))}function X(W){let $=z()[W];$&&C.setState("value",$.getAttribute(Bs))}function ee(W){var $;let V=F(),U=z(),I=U.findIndex(fe=>fe===V),te=U[I+W];($=l.current)!=null&&$.loop&&(te=I+W<0?U[U.length-1]:I+W===U.length?U[0]:U[I+W]),te&&C.setState("value",te.getAttribute(Bs))}function H(W){let $=F(),V=$==null?void 0:$.closest(hd),U;for(;V&&!U;)V=W>0?Bxe(V,hd):Vxe(V,hd),U=V==null?void 0:V.querySelector(FT);U?C.setState("value",U.getAttribute(Bs)):ee(W)}let Q=()=>X(z().length-1),Y=W=>{W.preventDefault(),W.metaKey?Q():W.altKey?H(1):ee(1)},J=W=>{W.preventDefault(),W.metaKey?X(0):W.altKey?H(-1):ee(-1)};return L.createElement("div",{ref:wh([n,t]),...v,"cmdk-root":"",onKeyDown:W=>{var $;if(($=v.onKeyDown)==null||$.call(v,W),!W.defaultPrevented)switch(W.key){case"n":case"j":{W.ctrlKey&&Y(W);break}case"ArrowDown":{Y(W);break}case"p":case"k":{W.ctrlKey&&J(W);break}case"ArrowUp":{J(W);break}case"Home":{W.preventDefault(),X(0);break}case"End":{W.preventDefault(),Q();break}case"Enter":{W.preventDefault();let V=F();if(V){let U=new Event(Z1);V.dispatchEvent(U)}}}}},L.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:Wxe},c),L.createElement($F.Provider,{value:C},L.createElement(OF.Provider,{value:E},u)))}),kxe=L.forwardRef((e,t)=>{let n=L.useId(),r=L.useRef(null),o=L.useContext(TF),i=xh(),s=AF(e);Eu(()=>i.item(n,o),[]);let a=kF(n,r,[e.value,e.children,r]),l=aC(),c=pu(y=>y.value&&y.value===a.current),u=pu(y=>i.filter()===!1?!0:y.search?y.filtered.items.get(n)>0:!0);L.useEffect(()=>{let y=r.current;if(!(!y||e.disabled))return y.addEventListener(Z1,f),()=>y.removeEventListener(Z1,f)},[u,e.onSelect,e.disabled]);function f(){var y,_;(_=(y=s.current).onSelect)==null||_.call(y,a.current)}function p(){l.setState("value",a.current,!0)}if(!u)return null;let{disabled:h,value:b,onSelect:v,...w}=e;return L.createElement("div",{ref:wh([r,t]),...w,"cmdk-item":"",role:"option","aria-disabled":h||void 0,"aria-selected":c||void 0,"data-selected":c||void 0,onPointerMove:h?void 0:p,onClick:h?void 0:f},e.children)}),Mxe=L.forwardRef((e,t)=>{let{heading:n,children:r,...o}=e,i=L.useId(),s=L.useRef(null),a=L.useRef(null),l=L.useId(),c=xh(),u=pu(p=>c.filter()===!1?!0:p.search?p.filtered.groups.has(i):!0);Eu(()=>c.group(i),[]),kF(i,s,[e.value,e.heading,a]);let f=L.createElement(TF.Provider,{value:i},r);return L.createElement("div",{ref:wh([s,t]),...o,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&L.createElement("div",{ref:a,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),L.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},f))}),Ixe=L.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=L.useRef(null),i=pu(s=>!s.search);return!n&&!i?null:L.createElement("div",{ref:wh([o,t]),...r,"cmdk-separator":"",role:"separator"})}),Nxe=L.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=aC(),s=pu(l=>l.search),a=xh();return L.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),L.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":a.listId,"aria-labelledby":a.labelId,id:a.inputId,type:"text",value:o?e.value:s,onChange:l=>{o||i.setState("search",l.target.value),n==null||n(l.target.value)}})}),Lxe=L.forwardRef((e,t)=>{let{children:n,...r}=e,o=L.useRef(null),i=L.useRef(null),s=xh();return L.useEffect(()=>{if(i.current&&o.current){let a=i.current,l=o.current,c,u=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let f=a.getBoundingClientRect().height;l.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return u.observe(a),()=>{cancelAnimationFrame(c),u.unobserve(a)}}},[]),L.createElement("div",{ref:wh([o,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:s.listId,"aria-labelledby":s.inputId},L.createElement("div",{ref:i,"cmdk-list-sizer":""},n))}),Fxe=L.forwardRef((e,t)=>{let{open:n,onOpenChange:r,container:o,...i}=e;return L.createElement(vxe,{open:n,onOpenChange:r},L.createElement(bxe,{container:o},L.createElement(yxe,{"cmdk-overlay":""}),L.createElement(xxe,{"aria-label":e.label,"cmdk-dialog":""},L.createElement(DF,{ref:t,...i}))))}),jxe=L.forwardRef((e,t)=>{let n=L.useRef(!0),r=pu(o=>o.filtered.count===0);return L.useEffect(()=>{n.current=!1},[]),n.current||!r?null:L.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),zxe=L.forwardRef((e,t)=>{let{progress:n,children:r,...o}=e;return L.createElement("div",{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},L.createElement("div",{"aria-hidden":!0},r))}),Vr=Object.assign(DF,{List:Lxe,Item:kxe,Input:Nxe,Group:Mxe,Separator:Ixe,Dialog:Fxe,Empty:jxe,Loading:zxe});function Bxe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Vxe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function AF(e){let t=L.useRef(e);return Eu(()=>{t.current=e}),t}var Eu=typeof window>"u"?L.useEffect:L.useLayoutEffect;function wc(e){let t=L.useRef();return t.current===void 0&&(t.current=e()),t}function wh(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function pu(e){let t=aC(),n=()=>e(t.snapshot());return L.useSyncExternalStore(t.subscribe,n,n)}function kF(e,t,n){let r=L.useRef(),o=xh();return Eu(()=>{var i;let s=(()=>{var a;for(let l of n){if(typeof l=="string")return l.trim().toLowerCase();if(typeof l=="object"&&"current"in l&&l.current)return(a=l.current.textContent)==null?void 0:a.trim().toLowerCase()}})();o.value(e,s),(i=t.current)==null||i.setAttribute(Bs,s),r.current=s}),r}var Hxe=()=>{let[e,t]=L.useState(),n=wc(()=>new Map);return Eu(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}},Wxe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const MF=L.forwardRef(({className:e,...t},n)=>R.jsx(Vr,{ref:n,className:_e("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));MF.displayName=Vr.displayName;const IF=L.forwardRef(({className:e,...t},n)=>R.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[R.jsx(MJ,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),R.jsx(Vr.Input,{ref:n,className:_e("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));IF.displayName=Vr.Input.displayName;const NF=L.forwardRef(({className:e,...t},n)=>R.jsx(Vr.List,{ref:n,className:_e("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));NF.displayName=Vr.List.displayName;const LF=L.forwardRef((e,t)=>R.jsx(Vr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));LF.displayName=Vr.Empty.displayName;const FF=L.forwardRef(({className:e,...t},n)=>R.jsx(Vr.Group,{ref:n,className:_e("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));FF.displayName=Vr.Group.displayName;const Uxe=L.forwardRef(({className:e,...t},n)=>R.jsx(Vr.Separator,{ref:n,className:_e("-mx-1 h-px bg-border",e),...t}));Uxe.displayName=Vr.Separator.displayName;const jF=L.forwardRef(({className:e,...t},n)=>R.jsx(Vr.Item,{ref:n,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));jF.displayName=Vr.Item.displayName;var qxe=Object.defineProperty,Gxe=(e,t,n)=>t in e?qxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gg=(e,t,n)=>(Gxe(e,typeof t!="symbol"?t+"":t,n),n);const Yxe={stringify:e=>e,parse:e=>e},Kxe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},Xxe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},Qxe={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}},Jxe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},Hy={string:Yxe,number:Kxe,boolean:Xxe,function:Qxe,json:Jxe},Wy=Symbol.for("r2wc.render"),mg=Symbol.for("r2wc.connected"),Fa=Symbol.for("r2wc.context"),Ls=Symbol.for("r2wc.props");function Zxe(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(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const p=e1e(f);l[f]=p,c[p]=f}class u extends HTMLElement{constructor(){super(),gg(this,r,!0),gg(this,o),gg(this,i,{}),gg(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Ls].container=this.container;for(const p of s){const h=l[p],b=this.getAttribute(h),v=a[p],w=Hy[v];b&&w!=null&&w.parse&&(this[Ls][p]=w.parse(b,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[mg]=!0,this[Wy]()}disconnectedCallback(){this[mg]=!1,this[Fa]&&n.unmount(this[Fa]),delete this[Fa]}attributeChangedCallback(p,h,b){const v=c[p],w=a[v],y=Hy[w];v in a&&y!=null&&y.parse&&(this[Ls][v]=y.parse(b,this),this[Wy]())}[(r=mg,o=Fa,i=Ls,Wy)](){this[mg]&&(this[Fa]?n.update(this[Fa],this[Ls]):this[Fa]=n.mount(this.container,e,this[Ls]))}}for(const f of s){const p=l[f],h=a[f];Object.defineProperty(u.prototype,f,{enumerable:!0,configurable:!0,get(){return this[Ls][f]},set(b){this[Ls][f]=b;const v=Hy[h];if(v!=null&&v.stringify){const w=v.stringify(b);this.getAttribute(p)!==w&&this.setAttribute(p,w)}}})}return u}function e1e(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function t1e(e,t,n){const r=tx(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function n1e({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function r1e({root:e}){e.unmount()}function o1e(e,t={}){return Zxe(e,t,{mount:t1e,update:n1e,unmount:r1e})}const i1e={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean"},s1e=o1e(r3,{props:i1e});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=DN;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=lM;exports.Accordion=yye;exports.AccordionContent=hF;exports.AccordionItem=dF;exports.AccordionTrigger=fF;exports.BOOLEAN_DATA_TYPES=lw;exports.Bot=Xx;exports.Button=xr;exports.Calendar=jk;exports.Card=fw;exports.CardContent=Am;exports.CardDescription=hw;exports.CardFooter=pw;exports.CardHeader=Dm;exports.CardTitle=Wf;exports.CaretSortIcon=UQ;exports.ChartJsVisual=l_;exports.Check=Qf;exports.CheckIcon=Ik;exports.Checkbox=V3;exports.ClipboardCopyIcon=XQ;exports.ColorFormat=vI;exports.Command=MF;exports.CommandEmpty=LF;exports.CommandGroup=FF;exports.CommandInput=IF;exports.CommandItem=jF;exports.CommandList=NF;exports.Cross2Icon=Nk;exports.DATAMODEL_NAMESPCACE=gD;exports.DATE_DATA_TYPES=Bf;exports.Dashboard=r3;exports.DashboardPanel=TD;exports.DashboardTabs=t3;exports.DashboardWC=s1e;exports.Dialog=$be;exports.DialogContent=M3;exports.DialogDescription=F3;exports.DialogFooter=N3;exports.DialogHeader=I3;exports.DialogTitle=L3;exports.DialogTrigger=Tbe;exports.DropdownMenu=xbe;exports.DropdownMenuContent=P3;exports.DropdownMenuLabel=$3;exports.DropdownMenuRadioGroup=_be;exports.DropdownMenuRadioItem=O3;exports.DropdownMenuSeparator=T3;exports.DropdownMenuTrigger=wbe;exports.Editable=xi;exports.EditorAside=W3;exports.EditorMain=U3;exports.EditorPanel=H3;exports.Filter=Hk;exports.FilterHeader=mN;exports.Ft=W0e;exports.HoverCard=iv;exports.HoverCardContent=oh;exports.HoverCardTrigger=sv;exports.InfoCircledIcon=iJ;exports.Input=Dc;exports.Jt=xM;exports.KPICard=pM;exports.LOCALE_CURRENCY_PAIRS=nx;exports.Label=Fn;exports.Markdown=T5;exports.NUMBER_DATA_TYPES=eu;exports.PYTHON_DEFAULT_CODE=pD;exports.PaperPlaneIcon=Lk;exports.PlayIcon=lJ;exports.Plus=h_;exports.Popover=gv;exports.PopoverContent=sh;exports.PopoverTrigger=mv;exports.RadioGroup=bS;exports.RadioGroupItem=hm;exports.ResizableHandle=Mge;exports.ResizablePanel=z1;exports.ResizablePanelGroup=X5;exports.ScrollArea=CS;exports.ScrollBar=Cv;exports.Select=Vs;exports.SelectContent=es;exports.SelectGroup=yc;exports.SelectItem=Un;exports.SelectLabel=Ua;exports.SelectSeparator=sm;exports.SelectTrigger=Zi;exports.SelectValue=Hs;exports.SemaphorContextProvider=vM;exports.SemaphorQueryClient=gM;exports.Separator=ah;exports.Settings=p_;exports.SliderIcon=uJ;exports.Switch=WN;exports.TEXT_DATA_TYPES=Om;exports.Table=Wk;exports.Table$1=D_;exports.TableBody=k_;exports.TableCell=om;exports.TableHead=M_;exports.TableHeader=A_;exports.TableRow=kd;exports.TableVisual=yI;exports.Tabs=yw;exports.TabsContent=xw;exports.TabsList=Mm;exports.TabsTrigger=Im;exports.Te=tte;exports.TextCard=EI;exports.Textarea=vS;exports.Toggle=X_;exports.Tooltip=dM;exports.TooltipContent=E_;exports.TooltipTrigger=fM;exports.TriangleDownIcon=c_;exports.TriangleUpIcon=u_;exports.UXProvider=n3;exports.X=Jf;exports._=al;exports.cleanCard=D3;exports.cn=_e;exports.copyToClipboard=TB;exports.createChartConfig=P_;exports.createLucideIcon=Sn;exports.createSqlGenConfig=aV;exports.de=eF;exports.flexRender=c1;exports.fmt=cw;exports.getBookmarkKey=A3;exports.getCanvasBackgroundColor=zd;exports.getColumnDataType=lV;exports.getContrastColor=Zc;exports.getCoreRowModel=kM;exports.getDashbaordStateWithoutData=Pbe;exports.getDefaultFilterSql=Zle;exports.getFilterComponent=yS;exports.getFilterValueType=Ng;exports.getKeys=lr;exports.getNumberAxis=R_;exports.getPaginationRowModel=IM;exports.getQualifiedTableName=mD;exports.getRequest=$B;exports.getSortedRowModel=MM;exports.getSql=sV;exports.isColumnInSqlGen=cV;exports.jsxRuntimeExports=R;exports.pivotData=Jg;exports.postRequest=zf;exports.resolveBaseQuery=tD;exports.resolveDataType=Bd;exports.titleCase=AB;exports.useCard=Dee;exports.useDashboardActions=wr;exports.useDashboardCard=O_;exports.useDashboardStore=$e;exports.useEditorActions=Zm;exports.useEditorStore=br;exports.useQuery=Hf;exports.useReactTable=NM;exports.useSemaphorContext=ba;exports.useTheme=OD;exports.v4=ua;
|