semaphor 0.0.58 → 0.0.60

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.
@@ -1,435 +0,0 @@
1
- "use strict";var mj=Object.defineProperty;var vj=(e,t,n)=>t in e?mj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>(vj(e,typeof t!="symbol"?t+"":t,n),n),Eb=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var oe=(e,t,n)=>(Eb(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)=>(Eb(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Vh=(e,t,n,r)=>({set _(o){Ve(e,t,o,n)},get _(){return oe(e,t,r)}}),Ct=(e,t,n)=>(Eb(e,t,"access private method"),n);const m=require("react"),Mo=require("react-dom");function W2(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 H=W2(m),pw=W2(Mo);var Vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gw(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 h0={exports:{}},Du={};/**
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 jE;function bj(){return jE||(jE=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"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function w(D){if(D===null||typeof D!="object")return null;var te=v&&D[v]||D[b];return typeof te=="function"?te:null}var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(D){{for(var te=arguments.length,ce=new Array(te>1?te-1:0),Oe=1;Oe<te;Oe++)ce[Oe-1]=arguments[Oe];S("error",D,ce)}}function S(D,te,ce){{var Oe=x.ReactDebugCurrentFrame,He=Oe.getStackAddendum();He!==""&&(te+="%s",ce=ce.concat([He]));var qe=ce.map(function(ze){return String(ze)});qe.unshift("Warning: "+te),Function.prototype.apply.call(console[D],console,qe)}}var C=!1,E=!1,P=!1,A=!1,k=!1,I;I=Symbol.for("react.module.reference");function $(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===i||k||D===o||D===c||D===u||A||D===g||C||E||P||typeof D=="object"&&D!==null&&(D.$$typeof===h||D.$$typeof===f||D.$$typeof===s||D.$$typeof===a||D.$$typeof===l||D.$$typeof===I||D.getModuleId!==void 0))}function L(D,te,ce){var Oe=D.displayName;if(Oe)return Oe;var He=te.displayName||te.name||"";return He!==""?ce+"("+He+")":ce}function j(D){return D.displayName||"Context"}function Q(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 te=D;return j(te)+".Consumer";case s:var ce=D;return j(ce._context)+".Provider";case l:return L(D,D.render,"ForwardRef");case f:var Oe=D.displayName||null;return Oe!==null?Oe:Q(D.type)||"Memo";case h:{var He=D,qe=He._payload,ze=He._init;try{return Q(ze(qe))}catch{return null}}}return null}var ee=Object.assign,B=0,Z,G,q,K,T,V,X;function N(){}N.__reactDisabledLog=!0;function ie(){{if(B===0){Z=console.log,G=console.info,q=console.warn,K=console.error,T=console.group,V=console.groupCollapsed,X=console.groupEnd;var D={configurable:!0,enumerable:!0,value:N,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}B++}}function fe(){{if(B--,B===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},D,{value:Z}),info:ee({},D,{value:G}),warn:ee({},D,{value:q}),error:ee({},D,{value:K}),group:ee({},D,{value:T}),groupCollapsed:ee({},D,{value:V}),groupEnd:ee({},D,{value:X})})}B<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=x.ReactCurrentDispatcher,pe;function se(D,te,ce){{if(pe===void 0)try{throw Error()}catch(He){var Oe=He.stack.trim().match(/\n( *(at )?)/);pe=Oe&&Oe[1]||""}return`
10
- `+pe+D}}var ne=!1,le;{var ye=typeof WeakMap=="function"?WeakMap:Map;le=new ye}function Y(D,te){if(!D||ne)return"";{var ce=le.get(D);if(ce!==void 0)return ce}var Oe;ne=!0;var He=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qe;qe=ue.current,ue.current=null,ie();try{if(te){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){Oe=ft}Reflect.construct(D,[],ze)}else{try{ze.call()}catch(ft){Oe=ft}D.call(ze.prototype)}}else{try{throw Error()}catch(ft){Oe=ft}D()}}catch(ft){if(ft&&Oe&&typeof ft.stack=="string"){for(var Fe=ft.stack.split(`
11
- `),Ae=Oe.stack.split(`
12
- `),U=Fe.length-1,me=Ae.length-1;U>=1&&me>=0&&Fe[U]!==Ae[me];)me--;for(;U>=1&&me>=0;U--,me--)if(Fe[U]!==Ae[me]){if(U!==1||me!==1)do if(U--,me--,me<0||Fe[U]!==Ae[me]){var $e=`
13
- `+Fe[U].replace(" at new "," at ");return D.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",D.displayName)),typeof D=="function"&&le.set(D,$e),$e}while(U>=1&&me>=0);break}}}finally{ne=!1,ue.current=qe,fe(),Error.prepareStackTrace=He}var st=D?D.displayName||D.name:"",bn=st?se(st):"";return typeof D=="function"&&le.set(D,bn),bn}function be(D,te,ce){return Y(D,!1)}function _e(D){var te=D.prototype;return!!(te&&te.isReactComponent)}function Pe(D,te,ce){if(D==null)return"";if(typeof D=="function")return Y(D,_e(D));if(typeof D=="string")return se(D);switch(D){case c:return se("Suspense");case u:return se("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return be(D.render);case f:return Pe(D.type,te,ce);case h:{var Oe=D,He=Oe._payload,qe=Oe._init;try{return Pe(qe(He),te,ce)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Ue={},Be=x.ReactDebugCurrentFrame;function Ie(D){if(D){var te=D._owner,ce=Pe(D.type,D._source,te?te.type:null);Be.setExtraStackFrame(ce)}else Be.setExtraStackFrame(null)}function Ke(D,te,ce,Oe,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((Oe||"React class")+": "+ce+" 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](te,ze,Oe,ce,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(U){Fe=U}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).",Oe||"React class",ce,ze,typeof Fe),Ie(null)),Fe instanceof Error&&!(Fe.message in Ue)&&(Ue[Fe.message]=!0,Ie(He),_("Failed %s type: %s",ce,Fe.message),Ie(null))}}}var lt=Array.isArray;function It(D){return lt(D)}function At(D){{var te=typeof Symbol=="function"&&Symbol.toStringTag,ce=te&&D[Symbol.toStringTag]||D.constructor.name||"Object";return ce}}function Ht(D){try{return de(D),!1}catch{return!0}}function de(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.",At(D)),de(D)}var Le=x.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Ze,Wt,Zt;Zt={};function Kt(D){if(Te.call(D,"ref")){var te=Object.getOwnPropertyDescriptor(D,"ref").get;if(te&&te.isReactWarning)return!1}return D.ref!==void 0}function vn(D){if(Te.call(D,"key")){var te=Object.getOwnPropertyDescriptor(D,"key").get;if(te&&te.isReactWarning)return!1}return D.key!==void 0}function ln(D,te){if(typeof D.ref=="string"&&Le.current&&te&&Le.current.stateNode!==te){var ce=Q(Le.current.type);Zt[ce]||(_('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',Q(Le.current.type),D.ref),Zt[ce]=!0)}}function Lt(D,te){{var ce=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)",te))};ce.isReactWarning=!0,Object.defineProperty(D,"key",{get:ce,configurable:!0})}}function tn(D,te){{var ce=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)",te))};ce.isReactWarning=!0,Object.defineProperty(D,"ref",{get:ce,configurable:!0})}}var xn=function(D,te,ce,Oe,He,qe,ze){var Fe={$$typeof:t,type:D,key:te,ref:ce,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:Oe}),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,te,ce,Oe,He){{var qe,ze={},Fe=null,Ae=null;ce!==void 0&&(Ee(ce),Fe=""+ce),vn(te)&&(Ee(te.key),Fe=""+te.key),Kt(te)&&(Ae=te.ref,ln(te,He));for(qe in te)Te.call(te,qe)&&!Ge.hasOwnProperty(qe)&&(ze[qe]=te[qe]);if(D&&D.defaultProps){var U=D.defaultProps;for(qe in U)ze[qe]===void 0&&(ze[qe]=U[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,Oe,Le.current,ze)}}var ht=x.ReactCurrentOwner,$t=x.ReactDebugCurrentFrame;function Xt(D){if(D){var te=D._owner,ce=Pe(D.type,D._source,te?te.type:null);$t.setExtraStackFrame(ce)}else $t.setExtraStackFrame(null)}var bt;bt=!1;function Rn(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Lo(){{if(ht.current){var D=Q(ht.current.type);if(D)return`
14
-
15
- Check the render method of \``+D+"`."}return""}}function ms(D){{if(D!==void 0){var te=D.fileName.replace(/^.*[\\\/]/,""),ce=D.lineNumber;return`
16
-
17
- Check your code at `+te+":"+ce+"."}return""}}var Fo={};function Ai(D){{var te=Lo();if(!te){var ce=typeof D=="string"?D:D.displayName||D.name;ce&&(te=`
18
-
19
- Check the top-level render call using <`+ce+">.")}return te}}function ni(D,te){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var ce=Ai(te);if(Fo[ce])return;Fo[ce]=!0;var Oe="";D&&D._owner&&D._owner!==ht.current&&(Oe=" It was passed a child from "+Q(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.',ce,Oe),Xt(null)}}function $i(D,te){{if(typeof D!="object")return;if(It(D))for(var ce=0;ce<D.length;ce++){var Oe=D[ce];Rn(Oe)&&ni(Oe,te)}else if(Rn(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;)Rn(ze.value)&&ni(ze.value,te)}}}function vs(D){{var te=D.type;if(te==null||typeof te=="string")return;var ce;if(typeof te=="function")ce=te.propTypes;else if(typeof te=="object"&&(te.$$typeof===l||te.$$typeof===f))ce=te.propTypes;else return;if(ce){var Oe=Q(te);Ke(ce,D.props,"prop",Oe,D)}else if(te.PropTypes!==void 0&&!bt){bt=!0;var He=Q(te);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof te.getDefaultProps=="function"&&!te.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ri(D){{for(var te=Object.keys(D.props),ce=0;ce<te.length;ce++){var Oe=te[ce];if(Oe!=="children"&&Oe!=="key"){Xt(D),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Xt(null);break}}D.ref!==null&&(Xt(D),_("Invalid attribute `ref` supplied to `React.Fragment`."),Xt(null))}}function ki(D,te,ce,Oe,He,qe){{var ze=$(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=ms(He);Ae?Fe+=Ae:Fe+=Lo();var U;D===null?U="null":It(D)?U="array":D!==void 0&&D.$$typeof===t?(U="<"+(Q(D.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):U=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",U,Fe)}var me=nt(D,te,ce,He,qe);if(me==null)return me;if(ze){var $e=te.children;if($e!==void 0)if(Oe)if(It($e)){for(var st=0;st<$e.length;st++)$i($e[st],D);Object.freeze&&Object.freeze($e)}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 $i($e,D)}return D===r?ri(me):vs(me),me}}function jn(D,te,ce){return ki(D,te,ce,!0)}function oi(D,te,ce){return ki(D,te,ce,!1)}var bs=oi,ys=jn;Du.Fragment=r,Du.jsx=bs,Du.jsxs=ys}()),Du}var Au={};/**
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 zE;function yj(){if(zE)return Au;zE=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={},h=null,g=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(g=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:h,ref:g,props:f,_owner:o.current}}return Au.Fragment=n,Au.jsx=s,Au.jsxs=s,Au}process.env.NODE_ENV==="production"?h0.exports=yj():h0.exports=bj();var O=h0.exports;function U2(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=U2(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ug(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=U2(e))&&(r&&(r+=" "),r+=t);return r}const xj=Object.freeze(Object.defineProperty({__proto__:null,clsx:ug,default:ug},Symbol.toStringTag,{value:"Module"})),mw="-";function wj(e){const t=Sj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(mw);return a[0]===""&&a.length!==1&&a.shift(),q2(a,t)||_j(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function q2(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?q2(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(mw);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const BE=/^\[(.+)\]$/;function _j(e){if(BE.test(e)){const t=BE.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function Sj(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Ej(Object.entries(e.classGroups),n).forEach(([i,s])=>{p0(s,r,i,t)}),r}function p0(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:VE(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Cj(o)){p0(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{p0(s,VE(t,i),n,r)})})}function VE(e,t){let n=e;return t.split(mw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Cj(e){return e.isThemeGetter}function Ej(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 Rj(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 G2="!";function Oj(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 b=0;b<s.length;b++){let w=s[b];if(l===0){if(w===r&&(n||s.slice(b,b+o)===t)){a.push(s.slice(c,b)),c=b+o;continue}if(w==="/"){u=b;continue}}w==="["?l++:w==="]"&&l--}const f=a.length===0?s:s.substring(c),h=f.startsWith(G2),g=h?f.substring(1):f,v=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:v}}}function Pj(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 Tj(e){return{cache:Rj(e.cacheSize),splitModifiers:Oj(e),...wj(e)}}const Dj=/\s+/;function Aj(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(Dj).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let f=r(u?c.substring(0,u):c),h=!!u;if(!f){if(!u)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};h=!1}const g=Pj(a).join(":");return{isTailwindClass:!0,modifierId:l?g+G2:g,classGroupId:f,originalClassName:s,hasPostfixModifier:h}}).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 $j(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Y2(t))&&(r&&(r+=" "),r+=n);return r}function Y2(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Y2(e[r]))&&(n&&(n+=" "),n+=t);return n}function kj(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=Tj(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=Aj(l,n);return o(l,u),u}return function(){return i($j.apply(null,arguments))}}function un(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const K2=/^\[(?:([a-z-]+):)?(.+)\]$/i,Mj=/^\d+\/\d+$/,Ij=new Set(["px","full","screen"]),Nj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lj=/\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$/,Fj=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Ho(e){return Ua(e)||Ij.has(e)||Mj.test(e)}function Ts(e){return ru(e,"length",Gj)}function Ua(e){return!!e&&!Number.isNaN(Number(e))}function Hh(e){return ru(e,"number",Ua)}function $u(e){return!!e&&Number.isInteger(Number(e))}function zj(e){return e.endsWith("%")&&Ua(e.slice(0,-1))}function xt(e){return K2.test(e)}function Ds(e){return Nj.test(e)}const Bj=new Set(["length","size","percentage"]);function Vj(e){return ru(e,Bj,X2)}function Hj(e){return ru(e,"position",X2)}const Wj=new Set(["image","url"]);function Uj(e){return ru(e,Wj,Kj)}function qj(e){return ru(e,"",Yj)}function ku(){return!0}function ru(e,t,n){const r=K2.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Gj(e){return Lj.test(e)}function X2(){return!1}function Yj(e){return Fj.test(e)}function Kj(e){return jj.test(e)}function Xj(){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"),h=un("gap"),g=un("gradientColorStops"),v=un("gradientColorStopPositions"),b=un("inset"),w=un("margin"),x=un("opacity"),_=un("padding"),S=un("saturate"),C=un("scale"),E=un("sepia"),P=un("skew"),A=un("space"),k=un("translate"),I=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",xt,t],j=()=>[xt,t],Q=()=>["",Ho,Ts],ee=()=>["auto",Ua,xt],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],q=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",xt],T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Ua,Hh],X=()=>[Ua,xt];return{cacheSize:500,separator:":",theme:{colors:[ku],spacing:[Ho,Ts],blur:["none","",Ds,xt],brightness:V(),borderColor:[e],borderRadius:["none","","full",Ds,xt],borderSpacing:j(),borderWidth:Q(),contrast:V(),grayscale:K(),hueRotate:X(),invert:K(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[zj,Ts],inset:L(),margin:L(),opacity:V(),padding:j(),saturate:V(),scale:V(),sepia:K(),skew:X(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",xt]}],container:["container"],columns:[{columns:[Ds]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:[...B(),xt]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",$u,xt]}],basis:[{basis:L()}],"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:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",$u,xt]}],"grid-cols":[{"grid-cols":[ku]}],"col-start-end":[{col:["auto",{span:["full",$u,xt]},xt]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[ku]}],"row-start-end":[{row:["auto",{span:[$u,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:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"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":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",xt,t]}],"min-w":[{"min-w":["min","max","fit",xt,Ho]}],"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",Ho,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",Hh]}],"font-family":[{font:[ku]}],"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",Ua,Hh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ho,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":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ho,Ts]}],"underline-offset":[{"underline-offset":["auto",Ho,xt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:j()}],"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":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),Hj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Vj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Uj]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...Z(),"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":[x]}],"divide-style":[{divide:Z()}],"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:["",...Z()]}],"outline-offset":[{"outline-offset":[Ho,xt]}],"outline-w":[{outline:[Ho,Ts]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Ho,Ts]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ds,qj]}],"shadow-color":[{shadow:[ku]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":G()}],"bg-blend":[{"bg-blend":G()}],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":[x]}],"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:X()}],ease:[{ease:["linear","in","out","in-out",xt]}],delay:[{delay:X()}],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:[$u,xt]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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:[Ho,Ts,Hh]}],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 Qj=kj(Xj);class Jj extends Error{}Jj.prototype.name="InvalidTokenError";async function Zj(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 ez(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),h=>h.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 h=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,f);return{decryptedData:o.decode(h)}}catch(h){throw new Error(`Decryption failed: ${h}`)}}function Ce(...e){return Qj(ug(e))}async function tz(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 Of(e,t,n={}){try{const r=JSON.stringify(n),o=await Zj(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 ez(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}function nz(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 Q2(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>rz(i,t))}function rz(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 oz(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Kp="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";var iz={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const HE=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(h=>h(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(iz?"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},sz=e=>e?HE(e):HE;var g0={exports:{}},Rb={},Wh={exports:{}},Ob={};/**
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 WE;function az(){return WE||(WE=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),P=1;P<C;P++)E[P-1]=arguments[P];r("error",S,E)}}function r(S,C,E){{var P=t.ReactDebugCurrentFrame,A=P.getStackAddendum();A!==""&&(C+="%s",E=E.concat([A]));var k=E.map(function(I){return String(I)});k.unshift("Warning: "+C),Function.prototype.apply.call(console[S],console,k)}}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 h(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 P=C();if(!f){var A=C();i(P,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var k=s({inst:{value:P,getSnapshot:C}}),I=k[0].inst,$=k[1];return l(function(){I.value=P,I.getSnapshot=C,g(I)&&$({inst:I})},[S,P,C]),a(function(){g(I)&&$({inst:I});var L=function(){g(I)&&$({inst:I})};return S(L)},[S]),c(P),P}function g(S){var C=S.getSnapshot,E=S.value;try{var P=C();return!i(E,P)}catch{return!0}}function v(S,C,E){return C()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",w=!b,x=w?v:h,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x;Ob.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ob}var Pb={};/**
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 UE;function lz(){if(UE)return Pb;UE=1;var e=m;function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(f,h){var g=h(),v=r({inst:{value:g,getSnapshot:h}}),b=v[0].inst,w=v[1];return i(function(){b.value=g,b.getSnapshot=h,l(b)&&w({inst:b})},[f,g,h]),o(function(){return l(b)&&w({inst:b}),f(function(){l(b)&&w({inst:b})})},[f]),s(g),g}function l(f){var h=f.getSnapshot;f=f.value;try{var g=h();return!n(f,g)}catch{return!0}}function c(f,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Pb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Pb}var qE;function vw(){return qE||(qE=1,process.env.NODE_ENV==="production"?Wh.exports=lz():Wh.exports=az()),Wh.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 GE;function cz(){return GE||(GE=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=vw();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,h,g,v){var b=i(null),w;b.current===null?(w={hasValue:!1,value:null},b.current=w):w=b.current;var x=a(function(){var E=!1,P,A,k=function(j){if(!E){E=!0,P=j;var Q=g(j);if(v!==void 0&&w.hasValue){var ee=w.value;if(v(ee,Q))return A=ee,ee}return A=Q,Q}var B=P,Z=A;if(r(B,j))return Z;var G=g(j);return v!==void 0&&v(Z,G)?Z:(P=j,A=G,G)},I=h===void 0?null:h,$=function(){return k(f())},L=I===null?void 0:function(){return k(I())};return[$,L]},[f,h,g,v]),_=x[0],S=x[1],C=o(u,_,S);return s(function(){w.hasValue=!0,w.value=C},[C]),l(C),C}Rb.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Rb}var Tb={};/**
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 YE;function uz(){if(YE)return Tb;YE=1;var e=m,t=vw();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 Tb.useSyncExternalStoreWithSelector=function(c,u,f,h,g){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function x(P){if(!_){if(_=!0,S=P,P=h(P),g!==void 0&&b.hasValue){var A=b.value;if(g(A,P))return C=A}return C=P}if(A=C,r(S,P))return A;var k=h(P);return g!==void 0&&g(A,k)?A:(S=P,C=k)}var _=!1,S,C,E=f===void 0?null:f;return[function(){return x(u())},E===null?void 0:function(){return x(E())}]},[u,f,h,g]);var w=o(c,v[0],v[1]);return s(function(){b.hasValue=!0,b.value=w},[w]),l(w),w},Tb}process.env.NODE_ENV==="production"?g0.exports=uz():g0.exports=cz();var dz=g0.exports;const fz=nu(dz);var J2={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:hz}=m,{useSyncExternalStoreWithSelector:pz}=fz;let KE=!1;function gz(e,t=e.getState,n){(J2?"production":void 0)!=="production"&&n&&!KE&&(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"),KE=!0);const r=pz(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return hz(r),r}const XE=e=>{(J2?"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"?sz(e):e,n=(r,o)=>gz(t,r,o);return Object.assign(n,t),n},Z2=e=>e?XE(e):XE;var eD=Symbol.for("immer-nothing"),QE=Symbol.for("immer-draftable"),ao=Symbol.for("immer-state"),mz=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 Mr(e,...t){if(process.env.NODE_ENV!=="production"){const n=mz[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 jc=Object.getPrototypeOf;function zc(e){return!!e&&!!e[ao]}function fl(e){var t;return e?tD(e)||Array.isArray(e)||!!e[QE]||!!((t=e.constructor)!=null&&t[QE])||nm(e)||rm(e):!1}var vz=Object.prototype.constructor.toString();function tD(e){if(!e||typeof e!="object")return!1;const t=jc(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)===vz}function Ed(e,t){tm(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function tm(e){const t=e[ao];return t?t.type_:Array.isArray(e)?1:nm(e)?2:rm(e)?3:0}function m0(e,t){return tm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function nD(e,t,n){const r=tm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function bz(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function nm(e){return e instanceof Map}function rm(e){return e instanceof Set}function La(e){return e.copy_||e.base_}function v0(e,t){if(nm(e))return new Map(e);if(rm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&tD(e))return jc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[ao];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(jc(e),n)}function bw(e,t=!1){return om(e)||zc(e)||!fl(e)||(tm(e)>1&&(e.set=e.add=e.clear=e.delete=yz),Object.freeze(e),t&&Ed(e,(n,r)=>bw(r,!0))),e}function yz(){Mr(2)}function om(e){return Object.isFrozen(e)}var xz={};function hl(e){const t=xz[e];return t||Mr(0,e),t}var Rd;function rD(){return Rd}function wz(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function JE(e,t){t&&(hl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function b0(e){y0(e),e.drafts_.forEach(_z),e.drafts_=null}function y0(e){e===Rd&&(Rd=e.parent_)}function ZE(e){return Rd=wz(Rd,e)}function _z(e){const t=e[ao];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function eR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ao].modified_&&(b0(t),Mr(4)),fl(e)&&(e=dg(t,e),t.parent_||fg(t,e)),t.patches_&&hl("Patches").generateReplacementPatches_(n[ao].base_,e,t.patches_,t.inversePatches_)):e=dg(t,n,[]),b0(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==eD?e:void 0}function dg(e,t,n){if(om(t))return t;const r=t[ao];if(!r)return Ed(t,(o,i)=>tR(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return fg(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),Ed(i,(a,l)=>tR(e,r,o,a,l,n,s)),fg(e,o,!1),n&&e.patches_&&hl("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function tR(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Mr(5),zc(o)){const a=i&&t&&t.type_!==3&&!m0(t.assigned_,r)?i.concat(r):void 0,l=dg(e,o,a);if(nD(n,r,l),zc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(fl(o)&&!om(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;dg(e,o),(!t||!t.scope_.parent_)&&fg(e,o)}}function fg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&bw(t,n)}function Sz(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:rD(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=yw;n&&(o=[r],i=Od);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var yw={get(e,t){if(t===ao)return e;const n=La(e);if(!m0(n,t))return Cz(e,n,t);const r=n[t];return e.finalized_||!fl(r)?r:r===Db(e.base_,t)?(Ab(e),e.copy_[t]=w0(r,e)):r},has(e,t){return t in La(e)},ownKeys(e){return Reflect.ownKeys(La(e))},set(e,t,n){const r=oD(La(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Db(La(e),t),i=o==null?void 0:o[ao];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(bz(n,o)&&(n!==void 0||m0(e.base_,t)))return!0;Ab(e),x0(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 Db(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ab(e),x0(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=La(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Mr(11)},getPrototypeOf(e){return jc(e.base_)},setPrototypeOf(){Mr(12)}},Od={};Ed(yw,(e,t)=>{Od[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Od.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Mr(13),Od.set.call(this,e,t,void 0)};Od.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Mr(14),yw.set.call(this,e[0],t,n,e[0])};function Db(e,t){const n=e[ao];return(n?La(n):e)[t]}function Cz(e,t,n){var o;const r=oD(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function oD(e,t){if(!(t in e))return;let n=jc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=jc(n)}}function x0(e){e.modified_||(e.modified_=!0,e.parent_&&x0(e.parent_))}function Ab(e){e.copy_||(e.copy_=v0(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ez=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"&&Mr(6),r!==void 0&&typeof r!="function"&&Mr(7);let o;if(fl(t)){const i=ZE(this),s=w0(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?b0(i):y0(i)}return JE(i,r),eR(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===eD&&(o=void 0),this.autoFreeze_&&bw(o,!0),r){const i=[],s=[];hl("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Mr(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){fl(e)||Mr(8),zc(e)&&(e=Rz(e));const t=ZE(this),n=w0(e,void 0);return n[ao].isManual_=!0,y0(t),n}finishDraft(e,t){const n=e&&e[ao];(!n||!n.isManual_)&&Mr(9);const{scope_:r}=n;return JE(r,t),eR(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=hl("Patches").applyPatches_;return zc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function w0(e,t){const n=nm(e)?hl("MapSet").proxyMap_(e,t):rm(e)?hl("MapSet").proxySet_(e,t):Sz(e,t);return(t?t.scope_:rD()).drafts_.push(n),n}function Rz(e){return zc(e)||Mr(10,e),iD(e)}function iD(e){if(!fl(e)||om(e))return e;const t=e[ao];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=v0(e,t.scope_.immer_.useStrictShallowCopy_)}else n=v0(e,!0);return Ed(n,(r,o)=>{nD(n,r,iD(o))}),t&&(t.finalized_=!1),n}var lo=new Ez,Oz=lo.produce;lo.produceWithPatches.bind(lo);lo.setAutoFreeze.bind(lo);lo.setUseStrictShallowCopy.bind(lo);lo.applyPatches.bind(lo);lo.createDraft.bind(lo);lo.finishDraft.bind(lo);const Pz=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?Oz(o):o;return t(a,i,...s)},e(r.setState,n,r)),sD=Pz;var _0,Uh=Mo;if(process.env.NODE_ENV==="production")_0=Uh.createRoot,Uh.hydrateRoot;else{var nR=Uh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;_0=function(e,t){nR.usingClientEntryPoint=!0;try{return Uh.createRoot(e,t)}finally{nR.usingClientEntryPoint=!1}}}var aD={},lD={},xw={exports:{}},dn=String,cD=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}};xw.exports=cD();xw.exports.createColors=cD;var Tz=xw.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(Tz);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])}}})(lD);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(lD);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}}})(aD);let $b=aD;var Dz=($b.__esModule?$b:{default:$b}).default;const Bt=nu(Dz),uD=`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
- `,dD="dm",S0=[{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"}],Az=[{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)"}]}],ww=["lg","md","sm","xs","xxs"],C0={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:E0},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:E0}},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 E0(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=Pd()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Pd()),Bc(n)}function Pd(){return ke.getState().theme==="dark"?"#000000":"#FFFFFF"}function Bc(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Bt.gray[500];const f=u.replace("#",""),h=parseInt(f.substring(0,2),16),g=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=h,n+=g,r+=v,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 im=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],Vc=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],Pf=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],_w=["boolean"];function Sw(e){return e.match(/[A-Z]/)?`"${e}"`:e}function $z(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?`${dD}.${r}`:fD(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 kz(e,t,n="AVG"){var i,s,a,l;let r={};const o=Sw(e.column_name);return im.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]}),Vc.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 hg(e){return im.includes(e.dataType)?"string":Vc.includes(e.dataType)?"number":Pf.includes(e.dataType)?"date":_w.includes(e.dataType)?"boolean":"string"}function Mz(e){let t;const n=e.data_type.toLowerCase();return im.includes(n)?t="T":Vc.includes(n)?t="#":Pf.includes(n)?t="D":_w.includes(n)?t="B":t="?",t}function Iz(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 fD(e,t){return t==="api"||e===Sw("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const Nz=e=>{const t=new Date(e);return!isNaN(t.getTime())},Lz=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Td=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?Nz(e)?t="date":Lz(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function Fz({get:e,dataPoint:t,card:n}){var h;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:(h=n.preferences)==null?void 0:h.filterOnClickField,valueType:Td(u),operation:"=",values:[u]};if(l!=null&&l.find(g=>g.id===n.id)){const g=n.id;if(u==null){a(n),i(g);return}else s(f)}o(n),r(f)}var pg={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
- */pg.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,h=2,g=4,v=1,b=2,w=1,x=2,_=4,S=8,C=16,E=32,P=64,A=128,k=256,I=512,$=30,L="...",j=800,Q=16,ee=1,B=2,Z=3,G=1/0,q=9007199254740991,K=17976931348623157e292,T=NaN,V=4294967295,X=V-1,N=V>>>1,ie=[["ary",A],["bind",w],["bindKey",x],["curry",S],["curryRight",C],["flip",I],["partial",E],["partialRight",P],["rearg",k]],fe="[object Arguments]",ue="[object Array]",pe="[object AsyncFunction]",se="[object Boolean]",ne="[object Date]",le="[object DOMException]",ye="[object Error]",Y="[object Function]",be="[object GeneratorFunction]",_e="[object Map]",Pe="[object Number]",Te="[object Null]",Ue="[object Object]",Be="[object Promise]",Ie="[object Proxy]",Ke="[object RegExp]",lt="[object Set]",It="[object String]",At="[object Symbol]",Ht="[object Undefined]",de="[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,$t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xt=/&(?:amp|lt|gt|quot|#39);/g,bt=/[&<>"']/g,Rn=RegExp(Xt.source),Lo=RegExp(bt.source),ms=/<%-([\s\S]+?)%>/g,Fo=/<%([\s\S]+?)%>/g,Ai=/<%=([\s\S]+?)%>/g,ni=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$i=/^\w*$/,vs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ri=/[\\^$.*+?()[\]{}|]/g,ki=RegExp(ri.source),jn=/^\s+/,oi=/\s/,bs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ys=/\{\n\/\* \[wrapped with (.+)\] \*/,D=/,? & /,te=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,Oe=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qe=/\w*$/,ze=/^[-+]0x[0-9a-f]+$/i,Fe=/^0b[01]+$/i,Ae=/^\[object .+?Constructor\]$/,U=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,$e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,st=/($^)/,bn=/['\n\r\u2028\u2029\\]/g,ft="\\ud800-\\udfff",tr="\\u0300-\\u036f",go="\\ufe20-\\ufe2f",ya="\\u20d0-\\u20ff",zn=tr+go+ya,hu="\\u2700-\\u27bf",pu="a-z\\xdf-\\xf6\\xf8-\\xff",fF="\\xac\\xb1\\xd7\\xf7",hF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",pF="\\u2000-\\u206f",gF=" \\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",vS="A-Z\\xc0-\\xd6\\xd8-\\xde",bS="\\ufe0e\\ufe0f",yS=fF+hF+pF+gF,gv="['’]",mF="["+ft+"]",xS="["+yS+"]",nh="["+zn+"]",wS="\\d+",vF="["+hu+"]",_S="["+pu+"]",SS="[^"+ft+yS+wS+hu+pu+vS+"]",mv="\\ud83c[\\udffb-\\udfff]",bF="(?:"+nh+"|"+mv+")",CS="[^"+ft+"]",vv="(?:\\ud83c[\\udde6-\\uddff]){2}",bv="[\\ud800-\\udbff][\\udc00-\\udfff]",Ml="["+vS+"]",ES="\\u200d",RS="(?:"+_S+"|"+SS+")",yF="(?:"+Ml+"|"+SS+")",OS="(?:"+gv+"(?:d|ll|m|re|s|t|ve))?",PS="(?:"+gv+"(?:D|LL|M|RE|S|T|VE))?",TS=bF+"?",DS="["+bS+"]?",xF="(?:"+ES+"(?:"+[CS,vv,bv].join("|")+")"+DS+TS+")*",wF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_F="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",AS=DS+TS+xF,SF="(?:"+[vF,vv,bv].join("|")+")"+AS,CF="(?:"+[CS+nh+"?",nh,vv,bv,mF].join("|")+")",EF=RegExp(gv,"g"),RF=RegExp(nh,"g"),yv=RegExp(mv+"(?="+mv+")|"+CF+AS,"g"),OF=RegExp([Ml+"?"+_S+"+"+OS+"(?="+[xS,Ml,"$"].join("|")+")",yF+"+"+PS+"(?="+[xS,Ml+RS,"$"].join("|")+")",Ml+"?"+RS+"+"+OS,Ml+"+"+PS,_F,wF,wS,SF].join("|"),"g"),PF=RegExp("["+ES+ft+zn+bS+"]"),TF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,DF=["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"],AF=-1,cn={};cn[Ze]=cn[Wt]=cn[Zt]=cn[Kt]=cn[vn]=cn[ln]=cn[Lt]=cn[tn]=cn[xn]=!0,cn[fe]=cn[ue]=cn[Le]=cn[se]=cn[Ge]=cn[ne]=cn[ye]=cn[Y]=cn[_e]=cn[Pe]=cn[Ue]=cn[Ke]=cn[lt]=cn[It]=cn[de]=!1;var rn={};rn[fe]=rn[ue]=rn[Le]=rn[Ge]=rn[se]=rn[ne]=rn[Ze]=rn[Wt]=rn[Zt]=rn[Kt]=rn[vn]=rn[_e]=rn[Pe]=rn[Ue]=rn[Ke]=rn[lt]=rn[It]=rn[At]=rn[ln]=rn[Lt]=rn[tn]=rn[xn]=!0,rn[ye]=rn[Y]=rn[de]=!1;var $F={À:"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"},kF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},MF={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},IF={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},NF=parseFloat,LF=parseInt,$S=typeof Vs=="object"&&Vs&&Vs.Object===Object&&Vs,FF=typeof self=="object"&&self&&self.Object===Object&&self,qn=$S||FF||Function("return this")(),xv=t&&!t.nodeType&&t,xa=xv&&!0&&e&&!e.nodeType&&e,kS=xa&&xa.exports===xv,wv=kS&&$S.process,mo=function(){try{var re=xa&&xa.require&&xa.require("util").types;return re||wv&&wv.binding&&wv.binding("util")}catch{}}(),MS=mo&&mo.isArrayBuffer,IS=mo&&mo.isDate,NS=mo&&mo.isMap,LS=mo&&mo.isRegExp,FS=mo&&mo.isSet,jS=mo&&mo.isTypedArray;function zr(re,ve,ge){switch(ge.length){case 0:return re.call(ve);case 1:return re.call(ve,ge[0]);case 2:return re.call(ve,ge[0],ge[1]);case 3:return re.call(ve,ge[0],ge[1],ge[2])}return re.apply(ve,ge)}function jF(re,ve,ge,We){for(var ct=-1,jt=re==null?0:re.length;++ct<jt;){var kn=re[ct];ve(We,kn,ge(kn),re)}return We}function vo(re,ve){for(var ge=-1,We=re==null?0:re.length;++ge<We&&ve(re[ge],ge,re)!==!1;);return re}function zF(re,ve){for(var ge=re==null?0:re.length;ge--&&ve(re[ge],ge,re)!==!1;);return re}function zS(re,ve){for(var ge=-1,We=re==null?0:re.length;++ge<We;)if(!ve(re[ge],ge,re))return!1;return!0}function xs(re,ve){for(var ge=-1,We=re==null?0:re.length,ct=0,jt=[];++ge<We;){var kn=re[ge];ve(kn,ge,re)&&(jt[ct++]=kn)}return jt}function rh(re,ve){var ge=re==null?0:re.length;return!!ge&&Il(re,ve,0)>-1}function _v(re,ve,ge){for(var We=-1,ct=re==null?0:re.length;++We<ct;)if(ge(ve,re[We]))return!0;return!1}function yn(re,ve){for(var ge=-1,We=re==null?0:re.length,ct=Array(We);++ge<We;)ct[ge]=ve(re[ge],ge,re);return ct}function ws(re,ve){for(var ge=-1,We=ve.length,ct=re.length;++ge<We;)re[ct+ge]=ve[ge];return re}function Sv(re,ve,ge,We){var ct=-1,jt=re==null?0:re.length;for(We&&jt&&(ge=re[++ct]);++ct<jt;)ge=ve(ge,re[ct],ct,re);return ge}function BF(re,ve,ge,We){var ct=re==null?0:re.length;for(We&&ct&&(ge=re[--ct]);ct--;)ge=ve(ge,re[ct],ct,re);return ge}function Cv(re,ve){for(var ge=-1,We=re==null?0:re.length;++ge<We;)if(ve(re[ge],ge,re))return!0;return!1}var VF=Ev("length");function HF(re){return re.split("")}function WF(re){return re.match(te)||[]}function BS(re,ve,ge){var We;return ge(re,function(ct,jt,kn){if(ve(ct,jt,kn))return We=jt,!1}),We}function oh(re,ve,ge,We){for(var ct=re.length,jt=ge+(We?1:-1);We?jt--:++jt<ct;)if(ve(re[jt],jt,re))return jt;return-1}function Il(re,ve,ge){return ve===ve?n3(re,ve,ge):oh(re,VS,ge)}function UF(re,ve,ge,We){for(var ct=ge-1,jt=re.length;++ct<jt;)if(We(re[ct],ve))return ct;return-1}function VS(re){return re!==re}function HS(re,ve){var ge=re==null?0:re.length;return ge?Ov(re,ve)/ge:T}function Ev(re){return function(ve){return ve==null?n:ve[re]}}function Rv(re){return function(ve){return re==null?n:re[ve]}}function WS(re,ve,ge,We,ct){return ct(re,function(jt,kn,nn){ge=We?(We=!1,jt):ve(ge,jt,kn,nn)}),ge}function qF(re,ve){var ge=re.length;for(re.sort(ve);ge--;)re[ge]=re[ge].value;return re}function Ov(re,ve){for(var ge,We=-1,ct=re.length;++We<ct;){var jt=ve(re[We]);jt!==n&&(ge=ge===n?jt:ge+jt)}return ge}function Pv(re,ve){for(var ge=-1,We=Array(re);++ge<re;)We[ge]=ve(ge);return We}function GF(re,ve){return yn(ve,function(ge){return[ge,re[ge]]})}function US(re){return re&&re.slice(0,KS(re)+1).replace(jn,"")}function Br(re){return function(ve){return re(ve)}}function Tv(re,ve){return yn(ve,function(ge){return re[ge]})}function gu(re,ve){return re.has(ve)}function qS(re,ve){for(var ge=-1,We=re.length;++ge<We&&Il(ve,re[ge],0)>-1;);return ge}function GS(re,ve){for(var ge=re.length;ge--&&Il(ve,re[ge],0)>-1;);return ge}function YF(re,ve){for(var ge=re.length,We=0;ge--;)re[ge]===ve&&++We;return We}var KF=Rv($F),XF=Rv(kF);function QF(re){return"\\"+IF[re]}function JF(re,ve){return re==null?n:re[ve]}function Nl(re){return PF.test(re)}function ZF(re){return TF.test(re)}function e3(re){for(var ve,ge=[];!(ve=re.next()).done;)ge.push(ve.value);return ge}function Dv(re){var ve=-1,ge=Array(re.size);return re.forEach(function(We,ct){ge[++ve]=[ct,We]}),ge}function YS(re,ve){return function(ge){return re(ve(ge))}}function _s(re,ve){for(var ge=-1,We=re.length,ct=0,jt=[];++ge<We;){var kn=re[ge];(kn===ve||kn===u)&&(re[ge]=u,jt[ct++]=ge)}return jt}function ih(re){var ve=-1,ge=Array(re.size);return re.forEach(function(We){ge[++ve]=We}),ge}function t3(re){var ve=-1,ge=Array(re.size);return re.forEach(function(We){ge[++ve]=[We,We]}),ge}function n3(re,ve,ge){for(var We=ge-1,ct=re.length;++We<ct;)if(re[We]===ve)return We;return-1}function r3(re,ve,ge){for(var We=ge+1;We--;)if(re[We]===ve)return We;return We}function Ll(re){return Nl(re)?i3(re):VF(re)}function jo(re){return Nl(re)?s3(re):HF(re)}function KS(re){for(var ve=re.length;ve--&&oi.test(re.charAt(ve)););return ve}var o3=Rv(MF);function i3(re){for(var ve=yv.lastIndex=0;yv.test(re);)++ve;return ve}function s3(re){return re.match(yv)||[]}function a3(re){return re.match(OF)||[]}var l3=function re(ve){ve=ve==null?qn:Fl.defaults(qn.Object(),ve,Fl.pick(qn,DF));var ge=ve.Array,We=ve.Date,ct=ve.Error,jt=ve.Function,kn=ve.Math,nn=ve.Object,Av=ve.RegExp,c3=ve.String,bo=ve.TypeError,sh=ge.prototype,u3=jt.prototype,jl=nn.prototype,ah=ve["__core-js_shared__"],lh=u3.toString,Qt=jl.hasOwnProperty,d3=0,XS=function(){var d=/[^.]+$/.exec(ah&&ah.keys&&ah.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),ch=jl.toString,f3=lh.call(nn),h3=qn._,p3=Av("^"+lh.call(Qt).replace(ri,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uh=kS?ve.Buffer:n,Ss=ve.Symbol,dh=ve.Uint8Array,QS=uh?uh.allocUnsafe:n,fh=YS(nn.getPrototypeOf,nn),JS=nn.create,ZS=jl.propertyIsEnumerable,hh=sh.splice,eC=Ss?Ss.isConcatSpreadable:n,mu=Ss?Ss.iterator:n,wa=Ss?Ss.toStringTag:n,ph=function(){try{var d=Ra(nn,"defineProperty");return d({},"",{}),d}catch{}}(),g3=ve.clearTimeout!==qn.clearTimeout&&ve.clearTimeout,m3=We&&We.now!==qn.Date.now&&We.now,v3=ve.setTimeout!==qn.setTimeout&&ve.setTimeout,gh=kn.ceil,mh=kn.floor,$v=nn.getOwnPropertySymbols,b3=uh?uh.isBuffer:n,tC=ve.isFinite,y3=sh.join,x3=YS(nn.keys,nn),Mn=kn.max,nr=kn.min,w3=We.now,_3=ve.parseInt,nC=kn.random,S3=sh.reverse,kv=Ra(ve,"DataView"),vu=Ra(ve,"Map"),Mv=Ra(ve,"Promise"),zl=Ra(ve,"Set"),bu=Ra(ve,"WeakMap"),yu=Ra(nn,"create"),vh=bu&&new bu,Bl={},C3=Oa(kv),E3=Oa(vu),R3=Oa(Mv),O3=Oa(zl),P3=Oa(bu),bh=Ss?Ss.prototype:n,xu=bh?bh.valueOf:n,rC=bh?bh.toString:n;function F(d){if(Sn(d)&&!ut(d)&&!(d instanceof kt)){if(d instanceof yo)return d;if(Qt.call(d,"__wrapped__"))return oE(d)}return new yo(d)}var Vl=function(){function d(){}return function(p){if(!wn(p))return{};if(JS)return JS(p);d.prototype=p;var y=new d;return d.prototype=n,y}}();function yh(){}function yo(d,p){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=n}F.templateSettings={escape:ms,evaluate:Fo,interpolate:Ai,variable:"",imports:{_:F}},F.prototype=yh.prototype,F.prototype.constructor=F,yo.prototype=Vl(yh.prototype),yo.prototype.constructor=yo;function kt(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=V,this.__views__=[]}function T3(){var d=new kt(this.__wrapped__);return d.__actions__=Sr(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=Sr(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=Sr(this.__views__),d}function D3(){if(this.__filtered__){var d=new kt(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function A3(){var d=this.__wrapped__.value(),p=this.__dir__,y=ut(d),R=p<0,M=y?d.length:0,z=H7(0,M,this.__views__),W=z.start,J=z.end,ae=J-W,xe=R?J:W-1,we=this.__iteratees__,Re=we.length,je=0,Ye=nr(ae,this.__takeCount__);if(!y||!R&&M==ae&&Ye==ae)return OC(d,this.__actions__);var et=[];e:for(;ae--&&je<Ye;){xe+=p;for(var yt=-1,tt=d[xe];++yt<Re;){var Pt=we[yt],Mt=Pt.iteratee,Wr=Pt.type,pr=Mt(tt);if(Wr==B)tt=pr;else if(!pr){if(Wr==ee)continue e;break e}}et[je++]=tt}return et}kt.prototype=Vl(yh.prototype),kt.prototype.constructor=kt;function _a(d){var p=-1,y=d==null?0:d.length;for(this.clear();++p<y;){var R=d[p];this.set(R[0],R[1])}}function $3(){this.__data__=yu?yu(null):{},this.size=0}function k3(d){var p=this.has(d)&&delete this.__data__[d];return this.size-=p?1:0,p}function M3(d){var p=this.__data__;if(yu){var y=p[d];return y===l?n:y}return Qt.call(p,d)?p[d]:n}function I3(d){var p=this.__data__;return yu?p[d]!==n:Qt.call(p,d)}function N3(d,p){var y=this.__data__;return this.size+=this.has(d)?0:1,y[d]=yu&&p===n?l:p,this}_a.prototype.clear=$3,_a.prototype.delete=k3,_a.prototype.get=M3,_a.prototype.has=I3,_a.prototype.set=N3;function Mi(d){var p=-1,y=d==null?0:d.length;for(this.clear();++p<y;){var R=d[p];this.set(R[0],R[1])}}function L3(){this.__data__=[],this.size=0}function F3(d){var p=this.__data__,y=xh(p,d);if(y<0)return!1;var R=p.length-1;return y==R?p.pop():hh.call(p,y,1),--this.size,!0}function j3(d){var p=this.__data__,y=xh(p,d);return y<0?n:p[y][1]}function z3(d){return xh(this.__data__,d)>-1}function B3(d,p){var y=this.__data__,R=xh(y,d);return R<0?(++this.size,y.push([d,p])):y[R][1]=p,this}Mi.prototype.clear=L3,Mi.prototype.delete=F3,Mi.prototype.get=j3,Mi.prototype.has=z3,Mi.prototype.set=B3;function Ii(d){var p=-1,y=d==null?0:d.length;for(this.clear();++p<y;){var R=d[p];this.set(R[0],R[1])}}function V3(){this.size=0,this.__data__={hash:new _a,map:new(vu||Mi),string:new _a}}function H3(d){var p=$h(this,d).delete(d);return this.size-=p?1:0,p}function W3(d){return $h(this,d).get(d)}function U3(d){return $h(this,d).has(d)}function q3(d,p){var y=$h(this,d),R=y.size;return y.set(d,p),this.size+=y.size==R?0:1,this}Ii.prototype.clear=V3,Ii.prototype.delete=H3,Ii.prototype.get=W3,Ii.prototype.has=U3,Ii.prototype.set=q3;function Sa(d){var p=-1,y=d==null?0:d.length;for(this.__data__=new Ii;++p<y;)this.add(d[p])}function G3(d){return this.__data__.set(d,l),this}function Y3(d){return this.__data__.has(d)}Sa.prototype.add=Sa.prototype.push=G3,Sa.prototype.has=Y3;function zo(d){var p=this.__data__=new Mi(d);this.size=p.size}function K3(){this.__data__=new Mi,this.size=0}function X3(d){var p=this.__data__,y=p.delete(d);return this.size=p.size,y}function Q3(d){return this.__data__.get(d)}function J3(d){return this.__data__.has(d)}function Z3(d,p){var y=this.__data__;if(y instanceof Mi){var R=y.__data__;if(!vu||R.length<o-1)return R.push([d,p]),this.size=++y.size,this;y=this.__data__=new Ii(R)}return y.set(d,p),this.size=y.size,this}zo.prototype.clear=K3,zo.prototype.delete=X3,zo.prototype.get=Q3,zo.prototype.has=J3,zo.prototype.set=Z3;function oC(d,p){var y=ut(d),R=!y&&Pa(d),M=!y&&!R&&Ps(d),z=!y&&!R&&!M&&ql(d),W=y||R||M||z,J=W?Pv(d.length,c3):[],ae=J.length;for(var xe in d)(p||Qt.call(d,xe))&&!(W&&(xe=="length"||M&&(xe=="offset"||xe=="parent")||z&&(xe=="buffer"||xe=="byteLength"||xe=="byteOffset")||ji(xe,ae)))&&J.push(xe);return J}function iC(d){var p=d.length;return p?d[Uv(0,p-1)]:n}function e7(d,p){return kh(Sr(d),Ca(p,0,d.length))}function t7(d){return kh(Sr(d))}function Iv(d,p,y){(y!==n&&!Bo(d[p],y)||y===n&&!(p in d))&&Ni(d,p,y)}function wu(d,p,y){var R=d[p];(!(Qt.call(d,p)&&Bo(R,y))||y===n&&!(p in d))&&Ni(d,p,y)}function xh(d,p){for(var y=d.length;y--;)if(Bo(d[y][0],p))return y;return-1}function n7(d,p,y,R){return Cs(d,function(M,z,W){p(R,M,y(M),W)}),R}function sC(d,p){return d&&si(p,Bn(p),d)}function r7(d,p){return d&&si(p,Er(p),d)}function Ni(d,p,y){p=="__proto__"&&ph?ph(d,p,{configurable:!0,enumerable:!0,value:y,writable:!0}):d[p]=y}function Nv(d,p){for(var y=-1,R=p.length,M=ge(R),z=d==null;++y<R;)M[y]=z?n:mb(d,p[y]);return M}function Ca(d,p,y){return d===d&&(y!==n&&(d=d<=y?d:y),p!==n&&(d=d>=p?d:p)),d}function xo(d,p,y,R,M,z){var W,J=p&f,ae=p&h,xe=p&g;if(y&&(W=M?y(d,R,M,z):y(d)),W!==n)return W;if(!wn(d))return d;var we=ut(d);if(we){if(W=U7(d),!J)return Sr(d,W)}else{var Re=rr(d),je=Re==Y||Re==be;if(Ps(d))return DC(d,J);if(Re==Ue||Re==fe||je&&!M){if(W=ae||je?{}:KC(d),!J)return ae?M7(d,r7(W,d)):k7(d,sC(W,d))}else{if(!rn[Re])return M?d:{};W=q7(d,Re,J)}}z||(z=new zo);var Ye=z.get(d);if(Ye)return Ye;z.set(d,W),CE(d)?d.forEach(function(tt){W.add(xo(tt,p,y,tt,d,z))}):_E(d)&&d.forEach(function(tt,Pt){W.set(Pt,xo(tt,p,y,Pt,d,z))});var et=xe?ae?nb:tb:ae?Er:Bn,yt=we?n:et(d);return vo(yt||d,function(tt,Pt){yt&&(Pt=tt,tt=d[Pt]),wu(W,Pt,xo(tt,p,y,Pt,d,z))}),W}function o7(d){var p=Bn(d);return function(y){return aC(y,d,p)}}function aC(d,p,y){var R=y.length;if(d==null)return!R;for(d=nn(d);R--;){var M=y[R],z=p[M],W=d[M];if(W===n&&!(M in d)||!z(W))return!1}return!0}function lC(d,p,y){if(typeof d!="function")throw new bo(s);return Pu(function(){d.apply(n,y)},p)}function _u(d,p,y,R){var M=-1,z=rh,W=!0,J=d.length,ae=[],xe=p.length;if(!J)return ae;y&&(p=yn(p,Br(y))),R?(z=_v,W=!1):p.length>=o&&(z=gu,W=!1,p=new Sa(p));e:for(;++M<J;){var we=d[M],Re=y==null?we:y(we);if(we=R||we!==0?we:0,W&&Re===Re){for(var je=xe;je--;)if(p[je]===Re)continue e;ae.push(we)}else z(p,Re,R)||ae.push(we)}return ae}var Cs=IC(ii),cC=IC(Fv,!0);function i7(d,p){var y=!0;return Cs(d,function(R,M,z){return y=!!p(R,M,z),y}),y}function wh(d,p,y){for(var R=-1,M=d.length;++R<M;){var z=d[R],W=p(z);if(W!=null&&(J===n?W===W&&!Hr(W):y(W,J)))var J=W,ae=z}return ae}function s7(d,p,y,R){var M=d.length;for(y=pt(y),y<0&&(y=-y>M?0:M+y),R=R===n||R>M?M:pt(R),R<0&&(R+=M),R=y>R?0:RE(R);y<R;)d[y++]=p;return d}function uC(d,p){var y=[];return Cs(d,function(R,M,z){p(R,M,z)&&y.push(R)}),y}function Gn(d,p,y,R,M){var z=-1,W=d.length;for(y||(y=Y7),M||(M=[]);++z<W;){var J=d[z];p>0&&y(J)?p>1?Gn(J,p-1,y,R,M):ws(M,J):R||(M[M.length]=J)}return M}var Lv=NC(),dC=NC(!0);function ii(d,p){return d&&Lv(d,p,Bn)}function Fv(d,p){return d&&dC(d,p,Bn)}function _h(d,p){return xs(p,function(y){return zi(d[y])})}function Ea(d,p){p=Rs(p,d);for(var y=0,R=p.length;d!=null&&y<R;)d=d[ai(p[y++])];return y&&y==R?d:n}function fC(d,p,y){var R=p(d);return ut(d)?R:ws(R,y(d))}function fr(d){return d==null?d===n?Ht:Te:wa&&wa in nn(d)?V7(d):t6(d)}function jv(d,p){return d>p}function a7(d,p){return d!=null&&Qt.call(d,p)}function l7(d,p){return d!=null&&p in nn(d)}function c7(d,p,y){return d>=nr(p,y)&&d<Mn(p,y)}function zv(d,p,y){for(var R=y?_v:rh,M=d[0].length,z=d.length,W=z,J=ge(z),ae=1/0,xe=[];W--;){var we=d[W];W&&p&&(we=yn(we,Br(p))),ae=nr(we.length,ae),J[W]=!y&&(p||M>=120&&we.length>=120)?new Sa(W&&we):n}we=d[0];var Re=-1,je=J[0];e:for(;++Re<M&&xe.length<ae;){var Ye=we[Re],et=p?p(Ye):Ye;if(Ye=y||Ye!==0?Ye:0,!(je?gu(je,et):R(xe,et,y))){for(W=z;--W;){var yt=J[W];if(!(yt?gu(yt,et):R(d[W],et,y)))continue e}je&&je.push(et),xe.push(Ye)}}return xe}function u7(d,p,y,R){return ii(d,function(M,z,W){p(R,y(M),z,W)}),R}function Su(d,p,y){p=Rs(p,d),d=ZC(d,p);var R=d==null?d:d[ai(_o(p))];return R==null?n:zr(R,d,y)}function hC(d){return Sn(d)&&fr(d)==fe}function d7(d){return Sn(d)&&fr(d)==Le}function f7(d){return Sn(d)&&fr(d)==ne}function Cu(d,p,y,R,M){return d===p?!0:d==null||p==null||!Sn(d)&&!Sn(p)?d!==d&&p!==p:h7(d,p,y,R,Cu,M)}function h7(d,p,y,R,M,z){var W=ut(d),J=ut(p),ae=W?ue:rr(d),xe=J?ue:rr(p);ae=ae==fe?Ue:ae,xe=xe==fe?Ue:xe;var we=ae==Ue,Re=xe==Ue,je=ae==xe;if(je&&Ps(d)){if(!Ps(p))return!1;W=!0,we=!1}if(je&&!we)return z||(z=new zo),W||ql(d)?qC(d,p,y,R,M,z):z7(d,p,ae,y,R,M,z);if(!(y&v)){var Ye=we&&Qt.call(d,"__wrapped__"),et=Re&&Qt.call(p,"__wrapped__");if(Ye||et){var yt=Ye?d.value():d,tt=et?p.value():p;return z||(z=new zo),M(yt,tt,y,R,z)}}return je?(z||(z=new zo),B7(d,p,y,R,M,z)):!1}function p7(d){return Sn(d)&&rr(d)==_e}function Bv(d,p,y,R){var M=y.length,z=M,W=!R;if(d==null)return!z;for(d=nn(d);M--;){var J=y[M];if(W&&J[2]?J[1]!==d[J[0]]:!(J[0]in d))return!1}for(;++M<z;){J=y[M];var ae=J[0],xe=d[ae],we=J[1];if(W&&J[2]){if(xe===n&&!(ae in d))return!1}else{var Re=new zo;if(R)var je=R(xe,we,ae,d,p,Re);if(!(je===n?Cu(we,xe,v|b,R,Re):je))return!1}}return!0}function pC(d){if(!wn(d)||X7(d))return!1;var p=zi(d)?p3:Ae;return p.test(Oa(d))}function g7(d){return Sn(d)&&fr(d)==Ke}function m7(d){return Sn(d)&&rr(d)==lt}function v7(d){return Sn(d)&&jh(d.length)&&!!cn[fr(d)]}function gC(d){return typeof d=="function"?d:d==null?Rr:typeof d=="object"?ut(d)?bC(d[0],d[1]):vC(d):LE(d)}function Vv(d){if(!Ou(d))return x3(d);var p=[];for(var y in nn(d))Qt.call(d,y)&&y!="constructor"&&p.push(y);return p}function b7(d){if(!wn(d))return e6(d);var p=Ou(d),y=[];for(var R in d)R=="constructor"&&(p||!Qt.call(d,R))||y.push(R);return y}function Hv(d,p){return d<p}function mC(d,p){var y=-1,R=Cr(d)?ge(d.length):[];return Cs(d,function(M,z,W){R[++y]=p(M,z,W)}),R}function vC(d){var p=ob(d);return p.length==1&&p[0][2]?QC(p[0][0],p[0][1]):function(y){return y===d||Bv(y,d,p)}}function bC(d,p){return sb(d)&&XC(p)?QC(ai(d),p):function(y){var R=mb(y,d);return R===n&&R===p?vb(y,d):Cu(p,R,v|b)}}function Sh(d,p,y,R,M){d!==p&&Lv(p,function(z,W){if(M||(M=new zo),wn(z))y7(d,p,W,y,Sh,R,M);else{var J=R?R(lb(d,W),z,W+"",d,p,M):n;J===n&&(J=z),Iv(d,W,J)}},Er)}function y7(d,p,y,R,M,z,W){var J=lb(d,y),ae=lb(p,y),xe=W.get(ae);if(xe){Iv(d,y,xe);return}var we=z?z(J,ae,y+"",d,p,W):n,Re=we===n;if(Re){var je=ut(ae),Ye=!je&&Ps(ae),et=!je&&!Ye&&ql(ae);we=ae,je||Ye||et?ut(J)?we=J:On(J)?we=Sr(J):Ye?(Re=!1,we=DC(ae,!0)):et?(Re=!1,we=AC(ae,!0)):we=[]:Tu(ae)||Pa(ae)?(we=J,Pa(J)?we=OE(J):(!wn(J)||zi(J))&&(we=KC(ae))):Re=!1}Re&&(W.set(ae,we),M(we,ae,R,z,W),W.delete(ae)),Iv(d,y,we)}function yC(d,p){var y=d.length;if(y)return p+=p<0?y:0,ji(p,y)?d[p]:n}function xC(d,p,y){p.length?p=yn(p,function(z){return ut(z)?function(W){return Ea(W,z.length===1?z[0]:z)}:z}):p=[Rr];var R=-1;p=yn(p,Br(Je()));var M=mC(d,function(z,W,J){var ae=yn(p,function(xe){return xe(z)});return{criteria:ae,index:++R,value:z}});return qF(M,function(z,W){return $7(z,W,y)})}function x7(d,p){return wC(d,p,function(y,R){return vb(d,R)})}function wC(d,p,y){for(var R=-1,M=p.length,z={};++R<M;){var W=p[R],J=Ea(d,W);y(J,W)&&Eu(z,Rs(W,d),J)}return z}function w7(d){return function(p){return Ea(p,d)}}function Wv(d,p,y,R){var M=R?UF:Il,z=-1,W=p.length,J=d;for(d===p&&(p=Sr(p)),y&&(J=yn(d,Br(y)));++z<W;)for(var ae=0,xe=p[z],we=y?y(xe):xe;(ae=M(J,we,ae,R))>-1;)J!==d&&hh.call(J,ae,1),hh.call(d,ae,1);return d}function _C(d,p){for(var y=d?p.length:0,R=y-1;y--;){var M=p[y];if(y==R||M!==z){var z=M;ji(M)?hh.call(d,M,1):Yv(d,M)}}return d}function Uv(d,p){return d+mh(nC()*(p-d+1))}function _7(d,p,y,R){for(var M=-1,z=Mn(gh((p-d)/(y||1)),0),W=ge(z);z--;)W[R?z:++M]=d,d+=y;return W}function qv(d,p){var y="";if(!d||p<1||p>q)return y;do p%2&&(y+=d),p=mh(p/2),p&&(d+=d);while(p);return y}function St(d,p){return cb(JC(d,p,Rr),d+"")}function S7(d){return iC(Gl(d))}function C7(d,p){var y=Gl(d);return kh(y,Ca(p,0,y.length))}function Eu(d,p,y,R){if(!wn(d))return d;p=Rs(p,d);for(var M=-1,z=p.length,W=z-1,J=d;J!=null&&++M<z;){var ae=ai(p[M]),xe=y;if(ae==="__proto__"||ae==="constructor"||ae==="prototype")return d;if(M!=W){var we=J[ae];xe=R?R(we,ae,J):n,xe===n&&(xe=wn(we)?we:ji(p[M+1])?[]:{})}wu(J,ae,xe),J=J[ae]}return d}var SC=vh?function(d,p){return vh.set(d,p),d}:Rr,E7=ph?function(d,p){return ph(d,"toString",{configurable:!0,enumerable:!1,value:yb(p),writable:!0})}:Rr;function R7(d){return kh(Gl(d))}function wo(d,p,y){var R=-1,M=d.length;p<0&&(p=-p>M?0:M+p),y=y>M?M:y,y<0&&(y+=M),M=p>y?0:y-p>>>0,p>>>=0;for(var z=ge(M);++R<M;)z[R]=d[R+p];return z}function O7(d,p){var y;return Cs(d,function(R,M,z){return y=p(R,M,z),!y}),!!y}function Ch(d,p,y){var R=0,M=d==null?R:d.length;if(typeof p=="number"&&p===p&&M<=N){for(;R<M;){var z=R+M>>>1,W=d[z];W!==null&&!Hr(W)&&(y?W<=p:W<p)?R=z+1:M=z}return M}return Gv(d,p,Rr,y)}function Gv(d,p,y,R){var M=0,z=d==null?0:d.length;if(z===0)return 0;p=y(p);for(var W=p!==p,J=p===null,ae=Hr(p),xe=p===n;M<z;){var we=mh((M+z)/2),Re=y(d[we]),je=Re!==n,Ye=Re===null,et=Re===Re,yt=Hr(Re);if(W)var tt=R||et;else xe?tt=et&&(R||je):J?tt=et&&je&&(R||!Ye):ae?tt=et&&je&&!Ye&&(R||!yt):Ye||yt?tt=!1:tt=R?Re<=p:Re<p;tt?M=we+1:z=we}return nr(z,X)}function CC(d,p){for(var y=-1,R=d.length,M=0,z=[];++y<R;){var W=d[y],J=p?p(W):W;if(!y||!Bo(J,ae)){var ae=J;z[M++]=W===0?0:W}}return z}function EC(d){return typeof d=="number"?d:Hr(d)?T:+d}function Vr(d){if(typeof d=="string")return d;if(ut(d))return yn(d,Vr)+"";if(Hr(d))return rC?rC.call(d):"";var p=d+"";return p=="0"&&1/d==-G?"-0":p}function Es(d,p,y){var R=-1,M=rh,z=d.length,W=!0,J=[],ae=J;if(y)W=!1,M=_v;else if(z>=o){var xe=p?null:F7(d);if(xe)return ih(xe);W=!1,M=gu,ae=new Sa}else ae=p?[]:J;e:for(;++R<z;){var we=d[R],Re=p?p(we):we;if(we=y||we!==0?we:0,W&&Re===Re){for(var je=ae.length;je--;)if(ae[je]===Re)continue e;p&&ae.push(Re),J.push(we)}else M(ae,Re,y)||(ae!==J&&ae.push(Re),J.push(we))}return J}function Yv(d,p){return p=Rs(p,d),d=ZC(d,p),d==null||delete d[ai(_o(p))]}function RC(d,p,y,R){return Eu(d,p,y(Ea(d,p)),R)}function Eh(d,p,y,R){for(var M=d.length,z=R?M:-1;(R?z--:++z<M)&&p(d[z],z,d););return y?wo(d,R?0:z,R?z+1:M):wo(d,R?z+1:0,R?M:z)}function OC(d,p){var y=d;return y instanceof kt&&(y=y.value()),Sv(p,function(R,M){return M.func.apply(M.thisArg,ws([R],M.args))},y)}function Kv(d,p,y){var R=d.length;if(R<2)return R?Es(d[0]):[];for(var M=-1,z=ge(R);++M<R;)for(var W=d[M],J=-1;++J<R;)J!=M&&(z[M]=_u(z[M]||W,d[J],p,y));return Es(Gn(z,1),p,y)}function PC(d,p,y){for(var R=-1,M=d.length,z=p.length,W={};++R<M;){var J=R<z?p[R]:n;y(W,d[R],J)}return W}function Xv(d){return On(d)?d:[]}function Qv(d){return typeof d=="function"?d:Rr}function Rs(d,p){return ut(d)?d:sb(d,p)?[d]:rE(Ut(d))}var P7=St;function Os(d,p,y){var R=d.length;return y=y===n?R:y,!p&&y>=R?d:wo(d,p,y)}var TC=g3||function(d){return qn.clearTimeout(d)};function DC(d,p){if(p)return d.slice();var y=d.length,R=QS?QS(y):new d.constructor(y);return d.copy(R),R}function Jv(d){var p=new d.constructor(d.byteLength);return new dh(p).set(new dh(d)),p}function T7(d,p){var y=p?Jv(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.byteLength)}function D7(d){var p=new d.constructor(d.source,qe.exec(d));return p.lastIndex=d.lastIndex,p}function A7(d){return xu?nn(xu.call(d)):{}}function AC(d,p){var y=p?Jv(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.length)}function $C(d,p){if(d!==p){var y=d!==n,R=d===null,M=d===d,z=Hr(d),W=p!==n,J=p===null,ae=p===p,xe=Hr(p);if(!J&&!xe&&!z&&d>p||z&&W&&ae&&!J&&!xe||R&&W&&ae||!y&&ae||!M)return 1;if(!R&&!z&&!xe&&d<p||xe&&y&&M&&!R&&!z||J&&y&&M||!W&&M||!ae)return-1}return 0}function $7(d,p,y){for(var R=-1,M=d.criteria,z=p.criteria,W=M.length,J=y.length;++R<W;){var ae=$C(M[R],z[R]);if(ae){if(R>=J)return ae;var xe=y[R];return ae*(xe=="desc"?-1:1)}}return d.index-p.index}function kC(d,p,y,R){for(var M=-1,z=d.length,W=y.length,J=-1,ae=p.length,xe=Mn(z-W,0),we=ge(ae+xe),Re=!R;++J<ae;)we[J]=p[J];for(;++M<W;)(Re||M<z)&&(we[y[M]]=d[M]);for(;xe--;)we[J++]=d[M++];return we}function MC(d,p,y,R){for(var M=-1,z=d.length,W=-1,J=y.length,ae=-1,xe=p.length,we=Mn(z-J,0),Re=ge(we+xe),je=!R;++M<we;)Re[M]=d[M];for(var Ye=M;++ae<xe;)Re[Ye+ae]=p[ae];for(;++W<J;)(je||M<z)&&(Re[Ye+y[W]]=d[M++]);return Re}function Sr(d,p){var y=-1,R=d.length;for(p||(p=ge(R));++y<R;)p[y]=d[y];return p}function si(d,p,y,R){var M=!y;y||(y={});for(var z=-1,W=p.length;++z<W;){var J=p[z],ae=R?R(y[J],d[J],J,y,d):n;ae===n&&(ae=d[J]),M?Ni(y,J,ae):wu(y,J,ae)}return y}function k7(d,p){return si(d,ib(d),p)}function M7(d,p){return si(d,GC(d),p)}function Rh(d,p){return function(y,R){var M=ut(y)?jF:n7,z=p?p():{};return M(y,d,Je(R,2),z)}}function Hl(d){return St(function(p,y){var R=-1,M=y.length,z=M>1?y[M-1]:n,W=M>2?y[2]:n;for(z=d.length>3&&typeof z=="function"?(M--,z):n,W&&hr(y[0],y[1],W)&&(z=M<3?n:z,M=1),p=nn(p);++R<M;){var J=y[R];J&&d(p,J,R,z)}return p})}function IC(d,p){return function(y,R){if(y==null)return y;if(!Cr(y))return d(y,R);for(var M=y.length,z=p?M:-1,W=nn(y);(p?z--:++z<M)&&R(W[z],z,W)!==!1;);return y}}function NC(d){return function(p,y,R){for(var M=-1,z=nn(p),W=R(p),J=W.length;J--;){var ae=W[d?J:++M];if(y(z[ae],ae,z)===!1)break}return p}}function I7(d,p,y){var R=p&w,M=Ru(d);function z(){var W=this&&this!==qn&&this instanceof z?M:d;return W.apply(R?y:this,arguments)}return z}function LC(d){return function(p){p=Ut(p);var y=Nl(p)?jo(p):n,R=y?y[0]:p.charAt(0),M=y?Os(y,1).join(""):p.slice(1);return R[d]()+M}}function Wl(d){return function(p){return Sv(IE(ME(p).replace(EF,"")),d,"")}}function Ru(d){return function(){var p=arguments;switch(p.length){case 0:return new d;case 1:return new d(p[0]);case 2:return new d(p[0],p[1]);case 3:return new d(p[0],p[1],p[2]);case 4:return new d(p[0],p[1],p[2],p[3]);case 5:return new d(p[0],p[1],p[2],p[3],p[4]);case 6:return new d(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new d(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var y=Vl(d.prototype),R=d.apply(y,p);return wn(R)?R:y}}function N7(d,p,y){var R=Ru(d);function M(){for(var z=arguments.length,W=ge(z),J=z,ae=Ul(M);J--;)W[J]=arguments[J];var xe=z<3&&W[0]!==ae&&W[z-1]!==ae?[]:_s(W,ae);if(z-=xe.length,z<y)return VC(d,p,Oh,M.placeholder,n,W,xe,n,n,y-z);var we=this&&this!==qn&&this instanceof M?R:d;return zr(we,this,W)}return M}function FC(d){return function(p,y,R){var M=nn(p);if(!Cr(p)){var z=Je(y,3);p=Bn(p),y=function(J){return z(M[J],J,M)}}var W=d(p,y,R);return W>-1?M[z?p[W]:W]:n}}function jC(d){return Fi(function(p){var y=p.length,R=y,M=yo.prototype.thru;for(d&&p.reverse();R--;){var z=p[R];if(typeof z!="function")throw new bo(s);if(M&&!W&&Ah(z)=="wrapper")var W=new yo([],!0)}for(R=W?R:y;++R<y;){z=p[R];var J=Ah(z),ae=J=="wrapper"?rb(z):n;ae&&ab(ae[0])&&ae[1]==(A|S|E|k)&&!ae[4].length&&ae[9]==1?W=W[Ah(ae[0])].apply(W,ae[3]):W=z.length==1&&ab(z)?W[J]():W.thru(z)}return function(){var xe=arguments,we=xe[0];if(W&&xe.length==1&&ut(we))return W.plant(we).value();for(var Re=0,je=y?p[Re].apply(this,xe):we;++Re<y;)je=p[Re].call(this,je);return je}})}function Oh(d,p,y,R,M,z,W,J,ae,xe){var we=p&A,Re=p&w,je=p&x,Ye=p&(S|C),et=p&I,yt=je?n:Ru(d);function tt(){for(var Pt=arguments.length,Mt=ge(Pt),Wr=Pt;Wr--;)Mt[Wr]=arguments[Wr];if(Ye)var pr=Ul(tt),Ur=YF(Mt,pr);if(R&&(Mt=kC(Mt,R,M,Ye)),z&&(Mt=MC(Mt,z,W,Ye)),Pt-=Ur,Ye&&Pt<xe){var Pn=_s(Mt,pr);return VC(d,p,Oh,tt.placeholder,y,Mt,Pn,J,ae,xe-Pt)}var Vo=Re?y:this,Vi=je?Vo[d]:d;return Pt=Mt.length,J?Mt=n6(Mt,J):et&&Pt>1&&Mt.reverse(),we&&ae<Pt&&(Mt.length=ae),this&&this!==qn&&this instanceof tt&&(Vi=yt||Ru(Vi)),Vi.apply(Vo,Mt)}return tt}function zC(d,p){return function(y,R){return u7(y,d,p(R),{})}}function Ph(d,p){return function(y,R){var M;if(y===n&&R===n)return p;if(y!==n&&(M=y),R!==n){if(M===n)return R;typeof y=="string"||typeof R=="string"?(y=Vr(y),R=Vr(R)):(y=EC(y),R=EC(R)),M=d(y,R)}return M}}function Zv(d){return Fi(function(p){return p=yn(p,Br(Je())),St(function(y){var R=this;return d(p,function(M){return zr(M,R,y)})})})}function Th(d,p){p=p===n?" ":Vr(p);var y=p.length;if(y<2)return y?qv(p,d):p;var R=qv(p,gh(d/Ll(p)));return Nl(p)?Os(jo(R),0,d).join(""):R.slice(0,d)}function L7(d,p,y,R){var M=p&w,z=Ru(d);function W(){for(var J=-1,ae=arguments.length,xe=-1,we=R.length,Re=ge(we+ae),je=this&&this!==qn&&this instanceof W?z:d;++xe<we;)Re[xe]=R[xe];for(;ae--;)Re[xe++]=arguments[++J];return zr(je,M?y:this,Re)}return W}function BC(d){return function(p,y,R){return R&&typeof R!="number"&&hr(p,y,R)&&(y=R=n),p=Bi(p),y===n?(y=p,p=0):y=Bi(y),R=R===n?p<y?1:-1:Bi(R),_7(p,y,R,d)}}function Dh(d){return function(p,y){return typeof p=="string"&&typeof y=="string"||(p=So(p),y=So(y)),d(p,y)}}function VC(d,p,y,R,M,z,W,J,ae,xe){var we=p&S,Re=we?W:n,je=we?n:W,Ye=we?z:n,et=we?n:z;p|=we?E:P,p&=~(we?P:E),p&_||(p&=~(w|x));var yt=[d,p,M,Ye,Re,et,je,J,ae,xe],tt=y.apply(n,yt);return ab(d)&&eE(tt,yt),tt.placeholder=R,tE(tt,d,p)}function eb(d){var p=kn[d];return function(y,R){if(y=So(y),R=R==null?0:nr(pt(R),292),R&&tC(y)){var M=(Ut(y)+"e").split("e"),z=p(M[0]+"e"+(+M[1]+R));return M=(Ut(z)+"e").split("e"),+(M[0]+"e"+(+M[1]-R))}return p(y)}}var F7=zl&&1/ih(new zl([,-0]))[1]==G?function(d){return new zl(d)}:_b;function HC(d){return function(p){var y=rr(p);return y==_e?Dv(p):y==lt?t3(p):GF(p,d(p))}}function Li(d,p,y,R,M,z,W,J){var ae=p&x;if(!ae&&typeof d!="function")throw new bo(s);var xe=R?R.length:0;if(xe||(p&=~(E|P),R=M=n),W=W===n?W:Mn(pt(W),0),J=J===n?J:pt(J),xe-=M?M.length:0,p&P){var we=R,Re=M;R=M=n}var je=ae?n:rb(d),Ye=[d,p,y,R,M,we,Re,z,W,J];if(je&&Z7(Ye,je),d=Ye[0],p=Ye[1],y=Ye[2],R=Ye[3],M=Ye[4],J=Ye[9]=Ye[9]===n?ae?0:d.length:Mn(Ye[9]-xe,0),!J&&p&(S|C)&&(p&=~(S|C)),!p||p==w)var et=I7(d,p,y);else p==S||p==C?et=N7(d,p,J):(p==E||p==(w|E))&&!M.length?et=L7(d,p,y,R):et=Oh.apply(n,Ye);var yt=je?SC:eE;return tE(yt(et,Ye),d,p)}function WC(d,p,y,R){return d===n||Bo(d,jl[y])&&!Qt.call(R,y)?p:d}function UC(d,p,y,R,M,z){return wn(d)&&wn(p)&&(z.set(p,d),Sh(d,p,n,UC,z),z.delete(p)),d}function j7(d){return Tu(d)?n:d}function qC(d,p,y,R,M,z){var W=y&v,J=d.length,ae=p.length;if(J!=ae&&!(W&&ae>J))return!1;var xe=z.get(d),we=z.get(p);if(xe&&we)return xe==p&&we==d;var Re=-1,je=!0,Ye=y&b?new Sa:n;for(z.set(d,p),z.set(p,d);++Re<J;){var et=d[Re],yt=p[Re];if(R)var tt=W?R(yt,et,Re,p,d,z):R(et,yt,Re,d,p,z);if(tt!==n){if(tt)continue;je=!1;break}if(Ye){if(!Cv(p,function(Pt,Mt){if(!gu(Ye,Mt)&&(et===Pt||M(et,Pt,y,R,z)))return Ye.push(Mt)})){je=!1;break}}else if(!(et===yt||M(et,yt,y,R,z))){je=!1;break}}return z.delete(d),z.delete(p),je}function z7(d,p,y,R,M,z,W){switch(y){case Ge:if(d.byteLength!=p.byteLength||d.byteOffset!=p.byteOffset)return!1;d=d.buffer,p=p.buffer;case Le:return!(d.byteLength!=p.byteLength||!z(new dh(d),new dh(p)));case se:case ne:case Pe:return Bo(+d,+p);case ye:return d.name==p.name&&d.message==p.message;case Ke:case It:return d==p+"";case _e:var J=Dv;case lt:var ae=R&v;if(J||(J=ih),d.size!=p.size&&!ae)return!1;var xe=W.get(d);if(xe)return xe==p;R|=b,W.set(d,p);var we=qC(J(d),J(p),R,M,z,W);return W.delete(d),we;case At:if(xu)return xu.call(d)==xu.call(p)}return!1}function B7(d,p,y,R,M,z){var W=y&v,J=tb(d),ae=J.length,xe=tb(p),we=xe.length;if(ae!=we&&!W)return!1;for(var Re=ae;Re--;){var je=J[Re];if(!(W?je in p:Qt.call(p,je)))return!1}var Ye=z.get(d),et=z.get(p);if(Ye&&et)return Ye==p&&et==d;var yt=!0;z.set(d,p),z.set(p,d);for(var tt=W;++Re<ae;){je=J[Re];var Pt=d[je],Mt=p[je];if(R)var Wr=W?R(Mt,Pt,je,p,d,z):R(Pt,Mt,je,d,p,z);if(!(Wr===n?Pt===Mt||M(Pt,Mt,y,R,z):Wr)){yt=!1;break}tt||(tt=je=="constructor")}if(yt&&!tt){var pr=d.constructor,Ur=p.constructor;pr!=Ur&&"constructor"in d&&"constructor"in p&&!(typeof pr=="function"&&pr instanceof pr&&typeof Ur=="function"&&Ur instanceof Ur)&&(yt=!1)}return z.delete(d),z.delete(p),yt}function Fi(d){return cb(JC(d,n,aE),d+"")}function tb(d){return fC(d,Bn,ib)}function nb(d){return fC(d,Er,GC)}var rb=vh?function(d){return vh.get(d)}:_b;function Ah(d){for(var p=d.name+"",y=Bl[p],R=Qt.call(Bl,p)?y.length:0;R--;){var M=y[R],z=M.func;if(z==null||z==d)return M.name}return p}function Ul(d){var p=Qt.call(F,"placeholder")?F:d;return p.placeholder}function Je(){var d=F.iteratee||xb;return d=d===xb?gC:d,arguments.length?d(arguments[0],arguments[1]):d}function $h(d,p){var y=d.__data__;return K7(p)?y[typeof p=="string"?"string":"hash"]:y.map}function ob(d){for(var p=Bn(d),y=p.length;y--;){var R=p[y],M=d[R];p[y]=[R,M,XC(M)]}return p}function Ra(d,p){var y=JF(d,p);return pC(y)?y:n}function V7(d){var p=Qt.call(d,wa),y=d[wa];try{d[wa]=n;var R=!0}catch{}var M=ch.call(d);return R&&(p?d[wa]=y:delete d[wa]),M}var ib=$v?function(d){return d==null?[]:(d=nn(d),xs($v(d),function(p){return ZS.call(d,p)}))}:Sb,GC=$v?function(d){for(var p=[];d;)ws(p,ib(d)),d=fh(d);return p}:Sb,rr=fr;(kv&&rr(new kv(new ArrayBuffer(1)))!=Ge||vu&&rr(new vu)!=_e||Mv&&rr(Mv.resolve())!=Be||zl&&rr(new zl)!=lt||bu&&rr(new bu)!=de)&&(rr=function(d){var p=fr(d),y=p==Ue?d.constructor:n,R=y?Oa(y):"";if(R)switch(R){case C3:return Ge;case E3:return _e;case R3:return Be;case O3:return lt;case P3:return de}return p});function H7(d,p,y){for(var R=-1,M=y.length;++R<M;){var z=y[R],W=z.size;switch(z.type){case"drop":d+=W;break;case"dropRight":p-=W;break;case"take":p=nr(p,d+W);break;case"takeRight":d=Mn(d,p-W);break}}return{start:d,end:p}}function W7(d){var p=d.match(ys);return p?p[1].split(D):[]}function YC(d,p,y){p=Rs(p,d);for(var R=-1,M=p.length,z=!1;++R<M;){var W=ai(p[R]);if(!(z=d!=null&&y(d,W)))break;d=d[W]}return z||++R!=M?z:(M=d==null?0:d.length,!!M&&jh(M)&&ji(W,M)&&(ut(d)||Pa(d)))}function U7(d){var p=d.length,y=new d.constructor(p);return p&&typeof d[0]=="string"&&Qt.call(d,"index")&&(y.index=d.index,y.input=d.input),y}function KC(d){return typeof d.constructor=="function"&&!Ou(d)?Vl(fh(d)):{}}function q7(d,p,y){var R=d.constructor;switch(p){case Le:return Jv(d);case se:case ne:return new R(+d);case Ge:return T7(d,y);case Ze:case Wt:case Zt:case Kt:case vn:case ln:case Lt:case tn:case xn:return AC(d,y);case _e:return new R;case Pe:case It:return new R(d);case Ke:return D7(d);case lt:return new R;case At:return A7(d)}}function G7(d,p){var y=p.length;if(!y)return d;var R=y-1;return p[R]=(y>1?"& ":"")+p[R],p=p.join(y>2?", ":" "),d.replace(bs,`{
70
- /* [wrapped with `+p+`] */
71
- `)}function Y7(d){return ut(d)||Pa(d)||!!(eC&&d&&d[eC])}function ji(d,p){var y=typeof d;return p=p??q,!!p&&(y=="number"||y!="symbol"&&me.test(d))&&d>-1&&d%1==0&&d<p}function hr(d,p,y){if(!wn(y))return!1;var R=typeof p;return(R=="number"?Cr(y)&&ji(p,y.length):R=="string"&&p in y)?Bo(y[p],d):!1}function sb(d,p){if(ut(d))return!1;var y=typeof d;return y=="number"||y=="symbol"||y=="boolean"||d==null||Hr(d)?!0:$i.test(d)||!ni.test(d)||p!=null&&d in nn(p)}function K7(d){var p=typeof d;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?d!=="__proto__":d===null}function ab(d){var p=Ah(d),y=F[p];if(typeof y!="function"||!(p in kt.prototype))return!1;if(d===y)return!0;var R=rb(y);return!!R&&d===R[0]}function X7(d){return!!XS&&XS in d}var Q7=ah?zi:Cb;function Ou(d){var p=d&&d.constructor,y=typeof p=="function"&&p.prototype||jl;return d===y}function XC(d){return d===d&&!wn(d)}function QC(d,p){return function(y){return y==null?!1:y[d]===p&&(p!==n||d in nn(y))}}function J7(d){var p=Lh(d,function(R){return y.size===c&&y.clear(),R}),y=p.cache;return p}function Z7(d,p){var y=d[1],R=p[1],M=y|R,z=M<(w|x|A),W=R==A&&y==S||R==A&&y==k&&d[7].length<=p[8]||R==(A|k)&&p[7].length<=p[8]&&y==S;if(!(z||W))return d;R&w&&(d[2]=p[2],M|=y&w?0:_);var J=p[3];if(J){var ae=d[3];d[3]=ae?kC(ae,J,p[4]):J,d[4]=ae?_s(d[3],u):p[4]}return J=p[5],J&&(ae=d[5],d[5]=ae?MC(ae,J,p[6]):J,d[6]=ae?_s(d[5],u):p[6]),J=p[7],J&&(d[7]=J),R&A&&(d[8]=d[8]==null?p[8]:nr(d[8],p[8])),d[9]==null&&(d[9]=p[9]),d[0]=p[0],d[1]=M,d}function e6(d){var p=[];if(d!=null)for(var y in nn(d))p.push(y);return p}function t6(d){return ch.call(d)}function JC(d,p,y){return p=Mn(p===n?d.length-1:p,0),function(){for(var R=arguments,M=-1,z=Mn(R.length-p,0),W=ge(z);++M<z;)W[M]=R[p+M];M=-1;for(var J=ge(p+1);++M<p;)J[M]=R[M];return J[p]=y(W),zr(d,this,J)}}function ZC(d,p){return p.length<2?d:Ea(d,wo(p,0,-1))}function n6(d,p){for(var y=d.length,R=nr(p.length,y),M=Sr(d);R--;){var z=p[R];d[R]=ji(z,y)?M[z]:n}return d}function lb(d,p){if(!(p==="constructor"&&typeof d[p]=="function")&&p!="__proto__")return d[p]}var eE=nE(SC),Pu=v3||function(d,p){return qn.setTimeout(d,p)},cb=nE(E7);function tE(d,p,y){var R=p+"";return cb(d,G7(R,r6(W7(R),y)))}function nE(d){var p=0,y=0;return function(){var R=w3(),M=Q-(R-y);if(y=R,M>0){if(++p>=j)return arguments[0]}else p=0;return d.apply(n,arguments)}}function kh(d,p){var y=-1,R=d.length,M=R-1;for(p=p===n?R:p;++y<p;){var z=Uv(y,M),W=d[z];d[z]=d[y],d[y]=W}return d.length=p,d}var rE=J7(function(d){var p=[];return d.charCodeAt(0)===46&&p.push(""),d.replace(vs,function(y,R,M,z){p.push(M?z.replace(Oe,"$1"):R||y)}),p});function ai(d){if(typeof d=="string"||Hr(d))return d;var p=d+"";return p=="0"&&1/d==-G?"-0":p}function Oa(d){if(d!=null){try{return lh.call(d)}catch{}try{return d+""}catch{}}return""}function r6(d,p){return vo(ie,function(y){var R="_."+y[0];p&y[1]&&!rh(d,R)&&d.push(R)}),d.sort()}function oE(d){if(d instanceof kt)return d.clone();var p=new yo(d.__wrapped__,d.__chain__);return p.__actions__=Sr(d.__actions__),p.__index__=d.__index__,p.__values__=d.__values__,p}function o6(d,p,y){(y?hr(d,p,y):p===n)?p=1:p=Mn(pt(p),0);var R=d==null?0:d.length;if(!R||p<1)return[];for(var M=0,z=0,W=ge(gh(R/p));M<R;)W[z++]=wo(d,M,M+=p);return W}function i6(d){for(var p=-1,y=d==null?0:d.length,R=0,M=[];++p<y;){var z=d[p];z&&(M[R++]=z)}return M}function s6(){var d=arguments.length;if(!d)return[];for(var p=ge(d-1),y=arguments[0],R=d;R--;)p[R-1]=arguments[R];return ws(ut(y)?Sr(y):[y],Gn(p,1))}var a6=St(function(d,p){return On(d)?_u(d,Gn(p,1,On,!0)):[]}),l6=St(function(d,p){var y=_o(p);return On(y)&&(y=n),On(d)?_u(d,Gn(p,1,On,!0),Je(y,2)):[]}),c6=St(function(d,p){var y=_o(p);return On(y)&&(y=n),On(d)?_u(d,Gn(p,1,On,!0),n,y):[]});function u6(d,p,y){var R=d==null?0:d.length;return R?(p=y||p===n?1:pt(p),wo(d,p<0?0:p,R)):[]}function d6(d,p,y){var R=d==null?0:d.length;return R?(p=y||p===n?1:pt(p),p=R-p,wo(d,0,p<0?0:p)):[]}function f6(d,p){return d&&d.length?Eh(d,Je(p,3),!0,!0):[]}function h6(d,p){return d&&d.length?Eh(d,Je(p,3),!0):[]}function p6(d,p,y,R){var M=d==null?0:d.length;return M?(y&&typeof y!="number"&&hr(d,p,y)&&(y=0,R=M),s7(d,p,y,R)):[]}function iE(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=y==null?0:pt(y);return M<0&&(M=Mn(R+M,0)),oh(d,Je(p,3),M)}function sE(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=R-1;return y!==n&&(M=pt(y),M=y<0?Mn(R+M,0):nr(M,R-1)),oh(d,Je(p,3),M,!0)}function aE(d){var p=d==null?0:d.length;return p?Gn(d,1):[]}function g6(d){var p=d==null?0:d.length;return p?Gn(d,G):[]}function m6(d,p){var y=d==null?0:d.length;return y?(p=p===n?1:pt(p),Gn(d,p)):[]}function v6(d){for(var p=-1,y=d==null?0:d.length,R={};++p<y;){var M=d[p];R[M[0]]=M[1]}return R}function lE(d){return d&&d.length?d[0]:n}function b6(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=y==null?0:pt(y);return M<0&&(M=Mn(R+M,0)),Il(d,p,M)}function y6(d){var p=d==null?0:d.length;return p?wo(d,0,-1):[]}var x6=St(function(d){var p=yn(d,Xv);return p.length&&p[0]===d[0]?zv(p):[]}),w6=St(function(d){var p=_o(d),y=yn(d,Xv);return p===_o(y)?p=n:y.pop(),y.length&&y[0]===d[0]?zv(y,Je(p,2)):[]}),_6=St(function(d){var p=_o(d),y=yn(d,Xv);return p=typeof p=="function"?p:n,p&&y.pop(),y.length&&y[0]===d[0]?zv(y,n,p):[]});function S6(d,p){return d==null?"":y3.call(d,p)}function _o(d){var p=d==null?0:d.length;return p?d[p-1]:n}function C6(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=R;return y!==n&&(M=pt(y),M=M<0?Mn(R+M,0):nr(M,R-1)),p===p?r3(d,p,M):oh(d,VS,M,!0)}function E6(d,p){return d&&d.length?yC(d,pt(p)):n}var R6=St(cE);function cE(d,p){return d&&d.length&&p&&p.length?Wv(d,p):d}function O6(d,p,y){return d&&d.length&&p&&p.length?Wv(d,p,Je(y,2)):d}function P6(d,p,y){return d&&d.length&&p&&p.length?Wv(d,p,n,y):d}var T6=Fi(function(d,p){var y=d==null?0:d.length,R=Nv(d,p);return _C(d,yn(p,function(M){return ji(M,y)?+M:M}).sort($C)),R});function D6(d,p){var y=[];if(!(d&&d.length))return y;var R=-1,M=[],z=d.length;for(p=Je(p,3);++R<z;){var W=d[R];p(W,R,d)&&(y.push(W),M.push(R))}return _C(d,M),y}function ub(d){return d==null?d:S3.call(d)}function A6(d,p,y){var R=d==null?0:d.length;return R?(y&&typeof y!="number"&&hr(d,p,y)?(p=0,y=R):(p=p==null?0:pt(p),y=y===n?R:pt(y)),wo(d,p,y)):[]}function $6(d,p){return Ch(d,p)}function k6(d,p,y){return Gv(d,p,Je(y,2))}function M6(d,p){var y=d==null?0:d.length;if(y){var R=Ch(d,p);if(R<y&&Bo(d[R],p))return R}return-1}function I6(d,p){return Ch(d,p,!0)}function N6(d,p,y){return Gv(d,p,Je(y,2),!0)}function L6(d,p){var y=d==null?0:d.length;if(y){var R=Ch(d,p,!0)-1;if(Bo(d[R],p))return R}return-1}function F6(d){return d&&d.length?CC(d):[]}function j6(d,p){return d&&d.length?CC(d,Je(p,2)):[]}function z6(d){var p=d==null?0:d.length;return p?wo(d,1,p):[]}function B6(d,p,y){return d&&d.length?(p=y||p===n?1:pt(p),wo(d,0,p<0?0:p)):[]}function V6(d,p,y){var R=d==null?0:d.length;return R?(p=y||p===n?1:pt(p),p=R-p,wo(d,p<0?0:p,R)):[]}function H6(d,p){return d&&d.length?Eh(d,Je(p,3),!1,!0):[]}function W6(d,p){return d&&d.length?Eh(d,Je(p,3)):[]}var U6=St(function(d){return Es(Gn(d,1,On,!0))}),q6=St(function(d){var p=_o(d);return On(p)&&(p=n),Es(Gn(d,1,On,!0),Je(p,2))}),G6=St(function(d){var p=_o(d);return p=typeof p=="function"?p:n,Es(Gn(d,1,On,!0),n,p)});function Y6(d){return d&&d.length?Es(d):[]}function K6(d,p){return d&&d.length?Es(d,Je(p,2)):[]}function X6(d,p){return p=typeof p=="function"?p:n,d&&d.length?Es(d,n,p):[]}function db(d){if(!(d&&d.length))return[];var p=0;return d=xs(d,function(y){if(On(y))return p=Mn(y.length,p),!0}),Pv(p,function(y){return yn(d,Ev(y))})}function uE(d,p){if(!(d&&d.length))return[];var y=db(d);return p==null?y:yn(y,function(R){return zr(p,n,R)})}var Q6=St(function(d,p){return On(d)?_u(d,p):[]}),J6=St(function(d){return Kv(xs(d,On))}),Z6=St(function(d){var p=_o(d);return On(p)&&(p=n),Kv(xs(d,On),Je(p,2))}),e9=St(function(d){var p=_o(d);return p=typeof p=="function"?p:n,Kv(xs(d,On),n,p)}),t9=St(db);function n9(d,p){return PC(d||[],p||[],wu)}function r9(d,p){return PC(d||[],p||[],Eu)}var o9=St(function(d){var p=d.length,y=p>1?d[p-1]:n;return y=typeof y=="function"?(d.pop(),y):n,uE(d,y)});function dE(d){var p=F(d);return p.__chain__=!0,p}function i9(d,p){return p(d),d}function Mh(d,p){return p(d)}var s9=Fi(function(d){var p=d.length,y=p?d[0]:0,R=this.__wrapped__,M=function(z){return Nv(z,d)};return p>1||this.__actions__.length||!(R instanceof kt)||!ji(y)?this.thru(M):(R=R.slice(y,+y+(p?1:0)),R.__actions__.push({func:Mh,args:[M],thisArg:n}),new yo(R,this.__chain__).thru(function(z){return p&&!z.length&&z.push(n),z}))});function a9(){return dE(this)}function l9(){return new yo(this.value(),this.__chain__)}function c9(){this.__values__===n&&(this.__values__=EE(this.value()));var d=this.__index__>=this.__values__.length,p=d?n:this.__values__[this.__index__++];return{done:d,value:p}}function u9(){return this}function d9(d){for(var p,y=this;y instanceof yh;){var R=oE(y);R.__index__=0,R.__values__=n,p?M.__wrapped__=R:p=R;var M=R;y=y.__wrapped__}return M.__wrapped__=d,p}function f9(){var d=this.__wrapped__;if(d instanceof kt){var p=d;return this.__actions__.length&&(p=new kt(this)),p=p.reverse(),p.__actions__.push({func:Mh,args:[ub],thisArg:n}),new yo(p,this.__chain__)}return this.thru(ub)}function h9(){return OC(this.__wrapped__,this.__actions__)}var p9=Rh(function(d,p,y){Qt.call(d,y)?++d[y]:Ni(d,y,1)});function g9(d,p,y){var R=ut(d)?zS:i7;return y&&hr(d,p,y)&&(p=n),R(d,Je(p,3))}function m9(d,p){var y=ut(d)?xs:uC;return y(d,Je(p,3))}var v9=FC(iE),b9=FC(sE);function y9(d,p){return Gn(Ih(d,p),1)}function x9(d,p){return Gn(Ih(d,p),G)}function w9(d,p,y){return y=y===n?1:pt(y),Gn(Ih(d,p),y)}function fE(d,p){var y=ut(d)?vo:Cs;return y(d,Je(p,3))}function hE(d,p){var y=ut(d)?zF:cC;return y(d,Je(p,3))}var _9=Rh(function(d,p,y){Qt.call(d,y)?d[y].push(p):Ni(d,y,[p])});function S9(d,p,y,R){d=Cr(d)?d:Gl(d),y=y&&!R?pt(y):0;var M=d.length;return y<0&&(y=Mn(M+y,0)),zh(d)?y<=M&&d.indexOf(p,y)>-1:!!M&&Il(d,p,y)>-1}var C9=St(function(d,p,y){var R=-1,M=typeof p=="function",z=Cr(d)?ge(d.length):[];return Cs(d,function(W){z[++R]=M?zr(p,W,y):Su(W,p,y)}),z}),E9=Rh(function(d,p,y){Ni(d,y,p)});function Ih(d,p){var y=ut(d)?yn:mC;return y(d,Je(p,3))}function R9(d,p,y,R){return d==null?[]:(ut(p)||(p=p==null?[]:[p]),y=R?n:y,ut(y)||(y=y==null?[]:[y]),xC(d,p,y))}var O9=Rh(function(d,p,y){d[y?0:1].push(p)},function(){return[[],[]]});function P9(d,p,y){var R=ut(d)?Sv:WS,M=arguments.length<3;return R(d,Je(p,4),y,M,Cs)}function T9(d,p,y){var R=ut(d)?BF:WS,M=arguments.length<3;return R(d,Je(p,4),y,M,cC)}function D9(d,p){var y=ut(d)?xs:uC;return y(d,Fh(Je(p,3)))}function A9(d){var p=ut(d)?iC:S7;return p(d)}function $9(d,p,y){(y?hr(d,p,y):p===n)?p=1:p=pt(p);var R=ut(d)?e7:C7;return R(d,p)}function k9(d){var p=ut(d)?t7:R7;return p(d)}function M9(d){if(d==null)return 0;if(Cr(d))return zh(d)?Ll(d):d.length;var p=rr(d);return p==_e||p==lt?d.size:Vv(d).length}function I9(d,p,y){var R=ut(d)?Cv:O7;return y&&hr(d,p,y)&&(p=n),R(d,Je(p,3))}var N9=St(function(d,p){if(d==null)return[];var y=p.length;return y>1&&hr(d,p[0],p[1])?p=[]:y>2&&hr(p[0],p[1],p[2])&&(p=[p[0]]),xC(d,Gn(p,1),[])}),Nh=m3||function(){return qn.Date.now()};function L9(d,p){if(typeof p!="function")throw new bo(s);return d=pt(d),function(){if(--d<1)return p.apply(this,arguments)}}function pE(d,p,y){return p=y?n:p,p=d&&p==null?d.length:p,Li(d,A,n,n,n,n,p)}function gE(d,p){var y;if(typeof p!="function")throw new bo(s);return d=pt(d),function(){return--d>0&&(y=p.apply(this,arguments)),d<=1&&(p=n),y}}var fb=St(function(d,p,y){var R=w;if(y.length){var M=_s(y,Ul(fb));R|=E}return Li(d,R,p,y,M)}),mE=St(function(d,p,y){var R=w|x;if(y.length){var M=_s(y,Ul(mE));R|=E}return Li(p,R,d,y,M)});function vE(d,p,y){p=y?n:p;var R=Li(d,S,n,n,n,n,n,p);return R.placeholder=vE.placeholder,R}function bE(d,p,y){p=y?n:p;var R=Li(d,C,n,n,n,n,n,p);return R.placeholder=bE.placeholder,R}function yE(d,p,y){var R,M,z,W,J,ae,xe=0,we=!1,Re=!1,je=!0;if(typeof d!="function")throw new bo(s);p=So(p)||0,wn(y)&&(we=!!y.leading,Re="maxWait"in y,z=Re?Mn(So(y.maxWait)||0,p):z,je="trailing"in y?!!y.trailing:je);function Ye(Pn){var Vo=R,Vi=M;return R=M=n,xe=Pn,W=d.apply(Vi,Vo),W}function et(Pn){return xe=Pn,J=Pu(Pt,p),we?Ye(Pn):W}function yt(Pn){var Vo=Pn-ae,Vi=Pn-xe,FE=p-Vo;return Re?nr(FE,z-Vi):FE}function tt(Pn){var Vo=Pn-ae,Vi=Pn-xe;return ae===n||Vo>=p||Vo<0||Re&&Vi>=z}function Pt(){var Pn=Nh();if(tt(Pn))return Mt(Pn);J=Pu(Pt,yt(Pn))}function Mt(Pn){return J=n,je&&R?Ye(Pn):(R=M=n,W)}function Wr(){J!==n&&TC(J),xe=0,R=ae=M=J=n}function pr(){return J===n?W:Mt(Nh())}function Ur(){var Pn=Nh(),Vo=tt(Pn);if(R=arguments,M=this,ae=Pn,Vo){if(J===n)return et(ae);if(Re)return TC(J),J=Pu(Pt,p),Ye(ae)}return J===n&&(J=Pu(Pt,p)),W}return Ur.cancel=Wr,Ur.flush=pr,Ur}var F9=St(function(d,p){return lC(d,1,p)}),j9=St(function(d,p,y){return lC(d,So(p)||0,y)});function z9(d){return Li(d,I)}function Lh(d,p){if(typeof d!="function"||p!=null&&typeof p!="function")throw new bo(s);var y=function(){var R=arguments,M=p?p.apply(this,R):R[0],z=y.cache;if(z.has(M))return z.get(M);var W=d.apply(this,R);return y.cache=z.set(M,W)||z,W};return y.cache=new(Lh.Cache||Ii),y}Lh.Cache=Ii;function Fh(d){if(typeof d!="function")throw new bo(s);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}function B9(d){return gE(2,d)}var V9=P7(function(d,p){p=p.length==1&&ut(p[0])?yn(p[0],Br(Je())):yn(Gn(p,1),Br(Je()));var y=p.length;return St(function(R){for(var M=-1,z=nr(R.length,y);++M<z;)R[M]=p[M].call(this,R[M]);return zr(d,this,R)})}),hb=St(function(d,p){var y=_s(p,Ul(hb));return Li(d,E,n,p,y)}),xE=St(function(d,p){var y=_s(p,Ul(xE));return Li(d,P,n,p,y)}),H9=Fi(function(d,p){return Li(d,k,n,n,n,p)});function W9(d,p){if(typeof d!="function")throw new bo(s);return p=p===n?p:pt(p),St(d,p)}function U9(d,p){if(typeof d!="function")throw new bo(s);return p=p==null?0:Mn(pt(p),0),St(function(y){var R=y[p],M=Os(y,0,p);return R&&ws(M,R),zr(d,this,M)})}function q9(d,p,y){var R=!0,M=!0;if(typeof d!="function")throw new bo(s);return wn(y)&&(R="leading"in y?!!y.leading:R,M="trailing"in y?!!y.trailing:M),yE(d,p,{leading:R,maxWait:p,trailing:M})}function G9(d){return pE(d,1)}function Y9(d,p){return hb(Qv(p),d)}function K9(){if(!arguments.length)return[];var d=arguments[0];return ut(d)?d:[d]}function X9(d){return xo(d,g)}function Q9(d,p){return p=typeof p=="function"?p:n,xo(d,g,p)}function J9(d){return xo(d,f|g)}function Z9(d,p){return p=typeof p=="function"?p:n,xo(d,f|g,p)}function e4(d,p){return p==null||aC(d,p,Bn(p))}function Bo(d,p){return d===p||d!==d&&p!==p}var t4=Dh(jv),n4=Dh(function(d,p){return d>=p}),Pa=hC(function(){return arguments}())?hC:function(d){return Sn(d)&&Qt.call(d,"callee")&&!ZS.call(d,"callee")},ut=ge.isArray,r4=MS?Br(MS):d7;function Cr(d){return d!=null&&jh(d.length)&&!zi(d)}function On(d){return Sn(d)&&Cr(d)}function o4(d){return d===!0||d===!1||Sn(d)&&fr(d)==se}var Ps=b3||Cb,i4=IS?Br(IS):f7;function s4(d){return Sn(d)&&d.nodeType===1&&!Tu(d)}function a4(d){if(d==null)return!0;if(Cr(d)&&(ut(d)||typeof d=="string"||typeof d.splice=="function"||Ps(d)||ql(d)||Pa(d)))return!d.length;var p=rr(d);if(p==_e||p==lt)return!d.size;if(Ou(d))return!Vv(d).length;for(var y in d)if(Qt.call(d,y))return!1;return!0}function l4(d,p){return Cu(d,p)}function c4(d,p,y){y=typeof y=="function"?y:n;var R=y?y(d,p):n;return R===n?Cu(d,p,n,y):!!R}function pb(d){if(!Sn(d))return!1;var p=fr(d);return p==ye||p==le||typeof d.message=="string"&&typeof d.name=="string"&&!Tu(d)}function u4(d){return typeof d=="number"&&tC(d)}function zi(d){if(!wn(d))return!1;var p=fr(d);return p==Y||p==be||p==pe||p==Ie}function wE(d){return typeof d=="number"&&d==pt(d)}function jh(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=q}function wn(d){var p=typeof d;return d!=null&&(p=="object"||p=="function")}function Sn(d){return d!=null&&typeof d=="object"}var _E=NS?Br(NS):p7;function d4(d,p){return d===p||Bv(d,p,ob(p))}function f4(d,p,y){return y=typeof y=="function"?y:n,Bv(d,p,ob(p),y)}function h4(d){return SE(d)&&d!=+d}function p4(d){if(Q7(d))throw new ct(i);return pC(d)}function g4(d){return d===null}function m4(d){return d==null}function SE(d){return typeof d=="number"||Sn(d)&&fr(d)==Pe}function Tu(d){if(!Sn(d)||fr(d)!=Ue)return!1;var p=fh(d);if(p===null)return!0;var y=Qt.call(p,"constructor")&&p.constructor;return typeof y=="function"&&y instanceof y&&lh.call(y)==f3}var gb=LS?Br(LS):g7;function v4(d){return wE(d)&&d>=-q&&d<=q}var CE=FS?Br(FS):m7;function zh(d){return typeof d=="string"||!ut(d)&&Sn(d)&&fr(d)==It}function Hr(d){return typeof d=="symbol"||Sn(d)&&fr(d)==At}var ql=jS?Br(jS):v7;function b4(d){return d===n}function y4(d){return Sn(d)&&rr(d)==de}function x4(d){return Sn(d)&&fr(d)==Ee}var w4=Dh(Hv),_4=Dh(function(d,p){return d<=p});function EE(d){if(!d)return[];if(Cr(d))return zh(d)?jo(d):Sr(d);if(mu&&d[mu])return e3(d[mu]());var p=rr(d),y=p==_e?Dv:p==lt?ih:Gl;return y(d)}function Bi(d){if(!d)return d===0?d:0;if(d=So(d),d===G||d===-G){var p=d<0?-1:1;return p*K}return d===d?d:0}function pt(d){var p=Bi(d),y=p%1;return p===p?y?p-y:p:0}function RE(d){return d?Ca(pt(d),0,V):0}function So(d){if(typeof d=="number")return d;if(Hr(d))return T;if(wn(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=wn(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=US(d);var y=Fe.test(d);return y||U.test(d)?LF(d.slice(2),y?2:8):ze.test(d)?T:+d}function OE(d){return si(d,Er(d))}function S4(d){return d?Ca(pt(d),-q,q):d===0?d:0}function Ut(d){return d==null?"":Vr(d)}var C4=Hl(function(d,p){if(Ou(p)||Cr(p)){si(p,Bn(p),d);return}for(var y in p)Qt.call(p,y)&&wu(d,y,p[y])}),PE=Hl(function(d,p){si(p,Er(p),d)}),Bh=Hl(function(d,p,y,R){si(p,Er(p),d,R)}),E4=Hl(function(d,p,y,R){si(p,Bn(p),d,R)}),R4=Fi(Nv);function O4(d,p){var y=Vl(d);return p==null?y:sC(y,p)}var P4=St(function(d,p){d=nn(d);var y=-1,R=p.length,M=R>2?p[2]:n;for(M&&hr(p[0],p[1],M)&&(R=1);++y<R;)for(var z=p[y],W=Er(z),J=-1,ae=W.length;++J<ae;){var xe=W[J],we=d[xe];(we===n||Bo(we,jl[xe])&&!Qt.call(d,xe))&&(d[xe]=z[xe])}return d}),T4=St(function(d){return d.push(n,UC),zr(TE,n,d)});function D4(d,p){return BS(d,Je(p,3),ii)}function A4(d,p){return BS(d,Je(p,3),Fv)}function $4(d,p){return d==null?d:Lv(d,Je(p,3),Er)}function k4(d,p){return d==null?d:dC(d,Je(p,3),Er)}function M4(d,p){return d&&ii(d,Je(p,3))}function I4(d,p){return d&&Fv(d,Je(p,3))}function N4(d){return d==null?[]:_h(d,Bn(d))}function L4(d){return d==null?[]:_h(d,Er(d))}function mb(d,p,y){var R=d==null?n:Ea(d,p);return R===n?y:R}function F4(d,p){return d!=null&&YC(d,p,a7)}function vb(d,p){return d!=null&&YC(d,p,l7)}var j4=zC(function(d,p,y){p!=null&&typeof p.toString!="function"&&(p=ch.call(p)),d[p]=y},yb(Rr)),z4=zC(function(d,p,y){p!=null&&typeof p.toString!="function"&&(p=ch.call(p)),Qt.call(d,p)?d[p].push(y):d[p]=[y]},Je),B4=St(Su);function Bn(d){return Cr(d)?oC(d):Vv(d)}function Er(d){return Cr(d)?oC(d,!0):b7(d)}function V4(d,p){var y={};return p=Je(p,3),ii(d,function(R,M,z){Ni(y,p(R,M,z),R)}),y}function H4(d,p){var y={};return p=Je(p,3),ii(d,function(R,M,z){Ni(y,M,p(R,M,z))}),y}var W4=Hl(function(d,p,y){Sh(d,p,y)}),TE=Hl(function(d,p,y,R){Sh(d,p,y,R)}),U4=Fi(function(d,p){var y={};if(d==null)return y;var R=!1;p=yn(p,function(z){return z=Rs(z,d),R||(R=z.length>1),z}),si(d,nb(d),y),R&&(y=xo(y,f|h|g,j7));for(var M=p.length;M--;)Yv(y,p[M]);return y});function q4(d,p){return DE(d,Fh(Je(p)))}var G4=Fi(function(d,p){return d==null?{}:x7(d,p)});function DE(d,p){if(d==null)return{};var y=yn(nb(d),function(R){return[R]});return p=Je(p),wC(d,y,function(R,M){return p(R,M[0])})}function Y4(d,p,y){p=Rs(p,d);var R=-1,M=p.length;for(M||(M=1,d=n);++R<M;){var z=d==null?n:d[ai(p[R])];z===n&&(R=M,z=y),d=zi(z)?z.call(d):z}return d}function K4(d,p,y){return d==null?d:Eu(d,p,y)}function X4(d,p,y,R){return R=typeof R=="function"?R:n,d==null?d:Eu(d,p,y,R)}var AE=HC(Bn),$E=HC(Er);function Q4(d,p,y){var R=ut(d),M=R||Ps(d)||ql(d);if(p=Je(p,4),y==null){var z=d&&d.constructor;M?y=R?new z:[]:wn(d)?y=zi(z)?Vl(fh(d)):{}:y={}}return(M?vo:ii)(d,function(W,J,ae){return p(y,W,J,ae)}),y}function J4(d,p){return d==null?!0:Yv(d,p)}function Z4(d,p,y){return d==null?d:RC(d,p,Qv(y))}function e8(d,p,y,R){return R=typeof R=="function"?R:n,d==null?d:RC(d,p,Qv(y),R)}function Gl(d){return d==null?[]:Tv(d,Bn(d))}function t8(d){return d==null?[]:Tv(d,Er(d))}function n8(d,p,y){return y===n&&(y=p,p=n),y!==n&&(y=So(y),y=y===y?y:0),p!==n&&(p=So(p),p=p===p?p:0),Ca(So(d),p,y)}function r8(d,p,y){return p=Bi(p),y===n?(y=p,p=0):y=Bi(y),d=So(d),c7(d,p,y)}function o8(d,p,y){if(y&&typeof y!="boolean"&&hr(d,p,y)&&(p=y=n),y===n&&(typeof p=="boolean"?(y=p,p=n):typeof d=="boolean"&&(y=d,d=n)),d===n&&p===n?(d=0,p=1):(d=Bi(d),p===n?(p=d,d=0):p=Bi(p)),d>p){var R=d;d=p,p=R}if(y||d%1||p%1){var M=nC();return nr(d+M*(p-d+NF("1e-"+((M+"").length-1))),p)}return Uv(d,p)}var i8=Wl(function(d,p,y){return p=p.toLowerCase(),d+(y?kE(p):p)});function kE(d){return bb(Ut(d).toLowerCase())}function ME(d){return d=Ut(d),d&&d.replace($e,KF).replace(RF,"")}function s8(d,p,y){d=Ut(d),p=Vr(p);var R=d.length;y=y===n?R:Ca(pt(y),0,R);var M=y;return y-=p.length,y>=0&&d.slice(y,M)==p}function a8(d){return d=Ut(d),d&&Lo.test(d)?d.replace(bt,XF):d}function l8(d){return d=Ut(d),d&&ki.test(d)?d.replace(ri,"\\$&"):d}var c8=Wl(function(d,p,y){return d+(y?"-":"")+p.toLowerCase()}),u8=Wl(function(d,p,y){return d+(y?" ":"")+p.toLowerCase()}),d8=LC("toLowerCase");function f8(d,p,y){d=Ut(d),p=pt(p);var R=p?Ll(d):0;if(!p||R>=p)return d;var M=(p-R)/2;return Th(mh(M),y)+d+Th(gh(M),y)}function h8(d,p,y){d=Ut(d),p=pt(p);var R=p?Ll(d):0;return p&&R<p?d+Th(p-R,y):d}function p8(d,p,y){d=Ut(d),p=pt(p);var R=p?Ll(d):0;return p&&R<p?Th(p-R,y)+d:d}function g8(d,p,y){return y||p==null?p=0:p&&(p=+p),_3(Ut(d).replace(jn,""),p||0)}function m8(d,p,y){return(y?hr(d,p,y):p===n)?p=1:p=pt(p),qv(Ut(d),p)}function v8(){var d=arguments,p=Ut(d[0]);return d.length<3?p:p.replace(d[1],d[2])}var b8=Wl(function(d,p,y){return d+(y?"_":"")+p.toLowerCase()});function y8(d,p,y){return y&&typeof y!="number"&&hr(d,p,y)&&(p=y=n),y=y===n?V:y>>>0,y?(d=Ut(d),d&&(typeof p=="string"||p!=null&&!gb(p))&&(p=Vr(p),!p&&Nl(d))?Os(jo(d),0,y):d.split(p,y)):[]}var x8=Wl(function(d,p,y){return d+(y?" ":"")+bb(p)});function w8(d,p,y){return d=Ut(d),y=y==null?0:Ca(pt(y),0,d.length),p=Vr(p),d.slice(y,y+p.length)==p}function _8(d,p,y){var R=F.templateSettings;y&&hr(d,p,y)&&(p=n),d=Ut(d),p=Bh({},p,R,WC);var M=Bh({},p.imports,R.imports,WC),z=Bn(M),W=Tv(M,z),J,ae,xe=0,we=p.interpolate||st,Re="__p += '",je=Av((p.escape||st).source+"|"+we.source+"|"+(we===Ai?He:st).source+"|"+(p.evaluate||st).source+"|$","g"),Ye="//# sourceURL="+(Qt.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++AF+"]")+`
72
- `;d.replace(je,function(tt,Pt,Mt,Wr,pr,Ur){return Mt||(Mt=Wr),Re+=d.slice(xe,Ur).replace(bn,QF),Pt&&(J=!0,Re+=`' +
73
- __e(`+Pt+`) +
74
- '`),pr&&(ae=!0,Re+=`';
75
- `+pr+`;
76
- __p += '`),Mt&&(Re+=`' +
77
- ((__t = (`+Mt+`)) == null ? '' : __t) +
78
- '`),xe=Ur+tt.length,tt}),Re+=`';
79
- `;var et=Qt.call(p,"variable")&&p.variable;if(!et)Re=`with (obj) {
80
- `+Re+`
81
- }
82
- `;else if(ce.test(et))throw new ct(a);Re=(ae?Re.replace(nt,""):Re).replace(ht,"$1").replace($t,"$1;"),Re="function("+(et||"obj")+`) {
83
- `+(et?"":`obj || (obj = {});
84
- `)+"var __t, __p = ''"+(J?", __e = _.escape":"")+(ae?`, __j = Array.prototype.join;
85
- function print() { __p += __j.call(arguments, '') }
86
- `:`;
87
- `)+Re+`return __p
88
- }`;var yt=NE(function(){return jt(z,Ye+"return "+Re).apply(n,W)});if(yt.source=Re,pb(yt))throw yt;return yt}function S8(d){return Ut(d).toLowerCase()}function C8(d){return Ut(d).toUpperCase()}function E8(d,p,y){if(d=Ut(d),d&&(y||p===n))return US(d);if(!d||!(p=Vr(p)))return d;var R=jo(d),M=jo(p),z=qS(R,M),W=GS(R,M)+1;return Os(R,z,W).join("")}function R8(d,p,y){if(d=Ut(d),d&&(y||p===n))return d.slice(0,KS(d)+1);if(!d||!(p=Vr(p)))return d;var R=jo(d),M=GS(R,jo(p))+1;return Os(R,0,M).join("")}function O8(d,p,y){if(d=Ut(d),d&&(y||p===n))return d.replace(jn,"");if(!d||!(p=Vr(p)))return d;var R=jo(d),M=qS(R,jo(p));return Os(R,M).join("")}function P8(d,p){var y=$,R=L;if(wn(p)){var M="separator"in p?p.separator:M;y="length"in p?pt(p.length):y,R="omission"in p?Vr(p.omission):R}d=Ut(d);var z=d.length;if(Nl(d)){var W=jo(d);z=W.length}if(y>=z)return d;var J=y-Ll(R);if(J<1)return R;var ae=W?Os(W,0,J).join(""):d.slice(0,J);if(M===n)return ae+R;if(W&&(J+=ae.length-J),gb(M)){if(d.slice(J).search(M)){var xe,we=ae;for(M.global||(M=Av(M.source,Ut(qe.exec(M))+"g")),M.lastIndex=0;xe=M.exec(we);)var Re=xe.index;ae=ae.slice(0,Re===n?J:Re)}}else if(d.indexOf(Vr(M),J)!=J){var je=ae.lastIndexOf(M);je>-1&&(ae=ae.slice(0,je))}return ae+R}function T8(d){return d=Ut(d),d&&Rn.test(d)?d.replace(Xt,o3):d}var D8=Wl(function(d,p,y){return d+(y?" ":"")+p.toUpperCase()}),bb=LC("toUpperCase");function IE(d,p,y){return d=Ut(d),p=y?n:p,p===n?ZF(d)?a3(d):WF(d):d.match(p)||[]}var NE=St(function(d,p){try{return zr(d,n,p)}catch(y){return pb(y)?y:new ct(y)}}),A8=Fi(function(d,p){return vo(p,function(y){y=ai(y),Ni(d,y,fb(d[y],d))}),d});function $8(d){var p=d==null?0:d.length,y=Je();return d=p?yn(d,function(R){if(typeof R[1]!="function")throw new bo(s);return[y(R[0]),R[1]]}):[],St(function(R){for(var M=-1;++M<p;){var z=d[M];if(zr(z[0],this,R))return zr(z[1],this,R)}})}function k8(d){return o7(xo(d,f))}function yb(d){return function(){return d}}function M8(d,p){return d==null||d!==d?p:d}var I8=jC(),N8=jC(!0);function Rr(d){return d}function xb(d){return gC(typeof d=="function"?d:xo(d,f))}function L8(d){return vC(xo(d,f))}function F8(d,p){return bC(d,xo(p,f))}var j8=St(function(d,p){return function(y){return Su(y,d,p)}}),z8=St(function(d,p){return function(y){return Su(d,y,p)}});function wb(d,p,y){var R=Bn(p),M=_h(p,R);y==null&&!(wn(p)&&(M.length||!R.length))&&(y=p,p=d,d=this,M=_h(p,Bn(p)));var z=!(wn(y)&&"chain"in y)||!!y.chain,W=zi(d);return vo(M,function(J){var ae=p[J];d[J]=ae,W&&(d.prototype[J]=function(){var xe=this.__chain__;if(z||xe){var we=d(this.__wrapped__),Re=we.__actions__=Sr(this.__actions__);return Re.push({func:ae,args:arguments,thisArg:d}),we.__chain__=xe,we}return ae.apply(d,ws([this.value()],arguments))})}),d}function B8(){return qn._===this&&(qn._=h3),this}function _b(){}function V8(d){return d=pt(d),St(function(p){return yC(p,d)})}var H8=Zv(yn),W8=Zv(zS),U8=Zv(Cv);function LE(d){return sb(d)?Ev(ai(d)):w7(d)}function q8(d){return function(p){return d==null?n:Ea(d,p)}}var G8=BC(),Y8=BC(!0);function Sb(){return[]}function Cb(){return!1}function K8(){return{}}function X8(){return""}function Q8(){return!0}function J8(d,p){if(d=pt(d),d<1||d>q)return[];var y=V,R=nr(d,V);p=Je(p),d-=V;for(var M=Pv(R,p);++y<d;)p(y);return M}function Z8(d){return ut(d)?yn(d,ai):Hr(d)?[d]:Sr(rE(Ut(d)))}function ej(d){var p=++d3;return Ut(d)+p}var tj=Ph(function(d,p){return d+p},0),nj=eb("ceil"),rj=Ph(function(d,p){return d/p},1),oj=eb("floor");function ij(d){return d&&d.length?wh(d,Rr,jv):n}function sj(d,p){return d&&d.length?wh(d,Je(p,2),jv):n}function aj(d){return HS(d,Rr)}function lj(d,p){return HS(d,Je(p,2))}function cj(d){return d&&d.length?wh(d,Rr,Hv):n}function uj(d,p){return d&&d.length?wh(d,Je(p,2),Hv):n}var dj=Ph(function(d,p){return d*p},1),fj=eb("round"),hj=Ph(function(d,p){return d-p},0);function pj(d){return d&&d.length?Ov(d,Rr):0}function gj(d,p){return d&&d.length?Ov(d,Je(p,2)):0}return F.after=L9,F.ary=pE,F.assign=C4,F.assignIn=PE,F.assignInWith=Bh,F.assignWith=E4,F.at=R4,F.before=gE,F.bind=fb,F.bindAll=A8,F.bindKey=mE,F.castArray=K9,F.chain=dE,F.chunk=o6,F.compact=i6,F.concat=s6,F.cond=$8,F.conforms=k8,F.constant=yb,F.countBy=p9,F.create=O4,F.curry=vE,F.curryRight=bE,F.debounce=yE,F.defaults=P4,F.defaultsDeep=T4,F.defer=F9,F.delay=j9,F.difference=a6,F.differenceBy=l6,F.differenceWith=c6,F.drop=u6,F.dropRight=d6,F.dropRightWhile=f6,F.dropWhile=h6,F.fill=p6,F.filter=m9,F.flatMap=y9,F.flatMapDeep=x9,F.flatMapDepth=w9,F.flatten=aE,F.flattenDeep=g6,F.flattenDepth=m6,F.flip=z9,F.flow=I8,F.flowRight=N8,F.fromPairs=v6,F.functions=N4,F.functionsIn=L4,F.groupBy=_9,F.initial=y6,F.intersection=x6,F.intersectionBy=w6,F.intersectionWith=_6,F.invert=j4,F.invertBy=z4,F.invokeMap=C9,F.iteratee=xb,F.keyBy=E9,F.keys=Bn,F.keysIn=Er,F.map=Ih,F.mapKeys=V4,F.mapValues=H4,F.matches=L8,F.matchesProperty=F8,F.memoize=Lh,F.merge=W4,F.mergeWith=TE,F.method=j8,F.methodOf=z8,F.mixin=wb,F.negate=Fh,F.nthArg=V8,F.omit=U4,F.omitBy=q4,F.once=B9,F.orderBy=R9,F.over=H8,F.overArgs=V9,F.overEvery=W8,F.overSome=U8,F.partial=hb,F.partialRight=xE,F.partition=O9,F.pick=G4,F.pickBy=DE,F.property=LE,F.propertyOf=q8,F.pull=R6,F.pullAll=cE,F.pullAllBy=O6,F.pullAllWith=P6,F.pullAt=T6,F.range=G8,F.rangeRight=Y8,F.rearg=H9,F.reject=D9,F.remove=D6,F.rest=W9,F.reverse=ub,F.sampleSize=$9,F.set=K4,F.setWith=X4,F.shuffle=k9,F.slice=A6,F.sortBy=N9,F.sortedUniq=F6,F.sortedUniqBy=j6,F.split=y8,F.spread=U9,F.tail=z6,F.take=B6,F.takeRight=V6,F.takeRightWhile=H6,F.takeWhile=W6,F.tap=i9,F.throttle=q9,F.thru=Mh,F.toArray=EE,F.toPairs=AE,F.toPairsIn=$E,F.toPath=Z8,F.toPlainObject=OE,F.transform=Q4,F.unary=G9,F.union=U6,F.unionBy=q6,F.unionWith=G6,F.uniq=Y6,F.uniqBy=K6,F.uniqWith=X6,F.unset=J4,F.unzip=db,F.unzipWith=uE,F.update=Z4,F.updateWith=e8,F.values=Gl,F.valuesIn=t8,F.without=Q6,F.words=IE,F.wrap=Y9,F.xor=J6,F.xorBy=Z6,F.xorWith=e9,F.zip=t9,F.zipObject=n9,F.zipObjectDeep=r9,F.zipWith=o9,F.entries=AE,F.entriesIn=$E,F.extend=PE,F.extendWith=Bh,wb(F,F),F.add=tj,F.attempt=NE,F.camelCase=i8,F.capitalize=kE,F.ceil=nj,F.clamp=n8,F.clone=X9,F.cloneDeep=J9,F.cloneDeepWith=Z9,F.cloneWith=Q9,F.conformsTo=e4,F.deburr=ME,F.defaultTo=M8,F.divide=rj,F.endsWith=s8,F.eq=Bo,F.escape=a8,F.escapeRegExp=l8,F.every=g9,F.find=v9,F.findIndex=iE,F.findKey=D4,F.findLast=b9,F.findLastIndex=sE,F.findLastKey=A4,F.floor=oj,F.forEach=fE,F.forEachRight=hE,F.forIn=$4,F.forInRight=k4,F.forOwn=M4,F.forOwnRight=I4,F.get=mb,F.gt=t4,F.gte=n4,F.has=F4,F.hasIn=vb,F.head=lE,F.identity=Rr,F.includes=S9,F.indexOf=b6,F.inRange=r8,F.invoke=B4,F.isArguments=Pa,F.isArray=ut,F.isArrayBuffer=r4,F.isArrayLike=Cr,F.isArrayLikeObject=On,F.isBoolean=o4,F.isBuffer=Ps,F.isDate=i4,F.isElement=s4,F.isEmpty=a4,F.isEqual=l4,F.isEqualWith=c4,F.isError=pb,F.isFinite=u4,F.isFunction=zi,F.isInteger=wE,F.isLength=jh,F.isMap=_E,F.isMatch=d4,F.isMatchWith=f4,F.isNaN=h4,F.isNative=p4,F.isNil=m4,F.isNull=g4,F.isNumber=SE,F.isObject=wn,F.isObjectLike=Sn,F.isPlainObject=Tu,F.isRegExp=gb,F.isSafeInteger=v4,F.isSet=CE,F.isString=zh,F.isSymbol=Hr,F.isTypedArray=ql,F.isUndefined=b4,F.isWeakMap=y4,F.isWeakSet=x4,F.join=S6,F.kebabCase=c8,F.last=_o,F.lastIndexOf=C6,F.lowerCase=u8,F.lowerFirst=d8,F.lt=w4,F.lte=_4,F.max=ij,F.maxBy=sj,F.mean=aj,F.meanBy=lj,F.min=cj,F.minBy=uj,F.stubArray=Sb,F.stubFalse=Cb,F.stubObject=K8,F.stubString=X8,F.stubTrue=Q8,F.multiply=dj,F.nth=E6,F.noConflict=B8,F.noop=_b,F.now=Nh,F.pad=f8,F.padEnd=h8,F.padStart=p8,F.parseInt=g8,F.random=o8,F.reduce=P9,F.reduceRight=T9,F.repeat=m8,F.replace=v8,F.result=Y4,F.round=fj,F.runInContext=re,F.sample=A9,F.size=M9,F.snakeCase=b8,F.some=I9,F.sortedIndex=$6,F.sortedIndexBy=k6,F.sortedIndexOf=M6,F.sortedLastIndex=I6,F.sortedLastIndexBy=N6,F.sortedLastIndexOf=L6,F.startCase=x8,F.startsWith=w8,F.subtract=hj,F.sum=pj,F.sumBy=gj,F.template=_8,F.times=J8,F.toFinite=Bi,F.toInteger=pt,F.toLength=RE,F.toLower=S8,F.toNumber=So,F.toSafeInteger=S4,F.toString=Ut,F.toUpper=C8,F.trim=E8,F.trimEnd=R8,F.trimStart=O8,F.truncate=P8,F.unescape=T8,F.uniqueId=ej,F.upperCase=D8,F.upperFirst=bb,F.each=fE,F.eachRight=hE,F.first=lE,wb(F,function(){var d={};return ii(F,function(p,y){Qt.call(F.prototype,y)||(d[y]=p)}),d}(),{chain:!1}),F.VERSION=r,vo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){F[d].placeholder=F}),vo(["drop","take"],function(d,p){kt.prototype[d]=function(y){y=y===n?1:Mn(pt(y),0);var R=this.__filtered__&&!p?new kt(this):this.clone();return R.__filtered__?R.__takeCount__=nr(y,R.__takeCount__):R.__views__.push({size:nr(y,V),type:d+(R.__dir__<0?"Right":"")}),R},kt.prototype[d+"Right"]=function(y){return this.reverse()[d](y).reverse()}}),vo(["filter","map","takeWhile"],function(d,p){var y=p+1,R=y==ee||y==Z;kt.prototype[d]=function(M){var z=this.clone();return z.__iteratees__.push({iteratee:Je(M,3),type:y}),z.__filtered__=z.__filtered__||R,z}}),vo(["head","last"],function(d,p){var y="take"+(p?"Right":"");kt.prototype[d]=function(){return this[y](1).value()[0]}}),vo(["initial","tail"],function(d,p){var y="drop"+(p?"":"Right");kt.prototype[d]=function(){return this.__filtered__?new kt(this):this[y](1)}}),kt.prototype.compact=function(){return this.filter(Rr)},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,p){return typeof d=="function"?new kt(this):this.map(function(y){return Su(y,d,p)})}),kt.prototype.reject=function(d){return this.filter(Fh(Je(d)))},kt.prototype.slice=function(d,p){d=pt(d);var y=this;return y.__filtered__&&(d>0||p<0)?new kt(y):(d<0?y=y.takeRight(-d):d&&(y=y.drop(d)),p!==n&&(p=pt(p),y=p<0?y.dropRight(-p):y.take(p-d)),y)},kt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},kt.prototype.toArray=function(){return this.take(V)},ii(kt.prototype,function(d,p){var y=/^(?:filter|find|map|reject)|While$/.test(p),R=/^(?:head|last)$/.test(p),M=F[R?"take"+(p=="last"?"Right":""):p],z=R||/^find/.test(p);M&&(F.prototype[p]=function(){var W=this.__wrapped__,J=R?[1]:arguments,ae=W instanceof kt,xe=J[0],we=ae||ut(W),Re=function(Pt){var Mt=M.apply(F,ws([Pt],J));return R&&je?Mt[0]:Mt};we&&y&&typeof xe=="function"&&xe.length!=1&&(ae=we=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=z&&!je,yt=ae&&!Ye;if(!z&&we){W=yt?W:new kt(this);var tt=d.apply(W,J);return tt.__actions__.push({func:Mh,args:[Re],thisArg:n}),new yo(tt,je)}return et&&yt?d.apply(this,J):(tt=this.thru(Re),et?R?tt.value()[0]:tt.value():tt)})}),vo(["pop","push","shift","sort","splice","unshift"],function(d){var p=sh[d],y=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",R=/^(?:pop|shift)$/.test(d);F.prototype[d]=function(){var M=arguments;if(R&&!this.__chain__){var z=this.value();return p.apply(ut(z)?z:[],M)}return this[y](function(W){return p.apply(ut(W)?W:[],M)})}}),ii(kt.prototype,function(d,p){var y=F[p];if(y){var R=y.name+"";Qt.call(Bl,R)||(Bl[R]=[]),Bl[R].push({name:p,func:y})}}),Bl[Oh(n,x).name]=[{name:"wrapper",func:n}],kt.prototype.clone=T3,kt.prototype.reverse=D3,kt.prototype.value=A3,F.prototype.at=s9,F.prototype.chain=a9,F.prototype.commit=l9,F.prototype.next=c9,F.prototype.plant=d9,F.prototype.reverse=f9,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=h9,F.prototype.first=F.prototype.head,mu&&(F.prototype[mu]=u9),F},Fl=l3();xa?((xa.exports=Fl)._=Fl,xv._=Fl):qn._=Fl}).call(Vs)})(pg,pg.exports);var uc=pg.exports;const ol=nu(uc);function rR({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={}),ww.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 oR(e,t){t&&ww.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const ke=Z2()(sD((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:C0},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=>{ww.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&&uc.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}))},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&&uc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.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&&uc.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&&uc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.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(h=>h.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&&uc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.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);rR({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);oR(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(g=>g.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(g=>g.id===r);if(a){const g=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);g>-1&&((h=a.cards)==null||h.splice(g,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,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,h=0;o==="start"&&(f=0),rR({id:r.id,layouts:s.layouts,minH:10,x:h,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(h=>h.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),oR(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(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,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(g=>g.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.splice(s,1),(h=o.onRemoveCard)==null||h.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)=>{Fz({card:n,dataPoint:r,set:e,get:t})}}}))),co=()=>ke(e=>e.actions);var Tf=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(){}},Hc=typeof window>"u"||"Deno"in window;function Po(){}function jz(e,t){return typeof e=="function"?e(t):e}function R0(e){return typeof e=="number"&&e>=0&&e!==1/0}function hD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function iR(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Cw(s,t.options))return!1}else if(!Ad(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 sR(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Dd(t.options.mutationKey)!==Dd(i))return!1}else if(!Ad(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Cw(e,t){return((t==null?void 0:t.queryKeyHashFn)||Dd)(e)}function Dd(e){return JSON.stringify(e,(t,n)=>P0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Ad(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ad(e[n],t[n])):!1}function pD(e,t){if(e===t)return e;const n=aR(e)&&aR(t);if(n||P0(e)&&P0(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]=pD(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function O0(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function aR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function P0(e){if(!lR(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!lR(n)||!n.hasOwnProperty("isPrototypeOf"))}function lR(e){return Object.prototype.toString.call(e)==="[object Object]"}function zz(e){return new Promise(t=>{setTimeout(t,e)})}function T0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?pD(e,t):t}function Bz(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Vz(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xa,Hs,Cc,I2,Hz=(I2=class extends Tf{constructor(){super();Xe(this,Xa,void 0);Xe(this,Hs,void 0);Xe(this,Cc,void 0);Ve(this,Cc,t=>{if(!Hc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){oe(this,Hs)||this.setEventListener(oe(this,Cc))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Hs))==null||t.call(this),Ve(this,Hs,void 0))}setEventListener(t){var n;Ve(this,Cc,t),(n=oe(this,Hs))==null||n.call(this),Ve(this,Hs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){oe(this,Xa)!==t&&(Ve(this,Xa,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof oe(this,Xa)=="boolean"?oe(this,Xa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Xa=new WeakMap,Hs=new WeakMap,Cc=new WeakMap,I2),gg=new Hz,Ec,Ws,Rc,N2,Wz=(N2=class extends Tf{constructor(){super();Xe(this,Ec,!0);Xe(this,Ws,void 0);Xe(this,Rc,void 0);Ve(this,Rc,t=>{if(!Hc&&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(){oe(this,Ws)||this.setEventListener(oe(this,Rc))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Ws))==null||t.call(this),Ve(this,Ws,void 0))}setEventListener(t){var n;Ve(this,Rc,t),(n=oe(this,Ws))==null||n.call(this),Ve(this,Ws,t(this.setOnline.bind(this)))}setOnline(t){oe(this,Ec)!==t&&(Ve(this,Ec,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return oe(this,Ec)}},Ec=new WeakMap,Ws=new WeakMap,Rc=new WeakMap,N2),mg=new Wz;function Uz(e){return Math.min(1e3*2**e,3e4)}function sm(e){return(e??"online")==="online"?mg.isOnline():!0}var gD=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function kb(e){return e instanceof gD}function mD(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((w,x)=>{i=w,s=x}),l=w=>{var x;r||(g(new gD(w)),(x=e.abort)==null||x.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!gg.isFocused()||e.networkMode!=="always"&&!mg.isOnline(),h=w=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,w),o==null||o(),i(w))},g=w=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,w),o==null||o(),s(w))},v=()=>new Promise(w=>{var x;o=_=>{const S=r||!f();return S&&w(_),S},(x=e.onPause)==null||x.call(e)}).then(()=>{var w;o=void 0,r||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(r)return;let w;try{w=e.fn()}catch(x){w=Promise.reject(x)}Promise.resolve(w).then(h).catch(x=>{var P;if(r)return;const _=e.retry??(Hc?0:3),S=e.retryDelay??Uz,C=typeof S=="function"?S(n,x):S,E=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,x);if(t||!E){g(x);return}n++,(P=e.onFail)==null||P.call(e,n,x),zz(C).then(()=>{if(f())return v()}).then(()=>{t?g(x):b()})})};return sm(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function qz(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let g;t++;try{g=h()}finally{t--,t||c()}return g},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...g)=>{a(()=>{h(...g)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var Xn=qz(),Qa,L2,vD=(L2=class{constructor(){Xe(this,Qa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),R0(this.gcTime)&&Ve(this,Qa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Hc?1/0:5*60*1e3))}clearGcTimeout(){oe(this,Qa)&&(clearTimeout(oe(this,Qa)),Ve(this,Qa,void 0))}},Qa=new WeakMap,L2),Oc,Pc,Eo,Us,Ro,Vn,gf,Ja,Tc,Xp,Go,qi,F2,Gz=(F2=class extends vD{constructor(t){super();Xe(this,Tc);Xe(this,Go);Xe(this,Oc,void 0);Xe(this,Pc,void 0);Xe(this,Eo,void 0);Xe(this,Us,void 0);Xe(this,Ro,void 0);Xe(this,Vn,void 0);Xe(this,gf,void 0);Xe(this,Ja,void 0);Ve(this,Ja,!1),Ve(this,gf,t.defaultOptions),Ct(this,Tc,Xp).call(this,t.options),Ve(this,Vn,[]),Ve(this,Eo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,Oc,t.state||Yz(this.options)),this.state=oe(this,Oc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!oe(this,Vn).length&&this.state.fetchStatus==="idle"&&oe(this,Eo).remove(this)}setData(t,n){const r=T0(this.state.data,t,this.options);return Ct(this,Go,qi).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,Go,qi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=oe(this,Us);return(r=oe(this,Ro))==null||r.cancel(t),n?n.then(Po).catch(Po):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(oe(this,Oc))}isActive(){return oe(this,Vn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||oe(this,Vn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!hD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=oe(this,Vn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,Ro))==null||n.continue()}onOnline(){var n;const t=oe(this,Vn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,Ro))==null||n.continue()}addObserver(t){oe(this,Vn).includes(t)||(oe(this,Vn).push(t),this.clearGcTimeout(),oe(this,Eo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){oe(this,Vn).includes(t)&&(Ve(this,Vn,oe(this,Vn).filter(n=>n!==t)),oe(this,Vn).length||(oe(this,Ro)&&(oe(this,Ja)?oe(this,Ro).cancel({revert:!0}):oe(this,Ro).cancelRetry()),this.scheduleGc()),oe(this,Eo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return oe(this,Vn).length}invalidate(){this.state.isInvalidated||Ct(this,Go,qi).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(oe(this,Us))return(c=oe(this,Ro))==null||c.continueRetry(),oe(this,Us)}if(t&&Ct(this,Tc,Xp).call(this,t),!this.options.queryFn){const g=oe(this,Vn).find(v=>v.options.queryFn);g&&Ct(this,Tc,Xp).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(Ve(this,Ja,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,Ja,!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,Pc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Ct(this,Go,qi).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=g=>{var v,b,w,x;kb(g)&&g.silent||Ct(this,Go,qi).call(this,{type:"error",error:g}),kb(g)||((b=(v=oe(this,Eo).config).onError)==null||b.call(v,g,this),(x=(w=oe(this,Eo).config).onSettled)==null||x.call(w,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Ro,mD({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var v,b,w,x;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(b=(v=oe(this,Eo).config).onSuccess)==null||b.call(v,g,this),(x=(w=oe(this,Eo).config).onSettled)==null||x.call(w,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,v)=>{Ct(this,Go,qi).call(this,{type:"failed",failureCount:g,error:v})},onPause:()=>{Ct(this,Go,qi).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Go,qi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Us,oe(this,Ro).promise),oe(this,Us)}},Oc=new WeakMap,Pc=new WeakMap,Eo=new WeakMap,Us=new WeakMap,Ro=new WeakMap,Vn=new WeakMap,gf=new WeakMap,Ja=new WeakMap,Tc=new WeakSet,Xp=function(t){this.options={...oe(this,gf),...t},this.updateGcTime(this.options.gcTime)},Go=new WeakSet,qi=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:sm(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 kb(o)&&o.revert&&oe(this,Pc)?{...oe(this,Pc),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),Xn.batch(()=>{oe(this,Vn).forEach(r=>{r.onQueryUpdate()}),oe(this,Eo).notify({query:this,type:"updated",action:t})})},F2);function Yz(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 fi,j2,bD=(j2=class extends Tf{constructor(t={}){super();Xe(this,fi,void 0);this.config=t,Ve(this,fi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Cw(o,n);let s=this.get(i);return s||(s=new Gz({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){oe(this,fi).has(t.queryHash)||(oe(this,fi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=oe(this,fi).get(t.queryHash);n&&(t.destroy(),n===t&&oe(this,fi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return oe(this,fi).get(t)}getAll(){return[...oe(this,fi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>iR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>iR(t,r)):n}notify(t){Xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Xn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fi=new WeakMap,j2),hi,mf,Xr,Dc,pi,Ls,z2,Kz=(z2=class extends vD{constructor(t){super();Xe(this,pi);Xe(this,hi,void 0);Xe(this,mf,void 0);Xe(this,Xr,void 0);Xe(this,Dc,void 0);this.mutationId=t.mutationId,Ve(this,mf,t.defaultOptions),Ve(this,Xr,t.mutationCache),Ve(this,hi,[]),this.state=t.state||Xz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...oe(this,mf),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){oe(this,hi).includes(t)||(oe(this,hi).push(t),this.clearGcTimeout(),oe(this,Xr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,hi,oe(this,hi).filter(n=>n!==t)),this.scheduleGc(),oe(this,Xr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){oe(this,hi).length||(this.state.status==="pending"?this.scheduleGc():oe(this,Xr).remove(this))}continue(){var t;return((t=oe(this,Dc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,h,g,v,b,w,x,_,S,C,E,P,A;const n=()=>(Ve(this,Dc,mD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,I)=>{Ct(this,pi,Ls).call(this,{type:"failed",failureCount:k,error:I})},onPause:()=>{Ct(this,pi,Ls).call(this,{type:"pause"})},onContinue:()=>{Ct(this,pi,Ls).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),oe(this,Dc).promise),r=this.state.status==="pending";try{if(!r){Ct(this,pi,Ls).call(this,{type:"pending",variables:t}),await((i=(o=oe(this,Xr).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Ct(this,pi,Ls).call(this,{type:"pending",context:I,variables:t})}const k=await n();return await((c=(l=oe(this,Xr).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,k,t,this.state.context)),await((g=(h=oe(this,Xr).config).onSettled)==null?void 0:g.call(h,k,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,k,null,t,this.state.context)),Ct(this,pi,Ls).call(this,{type:"success",data:k}),k}catch(k){try{throw await((x=(w=oe(this,Xr).config).onError)==null?void 0:x.call(w,k,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,k,t,this.state.context)),await((E=(C=oe(this,Xr).config).onSettled)==null?void 0:E.call(C,void 0,k,this.state.variables,this.state.context,this)),await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,k,t,this.state.context)),k}finally{Ct(this,pi,Ls).call(this,{type:"error",error:k})}}}},hi=new WeakMap,mf=new WeakMap,Xr=new WeakMap,Dc=new WeakMap,pi=new WeakSet,Ls=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:!sm(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),Xn.batch(()=>{oe(this,hi).forEach(r=>{r.onMutationUpdate(t)}),oe(this,Xr).notify({mutation:this,type:"updated",action:t})})},z2);function Xz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Oo,vf,Za,B2,Qz=(B2=class extends Tf{constructor(t={}){super();Xe(this,Oo,void 0);Xe(this,vf,void 0);Xe(this,Za,void 0);this.config=t,Ve(this,Oo,[]),Ve(this,vf,0)}build(t,n,r){const o=new Kz({mutationCache:this,mutationId:++Vh(this,vf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){oe(this,Oo).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,Oo,oe(this,Oo).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Xn.batch(()=>{oe(this,Oo).forEach(t=>{this.remove(t)})})}getAll(){return oe(this,Oo)}find(t){const n={exact:!0,...t};return oe(this,Oo).find(r=>sR(n,r))}findAll(t={}){return oe(this,Oo).filter(n=>sR(t,n))}notify(t){Xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,Za,(oe(this,Za)??Promise.resolve()).then(()=>{const t=oe(this,Oo).filter(n=>n.state.isPaused);return Xn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Po)),Promise.resolve()))}).then(()=>{Ve(this,Za,void 0)})),oe(this,Za)}},Oo=new WeakMap,vf=new WeakMap,Za=new WeakMap,B2);function Jz(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,w,x,_;const o=t.options,i=(w=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:w.direction,s=((x=t.state.data)==null?void 0:x.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}'`))),h=async(S,C,E)=>{if(c)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const P={queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};u(P);const A=await f(P),{maxPages:k}=t.options,I=E?Vz:Bz;return{pages:I(S.pages,A,k),pageParams:I(S.pageParams,C,k)}};let g;if(i&&s.length){const S=i==="backward",C=S?Zz:cR,E={pages:s,pageParams:a},P=C(o,E);g=await h(E,P,S)}else{g=await h(l,a[0]??o.initialPageParam);const S=e??s.length;for(let C=1;C<S;C++){const E=cR(o,g);g=await h(g,E)}}return g};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function cR(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function Zz(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var In,qs,Gs,Ac,$c,Ys,kc,Mc,V2,eB=(V2=class{constructor(e={}){Xe(this,In,void 0);Xe(this,qs,void 0);Xe(this,Gs,void 0);Xe(this,Ac,void 0);Xe(this,$c,void 0);Xe(this,Ys,void 0);Xe(this,kc,void 0);Xe(this,Mc,void 0);Ve(this,In,e.queryCache||new bD),Ve(this,qs,e.mutationCache||new Qz),Ve(this,Gs,e.defaultOptions||{}),Ve(this,Ac,new Map),Ve(this,$c,new Map),Ve(this,Ys,0)}mount(){Vh(this,Ys)._++,oe(this,Ys)===1&&(Ve(this,kc,gg.subscribe(()=>{gg.isFocused()&&(this.resumePausedMutations(),oe(this,In).onFocus())})),Ve(this,Mc,mg.subscribe(()=>{mg.isOnline()&&(this.resumePausedMutations(),oe(this,In).onOnline())})))}unmount(){var e,t;Vh(this,Ys)._--,oe(this,Ys)===0&&((e=oe(this,kc))==null||e.call(this),Ve(this,kc,void 0),(t=oe(this,Mc))==null||t.call(this),Ve(this,Mc,void 0))}isFetching(e){return oe(this,In).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return oe(this,qs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=oe(this,In).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=oe(this,In).find({queryKey:e}),o=r==null?void 0:r.state.data,i=jz(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return oe(this,In).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Xn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=oe(this,In).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=oe(this,In);Xn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=oe(this,In),r={type:"active",...e};return Xn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Xn.batch(()=>oe(this,In).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Po).catch(Po)}invalidateQueries(e={},t={}){return Xn.batch(()=>{if(oe(this,In).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=Xn.batch(()=>oe(this,In).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Po)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Po)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=oe(this,In).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Po).catch(Po)}fetchInfiniteQuery(e){return e.behavior=Jz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Po).catch(Po)}resumePausedMutations(){return oe(this,qs).resumePausedMutations()}getQueryCache(){return oe(this,In)}getMutationCache(){return oe(this,qs)}getDefaultOptions(){return oe(this,Gs)}setDefaultOptions(e){Ve(this,Gs,e)}setQueryDefaults(e,t){oe(this,Ac).set(Dd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...oe(this,Ac).values()];let n={};return t.forEach(r=>{Ad(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){oe(this,$c).set(Dd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...oe(this,$c).values()];let n={};return t.forEach(r=>{Ad(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...oe(this,Gs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Cw(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:{...oe(this,Gs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){oe(this,In).clear(),oe(this,qs).clear()}},In=new WeakMap,qs=new WeakMap,Gs=new WeakMap,Ac=new WeakMap,$c=new WeakMap,Ys=new WeakMap,kc=new WeakMap,Mc=new WeakMap,V2),$r,fn,bf,vr,el,Ic,gi,yf,Nc,Lc,tl,nl,Ks,Fc,rl,ed,xf,D0,wf,A0,_f,$0,Sf,k0,Cf,M0,Ef,I0,Rf,N0,em,yD,H2,tB=(H2=class extends Tf{constructor(t,n){super();Xe(this,rl);Xe(this,xf);Xe(this,wf);Xe(this,_f);Xe(this,Sf);Xe(this,Cf);Xe(this,Ef);Xe(this,Rf);Xe(this,em);Xe(this,$r,void 0);Xe(this,fn,void 0);Xe(this,bf,void 0);Xe(this,vr,void 0);Xe(this,el,void 0);Xe(this,Ic,void 0);Xe(this,gi,void 0);Xe(this,yf,void 0);Xe(this,Nc,void 0);Xe(this,Lc,void 0);Xe(this,tl,void 0);Xe(this,nl,void 0);Xe(this,Ks,void 0);Xe(this,Fc,new Set);this.options=n,Ve(this,$r,t),Ve(this,gi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(oe(this,fn).addObserver(this),uR(oe(this,fn),this.options)?Ct(this,rl,ed).call(this):this.updateResult(),Ct(this,Sf,k0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L0(oe(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L0(oe(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,Cf,M0).call(this),Ct(this,Ef,I0).call(this),oe(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=oe(this,fn);if(this.options=oe(this,$r).defaultQueryOptions(t),O0(r,this.options)||oe(this,$r).getQueryCache().notify({type:"observerOptionsUpdated",query:oe(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,Rf,N0).call(this);const i=this.hasListeners();i&&dR(oe(this,fn),o,this.options,r)&&Ct(this,rl,ed).call(this),this.updateResult(n),i&&(oe(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ct(this,xf,D0).call(this);const s=Ct(this,wf,A0).call(this);i&&(oe(this,fn)!==o||this.options.enabled!==r.enabled||s!==oe(this,Ks))&&Ct(this,_f,$0).call(this,s)}getOptimisticResult(t){const n=oe(this,$r).getQueryCache().build(oe(this,$r),t),r=this.createResult(n,t);return rB(this,r)&&(Ve(this,vr,r),Ve(this,Ic,this.options),Ve(this,el,oe(this,fn).state)),r}getCurrentResult(){return oe(this,vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(oe(this,Fc).add(r),t[r])})}),n}getCurrentQuery(){return oe(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=oe(this,$r).defaultQueryOptions(t),r=oe(this,$r).getQueryCache().build(oe(this,$r),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ct(this,rl,ed).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),oe(this,vr)))}createResult(t,n){var P;const r=oe(this,fn),o=this.options,i=oe(this,vr),s=oe(this,el),a=oe(this,Ic),c=t!==r?t.state:oe(this,bf),{state:u}=t;let{error:f,errorUpdatedAt:h,fetchStatus:g,status:v}=u,b=!1,w;if(n._optimisticResults){const A=this.hasListeners(),k=!A&&uR(t,n),I=A&&dR(t,r,n,o);(k||I)&&(g=sm(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===oe(this,yf))w=oe(this,Nc);else try{Ve(this,yf,n.select),w=n.select(u.data),w=T0(i==null?void 0:i.data,w,n),Ve(this,Nc,w),Ve(this,gi,null)}catch(A){Ve(this,gi,A)}else w=u.data;if(typeof n.placeholderData<"u"&&typeof w>"u"&&v==="pending"){let A;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=i.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((P=oe(this,Lc))==null?void 0:P.state.data,oe(this,Lc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ve(this,gi,null)}catch(k){Ve(this,gi,k)}typeof A<"u"&&(v="success",w=T0(i==null?void 0:i.data,A,n),b=!0)}oe(this,gi)&&(f=oe(this,gi),w=oe(this,Nc),h=Date.now(),v="error");const x=g==="fetching",_=v==="pending",S=v==="error",C=_&&x;return{status:v,fetchStatus:g,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:C,isLoading:C,data:w,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:h,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:x,isRefetching:x&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:b,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:Ew(t,n),refetch:this.refetch}}updateResult(t){const n=oe(this,vr),r=this.createResult(oe(this,fn),this.options);if(Ve(this,el,oe(this,fn).state),Ve(this,Ic,this.options),oe(this,el).data!==void 0&&Ve(this,Lc,oe(this,fn)),O0(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&&!oe(this,Fc).size)return!0;const l=new Set(a??oe(this,Fc));return this.options.throwOnError&&l.add("error"),Object.keys(oe(this,vr)).some(c=>{const u=c;return oe(this,vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ct(this,em,yD).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,Sf,k0).call(this)}},$r=new WeakMap,fn=new WeakMap,bf=new WeakMap,vr=new WeakMap,el=new WeakMap,Ic=new WeakMap,gi=new WeakMap,yf=new WeakMap,Nc=new WeakMap,Lc=new WeakMap,tl=new WeakMap,nl=new WeakMap,Ks=new WeakMap,Fc=new WeakMap,rl=new WeakSet,ed=function(t){Ct(this,Rf,N0).call(this);let n=oe(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Po)),n},xf=new WeakSet,D0=function(){if(Ct(this,Cf,M0).call(this),Hc||oe(this,vr).isStale||!R0(this.options.staleTime))return;const n=hD(oe(this,vr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,tl,setTimeout(()=>{oe(this,vr).isStale||this.updateResult()},n))},wf=new WeakSet,A0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(oe(this,fn)):this.options.refetchInterval)??!1},_f=new WeakSet,$0=function(t){Ct(this,Ef,I0).call(this),Ve(this,Ks,t),!(Hc||this.options.enabled===!1||!R0(oe(this,Ks))||oe(this,Ks)===0)&&Ve(this,nl,setInterval(()=>{(this.options.refetchIntervalInBackground||gg.isFocused())&&Ct(this,rl,ed).call(this)},oe(this,Ks)))},Sf=new WeakSet,k0=function(){Ct(this,xf,D0).call(this),Ct(this,_f,$0).call(this,Ct(this,wf,A0).call(this))},Cf=new WeakSet,M0=function(){oe(this,tl)&&(clearTimeout(oe(this,tl)),Ve(this,tl,void 0))},Ef=new WeakSet,I0=function(){oe(this,nl)&&(clearInterval(oe(this,nl)),Ve(this,nl,void 0))},Rf=new WeakSet,N0=function(){const t=oe(this,$r).getQueryCache().build(oe(this,$r),this.options);if(t===oe(this,fn))return;const n=oe(this,fn);Ve(this,fn,t),Ve(this,bf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},em=new WeakSet,yD=function(t){Xn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(oe(this,vr))}),oe(this,$r).getQueryCache().notify({query:oe(this,fn),type:"observerResultsUpdated"})})},H2);function nB(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function uR(e,t){return nB(e,t)||e.state.dataUpdatedAt>0&&L0(e,t,t.refetchOnMount)}function L0(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ew(e,t)}return!1}function dR(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Ew(e,n)}function Ew(e,t){return e.isStaleByTime(t.staleTime)}function rB(e,t){return!O0(e.getCurrentResult(),t)}var xD=H.createContext(void 0),wD=e=>{const t=H.useContext(xD);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},oB=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),H.createElement(xD.Provider,{value:e},t)),_D=H.createContext(!1),iB=()=>H.useContext(_D);_D.Provider;function sB(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var aB=H.createContext(sB()),lB=()=>H.useContext(aB);function cB(e,t){return typeof e=="function"?e(...t):!!e}var uB=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},dB=e=>{H.useEffect(()=>{e.clearReset()},[e])},fB=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&cB(n,[e.error,r]),hB=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},pB=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,gB=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function mB(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=wD(n),o=iB(),i=lB(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",hB(s),uB(s,i),dB(i);const[a]=H.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(H.useSyncExternalStore(H.useCallback(c=>{const u=o?()=>{}:a.subscribe(Xn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),H.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),pB(s,l))throw gB(s,a,i);if(fB({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Df(e,t){return mB(e,tB,t)}const vB={theme:"system",setTheme:()=>null},SD=m.createContext(vB);function bB({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 O.jsx(SD.Provider,{...r,value:s,children:e})}const CD=()=>{const e=m.useContext(SD);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function yB(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function ED(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function fR(e,t){const n=ED(e);return n==="dark"?ol.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function xB({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=Df({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>yB(e==null?void 0:e.accessToken),enabled:!1}),{theme:c,setTheme:u}=CD(),f=ke(A=>A.dashboard.globalStyle),{setDashboard:h,setSelectedSheetId:g,setStyle:v,setOnSaveFunction:b}=ke(A=>A.actions);ke(A=>A.actions.setCustomCards);const w=ke(A=>A.actions.setFilterValues),x=ke(A=>A.actions.setBookmarkKey),_=ke(A=>A.actions.setAuthToken),S=ke(A=>A.actions.setThemeStyle),C=ke(A=>A.actions.setDashboardTheme),E=ke(A=>A.actions.setOnEvent);m.useEffect(()=>{if(c){const A=ED(c);C(A)}},[c,C]),m.useEffect(()=>{n&&u(n)},[n,u]);function P(){const A=ol.cloneDeep(C0),k=ol.merge(A,f);if(t){const I=ol.merge(k,t),$=fR(c,I);S($),v(I)}else{const I=fR(c,k);S(I),v(C0)}}return m.useEffect(()=>{i&&i.dashboard&&P()},[c,t,f]),m.useEffect(()=>{var L;if(!i||!i.dashboard)return;const A=i.dashboard,k=DL(A.id),I=JSON.parse(localStorage.getItem(k)||"[]"),$=I.find(j=>j.default===!0);if($)h($.template),P(),x($.name),$.filterValues&&w($.filterValues);else{h(A),P();const j=I.find(Q=>(Q==null?void 0:Q.name)==="Original");j?j.template=A:I.push({name:"Original",template:A,default:!1}),localStorage.setItem(k,JSON.stringify(I))}g((L=A.sheets)==null?void 0:L[0].id)},[i,h,g,w,x]),m.useEffect(()=>{r&&b(r),o&&E(o)},[r,b,o,E]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function am({className:e,...t}){return O.jsx("div",{className:Ce("animate-pulse rounded-md bg-muted",e),...t})}const Rw=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Rw.displayName="Card";const lm=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("flex flex-col space-y-1.5 p-6",e),...t}));lm.displayName="CardHeader";const Af=H.forwardRef(({className:e,...t},n)=>O.jsx("h3",{ref:n,className:Ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));Af.displayName="CardTitle";const Ow=H.forwardRef(({className:e,...t},n)=>O.jsx("p",{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));Ow.displayName="CardDescription";const cm=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("px-6 pt-0",e),...t}));cm.displayName="CardContent";const Pw=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("flex items-center p-6 pt-0",e),...t}));Pw.displayName="CardFooter";function RD({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:h,...g}){ke(_=>_.selectedSheetId);const v=ke(_=>_.themeStyle),b=ke(_=>_.isSessionExpired),{isLoading:w,isError:x}=xB({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return w||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?O.jsx(o,{message:"loading"}):O.jsx("div",{className:"flex items-center gap-3",children:O.jsx(am,{className:"h-1 w-full dark:h-[2px]"})})):x?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),O.jsx(i,{})):O.jsx("div",{children:"Error"})):b?(r==null||r({type:"error",message:"Session Expired"}),O.jsx("div",{className:"flex h-full items-center justify-center",children:O.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[O.jsx(Af,{children:"Session Expired"}),O.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):O.jsx("div",{className:Ce("flex h-full flex-col justify-between",v==null?void 0:v.dashboardPanel,e),role:"dashboard-panel",...g})}function he(){return he=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},he.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 Zn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:g,...v}=f,b=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:w},g)}function u(f,h){const g=(h==null?void 0:h[e][l])||a,v=m.useContext(g);if(v)return v;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,wB(o,...t)]}function wB(...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 _B(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cs(...e){return t=>e.forEach(n=>_B(n,t))}function _t(...e){return m.useCallback(cs(...e),e)}const F0=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(CB);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(j0,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(j0,he({},r,{ref:t}),n)});F0.displayName="Slot";const j0=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...EB(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});j0.displayName="SlotClone";const SB=({children:e})=>m.createElement(m.Fragment,null,e);function CB(e){return m.isValidElement(e)&&e.type===SB}function EB(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 um(e){const t=e+"CollectionProvider",[n,r]=Zn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:v,children:b}=g,w=m.useRef(null),x=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:x,collectionRef:w},b)},a=e+"CollectionSlot",l=m.forwardRef((g,v)=>{const{scope:b,children:w}=g,x=i(a,b),_=_t(v,x.collectionRef);return m.createElement(F0,{ref:_},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((g,v)=>{const{scope:b,children:w,...x}=g,_=m.useRef(null),S=_t(v,_),C=i(c,b);return m.useEffect(()=>(C.itemMap.set(_,{ref:_,...x}),()=>void C.itemMap.delete(_))),m.createElement(F0,{[u]:"",ref:S},w)});function h(g){const v=i(e+"CollectionConsumer",g);return m.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((C,E)=>x.indexOf(C.ref.current)-x.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},h,r]}const ur=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},RB=H.useId||(()=>{});let OB=0;function Jo(e){const[t,n]=H.useState(RB());return ur(()=>{e||n(r=>r??String(OB++))},[e]),e||(t?`radix-${t}`:"")}const OD=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(TB);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(z0,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(z0,he({},r,{ref:t}),n)});OD.displayName="Slot";const z0=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...DB(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});z0.displayName="SlotClone";const PB=({children:e})=>m.createElement(m.Fragment,null,e);function TB(e){return m.isValidElement(e)&&e.type===PB}function DB(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 AB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=AB.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?OD:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,he({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function PD(e,t){e&&Mo.flushSync(()=>e.dispatchEvent(t))}function Ln(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 wr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=$B({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Ln(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 $B({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=Ln(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const kB=m.createContext(void 0);function _l(e){const t=m.useContext(kB);return e||t||"ltr"}const Mb="rovingFocusGroup.onEntryFocus",MB={bubbles:!1,cancelable:!0},Tw="RovingFocusGroup",[B0,TD,IB]=um(Tw),[NB,ou]=Zn(Tw,[IB]),[LB,FB]=NB(Tw),jB=m.forwardRef((e,t)=>m.createElement(B0.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(B0.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(zB,he({},e,{ref:t}))))),zB=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),h=_t(t,f),g=_l(i),[v=null,b]=wr({prop:s,defaultProp:a,onChange:l}),[w,x]=m.useState(!1),_=Ln(c),S=TD(n),C=m.useRef(!1),[E,P]=m.useState(0);return m.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Mb,_),()=>A.removeEventListener(Mb,_)},[_]),m.createElement(LB,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(A=>b(A),[b]),onItemShiftTab:m.useCallback(()=>x(!0),[]),onFocusableItemAdd:m.useCallback(()=>P(A=>A+1),[]),onFocusableItemRemove:m.useCallback(()=>P(A=>A-1),[])},m.createElement(Qe.div,he({tabIndex:w||E===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{C.current=!0}),onFocus:Me(e.onFocus,A=>{const k=!C.current;if(A.target===A.currentTarget&&k&&!w){const I=new CustomEvent(Mb,MB);if(A.currentTarget.dispatchEvent(I),!I.defaultPrevented){const $=S().filter(B=>B.focusable),L=$.find(B=>B.active),j=$.find(B=>B.id===v),ee=[L,j,...$].filter(Boolean).map(B=>B.ref.current);DD(ee)}}C.current=!1}),onBlur:Me(e.onBlur,()=>x(!1))})))}),BB="RovingFocusGroupItem",VB=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Jo(),l=i||a,c=FB(BB,n),u=c.currentTabStopId===l,f=TD(n),{onFocusableItemAdd:h,onFocusableItemRemove:g}=c;return m.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),m.createElement(B0.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,he({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Me(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Me(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=UB(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let x=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const _=x.indexOf(v.currentTarget);x=c.loop?qB(x,_+1):x.slice(_+1)}setTimeout(()=>DD(x))}})})))}),HB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WB(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function UB(e,t,n){const r=WB(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HB[r]}function DD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function qB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Dw=jB,Aw=VB;function GB(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const er=e=>{const{present:t,children:n}=e,r=YB(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};er.displayName="Presence";function YB(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=GB(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=qh(r.current);i.current=a==="mounted"?c:"none"},[a]),ur(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,g=qh(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ur(()=>{if(t){const c=f=>{const g=qh(r.current).includes(f.animationName);f.target===t&&g&&Mo.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=qh(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 qh(e){return(e==null?void 0:e.animationName)||"none"}const AD="Tabs",[KB,iye]=Zn(AD,[ou]),$D=ou(),[XB,$w]=KB(AD),QB=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=_l(a),[f,h]=wr({prop:r,onChange:o,defaultProp:i});return m.createElement(XB,{scope:n,baseId:Jo(),value:f,onValueChange:h,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,he({dir:u,"data-orientation":s},c,{ref:t})))}),JB="TabsList",ZB=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=$w(JB,n),s=$D(n);return m.createElement(Dw,he({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,he({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),eV="TabsTrigger",tV=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=$w(eV,n),a=$D(n),l=kD(s.baseId,r),c=MD(s.baseId,r),u=r===s.value;return m.createElement(Aw,he({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,he({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)})})))}),nV="TabsContent",rV=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=$w(nV,n),l=kD(a.baseId,r),c=MD(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),m.createElement(er,{present:o||u},({present:h})=>m.createElement(Qe.div,he({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),h&&i))});function kD(e,t){return`${e}-trigger-${t}`}function MD(e,t){return`${e}-content-${t}`}const oV=QB,ID=ZB,ND=tV,LD=rV,kw=oV,dm=H.forwardRef(({className:e,...t},n)=>O.jsx(ID,{ref:n,className:Ce("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));dm.displayName=ID.displayName;const fm=H.forwardRef(({className:e,...t},n)=>O.jsx(ND,{ref:n,className:Ce("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}));fm.displayName=ND.displayName;const Mw=H.forwardRef(({className:e,...t},n)=>O.jsx(LD,{ref:n,className:Ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Mw.displayName=LD.displayName;var FD={exports:{}},$f={},V0={exports:{}};(function(e,t){(function(n,r){r(t)})(Vs,function(n){function r(se){return function(le,ye,Y,be,_e,Pe,Te){return se(le,ye,Te)}}function o(se){return function(le,ye,Y,be){if(!le||!ye||typeof le!="object"||typeof ye!="object")return se(le,ye,Y,be);var _e=be.get(le),Pe=be.get(ye);if(_e&&Pe)return _e===ye&&Pe===le;be.set(le,ye),be.set(ye,le);var Te=se(le,ye,Y,be);return be.delete(le),be.delete(ye),Te}}function i(se,ne){var le={};for(var ye in se)le[ye]=se[ye];for(var ye in ne)le[ye]=ne[ye];return le}function s(se){return se.constructor===Object||se.constructor==null}function a(se){return typeof se.then=="function"}function l(se,ne){return se===ne||se!==se&&ne!==ne}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",h="[object RegExp]",g="[object Map]",v="[object Number]",b="[object Object]",w="[object Set]",x="[object String]",_=Object.prototype.toString;function S(se){var ne=se.areArraysEqual,le=se.areDatesEqual,ye=se.areMapsEqual,Y=se.areObjectsEqual,be=se.areRegExpsEqual,_e=se.areSetsEqual,Pe=se.createIsNestedEqual,Te=Pe(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 Y(Be,Ie,Te,Ke);var lt=Array.isArray(Be),It=Array.isArray(Ie);if(lt||It)return lt===It&&ne(Be,Ie,Te,Ke);var At=_.call(Be);return At!==_.call(Ie)?!1:At===f?le(Be,Ie,Te,Ke):At===h?be(Be,Ie,Te,Ke):At===g?ye(Be,Ie,Te,Ke):At===w?_e(Be,Ie,Te,Ke):At===b||At===c?a(Be)||a(Ie)?!1:Y(Be,Ie,Te,Ke):At===u||At===v||At===x?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function C(se,ne,le,ye){var Y=se.length;if(ne.length!==Y)return!1;for(;Y-- >0;)if(!le(se[Y],ne[Y],Y,Y,se,ne,ye))return!1;return!0}var E=o(C);function P(se,ne){return l(se.valueOf(),ne.valueOf())}function A(se,ne,le,ye){var Y=se.size===ne.size;if(!Y)return!1;if(!se.size)return!0;var be={},_e=0;return se.forEach(function(Pe,Te){if(Y){var Ue=!1,Be=0;ne.forEach(function(Ie,Ke){!Ue&&!be[Be]&&(Ue=le(Te,Ke,_e,Be,se,ne,ye)&&le(Pe,Ie,Te,Ke,se,ne,ye))&&(be[Be]=!0),Be++}),_e++,Y=Ue}}),Y}var k=o(A),I="_owner",$=Object.prototype.hasOwnProperty;function L(se,ne,le,ye){var Y=Object.keys(se),be=Y.length;if(Object.keys(ne).length!==be)return!1;for(var _e;be-- >0;){if(_e=Y[be],_e===I){var Pe=!!se.$$typeof,Te=!!ne.$$typeof;if((Pe||Te)&&Pe!==Te)return!1}if(!$.call(ne,_e)||!le(se[_e],ne[_e],_e,_e,se,ne,ye))return!1}return!0}var j=o(L);function Q(se,ne){return se.source===ne.source&&se.flags===ne.flags}function ee(se,ne,le,ye){var Y=se.size===ne.size;if(!Y)return!1;if(!se.size)return!0;var be={};return se.forEach(function(_e,Pe){if(Y){var Te=!1,Ue=0;ne.forEach(function(Be,Ie){!Te&&!be[Ue]&&(Te=le(_e,Be,Pe,Ie,se,ne,ye))&&(be[Ue]=!0),Ue++}),Y=Te}}),Y}var B=o(ee),Z=Object.freeze({areArraysEqual:C,areDatesEqual:P,areMapsEqual:A,areObjectsEqual:L,areRegExpsEqual:Q,areSetsEqual:ee,createIsNestedEqual:r}),G=Object.freeze({areArraysEqual:E,areDatesEqual:P,areMapsEqual:k,areObjectsEqual:j,areRegExpsEqual:Q,areSetsEqual:B,createIsNestedEqual:r}),q=S(Z);function K(se,ne){return q(se,ne,void 0)}var T=S(i(Z,{createIsNestedEqual:function(){return l}}));function V(se,ne){return T(se,ne,void 0)}var X=S(G);function N(se,ne){return X(se,ne,new WeakMap)}var ie=S(i(G,{createIsNestedEqual:function(){return l}}));function fe(se,ne){return ie(se,ne,new WeakMap)}function ue(se){return S(i(Z,se(Z)))}function pe(se){var ne=S(i(G,se(G)));return function(le,ye,Y){return Y===void 0&&(Y=new WeakMap),ne(le,ye,Y)}}n.circularDeepEqual=N,n.circularShallowEqual=fe,n.createCustomCircularEqual=pe,n.createCustomEqual=ue,n.deepEqual=K,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(V0,V0.exports);var Iw=V0.exports;const Nw=gw(xj);var Ot={},iV=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(Ot,"__esModule",{value:!0});Ot.bottom=Lw;Ot.childrenEqual=cV;Ot.cloneLayout=jD;Ot.cloneLayoutItem=il;Ot.collides=hm;Ot.compact=BD;Ot.compactItem=VD;Ot.compactType=SV;Ot.correctBounds=HD;Ot.fastPositionEqual=dV;Ot.fastRGLPropsEqual=void 0;Ot.getAllCollisions=WD;Ot.getFirstCollision=qa;Ot.getLayoutItem=Fw;Ot.getStatics=jw;Ot.modifyLayout=zD;Ot.moveElement=nd;Ot.moveElementAwayFromCollision=W0;Ot.noop=void 0;Ot.perc=hV;Ot.resizeItemInDirection=yV;Ot.setTopLeft=wV;Ot.setTransform=xV;Ot.sortLayoutItems=Uw;Ot.sortLayoutItemsByColRow=KD;Ot.sortLayoutItemsByRowCol=YD;Ot.synchronizeLayoutWithChildren=_V;Ot.validateLayout=XD;Ot.withLayoutItem=lV;var hR=Iw,td=sV(m);function sV(e){return e&&e.__esModule?e:{default:e}}const aV=process.env.NODE_ENV==="production";function Lw(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 jD(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=il(e[n]);return t}function zD(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 lV(e,t,n){let r=Fw(e,t);return r?(r=n(il(r)),e=zD(e,r),[e,r]):[e,null]}function il(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 cV(e,t){return(0,hR.deepEqual)(td.default.Children.map(e,n=>n==null?void 0:n.key),td.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,hR.deepEqual)(td.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),td.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const uV=iV;Ot.fastRGLPropsEqual=uV;function dV(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function hm(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 BD(e,t,n,r){const o=jw(e),i=Uw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=il(i[a]);c.static||(c=VD(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const fV={x:"w",y:"h"};function H0(e,t,n,r){const o=fV[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;hm(t,a)&&H0(e,a,n+t[o],r)}}t[r]=n}function VD(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Lw(e),t.y);t.y>0&&!qa(e,t);)t.y--;else if(a)for(;t.x>0&&!qa(e,t);)t.x--;let l;for(;(l=qa(e,t))&&!(n===null&&i);)if(a?H0(o,t,l.x+l.w,"x"):H0(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!qa(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function HD(e,t){const n=jw(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(;qa(n,i);)i.y++}return e}function Fw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function qa(e,t){for(let n=0,r=e.length;n<r;n++)if(hm(e[n],t))return e[n]}function WD(e,t){return e.filter(n=>hm(n,t))}function jw(e){return e.filter(t=>t.static)}function nd(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=Uw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const g=WD(f,t),v=g.length>0;if(v&&l)return jD(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,w=g.length;b<w;b++){const x=g[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(x.i," at [").concat(x.x,",").concat(x.y,"]"),!x.moved&&(x.static?e=W0(e,x,t,o,s):e=W0(e,t,x,o,s))}return e}function W0(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"},h=qa(e,f),g=h&&h.y+h.h>t.y,v=h&&t.x+t.w>h.x;if(h){if(g&&a)return nd(e,n,void 0,t.y+1,r,l,o);if(g&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return nd(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,"]."),nd(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:nd(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function hV(e){return e*100+"%"}const UD=(e,t,n,r)=>e+n>r?t:n,qD=(e,t,n)=>e<0?t:n,GD=e=>Math.max(0,e),zw=e=>Math.max(0,e),Bw=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:qD(s,e.height,o),top:zw(s)}},Vw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:UD(e.left,e.width,s,n),left:GD(o)}},Hw=(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:UD(e.left,e.width,i,n),top:zw(r),left:GD(s)}},Ww=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:qD(r,e.height,i),top:zw(r)}},pV=function(){return Bw(arguments.length<=0?void 0:arguments[0],Vw(...arguments))},gV=function(){return Bw(arguments.length<=0?void 0:arguments[0],Hw(...arguments))},mV=function(){return Ww(arguments.length<=0?void 0:arguments[0],Vw(...arguments))},vV=function(){return Ww(arguments.length<=0?void 0:arguments[0],Hw(...arguments))},bV={n:Bw,ne:pV,e:Vw,se:mV,s:Ww,sw:vV,w:Hw,nw:gV};function yV(e,t,n,r){const o=bV[e];return o?o(t,{...t,...n},r):n}function xV(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 wV(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 Uw(e,t){return t==="horizontal"?KD(e):t==="vertical"?YD(e):e}function YD(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 KD(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 _V(e,t,n,r,o){e=e||[];const i=[];td.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Fw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(il(l)):c?(aV||XD([c],"ReactGridLayout.children"),i.push(il({...c,i:a.key}))):i.push(il({w:1,h:1,x:0,y:Lw(i),i:String(a.key)}))});const s=HD(i,{cols:n});return o?s:BD(s,r,n)}function XD(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 SV(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const CV=()=>{};Ot.noop=CV;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.calcGridColWidth=pm;Ri.calcGridItemPosition=EV;Ri.calcGridItemWHPx=U0;Ri.calcWH=OV;Ri.calcXY=RV;Ri.clamp=Ga;function pm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function U0(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function EV(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=pm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=U0(r,c,s[0]),u.height=U0(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 RV(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=pm(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Ga(u,0,s-r),f=Ga(f,0,l-o),{x:u,y:f}}function OV(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=pm(e);let f=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),g=Ga(f,0,l-r),v=Ga(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=Ga(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Ga(h,0,a)),{w:g,h:v}}function Ga(e,t,n){return Math.max(Math.min(e,n),t)}var gm={},q0={exports:{}},Ib,pR;function qw(){if(pR)return Ib;pR=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ib=e,Ib}var Nb,gR;function PV(){if(gR)return Nb;gR=1;var e=qw();function t(){}function n(){}return n.resetWarningCache=t,Nb=function(){function r(s,a,l,c,u,f){if(f!==e){var h=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 h.name="Invariant Violation",h}}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},Nb}var Gh={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 mR;function TV(){return mR||(mR=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,h=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(Y){return typeof Y=="string"||typeof Y=="function"||Y===r||Y===c||Y===i||Y===o||Y===f||Y===h||typeof Y=="object"&&Y!==null&&(Y.$$typeof===v||Y.$$typeof===g||Y.$$typeof===s||Y.$$typeof===a||Y.$$typeof===u||Y.$$typeof===w||Y.$$typeof===x||Y.$$typeof===_||Y.$$typeof===b)}function C(Y){if(typeof Y=="object"&&Y!==null){var be=Y.$$typeof;switch(be){case t:var _e=Y.type;switch(_e){case l:case c:case r:case i:case o:case f:return _e;default:var Pe=_e&&_e.$$typeof;switch(Pe){case a:case u:case v:case g:case s:return Pe;default:return be}}case n:return be}}}var E=l,P=c,A=a,k=s,I=t,$=u,L=r,j=v,Q=g,ee=n,B=i,Z=o,G=f,q=!1;function K(Y){return q||(q=!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.")),T(Y)||C(Y)===l}function T(Y){return C(Y)===c}function V(Y){return C(Y)===a}function X(Y){return C(Y)===s}function N(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===t}function ie(Y){return C(Y)===u}function fe(Y){return C(Y)===r}function ue(Y){return C(Y)===v}function pe(Y){return C(Y)===g}function se(Y){return C(Y)===n}function ne(Y){return C(Y)===i}function le(Y){return C(Y)===o}function ye(Y){return C(Y)===f}qt.AsyncMode=E,qt.ConcurrentMode=P,qt.ContextConsumer=A,qt.ContextProvider=k,qt.Element=I,qt.ForwardRef=$,qt.Fragment=L,qt.Lazy=j,qt.Memo=Q,qt.Portal=ee,qt.Profiler=B,qt.StrictMode=Z,qt.Suspense=G,qt.isAsyncMode=K,qt.isConcurrentMode=T,qt.isContextConsumer=V,qt.isContextProvider=X,qt.isElement=N,qt.isForwardRef=ie,qt.isFragment=fe,qt.isLazy=ue,qt.isMemo=pe,qt.isPortal=se,qt.isProfiler=ne,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 vR;function DV(){if(vR)return Gt;vR=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,h=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(E){if(typeof E=="object"&&E!==null){var P=E.$$typeof;switch(P){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 v:case g:case s:return E;default:return P}}case n:return P}}}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=v,Gt.Memo=g,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)===v},Gt.isMemo=function(E){return S(E)===g},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===h||typeof E=="object"&&E!==null&&(E.$$typeof===v||E.$$typeof===g||E.$$typeof===s||E.$$typeof===a||E.$$typeof===u||E.$$typeof===w||E.$$typeof===x||E.$$typeof===_||E.$$typeof===b)},Gt.typeOf=S,Gt}var bR;function QD(){return bR||(bR=1,process.env.NODE_ENV==="production"?Gh.exports=DV():Gh.exports=TV()),Gh.exports}/*
103
- object-assign
104
- (c) Sindre Sorhus
105
- @license MIT
106
- */var Lb,yR;function AV(){if(yR)return Lb;yR=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 Lb=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 h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Lb}var Fb,xR;function JD(){return xR||(xR=1,Fb=Function.call.bind(Object.prototype.hasOwnProperty)),Fb}var jb,wR;function $V(){if(wR)return jb;wR=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=qw(),n={},r=JD();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 h=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 h.name="Invariant Violation",h}f=i[u](s,u,l,a,null,t)}catch(v){f=v}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 g=c?c():"";e("Failed "+a+" type: "+f.message+(g??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},jb=o,jb}var zb,_R;function kV(){if(_R)return zb;_R=1;var e=QD(),t=AV(),n=qw(),r=JD(),o=$V(),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 zb=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var V=T&&(c&&T[c]||T[u]);if(typeof V=="function")return V}var h="<<anonymous>>",g={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:_(),arrayOf:S,element:C(),elementType:E(),instanceOf:P,node:$(),objectOf:k,oneOf:A,oneOfType:I,shape:j,exact:Q};function v(T,V){return T===V?T!==0||1/T===1/V:T!==T&&V!==V}function b(T,V){this.message=T,this.data=V&&typeof V=="object"?V:{},this.stack=""}b.prototype=Error.prototype;function w(T){if(process.env.NODE_ENV!=="production")var V={},X=0;function N(fe,ue,pe,se,ne,le,ye){if(se=se||h,le=le||pe,ye!==n){if(l){var Y=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 Y.name="Invariant Violation",Y}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var be=se+":"+pe;!V[be]&&X<3&&(i("You are manually calling a React.PropTypes validation function for the `"+le+"` prop on `"+se+"`. 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,X++)}}return ue[pe]==null?fe?ue[pe]===null?new b("The "+ne+" `"+le+"` is marked as required "+("in `"+se+"`, but its value is `null`.")):new b("The "+ne+" `"+le+"` is marked as required in "+("`"+se+"`, but its value is `undefined`.")):null:T(ue,pe,se,ne,le)}var ie=N.bind(null,!1);return ie.isRequired=N.bind(null,!0),ie}function x(T){function V(X,N,ie,fe,ue,pe){var se=X[N],ne=Z(se);if(ne!==T){var le=G(se);return new b("Invalid "+fe+" `"+ue+"` of type "+("`"+le+"` supplied to `"+ie+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return w(V)}function _(){return w(s)}function S(T){function V(X,N,ie,fe,ue){if(typeof T!="function")return new b("Property `"+ue+"` of component `"+ie+"` has invalid PropType notation inside arrayOf.");var pe=X[N];if(!Array.isArray(pe)){var se=Z(pe);return new b("Invalid "+fe+" `"+ue+"` of type "+("`"+se+"` supplied to `"+ie+"`, expected an array."))}for(var ne=0;ne<pe.length;ne++){var le=T(pe,ne,ie,fe,ue+"["+ne+"]",n);if(le instanceof Error)return le}return null}return w(V)}function C(){function T(V,X,N,ie,fe){var ue=V[X];if(!a(ue)){var pe=Z(ue);return new b("Invalid "+ie+" `"+fe+"` of type "+("`"+pe+"` supplied to `"+N+"`, expected a single ReactElement."))}return null}return w(T)}function E(){function T(V,X,N,ie,fe){var ue=V[X];if(!e.isValidElementType(ue)){var pe=Z(ue);return new b("Invalid "+ie+" `"+fe+"` of type "+("`"+pe+"` supplied to `"+N+"`, expected a single ReactElement type."))}return null}return w(T)}function P(T){function V(X,N,ie,fe,ue){if(!(X[N]instanceof T)){var pe=T.name||h,se=K(X[N]);return new b("Invalid "+fe+" `"+ue+"` of type "+("`"+se+"` supplied to `"+ie+"`, expected ")+("instance of `"+pe+"`."))}return null}return w(V)}function A(T){if(!Array.isArray(T))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(X,N,ie,fe,ue){for(var pe=X[N],se=0;se<T.length;se++)if(v(pe,T[se]))return null;var ne=JSON.stringify(T,function(ye,Y){var be=G(Y);return be==="symbol"?String(Y):Y});return new b("Invalid "+fe+" `"+ue+"` of value `"+String(pe)+"` "+("supplied to `"+ie+"`, expected one of "+ne+"."))}return w(V)}function k(T){function V(X,N,ie,fe,ue){if(typeof T!="function")return new b("Property `"+ue+"` of component `"+ie+"` has invalid PropType notation inside objectOf.");var pe=X[N],se=Z(pe);if(se!=="object")return new b("Invalid "+fe+" `"+ue+"` of type "+("`"+se+"` supplied to `"+ie+"`, expected an object."));for(var ne in pe)if(r(pe,ne)){var le=T(pe,ne,ie,fe,ue+"."+ne,n);if(le instanceof Error)return le}return null}return w(V)}function I(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var V=0;V<T.length;V++){var X=T[V];if(typeof X!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+q(X)+" at index "+V+"."),s}function N(ie,fe,ue,pe,se){for(var ne=[],le=0;le<T.length;le++){var ye=T[le],Y=ye(ie,fe,ue,pe,se,n);if(Y==null)return null;Y.data&&r(Y.data,"expectedType")&&ne.push(Y.data.expectedType)}var be=ne.length>0?", expected one of type ["+ne.join(", ")+"]":"";return new b("Invalid "+pe+" `"+se+"` supplied to "+("`"+ue+"`"+be+"."))}return w(N)}function $(){function T(V,X,N,ie,fe){return ee(V[X])?null:new b("Invalid "+ie+" `"+fe+"` supplied to "+("`"+N+"`, expected a ReactNode."))}return w(T)}function L(T,V,X,N,ie){return new b((T||"React class")+": "+V+" type `"+X+"."+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ie+"`.")}function j(T){function V(X,N,ie,fe,ue){var pe=X[N],se=Z(pe);if(se!=="object")return new b("Invalid "+fe+" `"+ue+"` of type `"+se+"` "+("supplied to `"+ie+"`, expected `object`."));for(var ne in T){var le=T[ne];if(typeof le!="function")return L(ie,fe,ue,ne,G(le));var ye=le(pe,ne,ie,fe,ue+"."+ne,n);if(ye)return ye}return null}return w(V)}function Q(T){function V(X,N,ie,fe,ue){var pe=X[N],se=Z(pe);if(se!=="object")return new b("Invalid "+fe+" `"+ue+"` of type `"+se+"` "+("supplied to `"+ie+"`, expected `object`."));var ne=t({},X[N],T);for(var le in ne){var ye=T[le];if(r(T,le)&&typeof ye!="function")return L(ie,fe,ue,le,G(ye));if(!ye)return new b("Invalid "+fe+" `"+ue+"` key `"+le+"` supplied to `"+ie+"`.\nBad object: "+JSON.stringify(X[N],null," ")+`
107
- Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Y=ye(pe,le,ie,fe,ue+"."+le,n);if(Y)return Y}return null}return w(V)}function ee(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(ee);if(T===null||a(T))return!0;var V=f(T);if(V){var X=V.call(T),N;if(V!==T.entries){for(;!(N=X.next()).done;)if(!ee(N.value))return!1}else for(;!(N=X.next()).done;){var ie=N.value;if(ie&&!ee(ie[1]))return!1}}else return!1;return!0;default:return!1}}function B(T,V){return T==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function Z(T){var V=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":B(V,T)?"symbol":V}function G(T){if(typeof T>"u"||T===null)return""+T;var V=Z(T);if(V==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return V}function q(T){var V=G(T);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function K(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return g.checkPropTypes=o,g.resetWarningCache=o.resetWarningCache,g.PropTypes=g,g},zb}if(process.env.NODE_ENV!=="production"){var MV=QD(),IV=!0;q0.exports=kV()(MV.isElement,IV)}else q0.exports=PV()();var pa=q0.exports,mm={exports:{}},ZD={};function eA(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=eA(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function SR(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=eA(e))&&(r&&(r+=" "),r+=t);return r}const NV=Object.freeze(Object.defineProperty({__proto__:null,clsx:SR,default:SR},Symbol.toStringTag,{value:"Module"})),LV=gw(NV);var En={},Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.dontSetMe=VV;Oi.findInArray=FV;Oi.int=BV;Oi.isFunction=jV;Oi.isNum=zV;function FV(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function jV(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function zV(e){return typeof e=="number"&&!isNaN(e)}function BV(e){return parseInt(e,10)}function VV(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 Sl={};Object.defineProperty(Sl,"__esModule",{value:!0});Sl.browserPrefixToKey=nA;Sl.browserPrefixToStyle=HV;Sl.default=void 0;Sl.getPrefix=tA;const Bb=["Moz","Webkit","O","ms"];function tA(){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<Bb.length;r++)if(nA(t,Bb[r])in n)return Bb[r];return""}function nA(e,t){return t?"".concat(t).concat(WV(e)):e}function HV(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function WV(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}Sl.default=tA();Object.defineProperty(En,"__esModule",{value:!0});En.addClassName=iA;En.addEvent=GV;En.addUserSelectStyles=oH;En.createCSSTransform=eH;En.createSVGTransform=tH;En.getTouch=nH;En.getTouchIdentifier=rH;En.getTranslation=Gw;En.innerHeight=QV;En.innerWidth=JV;En.matchesSelector=oA;En.matchesSelectorAndParentsTo=qV;En.offsetXYFromParent=ZV;En.outerHeight=KV;En.outerWidth=XV;En.removeClassName=sA;En.removeEvent=YV;En.removeUserSelectStyles=iH;var io=Oi,CR=UV(Sl);function rA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(rA=function(r){return r?n:t})(e)}function UV(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=rA(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 Yh="";function oA(e,t){return Yh||(Yh=(0,io.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,io.isFunction)(e[n])})),(0,io.isFunction)(e[Yh])?e[Yh](t):!1}function qV(e,t,n){let r=e;do{if(oA(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function GV(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 YV(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 KV(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,io.int)(n.borderTopWidth),t+=(0,io.int)(n.borderBottomWidth),t}function XV(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,io.int)(n.borderLeftWidth),t+=(0,io.int)(n.borderRightWidth),t}function QV(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,io.int)(n.paddingTop),t-=(0,io.int)(n.paddingBottom),t}function JV(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,io.int)(n.paddingLeft),t-=(0,io.int)(n.paddingRight),t}function ZV(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 eH(e,t){const n=Gw(e,t,"px");return{[(0,CR.browserPrefixToKey)("transform",CR.default)]:n}}function tH(e,t){return Gw(e,t,"")}function Gw(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 nH(e,t){return e.targetTouches&&(0,io.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,io.findInArray)(e.changedTouches,n=>t===n.identifier)}function rH(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function oH(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&&iA(e.body,"react-draggable-transparent-selection")}function iH(e){if(e)try{if(e.body&&sA(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 iA(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function sA(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.canDragX=lH;Pi.canDragY=cH;Pi.createCoreData=dH;Pi.createDraggableData=fH;Pi.getBoundPosition=sH;Pi.getControlPosition=uH;Pi.snapToGrid=aH;var qr=Oi,hc=En;function sH(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:hH(r);const o=Yw(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,qr.int)(u.paddingLeft)+(0,qr.int)(c.marginLeft),top:-o.offsetTop+(0,qr.int)(u.paddingTop)+(0,qr.int)(c.marginTop),right:(0,hc.innerWidth)(l)-(0,hc.outerWidth)(o)-o.offsetLeft+(0,qr.int)(u.paddingRight)-(0,qr.int)(c.marginRight),bottom:(0,hc.innerHeight)(l)-(0,hc.outerHeight)(o)-o.offsetTop+(0,qr.int)(u.paddingBottom)-(0,qr.int)(c.marginBottom)}}return(0,qr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,qr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,qr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,qr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function aH(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function lH(e){return e.props.axis==="both"||e.props.axis==="x"}function cH(e){return e.props.axis==="both"||e.props.axis==="y"}function uH(e,t,n){const r=typeof t=="number"?(0,hc.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=Yw(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,hc.offsetXYFromParent)(r||e,i,n.props.scale)}function dH(e,t,n){const r=!(0,qr.isNum)(e.lastX),o=Yw(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 fH(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 hH(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Yw(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var vm={},bm={};Object.defineProperty(bm,"__esModule",{value:!0});bm.default=pH;function pH(){}Object.defineProperty(vm,"__esModule",{value:!0});vm.default=void 0;var Vb=mH(m),Or=Kw(pa),gH=Kw(Mo),or=En,As=Pi,Hb=Oi,Mu=Kw(bm);function Kw(e){return e&&e.__esModule?e:{default:e}}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 mH(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}function mr(e,t,n){return t=vH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vH(e){var t=bH(e,"string");return typeof t=="symbol"?t:String(t)}function bH(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 Wo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let $s=Wo.mouse,ym=class extends Vb.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,or.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,or.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,or.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,Mu.default)("DraggableCore: handleDragStart: %j",l),(0,Mu.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,or.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,or.addEvent)(r,$s.move,this.handleDrag),(0,or.addEvent)(r,$s.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,Mu.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,or.removeUserSelectStyles)(a.ownerDocument),(0,Mu.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Mu.default)("DraggableCore: Removing handlers"),(0,or.removeEvent)(a.ownerDocument,$s.move,this.handleDrag),(0,or.removeEvent)(a.ownerDocument,$s.stop,this.handleDragStop))}),mr(this,"onMouseDown",t=>($s=Wo.mouse,this.handleDragStart(t))),mr(this,"onMouseUp",t=>($s=Wo.mouse,this.handleDragStop(t))),mr(this,"onTouchStart",t=>($s=Wo.touch,this.handleDragStart(t))),mr(this,"onTouchEnd",t=>($s=Wo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,or.addEvent)(t,Wo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,or.removeEvent)(n,Wo.mouse.move,this.handleDrag),(0,or.removeEvent)(n,Wo.touch.move,this.handleDrag),(0,or.removeEvent)(n,Wo.mouse.stop,this.handleDragStop),(0,or.removeEvent)(n,Wo.touch.stop,this.handleDragStop),(0,or.removeEvent)(t,Wo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,or.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:gH.default.findDOMNode(this)}render(){return Vb.cloneElement(Vb.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};vm.default=ym;mr(ym,"displayName","DraggableCore");mr(ym,"propTypes",{allowAnyClick:Or.default.bool,children:Or.default.node.isRequired,disabled:Or.default.bool,enableUserSelectHack:Or.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:Or.default.arrayOf(Or.default.number),handle:Or.default.string,cancel:Or.default.string,nodeRef:Or.default.object,onStart:Or.default.func,onDrag:Or.default.func,onStop:Or.default.func,onMouseDown:Or.default.func,scale:Or.default.number,className:Hb.dontSetMe,style:Hb.dontSetMe,transform:Hb.dontSetMe});mr(ym,"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=h(m),n=u(pa),r=u(Mo),o=u(LV),i=En,s=Pi,a=Oi,l=u(vm),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 h(_,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={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in _)if(A!=="default"&&Object.prototype.hasOwnProperty.call(_,A)){var k=P?Object.getOwnPropertyDescriptor(_,A):null;k&&(k.get||k.set)?Object.defineProperty(E,A,k):E[A]=_[A]}return E.default=_,C&&C.set(_,E),E}function g(){return g=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 _},g.apply(this,arguments)}function v(_,S,C){return S=b(S),S in _?Object.defineProperty(_,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[S]=C,_}function b(_){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 x extends t.Component{static getDerivedStateFromProps(S,C){let{position:E}=S,{prevPropsPosition:P}=C;return E&&(!P||E.x!==P.x||E.y!==P.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:P}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(S){super(S),v(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})}),v(this,"onDrag",(C,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const P=(0,s.createDraggableData)(this,E),A={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:$}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[L,j]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=L,A.y=j,A.slackX=this.state.slackX+(I-A.x),A.slackY=this.state.slackY+($-A.y),P.x=A.x,P.y=A.y,P.deltaX=A.x-this.state.x,P.deltaY=A.y-this.state.y}if(this.props.onDrag(C,P)===!1)return!1;this.setState(A)}),v(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 A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:$}=this.props.position;A.x=I,A.y=$}this.setState(A)}),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:P,defaultClassName:A,defaultClassNameDragging:k,defaultClassNameDragged:I,position:$,positionOffset:L,scale:j,...Q}=this.props;let ee={},B=null;const G=!!!$||this.state.dragging,q=$||P,K={x:(0,s.canDragX)(this)&&G?this.state.x:q.x,y:(0,s.canDragY)(this)&&G?this.state.y:q.y};this.state.isElementSVG?B=(0,i.createSVGTransform)(K,L):ee=(0,i.createCSSTransform)(K,L);const T=(0,o.default)(E.props.className||"",A,{[k]:this.state.dragging,[I]:this.state.dragged});return t.createElement(l.default,g({},Q,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:T,style:{...E.props.style,...ee},transform:B}))}}e.default=x,v(x,"displayName","Draggable"),v(x,"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}),v(x,"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})})(ZD);const{default:lA,DraggableCore:yH}=ZD;mm.exports=lA;mm.exports.default=lA;mm.exports.DraggableCore=yH;var cA=mm.exports,xm={exports:{}},kf={},Xw={};Xw.__esModule=!0;Xw.cloneElement=EH;var xH=wH(m);function wH(e){return e&&e.__esModule?e:{default:e}}function ER(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 RR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ER(Object(n),!0).forEach(function(r){_H(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ER(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _H(e,t,n){return t=SH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SH(e){var t=CH(e,"string");return typeof t=="symbol"?t:String(t)}function CH(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 EH(e,t){return t.style&&e.props.style&&(t.style=RR(RR({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),xH.default.cloneElement(e,t)}var Mf={};Mf.__esModule=!0;Mf.resizableProps=void 0;var gt=RH(pa);function RH(e){return e&&e.__esModule?e:{default:e}}var OH={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)}};Mf.resizableProps=OH;kf.__esModule=!0;kf.default=void 0;var Iu=$H(m),PH=cA,TH=Xw,DH=Mf,AH=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function uA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(uA=function(o){return o?n:t})(e)}function $H(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=uA(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 G0(){return G0=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},G0.apply(this,arguments)}function kH(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 OR(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 Wb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OR(Object(n),!0).forEach(function(r){MH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MH(e,t,n){return t=IH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IH(e){var t=NH(e,"string");return typeof t=="symbol"?t:String(t)}function NH(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 LH(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Y0(e,t)}function Y0(e,t){return Y0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Y0(e,t)}var Qw=function(e){LH(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,h=i-this.props.height;Math.abs(f)>Math.abs(h*u)?i=o/u:o=i*u}var g=o,v=i,b=this.slack||[0,0],w=b[0],x=b[1];return o+=w,i+=x,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+(g-o),x+(v-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 h=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",g=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!h&&!g)){var v=i[0],b=i[i.length-1],w=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var x=w.left-s.lastHandleRect.left;u+=x}if(v==="n"){var _=w.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=w,b==="w"&&(u=-u),v==="n"&&(f=-f);var S=s.props.width+(h?u/s.props.transformScale:0),C=s.props.height+(g?f/s.props.transformScale:0),E=s.runConstraints(S,C);S=E[0],C=E[1];var P=S!==s.props.width||C!==s.props.height,A=typeof s.props[o]=="function"?s.props[o]:null,k=o==="onResize"&&!P;A&&!k&&(a.persist==null||a.persist(),A(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 Iu.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=Wb({ref:i},a?{}:{handleAxis:o});return Iu.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=kH(i,AH);return(0,TH.cloneElement)(s,Wb(Wb({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var h,g=(h=o.handleRefs[f])!=null?h:o.handleRefs[f]=Iu.createRef();return Iu.createElement(PH.DraggableCore,G0({},l,{nodeRef:g,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,g))}))}))},t}(Iu.Component);kf.default=Qw;Qw.propTypes=DH.resizableProps;Qw.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 Ub=VH(m),FH=dA(pa),jH=dA(kf),zH=Mf,BH=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function dA(e){return e&&e.__esModule?e:{default:e}}function fA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(fA=function(o){return o?n:t})(e)}function VH(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=fA(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 K0(){return K0=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},K0.apply(this,arguments)}function PR(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 vg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PR(Object(n),!0).forEach(function(r){HH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HH(e,t,n){return t=WH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WH(e){var t=UH(e,"string");return typeof t=="symbol"?t:String(t)}function UH(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 qH(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 GH(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,X0(e,t)}function X0(e,t){return X0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},X0(e,t)}var hA=function(e){GH(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,h=o.lockAspectRatio,g=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,w=o.transformScale,x=qH(o,BH);return Ub.createElement(jH.default,{axis:g,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:h,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:w,width:this.state.width},Ub.createElement("div",K0({},x,{style:vg(vg({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ub.Component);wm.default=hA;hA.propTypes=vg(vg({},zH.resizableProps),{},{children:FH.default.element});xm.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};xm.exports.Resizable=kf.default;xm.exports.ResizableBox=wm.default;var YH=xm.exports,os={};Object.defineProperty(os,"__esModule",{value:!0});os.resizeHandleType=os.resizeHandleAxesType=os.default=void 0;var wt=pA(pa),KH=pA(m);function pA(e){return e&&e.__esModule?e:{default:e}}const gA=wt.default.arrayOf(wt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));os.resizeHandleAxesType=gA;const mA=wt.default.oneOfType([wt.default.node,wt.default.func]);os.resizeHandleType=mA;var XH={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&&Ot.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:gA,resizeHandle:mA,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={};KH.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};os.default=XH;Object.defineProperty(gm,"__esModule",{value:!0});gm.default=void 0;var Yl=Jw(m),zt=Jw(pa),QH=cA,JH=YH,Kl=Ot,Yn=Ri,TR=os,ZH=Jw(Nw);function Jw(e){return e&&e.__esModule?e:{default:e}}function ci(e,t,n){return t=eW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eW(e){var t=tW(e,"string");return typeof t=="symbol"?t:String(t)}function tW(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 Zw extends Yl.default.Component{constructor(){super(...arguments),ci(this,"state",{resizing:null,dragging:null,className:""}),ci(this,"elementRef",Yl.default.createRef()),ci(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,h=c.top/i,g=l.top/i;s.left=u-f+a.scrollLeft,s.top=h-g+a.scrollTop,this.setState({dragging:s});const{x:v,y:b}=(0,Yn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:s})}),ci(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,containerWidth:g}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:C}=this.props,E=_.clientHeight-(0,Yn.calcGridItemWHPx)(h,C,S[1]);a=(0,Yn.clamp)(a,0,E);const P=(0,Yn.calcGridColWidth)(v),A=g-(0,Yn.calcGridItemWHPx)(f,P,S[0]);l=(0,Yn.clamp)(l,0,A)}}const b={top:a,left:l};this.setState({dragging:b});const{x:w,y:x}=(0,Yn.calcXY)(v,a,l,f,h);return s.call(this,u,w,x,{e:t,node:r,newPosition:b})}),ci(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:h}=(0,Yn.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,f,h,{e:t,node:r,newPosition:u})}),ci(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),ci(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),ci(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,Yn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Yn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Kl.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,Kl.setTransform)(t):(i=(0,Kl.setTopLeft)(t),n&&(i.left=(0,Kl.perc)(t.left/r),i.width=(0,Kl.perc)(t.width/r))),i}mixinDraggable(t,n){return Yl.default.createElement(QH.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,h=this.getPositionParams(),g=(0,Yn.calcGridItemPosition)(h,0,0,o,0).width,v=(0,Yn.calcGridItemPosition)(h,0,0,i,s),b=(0,Yn.calcGridItemPosition)(h,0,0,a,l),w=[v.width,v.height],x=[Math.min(b.width,g),Math.min(b.height,1/0)];return Yl.default.createElement(JH.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:w,maxConstraints:x,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:h,minH:g,containerWidth:v}=this.props,{minW:b,maxW:w}=this.props;let x=s;i&&(x=(0,Kl.resizeItemInDirection)(a,r,s,v),this.setState({resizing:o==="onResizeStop"?null:x}));let{w:_,h:S}=(0,Yn.calcWH)(this.getPositionParams(),x.width,x.height,c,u,a);_=(0,Yn.clamp)(_,Math.max(b,1),w),S=(0,Yn.clamp)(S,g,h),l.call(this,f,_,S,{e:t,node:i,size:x,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Yn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Yl.default.Children.only(this.props.children);let f=Yl.default.cloneElement(u,{ref:this.elementRef,className:(0,ZH.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}}gm.default=Zw;ci(Zw,"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:TR.resizeHandleAxesType,resizeHandle:TR.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})});ci(Zw,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty($f,"__esModule",{value:!0});$f.default=void 0;var Ta=iW(m),qb=Iw,nW=e1(Nw),it=Ot,rW=Ri,DR=e1(gm),oW=e1(os);function e1(e){return e&&e.__esModule?e:{default:e}}function vA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(vA=function(r){return r?n:t})(e)}function iW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=vA(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 ir(e,t,n){return t=sW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sW(e){var t=aW(e,"string");return typeof t=="symbol"?t:String(t)}function aW(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 AR="react-grid-layout";let bA=!1;try{bA=/firefox/i.test(navigator.userAgent)}catch{}class _m extends Ta.Component{constructor(){super(...arguments),ir(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:[]}),ir(this,"dragEnterCounter",0),ir(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)}),ir(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,h=(0,it.getLayoutItem)(l,t);if(!h)return;const g={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t},v=!0;l=(0,it.moveElement)(l,h,n,r,v,f,(0,it.compactType)(this.props),c,u),this.props.onDrag(l,a,h,g,i,s),this.setState({layout:u?l:(0,it.compact)(l,(0,it.compactType)(this.props),c),activeDrag:g})}),ir(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,h=(0,it.getLayoutItem)(l,t);if(!h)return;const g=!0;l=(0,it.moveElement)(l,h,n,r,g,u,(0,it.compactType)(this.props),c,f);const v=f?l:(0,it.compact)(l,(0,it.compactType)(this.props),c);this.props.onDragStop(v,a,h,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),ir(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))}),ir(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:h,allowOverlap:g}=this.props;let v=!1,b,w,x;const[_,S]=(0,it.withLayoutItem)(u,t,E=>{let P;return w=E.x,x=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&&(x=E.y+(E.h-r),r=E.y!==x&&x<0?E.h:r,x=x<0?0:x),v=!0),h&&!g&&(P=(0,it.getAllCollisions)(u,{...E,w:n,h:r,x:w,y:x}).filter(k=>k.i!==E.i).length>0,P&&(x=E.y,r=E.h,w=E.x,n=E.w,v=!1)),E.w=n,E.h=r,E});if(!S)return;b=_,v&&(b=(0,it.moveElement)(_,S,w,x,!0,this.props.preventCollision,(0,it.compactType)(this.props),f,g));const C={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,C,i,s),this.setState({layout:g?b:(0,it.compact)(b,(0,it.compactType)(this.props),f),activeDrag:C})}),ir(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),h=u?a:(0,it.compact)(a,(0,it.compactType)(this.props),c);this.props.onResizeStop(h,l,f,null,i,s);const{oldLayout:g}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,g)}),ir(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),bA&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(AR)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:f}=this.props,h=o==null?void 0:o(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const g={...r,...h},{layout:v}=this.state,{layerX:b,layerY:w}=t.nativeEvent,x={left:b/f,top:w/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=b||S!=w)&&this.setState({droppingPosition:x})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},S=(0,rW.calcXY)(_,w,b,g.w,g.h);this.setState({droppingDOMNode:Ta.createElement("div",{key:g.i}),droppingPosition:x,layout:[...v,{...g,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),ir(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})}),ir(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ir(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),ir(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,qb.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,qb.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,qb.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 Ta.createElement(DR.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},Ta.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:h,useCSSTransforms:g,transformScale:v,draggableCancel:b,draggableHandle:w,resizeHandles:x,resizeHandle:_}=this.props,{mounted:S,droppingPosition:C}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,P=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,A=r.resizeHandles||x,k=E&&h&&r.isBounded!==!1;return Ta.createElement(DR.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:w,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:P,isBounded:k,useCSSTransforms:g&&S,usePercentages:!S,transformScale:v,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:A,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,nW.default)(AR,t),s={height:this.containerHeight(),...n};return Ta.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},Ta.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}$f.default=_m;ir(_m,"displayName","ReactGridLayout");ir(_m,"propTypes",oW.default);ir(_m,"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 Sm={},Cl={};Object.defineProperty(Cl,"__esModule",{value:!0});Cl.findOrGenerateResponsiveLayout=uW;Cl.getBreakpointFromWidth=lW;Cl.getColsFromBreakpoint=cW;Cl.sortBreakpoints=t1;var Kh=Ot;function lW(e,t){const n=t1(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 cW(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function uW(e,t,n,r,o,i){if(e[n])return(0,Kh.cloneLayout)(e[n]);let s=e[r];const a=t1(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,Kh.cloneLayout)(s||[]),(0,Kh.compact)((0,Kh.correctBounds)(s,{cols:o}),i,o)}function t1(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Sm,"__esModule",{value:!0});Sm.default=void 0;var $R=fW(m),Pr=yA(pa),Gb=Iw,vc=Ot,Da=Cl,dW=yA($f);function yA(e){return e&&e.__esModule?e:{default:e}}function xA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(xA=function(r){return r?n:t})(e)}function fW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=xA(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 Q0(){return Q0=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},Q0.apply(this,arguments)}function bg(e,t,n){return t=hW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hW(e){var t=pW(e,"string");return typeof t=="symbol"?t:String(t)}function pW(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 kR=e=>Object.prototype.toString.call(e);function Xh(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class n1 extends $R.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,Da.getBreakpointFromWidth)(n,t),s=(0,Da.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Da.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Gb.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Da.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,Gb.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Gb.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,Da.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Da.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,vc.cloneLayout)(this.state.layout));let h=(0,Da.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);h=(0,vc.synchronizeLayoutWithChildren)(h,this.props.children,l,i,this.props.allowOverlap),c[s]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:h,cols:l})}const u=Xh(this.props.margin,s),f=Xh(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 $R.createElement(dW.default,Q0({},u,{margin:Xh(i,this.state.breakpoint),containerPadding:Xh(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Sm.default=n1;bg(n1,"propTypes",{breakpoint:Pr.default.string,breakpoints:Pr.default.object,allowOverlap:Pr.default.bool,cols:Pr.default.object,margin:Pr.default.oneOfType([Pr.default.array,Pr.default.object]),containerPadding:Pr.default.oneOfType([Pr.default.array,Pr.default.object]),layouts(e,t){if(kR(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+kR(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,vc.validateLayout)(e.layouts[n],"layouts."+n)})},width:Pr.default.number.isRequired,onBreakpointChange:Pr.default.func,onLayoutChange:Pr.default.func,onWidthChange:Pr.default.func});bg(n1,"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:vc.noop,onLayoutChange:vc.noop,onWidthChange:vc.noop});var r1={},wA=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}()}(),J0=typeof window<"u"&&typeof document<"u"&&window.document===document,yg=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")()}(),gW=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(yg):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),mW=2;function vW(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){gW(i)}function a(){var l=Date.now();if(n){if(l-o<mW)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var bW=20,yW=["top","right","bottom","left","width","height","size","weight"],xW=typeof MutationObserver<"u",wW=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=vW(this.refresh.bind(this),bW)}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(){!J0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xW?(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(){!J0||!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=yW.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}(),_A=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},Wc=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||yg},SA=Cm(0,0,0,0);function xg(e){return parseFloat(e)||0}function MR(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+xg(i)},0)}function _W(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]=xg(s)}return n}function SW(e){var t=e.getBBox();return Cm(0,0,t.width,t.height)}function CW(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return SA;var r=Wc(e).getComputedStyle(e),o=_W(r),i=o.left+o.right,s=o.top+o.bottom,a=xg(r.width),l=xg(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=MR(r,"left","right")+i),Math.round(l+s)!==n&&(l-=MR(r,"top","bottom")+s)),!RW(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 Cm(o.left,o.top,a,l)}var EW=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Wc(e).SVGGraphicsElement}:function(e){return e instanceof Wc(e).SVGElement&&typeof e.getBBox=="function"}}();function RW(e){return e===Wc(e).document.documentElement}function OW(e){return J0?EW(e)?SW(e):CW(e):SA}function PW(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 _A(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Cm(e,t,n,r){return{x:e,y:t,width:n,height:r}}var TW=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Cm(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=OW(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}(),DW=function(){function e(t,n){var r=PW(n);_A(this,{target:t,contentRect:r})}return e}(),AW=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new wA,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 Wc(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new TW(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 Wc(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 DW(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}(),CA=typeof WeakMap<"u"?new WeakMap:new wA,EA=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=wW.getInstance(),r=new AW(t,n,this);CA.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){EA.prototype[e]=function(){var t;return(t=CA.get(this))[e].apply(t,arguments)}});var $W=function(){return typeof yg.ResizeObserver<"u"?yg.ResizeObserver:EA}();const kW=Object.freeze(Object.defineProperty({__proto__:null,default:$W},Symbol.toStringTag,{value:"Module"})),MW=gw(kW);Object.defineProperty(r1,"__esModule",{value:!0});r1.default=VW;var Qh=FW(m),IW=o1(pa),NW=o1(MW),LW=o1(Nw);function o1(e){return e&&e.__esModule?e:{default:e}}function RA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(RA=function(r){return r?n:t})(e)}function FW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=RA(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 Z0(){return Z0=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},Z0.apply(this,arguments)}function Xl(e,t,n){return t=jW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jW(e){var t=zW(e,"string");return typeof t=="symbol"?t:String(t)}function zW(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 BW="react-grid-layout";function VW(e){var t;return t=class extends Qh.Component{constructor(){super(...arguments),Xl(this,"state",{width:1280}),Xl(this,"elementRef",Qh.createRef()),Xl(this,"mounted",!1),Xl(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new NW.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?Qh.createElement("div",{className:(0,LW.default)(this.props.className,BW),style:this.props.style,ref:this.elementRef}):Qh.createElement(e,Z0({innerRef:this.elementRef},o,this.state))}},Xl(t,"defaultProps",{measureBeforeMount:!1}),Xl(t,"propTypes",{measureBeforeMount:IW.default.bool}),t}(function(e){e.exports=$f.default,e.exports.utils=Ot,e.exports.calculateUtils=Ri,e.exports.Responsive=Sm.default,e.exports.Responsive.utils=Cl,e.exports.WidthProvider=r1.default})(FD);var IR=FD.exports;function is({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),c=ke(h=>h.isDashboardEditing),u=h=>{h.stopPropagation(),c&&s(!0)};function f(){return o==="textarea"?O.jsx("textarea",{className:Ce(" grow px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:h=>l(h.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:h=>{h.key==="Enter"&&h.shiftKey||(h.key==="Enter"||h.key==="Tab")&&(s(!1),r(a))}}):O.jsx("input",{onMouseDown:h=>h.stopPropagation(),type:"text",className:Ce("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:h=>l(h.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:h=>{(h.key==="Enter"||h.key==="Tab")&&(s(!1),r(a))}})}return O.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 If(e){return e+.5|0}const Xs=(e,t,n)=>Math.max(Math.min(e,n),t);function rd(e){return Xs(If(e*2.55),0,255)}function ra(e){return Xs(If(e*255),0,255)}function Xi(e){return Xs(If(e/2.55)/100,0,1)}function NR(e){return Xs(If(e*100),0,100)}const Co={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},ex=[..."0123456789ABCDEF"],HW=e=>ex[e&15],WW=e=>ex[(e&240)>>4]+ex[e&15],Jh=e=>(e&240)>>4===(e&15),UW=e=>Jh(e.r)&&Jh(e.g)&&Jh(e.b)&&Jh(e.a);function qW(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Co[e[1]]*17,g:255&Co[e[2]]*17,b:255&Co[e[3]]*17,a:t===5?Co[e[4]]*17:255}:(t===7||t===9)&&(n={r:Co[e[1]]<<4|Co[e[2]],g:Co[e[3]]<<4|Co[e[4]],b:Co[e[5]]<<4|Co[e[6]],a:t===9?Co[e[7]]<<4|Co[e[8]]:255})),n}const GW=(e,t)=>e<255?t(e):"";function YW(e){var t=UW(e)?HW:WW;return e?"#"+t(e.r)+t(e.g)+t(e.b)+GW(e.a,t):void 0}const KW=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function OA(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 XW(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 QW(e,t,n){const r=OA(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 JW(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 i1(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=JW(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function s1(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(ra)}function a1(e,t,n){return s1(OA,e,t,n)}function ZW(e,t,n){return s1(QW,e,t,n)}function eU(e,t,n){return s1(XW,e,t,n)}function PA(e){return(e%360+360)%360}function tU(e){const t=KW.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?rd(+t[5]):ra(+t[5]));const o=PA(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=ZW(o,i,s):t[1]==="hsv"?r=eU(o,i,s):r=a1(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function nU(e,t){var n=i1(e);n[0]=PA(n[0]+t),n=a1(n),e.r=n[0],e.g=n[1],e.b=n[2]}function rU(e){if(!e)return;const t=i1(e),n=t[0],r=NR(t[1]),o=NR(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Xi(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const LR={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"},FR={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 oU(){const e={},t=Object.keys(FR),n=Object.keys(LR);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,LR[i]);i=parseInt(FR[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let Zh;function iU(e){Zh||(Zh=oU(),Zh.transparent=[0,0,0,0]);const t=Zh[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const sU=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function aU(e){const t=sU.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?rd(s):Xs(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?rd(r):Xs(r,0,255)),o=255&(t[4]?rd(o):Xs(o,0,255)),i=255&(t[6]?rd(i):Xs(i,0,255)),{r,g:o,b:i,a:n}}}function lU(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Xi(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Yb=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ql=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function cU(e,t,n){const r=Ql(Xi(e.r)),o=Ql(Xi(e.g)),i=Ql(Xi(e.b));return{r:ra(Yb(r+n*(Ql(Xi(t.r))-r))),g:ra(Yb(o+n*(Ql(Xi(t.g))-o))),b:ra(Yb(i+n*(Ql(Xi(t.b))-i))),a:e.a+n*(t.a-e.a)}}function ep(e,t,n){if(e){let r=i1(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=a1(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function TA(e,t){return e&&Object.assign(t||{},e)}function jR(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=ra(e[3]))):(t=TA(e,{r:0,g:0,b:0,a:1}),t.a=ra(t.a)),t}function uU(e){return e.charAt(0)==="r"?aU(e):tU(e)}class $d{constructor(t){if(t instanceof $d)return t;const n=typeof t;let r;n==="object"?r=jR(t):n==="string"&&(r=qW(t)||iU(t)||uU(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=TA(this._rgb);return t&&(t.a=Xi(t.a)),t}set rgb(t){this._rgb=jR(t)}rgbString(){return this._valid?lU(this._rgb):void 0}hexString(){return this._valid?YW(this._rgb):void 0}hslString(){return this._valid?rU(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=cU(this._rgb,t._rgb,n)),this}clone(){return new $d(this.rgb)}alpha(t){return this._rgb.a=ra(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=If(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 ep(this._rgb,2,t),this}darken(t){return ep(this._rgb,2,-t),this}saturate(t){return ep(this._rgb,1,t),this}desaturate(t){return ep(this._rgb,1,-t),this}rotate(t){return nU(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 Hi(){}const dU=(()=>{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 Dt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Cn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Kr(e,t){return Cn(e)?e:t}function dt(e,t){return typeof e>"u"?t:e}const fU=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,DA=(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(Dt(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 _g(e){if(pn(e))return e.map(_g);if(Dt(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=_g(e[n[o]]);return t}return e}function AA(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function hU(e,t,n,r){if(!AA(e))return;const o=t[e],i=n[e];Dt(o)&&Dt(i)?_i(o,i,r):t[e]=_g(i)}function _i(e,t,n){const r=pn(t)?t:[t],o=r.length;if(!Dt(e))return e;n=n||{};const i=n.merger||hU;let s;for(let a=0;a<o;++a){if(s=r[a],!Dt(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 ud(e,t){return _i(e,t,{merger:pU})}function pU(e,t,n){if(!AA(e))return;const r=t[e],o=n[e];Dt(r)&&Dt(o)?ud(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=_g(o))}const zR={"":e=>e,x:e=>e.x,y:e=>e.y};function gU(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 mU(e){const t=gU(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function sa(e,t){return(zR[t]||(zR[t]=mU(t)))(e)}function l1(e){return e.charAt(0).toUpperCase()+e.slice(1)}const kd=e=>typeof e<"u",aa=e=>typeof e=="function",BR=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function vU(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const mn=Math.PI,gn=2*mn,bU=gn+mn,Sg=Number.POSITIVE_INFINITY,yU=mn/180,Tn=mn/2,Aa=mn/4,VR=mn*2/3,Qs=Math.log10,yi=Math.sign;function dd(e,t,n){return Math.abs(e-t)<n}function HR(e){const t=Math.round(e);e=dd(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Qs(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function xU(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 Uc(e){return!isNaN(parseFloat(e))&&isFinite(e)}function wU(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function $A(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 Yo(e){return e*(mn/180)}function c1(e){return e*(180/mn)}function WR(e){if(!Cn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function kA(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 tx(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function _U(e,t){return(e-t+bU)%gn-mn}function eo(e){return(e%gn+gn)%gn}function Md(e,t,n,r){const o=eo(e),i=eo(t),s=eo(n),a=eo(i-o),l=eo(s-o),c=eo(o-i),u=eo(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function Un(e,t,n){return Math.max(t,Math.min(n,e))}function SU(e){return Un(e,-32768,32767)}function es(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function u1(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 ts=(e,t,n,r)=>u1(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),CU=(e,t,n)=>u1(e,n,r=>e[r][t]>=n);function EU(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 MA=["push","pop","shift","splice","unshift"];function RU(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),MA.forEach(n=>{const r="_onData"+l1(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 UR(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)&&(MA.forEach(i=>{delete e[i]}),delete e._chartjs)}function IA(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const NA=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function LA(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,NA.call(window,()=>{r=!1,e.apply(t,n)}))}}function OU(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const d1=e=>e==="start"?"left":e==="end"?"right":"center",sr=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,PU=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function FA(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:h}=s.getUserBounds();f&&(o=Un(Math.min(ts(a,l,c).lo,n?r:ts(t,l,s.getPixelForValue(c)).lo),0,r-1)),h?i=Un(Math.max(ts(a,s.axis,u,!0).hi+1,n?0:ts(t,l,s.getPixelForValue(u),!0).hi+1),o,r)-o:i=r-o}return{start:o,count:i}}function jA(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 tp=e=>e===0||e===1,qR=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*gn/n)),GR=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*gn/n)+1,fd={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*Tn)+1,easeOutSine:e=>Math.sin(e*Tn),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=>tp(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=>tp(e)?e:qR(e,.075,.3),easeOutElastic:e=>tp(e)?e:GR(e,.075,.3),easeInOutElastic(e){return tp(e)?e:e<.5?.5*qR(e*2,.1125,.45):.5+.5*GR(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-fd.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?fd.easeInBounce(e*2)*.5:fd.easeOutBounce(e*2-1)*.5+.5};function f1(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function YR(e){return f1(e)?e:new $d(e)}function Kb(e){return f1(e)?e:new $d(e).saturate(.5).darken(.1).hexString()}const TU=["x","y","borderWidth","radius","tension"],DU=["color","borderColor","backgroundColor"];function AU(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:DU},numbers:{type:"number",properties:TU}}),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 $U(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const KR=new Map;function kU(e,t){t=t||{};const n=e+JSON.stringify(t);let r=KR.get(n);return r||(r=new Intl.NumberFormat(e,t),KR.set(n,r)),r}function Nf(e,t,n){return kU(t,n).format(e)}const zA={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=MU(e,n)}const s=Qs(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),Nf(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Qs(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?zA.numeric.call(this,e,t,n):""}};function MU(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 Em={formatters:zA};function IU(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:Em.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 pl=Object.create(null),nx=Object.create(null);function hd(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 Xb(e,t,n){return typeof t=="string"?_i(hd(e,t),n):_i(hd(e,""),t)}class NU{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)=>Kb(o.backgroundColor),this.hoverBorderColor=(r,o)=>Kb(o.borderColor),this.hoverColor=(r,o)=>Kb(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 Xb(this,t,n)}get(t){return hd(this,t)}describe(t,n){return Xb(nx,t,n)}override(t,n){return Xb(pl,t,n)}route(t,n,r,o){const i=hd(this,t),s=hd(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 Dt(l)?Object.assign({},c,l):dt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var _n=new NU({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[AU,$U,IU]);function LU(e){return!e||Rt(e.size)||Rt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Cg(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 FU(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,h;for(l=0;l<a;l++)if(f=n[l],f!=null&&!pn(f))s=Cg(e,o,i,s,f);else if(pn(f))for(c=0,u=f.length;c<u;c++)h=f[c],h!=null&&!pn(h)&&(s=Cg(e,o,i,s,h));e.restore();const g=i.length/2;if(g>n.length){for(l=0;l<g;l++)delete o[i[l]];i.splice(0,g)}return s}function $a(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 XR(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function rx(e,t,n,r){BA(e,t,n,r,null)}function BA(e,t,n,r,o){let i,s,a,l,c,u,f,h;const g=t.pointStyle,v=t.rotation,b=t.radius;let w=(v||0)*yU;if(g&&typeof g=="object"&&(i=g.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(w),e.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),e.restore();return}if(!(isNaN(b)||b<=0)){switch(e.beginPath(),g){default:o?e.ellipse(n,r,o/2,b,0,0,gn):e.arc(n,r,b,0,gn),e.closePath();break;case"triangle":u=o?o/2:b,e.moveTo(n+Math.sin(w)*u,r-Math.cos(w)*b),w+=VR,e.lineTo(n+Math.sin(w)*u,r-Math.cos(w)*b),w+=VR,e.lineTo(n+Math.sin(w)*u,r-Math.cos(w)*b),e.closePath();break;case"rectRounded":c=b*.516,l=b-c,s=Math.cos(w+Aa)*l,f=Math.cos(w+Aa)*(o?o/2-c:l),a=Math.sin(w+Aa)*l,h=Math.sin(w+Aa)*(o?o/2-c:l),e.arc(n-f,r-a,c,w-mn,w-Tn),e.arc(n+h,r-s,c,w-Tn,w),e.arc(n+f,r+a,c,w,w+Tn),e.arc(n-h,r+s,c,w+Tn,w+mn),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*b,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}w+=Aa;case"rectRot":f=Math.cos(w)*(o?o/2:b),s=Math.cos(w)*b,a=Math.sin(w)*b,h=Math.sin(w)*(o?o/2:b),e.moveTo(n-f,r-a),e.lineTo(n+h,r-s),e.lineTo(n+f,r+a),e.lineTo(n-h,r+s),e.closePath();break;case"crossRot":w+=Aa;case"cross":f=Math.cos(w)*(o?o/2:b),s=Math.cos(w)*b,a=Math.sin(w)*b,h=Math.sin(w)*(o?o/2:b),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s);break;case"star":f=Math.cos(w)*(o?o/2:b),s=Math.cos(w)*b,a=Math.sin(w)*b,h=Math.sin(w)*(o?o/2:b),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s),w+=Aa,f=Math.cos(w)*(o?o/2:b),s=Math.cos(w)*b,a=Math.sin(w)*b,h=Math.sin(w)*(o?o/2:b),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s);break;case"line":s=o?o/2:Math.cos(w)*b,a=Math.sin(w)*b,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:b),r+Math.sin(w)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ns(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 Rm(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Om(e){e.restore()}function jU(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 zU(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 BU(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 VU(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 HU(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function gl(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,BU(e,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&HU(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),VU(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function Id(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,Tn,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,Tn,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-Tn,!0),e.lineTo(n+s.topLeft,r)}const WU=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,UU=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function qU(e,t){const n=(""+e).match(WU);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 GU=e=>+e||0;function h1(e,t){const n={},r=Dt(t),o=r?Object.keys(t):t,i=Dt(e)?r?s=>dt(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=GU(i(s));return n}function VA(e){return h1(e,{top:"y",right:"x",bottom:"y",left:"x"})}function sl(e){return h1(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Jn(e){const t=VA(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $n(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(UU)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:dt(e.family,t.family),lineHeight:qU(dt(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:dt(e.weight,t.weight),string:""};return o.string=LU(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 YU(e,t,n){const{min:r,max:o}=e,i=DA(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 ga(e,t){return Object.assign(Object.create(e),t)}function p1(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=qA("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>p1([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 WA(a,l,()=>nq(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return JR(a).includes(l)},ownKeys(a){return JR(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function qc(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:HA(e,r),setContext:i=>qc(e,i,n,r),override:i=>qc(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 WA(i,s,()=>XU(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 HA(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:aa(n)?n:()=>n,isIndexable:aa(r)?r:()=>r}}const KU=(e,t)=>e?e+l1(t):t,g1=(e,t)=>Dt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function WA(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function XU(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return aa(a)&&s.isScriptable(t)&&(a=QU(t,a,e,n)),pn(a)&&a.length&&(a=JU(t,a,e,s.isIndexable)),g1(t,a)&&(a=qc(a,o,i&&i[t],s)),a}function QU(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),g1(e,l)&&(l=m1(o._scopes,o,e,l)),l}function JU(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(Dt(t[0])){const l=t,c=o._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=m1(c,o,e,u);t.push(qc(f,i,s&&s[e],a))}}return t}function UA(e,t,n){return aa(e)?e(t,n):e}const ZU=(e,t)=>e===!0?t:typeof e=="string"?sa(t,e):void 0;function eq(e,t,n,r,o){for(const i of t){const s=ZU(n,i);if(s){e.add(s);const a=UA(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 m1(e,t,n,r){const o=t._rootScopes,i=UA(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=QR(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=QR(a,s,i,l,r),l===null)?!1:p1(Array.from(a),[""],o,i,()=>tq(t,n,r))}function QR(e,t,n,r,o){for(;n;)n=eq(e,t,n,r,o);return n}function tq(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return pn(o)&&Dt(n)?n:o||{}}function nq(e,t,n,r){let o;for(const i of t)if(o=qA(KU(i,e),n),typeof o<"u")return g1(e,o)?m1(n,r,e,o):o}function qA(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function JR(e){let t=e._keys;return t||(t=e._keys=rq(e._scopes)),t}function rq(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 GA(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(sa(u,i),c)};return s}const oq=Number.EPSILON||1e-14,Gc=(e,t)=>t<e.length&&!e[t].skip&&e[t],YA=e=>e==="x"?"y":"x";function iq(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=tx(i,o),l=tx(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,h=r*u;return{previous:{x:i.x-f*(s.x-o.x),y:i.y-f*(s.y-o.y)},next:{x:i.x+h*(s.x-o.x),y:i.y+h*(s.y-o.y)}}}function sq(e,t,n){const r=e.length;let o,i,s,a,l,c=Gc(e,0);for(let u=0;u<r-1;++u)if(l=c,c=Gc(e,u+1),!(!l||!c)){if(dd(t[u],0,oq)){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 aq(e,t,n="x"){const r=YA(n),o=e.length;let i,s,a,l=Gc(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=Gc(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 lq(e,t="x"){const n=YA(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,c=Gc(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=Gc(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?yi(o[s-1])!==yi(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}sq(e,o,i),aq(e,i,t)}function np(e,t,n){return Math.max(Math.min(e,n),t)}function cq(e,t){let n,r,o,i,s,a=ns(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&ns(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=np(o.cp1x,t.left,t.right),o.cp1y=np(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=np(o.cp2x,t.left,t.right),o.cp2y=np(o.cp2y,t.top,t.bottom)))}function uq(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")lq(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=iq(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&&cq(e,n)}function v1(){return typeof window<"u"&&typeof document<"u"}function b1(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Eg(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 Pm=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function dq(e,t){return Pm(e).getPropertyValue(t)}const fq=["top","right","bottom","left"];function al(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=fq[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const hq=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function pq(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(hq(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 Fa(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=Pm(n),i=o.boxSizing==="border-box",s=al(o,"padding"),a=al(o,"border","width"),{x:l,y:c,box:u}=pq(e,n),f=s.left+(u&&a.left),h=s.top+(u&&a.top);let{width:g,height:v}=t;return i&&(g-=s.width+a.width,v-=s.height+a.height),{x:Math.round((l-f)/g*n.width/r),y:Math.round((c-h)/v*n.height/r)}}function gq(e,t,n){let r,o;if(t===void 0||n===void 0){const i=b1(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=Pm(i),l=al(a,"border","width"),c=al(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Eg(a.maxWidth,i,"clientWidth"),o=Eg(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||Sg,maxHeight:o||Sg}}const rp=e=>Math.round(e*10)/10;function mq(e,t,n,r){const o=Pm(e),i=al(o,"margin"),s=Eg(o.maxWidth,e,"clientWidth")||Sg,a=Eg(o.maxHeight,e,"clientHeight")||Sg,l=gq(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const h=al(o,"border","width"),g=al(o,"padding");c-=g.width+h.width,u-=g.height+h.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=rp(Math.min(c,s,l.maxWidth)),u=rp(Math.min(u,a,l.maxHeight)),c&&!u&&(u=rp(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=rp(Math.floor(u*r))),{width:c,height:u}}function ZR(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 vq=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};v1()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function eO(e,t){const n=dq(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ja(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function bq(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 yq(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=ja(e,o,n),a=ja(o,i,n),l=ja(i,t,n),c=ja(s,a,n),u=ja(a,l,n);return ja(c,u,n)}const xq=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}}},wq=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function bc(e,t,n){return e?xq(t,n):wq()}function KA(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 XA(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function QA(e){return e==="angle"?{between:Md,compare:_U,normalize:eo}:{between:es,compare:(t,n)=>t-n,normalize:t=>t}}function tO({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 _q(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=QA(r),l=t.length;let{start:c,end:u,loop:f}=e,h,g;if(f){for(c+=l,u+=l,h=0,g=l;h<g&&s(a(t[c%l][r]),o,i);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:e.style}}function JA(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:c}=QA(r),{start:u,end:f,loop:h,style:g}=_q(e,t,n),v=[];let b=!1,w=null,x,_,S;const C=()=>l(o,S,x)&&a(o,S)!==0,E=()=>a(i,x)===0||l(i,S,x),P=()=>b||C(),A=()=>!b||E();for(let k=u,I=u;k<=f;++k)_=t[k%s],!_.skip&&(x=c(_[r]),x!==S&&(b=l(x,o,i),w===null&&P()&&(w=a(x,o)===0?k:I),w!==null&&A()&&(v.push(tO({start:w,end:k,loop:h,count:s,style:g})),w=null),I=k,S=x));return w!==null&&v.push(tO({start:w,end:f,loop:h,count:s,style:g})),v}function ZA(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=JA(r[o],e.points,t);i.length&&n.push(...i)}return n}function Sq(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 Cq(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 Eq(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=Sq(n,o,i,r);if(r===!0)return nO(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 nO(e,Cq(n,s,l,c),n,t)}function nO(e,t,n,r){return!r||!r.setContext||!n?t:Rq(e,t,n,r)}function Rq(e,t,n,r){const o=e._chart.getContext(),i=rO(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=i,f=t[0].start,h=f;function g(v,b,w,x){const _=a?-1:1;if(v!==b){for(v+=l;n[v%l].skip;)v-=_;for(;n[b%l].skip;)b+=_;v%l!==b%l&&(c.push({start:v%l,end:b%l,loop:w,style:x}),u=x,f=b%l)}}for(const v of t){f=a?f:v.start;let b=n[f%l],w;for(h=f+1;h<=v.end;h++){const x=n[h%l];w=rO(r.setContext(ga(o,{type:"segment",p0:b,p1:x,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:s}))),Oq(w,u)&&g(f,h-1,v.loop,u),b=x,u=w}f<h-1&&g(f,h-1,v.loop,u)}return c}function rO(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Oq(e,t){if(!t)return!1;const n=[],r=function(o,i){return f1(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 Pq{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=NA.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 Gi=new Pq;const oO="transparent",Tq={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=YR(e||oO),o=r.valid&&YR(t||oO);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Dq{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||Tq[t.type||typeof s],this._easing=fd[t.easing]||fd.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 e${constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Dt(t))return;const n=Object.keys(_n.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!Dt(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=$q(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&Aq(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 h=r.get(c);if(f)if(h&&f.active()){f.update(h,u,a);continue}else f.cancel();if(!h||!h.duration){t[c]=u;continue}i[c]=f=new Dq(h,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 Gi.add(this._chart,r),!0}}function Aq(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 $q(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 iO(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 kq(e,t,n){if(n===!1)return!1;const r=iO(e,n),o=iO(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function Mq(e){let t,n,r,o;return Dt(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 t$(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 sO(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],Cn(c)&&(i||t===0||yi(t)===yi(c))&&(t+=c)}return t}}function Iq(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 aO(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Nq(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Lq(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 Fq(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function lO(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 cO(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=Nq(i,s,r),f=t.length;let h;for(let g=0;g<f;++g){const v=t[g],{[l]:b,[c]:w}=v,x=v._stacks||(v._stacks={});h=x[c]=Fq(o,u,b),h[a]=w,h._top=lO(h,s,!0,r.type),h._bottom=lO(h,s,!1,r.type);const _=h._visualValues||(h._visualValues={});_[a]=w}}function Qb(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function jq(e,t){return ga(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function zq(e,t,n){return ga(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Nu(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 Jb=e=>e==="reset"||e==="none",uO=(e,t)=>t?e:Object.assign({},e),Bq=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:t$(n,!0),values:null};class Ko{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=aO(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&&Nu(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(f,h,g,v)=>f==="x"?h:f==="r"?v:g,i=n.xAxisID=dt(r.xAxisID,Qb(t,"x")),s=n.yAxisID=dt(r.yAxisID,Qb(t,"y")),a=n.rAxisID=dt(r.rAxisID,Qb(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&&UR(this._data,this),t._stacked&&Nu(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Dt(n))this._data=Iq(n);else if(r!==n){if(r){UR(r,this);const o=this._cachedMeta;Nu(o),o._parsed=[]}n&&Object.isExtensible(n)&&RU(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=aO(n.vScale,n),n.stack!==r.stack&&(o=!0,Nu(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&cO(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,h;if(this._parsing===!1)r._parsed=o,r._sorted=!0,h=o;else{pn(o[t])?h=this.parseArrayData(r,o,t,n):Dt(o[t])?h=this.parseObjectData(r,o,t,n):h=this.parsePrimitiveData(r,o,t,n);const g=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=f=h[u],l&&(g()&&(l=!1),c=f);r._sorted=l}s&&cO(this,h)}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 h,g,v;for(h=0,g=o;h<g;++h)v=h+r,f[h]={[a]:u||i.parse(c[v],v),[l]:s.parse(n[v],v)};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,h,g;for(u=0,f=o;u<f;++u)h=u+r,g=n[h],c[u]={x:i.parse(sa(g,a),h),y:s.parse(sa(g,l),h)};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:t$(o,!0),values:n._stacks[t.axis]._visualValues};return sO(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=sO(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=Bq(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Lq(a);let h,g;function v(){g=o[h];const b=g[a.axis];return!Cn(g[t.axis])||u>b||f<b}for(h=0;h<s&&!(!v()&&(this.updateRangeFromParsed(c,t,g,l),i));++h);if(i){for(h=s-1;h>=0;--h)if(!v()){this.updateRangeFromParsed(c,t,g,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],Cn(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=Mq(dt(this.options.clip,kq(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=zq(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=jq(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&&kd(r);if(a)return uO(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=o?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),g=Object.keys(_n.elements[t]),v=()=>this.getContext(r,o,n),b=c.resolveNamedOptions(h,g,v,f);return b.$shared&&(b.$shared=l,i[s]=Object.freeze(uO(b,l))),b}_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),h=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(h,this.getContext(t,r,n))}const c=new e$(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||Jb(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){Jb(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!Jb(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&&Nu(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(Ko,"defaults",{}),Ne(Ko,"datasetElementType",null),Ne(Ko,"dataElementType",null);function Vq(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=IA(r.sort((o,i)=>o-i))}return e._cache.$bar}function Hq(e){const t=e.iScale,n=Vq(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(kd(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 Wq(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 Uq(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 qq(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 n$(e,t,n,r){return pn(e)?qq(e,t,n,r):t[n.axis]=n.parse(e,r),t}function dO(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,f,h;for(c=n,u=n+r;c<u;++c)h=t[c],f={},f[o.axis]=a||o.parse(s[c],c),l.push(n$(h,f,i,c));return l}function Zb(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Gq(e,t,n){return e!==0?yi(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Yq(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 Kq(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}=Yq(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[fO(u,s,a,l)]=!0,o=c)),i[fO(o,s,a,l)]=!0,e.borderSkipped=i}function fO(e,t,n,r){return r?(e=Xq(e,t,n),e=hO(e,n,t)):e=hO(e,t,n),e}function Xq(e,t,n){return e===t?n:e===n?t:e}function hO(e,t,n){return e==="start"?t:e==="end"?n:e}function Qq(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Qp extends Ko{parsePrimitiveData(t,n,r,o){return dO(t,n,r,o)}parseArrayData(t,n,r,o){return dO(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 h,g,v,b;for(h=r,g=r+o;h<g;++h)b=n[h],v={},v[i.axis]=i.parse(sa(b,c),h),f.push(n$(sa(b,u),v,s,h));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=Zb(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:h}=this._getSharedOptions(n,o);for(let g=n;g<n+r;g++){const v=this.getParsed(g),b=i||Rt(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),w=this._calculateBarIndexPixels(g,u),x=(v._stacks||{})[a.axis],_={horizontal:c,base:b.base,enableBorderRadius:!x||Zb(v._custom)||s===x._top||s===x._bottom,x:c?b.head:w.center,y:c?w.center:b.head,height:c?w.size:Math.abs(b.size),width:c?Math.abs(b.size):w.size};h&&(_.options=f||this.resolveDataElementOptions(g,t[g].active?"active":o));const S=_.options||t[g].options;Kq(_,S,x,s),Qq(_,S,u.ratio),this.updateElement(t[g],g,_,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||Hq(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=Zb(c);let f=l[n.axis],h=0,g=r?this.applyStack(n,l,r):f,v,b;g!==f&&(h=g-f,g=f),u&&(f=c.barStart,g=c.barEnd-c.barStart,f!==0&&yi(f)!==yi(c.barEnd)&&(h=0),h+=f);const w=!Rt(i)&&!u?i:h;let x=n.getPixelForValue(w);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(h+g):v=x,b=v-x,Math.abs(b)<s){b=Gq(b,n,a)*s,f===a&&(x-=b/2);const _=n.getPixelForDecimal(0),S=n.getPixelForDecimal(1),C=Math.min(_,S),E=Math.max(_,S);x=Math.max(Math.min(x,E),C),v=x+b,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(v)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const _=yi(b)*n.getLineWidthForValue(a)/2;x+=_,b-=_}return{size:b,base:x,head:v,center:v+b/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"?Uq(t,n,o,c):Wq(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(Qp,"id","bar"),Ne(Qp,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ne(Qp,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Jp extends Ko{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 h=n;h<n+r;h++){const g=t[h],v=!i&&this.getParsed(h),b={},w=b[u]=i?s.getPixelForDecimal(.5):s.getPixelForValue(v[u]),x=b[f]=i?a.getBasePixel():a.getPixelForValue(v[f]);b.skip=isNaN(w)||isNaN(x),c&&(b.options=l||this.resolveDataElementOptions(h,g.active?"active":o),i&&(b.options.radius=0)),this.updateElement(g,h,b,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(Jp,"id","bubble"),Ne(Jp,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Ne(Jp,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Jq(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),h=Math.sin(l),g=(S,C,E)=>Md(S,a,l,!0)?1:Math.max(C,C*n,E,E*n),v=(S,C,E)=>Md(S,a,l,!0)?-1:Math.min(C,C*n,E,E*n),b=g(0,c,f),w=g(Tn,u,h),x=v(mn,c,f),_=v(mn+Tn,u,h);r=(b-x)/2,o=(w-_)/2,i=-(b+x)/2,s=-(w+_)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class Ya extends Ko{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(Dt(r[t])){const{key:l="value"}=this._parsing;i=c=>+sa(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return Yo(this.options.rotation-90)}_getCircumference(){return Yo(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(fU(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:g,offsetX:v,offsetY:b}=Jq(f,u,l),w=(r.width-s)/h,x=(r.height-s)/g,_=Math.max(Math.min(w,x)/2,0),S=DA(this.options.radius,_),C=Math.max(S*l,0),E=(S-C)/this._getVisibleDatasetWeightTotal();this.offsetX=v*S,this.offsetY=b*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,h=i&&c.animateScale,g=h?0:this.innerRadius,v=h?0:this.outerRadius,{sharedOptions:b,includeOptions:w}=this._getSharedOptions(n,o);let x=this._getRotation(),_;for(_=0;_<n;++_)x+=this._circumference(_,i);for(_=n;_<n+r;++_){const S=this._circumference(_,i),C=t[_],E={x:u+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+S,circumference:S,outerRadius:v,innerRadius:g};w&&(E.options=b||this.resolveDataElementOptions(_,C.active?"active":o)),x+=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=Nf(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(Ya,"id","doughnut"),Ne(Ya,"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(Ya,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ne(Ya,"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 Zp extends Ko{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}=FA(n,o,s);this._drawStart=a,this._drawCount=l,jA(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),h=s.axis,g=a.axis,{spanGaps:v,segment:b}=this.options,w=Uc(v)?v:Number.POSITIVE_INFINITY,x=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 P=t[E],A=x?P:{};if(E<n||E>=_){A.skip=!0;continue}const k=this.getParsed(E),I=Rt(k[g]),$=A[h]=s.getPixelForValue(k[h],E),L=A[g]=i||I?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[g],E);A.skip=isNaN($)||isNaN(L)||I,A.stop=E>0&&Math.abs(k[h]-C[h])>w,b&&(A.parsed=k,A.raw=c.data[E]),f&&(A.options=u||this.resolveDataElementOptions(E,P.active?"active":o)),x||this.updateElement(P,E,A,o),C=k}}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(Zp,"id","line"),Ne(Zp,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ne(Zp,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class pd extends Ko{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=Nf(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return GA.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,h=c.getIndexAngle(0)-.5*mn;let g=h,v;const b=360/this.countVisibleElements();for(v=0;v<n;++v)g+=this._computeAngle(v,o,b);for(v=n;v<n+r;v++){const w=t[v];let x=g,_=g+this._computeAngle(v,o,b),S=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;g=_,i&&(l.animateScale&&(S=0),l.animateRotate&&(x=_=h));const C={x:u,y:f,innerRadius:0,outerRadius:S,startAngle:x,endAngle:_,options:this.resolveDataElementOptions(v,w.active?"active":o)};this.updateElement(w,v,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)?Yo(this.resolveDataElementOptions(t,n).angle||r):0}}Ne(pd,"id","polarArea"),Ne(pd,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Ne(pd,"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 ox extends Ya{}Ne(ox,"id","pie"),Ne(ox,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class eg extends Ko{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 GA.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,h=s?i.yCenter:u.y,g={x:f,y:h,angle:u.angle,skip:isNaN(f)||isNaN(h),options:c};this.updateElement(l,a,g,o)}}}Ne(eg,"id","radar"),Ne(eg,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Ne(eg,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class tg extends Ko{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}=FA(n,r,o);if(this._drawStart=i,this._drawCount=s,jA(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),h=this.includeOptions(o,f),g=s.axis,v=a.axis,{spanGaps:b,segment:w}=this.options,x=Uc(b)?b: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],P=this.getParsed(C),A=_?E:{},k=Rt(P[v]),I=A[g]=s.getPixelForValue(P[g],C),$=A[v]=i||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[v],C);A.skip=isNaN(I)||isNaN($)||k,A.stop=C>0&&Math.abs(P[g]-S[g])>x,w&&(A.parsed=P,A.raw=c.data[C]),h&&(A.options=f||this.resolveDataElementOptions(C,E.active?"active":o)),_||this.updateElement(E,C,A,o),S=P}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(tg,"id","scatter"),Ne(tg,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Ne(tg,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Zq=Object.freeze({__proto__:null,BarController:Qp,BubbleController:Jp,DoughnutController:Ya,LineController:Zp,PieController:ox,PolarAreaController:pd,RadarController:eg,ScatterController:tg});function ka(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class y1{constructor(t){Ne(this,"options");this.options=t||{}}static override(t){Object.assign(y1.prototype,t)}init(){}formats(){return ka()}parse(){return ka()}format(){return ka()}add(){return ka()}diff(){return ka()}startOf(){return ka()}endOf(){return ka()}}var eG={_date:y1};function tG(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?CU:ts;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),h=l(i,t,n+u);return{lo:f.lo,hi:h.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function Lf(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:h}=tG(i[a],t,s,o);for(let g=f;g<=h;++g){const v=u[g];v.skip||r(v,c,g)}}}function nG(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 ey(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||Lf(e,n,t,function(a,l,c){!o&&!ns(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function rG(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:f}=kA(s,{x:t.x,y:t.y});Md(f,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return Lf(e,n,t,i),o}function oG(e,t,n,r,o,i){let s=[];const a=nG(n);let l=Number.POSITIVE_INFINITY;function c(u,f,h){const g=u.inRange(t.x,t.y,o);if(r&&!g)return;const v=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(v))&&!g)return;const w=a(t,v);w<l?(s=[{element:u,datasetIndex:f,index:h}],l=w):w===l&&s.push({element:u,datasetIndex:f,index:h})}return Lf(e,n,t,c),s}function ty(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?rG(e,t,n,o):oG(e,t,n,r,o,i)}function pO(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Lf(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 iG={evaluateInteractionItems:Lf,modes:{index(e,t,n,r){const o=Fa(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?ey(e,o,i,r,s):ty(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=Fa(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?ey(e,o,i,r,s):ty(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=Fa(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return ey(e,o,i,r,s)},nearest(e,t,n,r){const o=Fa(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return ty(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=Fa(t,e);return pO(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=Fa(t,e);return pO(e,o,"y",n.intersect,r)}}};const r$=["left","top","right","bottom"];function Lu(e,t){return e.filter(n=>n.pos===t)}function gO(e,t){return e.filter(n=>r$.indexOf(n.pos)===-1&&n.box.axis===t)}function Fu(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 sG(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 aG(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!r$.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 lG(e,t){const n=aG(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 cG(e){const t=sG(e),n=Fu(t.filter(c=>c.box.fullSize),!0),r=Fu(Lu(t,"left"),!0),o=Fu(Lu(t,"right")),i=Fu(Lu(t,"top"),!0),s=Fu(Lu(t,"bottom")),a=gO(t,"x"),l=gO(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:Lu(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function mO(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function o$(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 uG(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!Dt(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&&o$(s,i.getPadding());const a=Math.max(0,t.outerWidth-mO(s,e,"left","right")),l=Math.max(0,t.outerHeight-mO(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 dG(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 fG(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 od(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,fG(a.horizontal,t));const{same:f,other:h}=uG(t,n,a,r);c|=f&&o.length,u=u||h,l.fullSize||o.push(a)}return c&&od(o,t,n,r)||u}function op(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 vO(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,h=c.size||l.height;kd(c.start)&&(s=c.start),l.fullSize?op(l,o.left,s,n.outerWidth-o.right-o.left,h):op(l,t.left+c.placed,s,f,h),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*u,h=c.size||l.width;kd(c.start)&&(i=c.start),l.fullSize?op(l,i,o.top,h,n.outerHeight-o.bottom-o.top):op(l,i,t.top+c.placed,h,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=Jn(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=cG(e.boxes),l=a.vertical,c=a.horizontal;Yt(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,w)=>w.box.options&&w.box.options.display===!1?b:b+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},o);o$(h,Jn(r));const g=Object.assign({maxPadding:h,w:i,h:s,x:o.left,y:o.top},o),v=lG(l.concat(c),f);od(a.fullSize,g,f,v),od(l,g,f,v),od(c,g,f,v)&&od(l,g,f,v),dG(g),vO(a.leftAndTop,g,f,v),g.x+=g.w,g.y+=g.h,vO(a.rightAndBottom,g,f,v),e.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Yt(a.chartArea,b=>{const w=b.box;Object.assign(w,e.chartArea),w.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class i${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 hG extends i${acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ng="$chartjs",pG={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bO=e=>e===null||e==="";function gG(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[ng]={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",bO(o)){const i=eO(e,"width");i!==void 0&&(e.width=i)}if(bO(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=eO(e,"height");i!==void 0&&(e.height=i)}return e}const s$=vq?{passive:!0}:!1;function mG(e,t,n){e.addEventListener(t,n,s$)}function vG(e,t,n){e.canvas.removeEventListener(t,n,s$)}function bG(e,t){const n=pG[e.type]||e.type,{x:r,y:o}=Fa(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function Rg(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function yG(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Rg(a.addedNodes,r),s=s&&!Rg(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function xG(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Rg(a.removedNodes,r),s=s&&!Rg(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Nd=new Map;let yO=0;function a$(){const e=window.devicePixelRatio;e!==yO&&(yO=e,Nd.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function wG(e,t){Nd.size||window.addEventListener("resize",a$),Nd.set(e,t)}function _G(e){Nd.delete(e),Nd.size||window.removeEventListener("resize",a$)}function SG(e,t,n){const r=e.canvas,o=r&&b1(r);if(!o)return;const i=LA((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),wG(e,i),s}function ny(e,t,n){n&&n.disconnect(),t==="resize"&&_G(e)}function CG(e,t,n){const r=e.canvas,o=LA(i=>{e.ctx!==null&&n(bG(i,e))},e);return mG(r,t,o),o}class EG extends i${acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(gG(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[ng])return!1;const r=n[ng].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[ng],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:yG,detach:xG,resize:SG}[n]||CG;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:ny,detach:ny,resize:ny}[n]||vG)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return mq(t,n,r,o)}isAttached(t){const n=b1(t);return!!(n&&n.isConnected)}}function RG(e){return!v1()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?hG:EG}var Yp;let us=(Yp=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 Uc(this.x)&&Uc(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(Yp,"defaults",{}),Ne(Yp,"defaultRoutes"),Yp);function OG(e,t){const n=e.options.ticks,r=PG(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?DG(t):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return AG(t,c,i,s/o),c;const u=TG(i,t,o);if(s>0){let f,h;const g=s>1?Math.round((l-a)/(s-1)):null;for(ip(t,c,u,Rt(g)?0:a-g,a),f=0,h=s-1;f<h;f++)ip(t,c,u,i[f],i[f+1]);return ip(t,c,u,l,Rt(g)?t.length:l+g),c}return ip(t,c,u),c}function PG(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 TG(e,t,n){const r=$G(e),o=t.length/n;if(!r)return Math.max(o,1);const i=xU(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 DG(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function AG(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 ip(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 $G(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 kG=e=>e==="left"?"right":e==="right"?"left":e,xO=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,wO=(e,t)=>Math.min(t||e,e);function _O(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 MG(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 IG(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 SO(e,t){if(!e.display)return 0;const n=$n(e.font,t),r=Jn(e.padding);return(pn(e.text)?e.text.length:1)*n.lineHeight+r.height}function NG(e,t){return ga(e,{scale:t,type:"scale"})}function LG(e,t,n){return ga(e,{tick:n,index:t,type:"tick"})}function FG(e,t,n){let r=d1(e);return(n&&t!=="right"||!n&&t==="right")&&(r=kG(r)),r}function jG(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,h,g,v;const b=s-o,w=a-i;if(e.isHorizontal()){if(g=sr(r,i,a),Dt(n)){const x=Object.keys(n)[0],_=n[x];v=u[x].getPixelForValue(_)+b-t}else n==="center"?v=(c.bottom+c.top)/2+b-t:v=xO(e,n,t);h=a-i}else{if(Dt(n)){const x=Object.keys(n)[0],_=n[x];g=u[x].getPixelForValue(_)-w+t}else n==="center"?g=(c.left+c.right)/2-w+t:g=xO(e,n,t);v=sr(r,s,o),f=n==="left"?-Tn:Tn}return{titleX:g,titleY:v,maxWidth:h,rotation:f}}class El extends us{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=Kr(t,Number.POSITIVE_INFINITY),n=Kr(n,Number.NEGATIVE_INFINITY),r=Kr(r,Number.POSITIVE_INFINITY),o=Kr(o,Number.NEGATIVE_INFINITY),{min:Kr(t,r),max:Kr(n,o),minDefined:Cn(t),maxDefined:Cn(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:Kr(n,Kr(r,n)),max:Kr(r,Kr(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=YU(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?_O(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=OG(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=wO(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,h=u.highest.height,g=Un(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:g/(r-1),f+6>a&&(a=g/(r-(t.offset?.5:1)),l=this.maxHeight-ju(t.grid)-n.padding-SO(t.title,this.chart.options.font),c=Math.sqrt(f*f+h*h),s=c1(Math.min(Math.asin(Un((u.highest.height+6)/a,-1,1)),Math.asin(Un(l/c,-1,1))-Math.asin(Un(h/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=SO(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:h}=this._getLabelSizes(),g=r.padding*2,v=Yo(this.labelRotation),b=Math.cos(v),w=Math.sin(v);if(a){const x=r.mirror?0:w*f.width+b*h.height;t.height=Math.min(this.maxHeight,t.height+x+g)}else{const x=r.mirror?0:b*f.width+w*h.height;t.width=Math.min(this.maxWidth,t.width+x+g)}this._calculatePadding(c,u,w,b)}}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 h=0,g=0;l?c?(h=o*t.width,g=r*n.height):(h=r*t.height,g=o*n.width):i==="start"?g=n.width:i==="end"?h=t.width:i!=="inner"&&(h=t.width/2,g=n.width/2),this.paddingLeft=Math.max((h-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-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=_O(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/wO(n,r));let c=0,u=0,f,h,g,v,b,w,x,_,S,C,E;for(f=0;f<n;f+=l){if(v=t[f].label,b=this._resolveTickFontOptions(f),o.font=w=b.string,x=i[w]=i[w]||{data:{},gc:[]},_=b.lineHeight,S=C=0,!Rt(v)&&!pn(v))S=Cg(o,x.data,x.gc,S,v),C=_;else if(pn(v))for(h=0,g=v.length;h<g;++h)E=v[h],!Rt(E)&&!pn(E)&&(S=Cg(o,x.data,x.gc,S,E),C+=_);s.push(S),a.push(C),c=Math.max(S,c),u=Math.max(C,u)}IG(i,n);const P=s.indexOf(c),A=a.indexOf(u),k=I=>({width:s[I]||0,height:a[I]||0});return{first:k(0),last:k(n-1),widest:k(P),highest:k(A),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 SU(this._alignToPixels?$a(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=LG(this.getContext(),t,r))}return this.$context||(this.$context=NG(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Yo(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),h=ju(i),g=[],v=a.setContext(this.getContext()),b=v.display?v.width:0,w=b/2,x=function(Z){return $a(r,Z,b)};let _,S,C,E,P,A,k,I,$,L,j,Q;if(s==="top")_=x(this.bottom),A=this.bottom-h,I=_-w,L=x(t.top)+w,Q=t.bottom;else if(s==="bottom")_=x(this.top),L=t.top,Q=x(t.bottom)-w,A=_+w,I=this.top+h;else if(s==="left")_=x(this.right),P=this.right-h,k=_-w,$=x(t.left)+w,j=t.right;else if(s==="right")_=x(this.left),$=t.left,j=x(t.right)-w,P=_+w,k=this.left+h;else if(n==="x"){if(s==="center")_=x((t.top+t.bottom)/2+.5);else if(Dt(s)){const Z=Object.keys(s)[0],G=s[Z];_=x(this.chart.scales[Z].getPixelForValue(G))}L=t.top,Q=t.bottom,A=_+w,I=A+h}else if(n==="y"){if(s==="center")_=x((t.left+t.right)/2);else if(Dt(s)){const Z=Object.keys(s)[0],G=s[Z];_=x(this.chart.scales[Z].getPixelForValue(G))}P=_-w,k=P-h,$=t.left,j=t.right}const ee=dt(o.ticks.maxTicksLimit,f),B=Math.max(1,Math.ceil(f/ee));for(S=0;S<f;S+=B){const Z=this.getContext(S),G=i.setContext(Z),q=a.setContext(Z),K=G.lineWidth,T=G.color,V=q.dash||[],X=q.dashOffset,N=G.tickWidth,ie=G.tickColor,fe=G.tickBorderDash||[],ue=G.tickBorderDashOffset;C=MG(this,S,l),C!==void 0&&(E=$a(r,C,K),c?P=k=$=j=E:A=I=L=Q=E,g.push({tx1:P,ty1:A,tx2:k,ty2:I,x1:$,y1:L,x2:j,y2:Q,width:K,color:T,borderDash:V,borderDashOffset:X,tickWidth:N,tickColor:ie,tickBorderDash:fe,tickBorderDashOffset:ue}))}return this._ticksLength=f,this._borderValue=_,g}_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,h=ju(r.grid),g=h+u,v=f?-u:g,b=-Yo(this.labelRotation),w=[];let x,_,S,C,E,P,A,k,I,$,L,j,Q="middle";if(o==="top")P=this.bottom-v,A=this._getXAxisLabelAlignment();else if(o==="bottom")P=this.top+v,A=this._getXAxisLabelAlignment();else if(o==="left"){const B=this._getYAxisLabelAlignment(h);A=B.textAlign,E=B.x}else if(o==="right"){const B=this._getYAxisLabelAlignment(h);A=B.textAlign,E=B.x}else if(n==="x"){if(o==="center")P=(t.top+t.bottom)/2+g;else if(Dt(o)){const B=Object.keys(o)[0],Z=o[B];P=this.chart.scales[B].getPixelForValue(Z)+g}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(t.left+t.right)/2-g;else if(Dt(o)){const B=Object.keys(o)[0],Z=o[B];E=this.chart.scales[B].getPixelForValue(Z)}A=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const ee=this._getLabelSizes();for(x=0,_=a.length;x<_;++x){S=a[x],C=S.label;const B=i.setContext(this.getContext(x));k=this.getPixelForTick(x)+i.labelOffset,I=this._resolveTickFontOptions(x),$=I.lineHeight,L=pn(C)?C.length:1;const Z=L/2,G=B.color,q=B.textStrokeColor,K=B.textStrokeWidth;let T=A;s?(E=k,A==="inner"&&(x===_-1?T=this.options.reverse?"left":"right":x===0?T=this.options.reverse?"right":"left":T="center"),o==="top"?c==="near"||b!==0?j=-L*$+$/2:c==="center"?j=-ee.highest.height/2-Z*$+$:j=-ee.highest.height+$/2:c==="near"||b!==0?j=$/2:c==="center"?j=ee.highest.height/2-Z*$:j=ee.highest.height-L*$,f&&(j*=-1),b!==0&&!B.showLabelBackdrop&&(E+=$/2*Math.sin(b))):(P=k,j=(1-L)*$/2);let V;if(B.showLabelBackdrop){const X=Jn(B.backdropPadding),N=ee.heights[x],ie=ee.widths[x];let fe=j-X.top,ue=0-X.left;switch(Q){case"middle":fe-=N/2;break;case"bottom":fe-=N;break}switch(A){case"center":ue-=ie/2;break;case"right":ue-=ie;break;case"inner":x===_-1?ue-=ie:x>0&&(ue-=ie/2);break}V={left:ue,top:fe,width:ie+X.width,height:N+X.height,color:B.backdropColor}}w.push({label:C,font:I,textOffset:j,options:{rotation:b,color:G,strokeColor:q,strokeWidth:K,textAlign:T,textBaseline:Q,translation:[E,P],backdrop:V}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Yo(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,h;this.isHorizontal()?(c=$a(t,this.left,s)-s/2,u=$a(t,this.right,a)+a/2,f=h=l):(f=$a(t,this.top,s)-s/2,h=$a(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,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&Rm(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;gl(r,c,0,u,l,a)}o&&Om(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=$n(r.font),s=Jn(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Dt(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:h}=jG(this,l,n,a);gl(t,r.text,0,0,i,{color:r.color,maxWidth:f,rotation:h,textAlign:FG(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!==El.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 $n(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class sp{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;VG(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,zG(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 pl[r])}}function zG(e,t,n){const r=_i(Object.create(null),[n?_n.get(n):{},_n.get(t),e.defaults]);_n.set(t,r),e.defaultRoutes&&BG(t,e.defaultRoutes),e.descriptors&&_n.describe(t,e.descriptors)}function BG(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 VG(e){return"id"in e&&"defaults"in e}class HG{constructor(){this.controllers=new sp(Ko,"datasets",!0),this.elements=new sp(us,"elements"),this.plugins=new sp(Object,"plugins"),this.scales=new sp(El,"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=l1(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 ui=new HG;class WG{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=UG(r);return o===!1&&!n?[]:GG(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 UG(e){const t={},n=[],r=Object.keys(ui.plugins.items);for(let i=0;i<r.length;i++)n.push(ui.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 qG(e,t){return!t&&e===!1?null:e===!0?{}:e}function GG(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,c=qG(r[l],o);c!==null&&i.push({plugin:a,options:YG(e.config,{plugin:a,local:n[l]},c,s)})}return i}function YG(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 ix(e,t){const n=_n.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function KG(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function XG(e,t){return e===t?"_index_":"_value_"}function CO(e){if(e==="x"||e==="y"||e==="r")return e}function QG(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function sx(e,...t){if(CO(e))return e;for(const n of t){const r=n.axis||QG(n.position)||e.length>1&&CO(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function EO(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function JG(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 EO(e,"x",n[0])||EO(e,"y",n[0])}return{}}function ZG(e,t){const n=pl[e.type]||{scales:{}},r=t.scales||{},o=ix(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Dt(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=sx(s,a,JG(s,e),_n.scales[a.type]),c=XG(l,o),u=n.scales||{};i[s]=ud(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||ix(a,t),u=(pl[a]||{}).scales||{};Object.keys(u).forEach(f=>{const h=KG(f,l),g=s[h+"AxisID"]||h;i[g]=i[g]||Object.create(null),ud(i[g],[{axis:h},r[g],u[f]])})}),Object.keys(i).forEach(s=>{const a=i[s];ud(a,[_n.scales[a.type],_n.scale])}),i}function l$(e){const t=e.options||(e.options={});t.plugins=dt(t.plugins,{}),t.scales=ZG(e,t)}function c$(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function eY(e){return e=e||{},e.data=c$(e.data),l$(e),e}const RO=new Map,u$=new Set;function ap(e,t){let n=RO.get(e);return n||(n=t(),RO.set(e,n),u$.add(n)),n}const zu=(e,t,n)=>{const r=sa(t,n);r!==void 0&&e.add(r)};class tY{constructor(t){this._config=eY(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=c$(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(),l$(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ap(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return ap(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return ap(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return ap(`${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,pl[i]||{},f)),u.forEach(f=>zu(l,_n,f)),u.forEach(f=>zu(l,nx,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),u$.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,pl[n]||{},_n.datasets[n]||{},{type:n},_n,nx]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=OO(this._resolverCache,t,o);let l=s;if(rY(s,n)){i.$shared=!1,r=aa(r)?r():r;const c=this.createResolver(t,r,a);l=qc(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=OO(this._resolverCache,t,r);return Dt(n)?qc(i,n,void 0,o):i}}function OO(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:p1(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const nY=e=>Dt(e)&&Object.getOwnPropertyNames(e).some(t=>aa(e[t]));function rY(e,t){const{isScriptable:n,isIndexable:r}=HA(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(aa(a)||nY(a))||s&&pn(a))return!0}return!1}var oY="4.4.1";const iY=["top","bottom","left","right","chartArea"];function PO(e,t){return e==="top"||e==="bottom"||iY.indexOf(e)===-1&&t==="x"}function TO(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function DO(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),en(n&&n.onComplete,[e],t)}function sY(e){const t=e.chart,n=t.options.animation;en(n&&n.onProgress,[e],t)}function d$(e){return v1()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const rg={},AO=e=>{const t=d$(e);return Object.values(rg).filter(n=>n.canvas===t).pop()};function aY(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 lY(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function lp(e,t,n){return e.options.clip?e[n]:t[n]}function cY(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:lp(n,t,"left"),right:lp(n,t,"right"),top:lp(r,t,"top"),bottom:lp(r,t,"bottom")}:t}class To{static register(...t){ui.add(...t),$O()}static unregister(...t){ui.remove(...t),$O()}constructor(t,n){const r=this.config=new tY(n),o=d$(t),i=AO(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||RG(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=dU(),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 WG,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=OU(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}Gi.listen(this,"complete",DO),Gi.listen(this,"progress",sY),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 ui}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ZR(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return XR(this.canvas,this.ctx),this}stop(){return Gi.stop(this),this}resize(t,n){Gi.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,ZR(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=sx(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=sx(l,a),u=dt(a.type,s.dtype);(a.position===void 0||PO(a.position,c)!==PO(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 h=ui.getScale(u);f=new h({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(TO("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||ix(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=ui.getController(a),{datasetElementType:c,dataElementType:u}=_n.datasets[a];Object.assign(l,{dataElementType:ui.getElement(u),datasetElementType:c&&ui.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),h=!o&&i.indexOf(f)===-1;f.buildOrUpdateElements(h),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(TO("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);(!BR(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;aY(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(!BR(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,aa(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&&(Gi.has(this)?this.attached&&!Gi.running(this)&&Gi.start(this):(this.draw(),DO({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=cY(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&Rm(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&&Om(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ns(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=iG.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=ga(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);kd(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(),Gi.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(),XR(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=vU(t),c=lY(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(To,"defaults",_n),Ne(To,"instances",rg),Ne(To,"overrides",pl),Ne(To,"registry",ui),Ne(To,"version",oY),Ne(To,"getChart",AO);function $O(){return Yt(To.instances,e=>e._plugins.invalidate())}function uY(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+Tn,r-Tn),e.closePath(),e.clip()}function dY(e){return h1(e,["outerStart","outerEnd","innerStart","innerEnd"])}function fY(e,t,n,r){const o=dY(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 Un(l,0,Math.min(i,c))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:Un(o.innerStart,0,s),innerEnd:Un(o.innerEnd,0,s)}}function Jl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Og(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),h=u>0?u+r+n+c:0;let g=0;const v=o-l;if(r){const B=u>0?u-r:0,Z=f>0?f-r:0,G=(B+Z)/2,q=G!==0?v*G/(G+r):v;g=(v-q)/2}const b=Math.max(.001,v*f-n/mn)/f,w=(v-b)/2,x=l+w+g,_=o-w-g,{outerStart:S,outerEnd:C,innerStart:E,innerEnd:P}=fY(t,h,f,_-x),A=f-S,k=f-C,I=x+S/A,$=_-C/k,L=h+E,j=h+P,Q=x+E/L,ee=_-P/j;if(e.beginPath(),i){const B=(I+$)/2;if(e.arc(s,a,f,I,B),e.arc(s,a,f,B,$),C>0){const K=Jl(k,$,s,a);e.arc(K.x,K.y,C,$,_+Tn)}const Z=Jl(j,_,s,a);if(e.lineTo(Z.x,Z.y),P>0){const K=Jl(j,ee,s,a);e.arc(K.x,K.y,P,_+Tn,ee+Math.PI)}const G=(_-P/h+(x+E/h))/2;if(e.arc(s,a,h,_-P/h,G,!0),e.arc(s,a,h,G,x+E/h,!0),E>0){const K=Jl(L,Q,s,a);e.arc(K.x,K.y,E,Q+Math.PI,x-Tn)}const q=Jl(A,x,s,a);if(e.lineTo(q.x,q.y),S>0){const K=Jl(A,I,s,a);e.arc(K.x,K.y,S,x-Tn,I)}}else{e.moveTo(s,a);const B=Math.cos(I)*f+s,Z=Math.sin(I)*f+a;e.lineTo(B,Z);const G=Math.cos($)*f+s,q=Math.sin($)*f+a;e.lineTo(G,q)}e.closePath()}function hY(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){Og(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=s+(a%gn||gn))}return Og(e,t,n,r,l,o),e.fill(),l}function pY(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:h}=l,g=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=h,g?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let v=t.endAngle;if(i){Og(e,t,n,r,v,o);for(let b=0;b<i;++b)e.stroke();isNaN(a)||(v=s+(a%gn||gn))}g&&uY(e,t,v),i||(Og(e,t,n,r,v,o),e.stroke())}class pc extends us{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}=kA(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),g=(this.options.spacing+this.options.borderWidth)/2,b=dt(h,c-l)>=gn||Md(s,l,c),w=es(a,u+g,f+g);return b&&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,h=(a+l+u+c)/2;return{x:r+Math.cos(f)*h,y:o+Math.sin(f)*h}}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,hY(n,this,u,s,a),pY(n,this,u,s,a),n.restore()}}Ne(pc,"id","arc"),Ne(pc,"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(pc,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ne(pc,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function f$(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 gY(e,t,n){e.lineTo(n.x,n.y)}function mY(e){return e.stepped?jU:e.tension||e.cubicInterpolationMode==="monotone"?zU:gY}function h$(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 vY(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:c}=h$(o,n,r),u=mY(i);let{move:f=!0,reverse:h}=r||{},g,v,b;for(g=0;g<=c;++g)v=o[(a+(h?c-g:g))%s],!v.skip&&(f?(e.moveTo(v.x,v.y),f=!1):u(e,b,v,h,i.stepped),b=v);return l&&(v=o[(a+(h?c:0))%s],u(e,b,v,h,i.stepped)),!!l}function bY(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=h$(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,f=0,h,g,v,b,w,x;const _=C=>(s+(c?a-C:C))%i,S=()=>{b!==w&&(e.lineTo(u,w),e.lineTo(u,b),e.lineTo(u,x))};for(l&&(g=o[_(0)],e.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=o[_(h)],g.skip)continue;const C=g.x,E=g.y,P=C|0;P===v?(E<b?b=E:E>w&&(w=E),u=(f*u+C)/++f):(S(),e.lineTo(C,E),v=P,f=0,b=w=E),x=E}S()}function ax(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?bY:vY}function yY(e){return e.stepped?bq:e.tension||e.cubicInterpolationMode==="monotone"?yq:ja}function xY(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),f$(e,t.options),e.stroke(o)}function wY(e,t,n,r){const{segments:o,options:i}=t,s=ax(t);for(const a of o)f$(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const _Y=typeof Path2D=="function";function SY(e,t,n,r){_Y&&!t.options.segment?xY(e,t,n,r):wY(e,t,n,r)}class Js extends us{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;uq(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=Eq(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=ZA(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=yY(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:f,end:h}=s[c],g=i[f],v=i[h];if(g===v){a.push(g);continue}const b=Math.abs((o-g[n])/(v[n]-g[n])),w=l(g,v,b,r.stepped);w[n]=t[n],a.push(w)}return a.length===1?a[0]:a}pathSegment(t,n,r){return ax(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=ax(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(),SY(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ne(Js,"id","line"),Ne(Js,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ne(Js,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ne(Js,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function kO(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class gd extends us{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 kO(this,n,"x",r)}inYRange(n,r){return kO(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||!ns(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,rx(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ne(gd,"id","point"),Ne(gd,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ne(gd,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function p$(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 Zs(e,t,n,r){return e?0:Un(t,n,r)}function CY(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=VA(r);return{t:Zs(o.top,i.top,0,n),r:Zs(o.right,i.right,0,t),b:Zs(o.bottom,i.bottom,0,n),l:Zs(o.left,i.left,0,t)}}function EY(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=sl(o),s=Math.min(t,n),a=e.borderSkipped,l=r||Dt(o);return{topLeft:Zs(!l||a.top||a.left,i.topLeft,0,s),topRight:Zs(!l||a.top||a.right,i.topRight,0,s),bottomLeft:Zs(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:Zs(!l||a.bottom||a.right,i.bottomRight,0,s)}}function RY(e){const t=p$(e),n=t.right-t.left,r=t.bottom-t.top,o=CY(e,n/2,r/2),i=EY(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 ry(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&p$(e,r);return a&&(o||es(t,a.left,a.right))&&(i||es(n,a.top,a.bottom))}function OY(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function PY(e,t){e.rect(t.x,t.y,t.w,t.h)}function oy(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 md extends us{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}=RY(this),a=OY(s.radius)?Id:PY;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,oy(s,n,i)),t.clip(),a(t,oy(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,oy(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return ry(this,t,n,r)}inXRange(t,n){return ry(this,t,null,n)}inYRange(t,n){return ry(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(md,"id","bar"),Ne(md,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ne(md,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var TY=Object.freeze({__proto__:null,ArcElement:pc,BarElement:md,LineElement:Js,PointElement:gd});const lx=["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)"],MO=lx.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function g$(e){return lx[e%lx.length]}function m$(e){return MO[e%MO.length]}function DY(e,t){return e.borderColor=g$(t),e.backgroundColor=m$(t),++t}function AY(e,t){return e.backgroundColor=e.data.map(()=>g$(t++)),t}function $Y(e,t){return e.backgroundColor=e.data.map(()=>m$(t++)),t}function kY(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Ya?t=AY(n,t):o instanceof pd?t=$Y(n,t):o&&(t=DY(n,t))}}function IO(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function MY(e){return e&&(e.borderColor||e.backgroundColor)}var IY={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&&(IO(r)||MY(o)||i&&IO(i)))return;const s=kY(e);r.forEach(s)}};function NY(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,h,g,v,b;for(s[l++]=e[u],f=0;f<i-2;f++){let w=0,x=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,x+=e[_].y;w/=E,x/=E;const P=Math.floor(f*a)+1+t,A=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:k,y:I}=e[u];for(g=v=-1,_=P;_<A;_++)v=.5*Math.abs((k-w)*(e[_].y-I)-(k-e[_].x)*(x-I)),v>g&&(g=v,h=e[_],b=_);s[l++]=h,u=b}return s[l++]=e[c],s}function LY(e,t,n,r){let o=0,i=0,s,a,l,c,u,f,h,g,v,b;const w=[],x=t+n-1,_=e[t].x,C=e[x].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<v?(v=c,f=s):c>b&&(b=c,h=s),o=(i*o+a.x)/++i;else{const P=s-1;if(!Rt(f)&&!Rt(h)){const A=Math.min(f,h),k=Math.max(f,h);A!==g&&A!==P&&w.push({...e[A],x:o}),k!==g&&k!==P&&w.push({...e[k],x:o})}s>0&&P!==g&&w.push(e[P]),w.push(a),u=E,i=0,v=b=c,f=h=g=s}}return w}function v$(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 NO(e){e.data.datasets.forEach(t=>{v$(t)})}function FY(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=Un(ts(t,i.axis,s).lo,0,n-1)),c?o=Un(ts(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var jY={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){NO(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:h}=FY(l,c);const g=n.threshold||4*r;if(h<=g){v$(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(b){this._data=b}}));let v;switch(n.algorithm){case"lttb":v=NY(c,f,h,r,n);break;case"min-max":v=LY(c,f,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=v})},destroy(e){NO(e)}};function zY(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=x1(l,c,o);const u=cx(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=ZA(t,u);for(const h of f){const g=cx(n,i[h.start],i[h.end],h.loop),v=JA(a,o,g);for(const b of v)s.push({source:b,target:h,start:{[n]:LO(u,g,"start",Math.max)},end:{[n]:LO(u,g,"end",Math.min)}})}}return s}function cx(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=eo(o),i=eo(i)),{property:e,start:o,end:i}}function BY(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=x1(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 x1(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function LO(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function b$(e,t){let n=[],r=!1;return pn(e)?(r=!0,n=e):n=BY(e,t),n.length?new Js({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function FO(e){return e&&e.fill!==!1}function VY(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(!Cn(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function HY(e,t,n){const r=GY(e);if(Dt(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Cn(o)&&Math.floor(o)===o?WY(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function WY(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function UY(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Dt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function qY(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Dt(e)?r=e.value:r=t.getBaseValue(),r}function GY(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 YY(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=KY(t,n);a.push(b$({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++)XY(o,s[u],a)}return new Js({points:o,options:{}})}function KY(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 XY(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=QY(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function QY(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],h=s[u.end][n];if(es(o,f,h)){a=o===f,l=o===h;break}}return{first:a,last:l,point:r}}class y${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 JY(e){const{chart:t,fill:n,line:r}=e;if(Cn(n))return ZY(t,n);if(n==="stack")return YY(e);if(n==="shape")return!0;const o=eK(e);return o instanceof y$?o:b$(o,r)}function ZY(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function eK(e){return(e.scale||{}).getPointPositionForValue?nK(e):tK(e)}function tK(e){const{scale:t={},fill:n}=e,r=UY(n,t);if(Cn(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function nK(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=qY(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new y$({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 iy(e,t,n){const r=JY(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&&(Rm(e,n),rK(e,{line:o,target:r,above:u,below:f,area:n,scale:i,axis:s}),Om(e))}function rK(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&&(jO(e,r,s.top),zO(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),jO(e,r,s.bottom)),zO(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function jO(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[x1(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 zO(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=zY(n,r,o);for(const{source:l,target:c,start:u,end:f}of a){const{style:{backgroundColor:h=i}={}}=l,g=r!==!0;e.save(),e.fillStyle=h,oK(e,s,g&&cx(o,u,f)),e.beginPath();const v=!!n.pathSegment(e,l);let b;if(g){v?e.closePath():BO(e,r,f,o);const w=!!r.pathSegment(e,c,{move:v,reverse:!0});b=v&&w,b||BO(e,r,u,o)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function oK(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 BO(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var iK={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 Js&&(l={visible:e.isDatasetVisible(s),index:s,fill:HY(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=VY(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&&iy(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;FO(i)&&iy(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!FO(r)||n.drawTime!=="beforeDatasetDraw"||iy(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const VO=(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)}},sK=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class HO extends us{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=$n(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=VO(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 h=-1,g=-u;return this.legendItems.forEach((v,b)=>{const w=r+n/2+i.measureText(v.text).width;(b===0||c[c.length-1]+w+2*a>s)&&(f+=u,c[c.length-(b>0?0:1)]=0,g+=u,h++),l[b]={left:0,top:g,row:h,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,h=0,g=0,v=0,b=0;return this.legendItems.forEach((w,x)=>{const{itemWidth:_,itemHeight:S}=aK(r,n,i,w,o);x>0&&g+S+2*a>u&&(f+=h+a,c.push({width:h,height:g}),v+=h+a,b++,h=g=0),l[x]={left:v,top:g,col:b,width:_,height:S},h=Math.max(h,_),g+=S+a}),f+=h,c.push({width:h,height:g}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=bc(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=sr(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=sr(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=sr(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=sr(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;Rm(t,this),this._draw(),Om(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=_n.color,l=bc(t.rtl,this.left,this.width),c=$n(s.font),{padding:u}=s,f=c.size,h=f/2;let g;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:v,boxHeight:b,itemHeight:w}=VO(s,f),x=function(P,A,k){if(isNaN(v)||v<=0||isNaN(b)||b<0)return;o.save();const I=dt(k.lineWidth,1);if(o.fillStyle=dt(k.fillStyle,a),o.lineCap=dt(k.lineCap,"butt"),o.lineDashOffset=dt(k.lineDashOffset,0),o.lineJoin=dt(k.lineJoin,"miter"),o.lineWidth=I,o.strokeStyle=dt(k.strokeStyle,a),o.setLineDash(dt(k.lineDash,[])),s.usePointStyle){const $={radius:b*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:I},L=l.xPlus(P,v/2),j=A+h;BA(o,$,L,j,s.pointStyleWidth&&v)}else{const $=A+Math.max((f-b)/2,0),L=l.leftForLtr(P,v),j=sl(k.borderRadius);o.beginPath(),Object.values(j).some(Q=>Q!==0)?Id(o,{x:L,y:$,w:v,h:b,radius:j}):o.rect(L,$,v,b),o.fill(),I!==0&&o.stroke()}o.restore()},_=function(P,A,k){gl(o,k.text,P,A+w/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},S=this.isHorizontal(),C=this._computeTitleHeight();S?g={x:sr(i,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:g={x:this.left+u,y:sr(i,this.top+C+u,this.bottom-n[0].height),line:0},KA(this.ctx,t.textDirection);const E=w+u;this.legendItems.forEach((P,A)=>{o.strokeStyle=P.fontColor,o.fillStyle=P.fontColor;const k=o.measureText(P.text).width,I=l.textAlign(P.textAlign||(P.textAlign=s.textAlign)),$=v+h+k;let L=g.x,j=g.y;l.setWidth(this.width),S?A>0&&L+$+u>this.right&&(j=g.y+=E,g.line++,L=g.x=sr(i,this.left+u,this.right-r[g.line])):A>0&&j+E>this.bottom&&(L=g.x=L+n[g.line].width+u,g.line++,j=g.y=sr(i,this.top+C+u,this.bottom-n[g.line].height));const Q=l.x(L);if(x(Q,j,P),L=PU(I,L+v+h,S?L+$:this.right,t.rtl),_(l.x(L),j,P),S)g.x+=$+u;else if(typeof P.text!="string"){const ee=c.lineHeight;g.y+=x$(P,ee)+u}else g.y+=E}),XA(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=$n(n.font),o=Jn(n.padding);if(!n.display)return;const i=bc(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,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,f=sr(t.align,f,this.right-h);else{const v=this.columnSizes.reduce((b,w)=>Math.max(b,w.height),0);u=c+sr(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const g=sr(a,f,f+h);s.textAlign=i.textAlign(d1(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,gl(s,n.text,g,u,r)}_computeTitleHeight(){const t=this.options.title,n=$n(t.font),r=Jn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(es(t,this.left,this.right)&&es(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],es(t,o.left,o.left+o.width)&&es(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!uK(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=sK(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 aK(e,t,n,r,o){const i=lK(r,e,t,n),s=cK(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function lK(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 cK(e,t,n){let r=e;return typeof t.text!="string"&&(r=x$(t,n)),r}function x$(e,t){const n=e.text?e.text.length:0;return t*n}function uK(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var dK={id:"legend",_element:HO,start(e,t,n){const r=e.legend=new HO({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=Jn(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 w1=class extends us{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=Jn(r.padding);const i=o*$n(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=sr(a,r,i),f=n+t,c=i-r):(s.position==="left"?(u=r+t,f=sr(a,o,n),l=mn*-.5):(u=i-t,f=sr(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=$n(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);gl(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:d1(n.align),textBaseline:"middle",translation:[s,a]})}};function fK(e,t){const n=new w1({ctx:e.ctx,options:t,chart:e});cr.configure(e,n,t),cr.addBox(e,n),e.titleBlock=n}var hK={id:"title",_element:w1,start(e,t,n){fK(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 cp=new WeakMap;var pK={id:"subtitle",start(e,t,n){const r=new w1({ctx:e.ctx,options:n,chart:e});cr.configure(e,r,n),cr.addBox(e,r),cp.set(e,r)},stop(e){cr.removeBox(e,cp.get(e)),cp.delete(e)},beforeUpdate(e,t,n){const r=cp.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 id={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=tx(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 li(e,t){return t&&(pn(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Yi(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
125
- `)>-1?e.split(`
126
- `):e}function gK(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 WO(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=$n(t.bodyFont),c=$n(t.titleFont),u=$n(t.footerFont),f=i.length,h=o.length,g=r.length,v=Jn(t.padding);let b=v.height,w=0,x=r.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,f&&(b+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),x){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=g*C+(x-g)*l.lineHeight+(x-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-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+=v.width,{width:w,height:b}}function mK(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function vK(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 bK(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"),vK(c,e,t,n)&&(c="center"),c}function UO(e,t,n){const r=n.yAlign||t.yAlign||mK(e,n);return{xAlign:n.xAlign||t.xAlign||bK(e,t,n,r),yAlign:r}}function yK(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function xK(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function qO(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:h,bottomRight:g}=sl(s);let v=yK(t,a);const b=xK(t,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(u,h)+o:a==="right"&&(v+=Math.max(f,g)+o),{x:Un(v,0,r.width-t.width),y:Un(b,0,r.height-t.height)}}function up(e,t,n){const r=Jn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function GO(e){return li([],Yi(e))}function wK(e,t,n){return ga(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function YO(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const w$={beforeTitle:Hi,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:Hi,beforeBody:Hi,beforeLabel:Hi,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:Hi,afterBody:Hi,beforeFooter:Hi,footer:Hi,afterFooter:Hi};function Tr(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?w$[t].call(n,r):o}var f0;let KO=(f0=class extends us{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 e$(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=wK(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Tr(r,"beforeTitle",this,t),i=Tr(r,"title",this,t),s=Tr(r,"afterTitle",this,t);let a=[];return a=li(a,Yi(o)),a=li(a,Yi(i)),a=li(a,Yi(s)),a}getBeforeBody(t,n){return GO(Tr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return Yt(t,i=>{const s={before:[],lines:[],after:[]},a=YO(r,i);li(s.before,Yi(Tr(a,"beforeLabel",this,i))),li(s.lines,Tr(a,"label",this,i)),li(s.after,Yi(Tr(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return GO(Tr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Tr(r,"beforeFooter",this,t),i=Tr(r,"footer",this,t),s=Tr(r,"afterFooter",this,t);let a=[];return a=li(a,Yi(o)),a=li(a,Yi(i)),a=li(a,Yi(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(gK(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,h)=>t.filter(u,f,h,r))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,r))),Yt(a,u=>{const f=YO(t.callbacks,u);o.push(Tr(f,"labelColor",this,u)),i.push(Tr(f,"labelPointStyle",this,u)),s.push(Tr(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=id[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=WO(this,r),c=Object.assign({},a,l),u=UO(this.chart,r,c),f=qO(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}=sl(a),{x:h,y:g}=t,{width:v,height:b}=n;let w,x,_,S,C,E;return i==="center"?(C=g+b/2,o==="left"?(w=h,x=w-s,S=C+s,E=C-s):(w=h+v,x=w+s,S=C-s,E=C+s),_=w):(o==="left"?x=h+Math.max(l,u)+s:o==="right"?x=h+v-Math.max(c,f)-s:x=this.caretX,i==="top"?(S=g,C=S-s,w=x-s,_=x+s):(S=g+b,C=S+s,w=x+s,_=x-s),E=S),{x1:w,x2:x,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=bc(r.rtl,this.x,this.width);for(t.x=up(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=$n(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=$n(i.bodyFont),f=up(this,"left",i),h=o.x(f),g=l<u.lineHeight?(u.lineHeight-l)/2:0,v=n.y+g;if(i.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=o.leftForLtr(h,c)+c/2,x=v+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,rx(t,b,w,x),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,rx(t,b,w,x)}else{t.lineWidth=Dt(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 b=o.leftForLtr(h,c),w=o.leftForLtr(o.xPlus(h,1),c-2),x=sl(s.borderRadius);Object.values(x).some(_=>_!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Id(t,{x:b,y:v,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Id(t,{x:w,y:v+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(b,v,c,l),t.strokeRect(b,v,c,l),t.fillStyle=s.backgroundColor,t.fillRect(w,v+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=$n(r.bodyFont);let h=f.lineHeight,g=0;const v=bc(r.rtl,this.x,this.width),b=function(k){n.fillText(k,v.x(t.x+g),t.y+h/2),t.y+=h+i},w=v.textAlign(s);let x,_,S,C,E,P,A;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=up(this,w,r),n.fillStyle=r.bodyColor,Yt(this.beforeBody,b),g=a&&w!=="right"?s==="center"?c/2+u:c+2+u:0,C=0,P=o.length;C<P;++C){for(x=o[C],_=this.labelTextColors[C],n.fillStyle=_,Yt(x.before,b),S=x.lines,a&&S.length&&(this._drawColorBox(n,t,C,v,r),h=Math.max(f.lineHeight,l)),E=0,A=S.length;E<A;++E)b(S[E]),h=f.lineHeight;Yt(x.after,b)}g=0,h=f.lineHeight,Yt(this.afterBody,b),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=bc(r.rtl,this.x,this.width);for(t.x=up(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=$n(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:h,bottomLeft:g,bottomRight:v}=sl(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-h,l),n.quadraticCurveTo(a+c,l,a+c,l+h),s==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(a+c,l+u-v),n.quadraticCurveTo(a+c,l+u,a+c-v,l+u),s==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(a+g,l+u),n.quadraticCurveTo(a,l+u,a,l+u-g),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=id[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=WO(this,t),l=Object.assign({},s,this._size),c=UO(n,t,l),u=qO(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=Jn(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),KA(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),XA(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=id[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Ne(f0,"positioners",id),f0);var _K={id:"tooltip",_element:KO,positioners:id,afterInit(e,t,n){n&&(e.tooltip=new KO({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:w$},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"]},SK=Object.freeze({__proto__:null,Colors:IY,Decimation:jY,Filler:iK,Legend:dK,SubTitle:pK,Title:hK,Tooltip:_K});const CK=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function EK(e,t,n,r){const o=e.indexOf(t);if(o===-1)return CK(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const RK=(e,t)=>e===null?null:Un(Math.round(e),0,t);function XO(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ux extends El{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:EK(r,t,dt(n,t),this._addedLabels),RK(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 XO.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(ux,"id","category"),Ne(ux,"defaults",{ticks:{callback:XO}});function OK(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:h}=e,g=i||1,v=u-1,{min:b,max:w}=t,x=!Rt(s),_=!Rt(a),S=!Rt(c),C=(w-b)/(f+1);let E=HR((w-b)/v/g)*g,P,A,k,I;if(E<1e-14&&!x&&!_)return[{value:b},{value:w}];I=Math.ceil(w/E)-Math.floor(b/E),I>v&&(E=HR(I*E/v/g)*g),Rt(l)||(P=Math.pow(10,l),E=Math.ceil(E*P)/P),o==="ticks"?(A=Math.floor(b/E)*E,k=Math.ceil(w/E)*E):(A=b,k=w),x&&_&&i&&wU((a-s)/i,E/1e3)?(I=Math.round(Math.min((a-s)/E,u)),E=(a-s)/I,A=s,k=a):S?(A=x?s:A,k=_?a:k,I=c-1,E=(k-A)/I):(I=(k-A)/E,dd(I,Math.round(I),E/1e3)?I=Math.round(I):I=Math.ceil(I));const $=Math.max(WR(E),WR(A));P=Math.pow(10,Rt(l)?$:l),A=Math.round(A*P)/P,k=Math.round(k*P)/P;let L=0;for(x&&(h&&A!==s?(n.push({value:s}),A<s&&L++,dd(Math.round((A+L*E)*P)/P,s,QO(s,C,e))&&L++):A<s&&L++);L<I;++L){const j=Math.round((A+L*E)*P)/P;if(_&&j>a)break;n.push({value:j})}return _&&h&&k!==a?n.length&&dd(n[n.length-1].value,a,QO(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!_||k===a)&&n.push({value:k}),n}function QO(e,t,{horizontal:n,minRotation:r}){const o=Yo(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class Pg extends El{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=yi(o),c=yi(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=OK(o,i);return t.bounds==="ticks"&&$A(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 Nf(t,this.chart.options.locale,this.options.ticks.format)}}class dx extends Pg{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Cn(t)?t:0,this.max=Cn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Yo(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(dx,"id","linear"),Ne(dx,"defaults",{ticks:{callback:Em.formatters.numeric}});const Ld=e=>Math.floor(Qs(e)),Ma=(e,t)=>Math.pow(10,Ld(e)+t);function JO(e){return e/Math.pow(10,Ld(e))===1}function ZO(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function PK(e,t){const n=t-e;let r=Ld(n);for(;ZO(e,t,r)>10;)r++;for(;ZO(e,t,r)<10;)r--;return Math.min(r,Ld(e))}function TK(e,{min:t,max:n}){t=Kr(e.min,t);const r=[],o=Ld(t);let i=PK(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)),h=Kr(e.min,Math.round((l+u+f*Math.pow(10,i))*s)/s);for(;h<n;)r.push({value:h,major:JO(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(i++,f=2,s=i>=0?1:s),h=Math.round((l+u+f*Math.pow(10,i))*s)/s;const g=Kr(e.max,h);return r.push({value:g,major:JO(g),significand:f}),r}class fx extends El{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Pg.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Cn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Cn(t)?Math.max(0,t):null,this.max=Cn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Cn(this._userMin)&&(this.min=t===Ma(this.min,0)?Ma(this.min,-1):Ma(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(Ma(r,-1)),s(Ma(o,1)))),r<=0&&i(Ma(o,-1)),o<=0&&s(Ma(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=TK(n,this);return t.bounds==="ticks"&&$A(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":Nf(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Qs(t),this._valueRange=Qs(this.max)-Qs(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Qs(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ne(fx,"id","logarithmic"),Ne(fx,"defaults",{ticks:{callback:Em.formatters.logarithmic,major:{enabled:!0}}});function hx(e){const t=e.ticks;if(t.display&&e.display){const n=Jn(t.backdropPadding);return dt(t.font&&t.font.size,_n.font.size)+n.height}return 0}function DK(e,t,n){return n=pn(n)?n:[n],{w:FU(e,t.string,n),h:n.length*t.lineHeight}}function eP(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 AK(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=$n(c.font),h=DK(e.ctx,f,e._pointLabels[l]);r[l]=h;const g=eo(e.getIndexAngle(l)+a),v=Math.round(c1(g)),b=eP(v,u.x,h.w,0,180),w=eP(v,u.y,h.h,90,270);$K(n,t,g,b,w)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=IK(e,r,o)}function $K(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 kK(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(c1(eo(l.angle+Tn))),u=FK(l.y,a.h,c),f=NK(c),h=LK(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:h,top:u,right:h+a.w,bottom:u+a.h}}function MK(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(ns({x:n,y:r},t)||ns({x:n,y:i},t)||ns({x:o,y:r},t)||ns({x:o,y:i},t))}function IK(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:hx(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=kK(e,u,l);r.push(f),a==="auto"&&(f.visible=MK(f,c),f.visible&&(c=f))}return r}function NK(e){return e===0||e===180?"center":e<180?"left":"right"}function LK(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function FK(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function jK(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!Rt(a)){const l=sl(t.borderRadius),c=Jn(t.backdropPadding);e.fillStyle=a;const u=r-c.left,f=o-c.top,h=i-r+c.width,g=s-o+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),Id(e,{x:u,y:f,w:h,h:g,radius:l}),e.fill()):e.fillRect(u,f,h,g)}}function zK(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));jK(n,s,i);const a=$n(s.font),{x:l,y:c,textAlign:u}=i;gl(n,e._pointLabels[o],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function _$(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 BK(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(),_$(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function VK(e,t,n){return ga(e,{label:n,index:t,type:"pointLabel"})}class sd extends Pg{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=Jn(hx(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=Cn(t)&&!isNaN(t)?t:0,this.max=Cn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/hx(this.options))}generateTickLabels(t){Pg.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?AK(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 eo(t*n+Yo(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 VK(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-Tn+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(),_$(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&&zK(this,s),o.display&&this.ticks.forEach((u,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),g=o.setContext(h),v=i.setContext(h);BK(this,g,l,s,v)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:h}=u;!h||!f||(t.lineWidth=h,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=$n(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=Jn(c.backdropPadding);t.fillRect(-s/2-f.left,-i-u.size/2-f.top,s+f.width,u.size+f.height)}gl(t,a.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Ne(sd,"id","radialLinear"),Ne(sd,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Em.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ne(sd,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ne(sd,"descriptors",{angleLines:{_fallback:"grid"}});const Tm={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}},Ir=Object.keys(Tm);function tP(e,t){return e-t}function nP(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)),Cn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(Uc(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function rP(e,t,n,r){const o=Ir.length;for(let i=Ir.indexOf(e);i<o-1;++i){const s=Tm[Ir[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return Ir[i]}return Ir[o-1]}function HK(e,t,n,r,o){for(let i=Ir.length-1;i>=Ir.indexOf(n);i--){const s=Ir[i];if(Tm[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return Ir[n?Ir.indexOf(n):0]}function WK(e){for(let t=Ir.indexOf(e)+1,n=Ir.length;t<n;++t)if(Tm[Ir[t]].common)return Ir[t]}function oP(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=u1(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function UK(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 iP(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:UK(e,r,o,n)}class Fd extends El{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 eG._date(t.adapters.date);o.init(n),ud(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:nP(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=Cn(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Cn(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=EU(o,i,s);return this._unit=n.unit||(r.autoSkip?rP(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):HK(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:WK(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),iP(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Un(n,0,s),r=Un(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,s=i.unit||rP(i.minUnit,n,r,this._getLabelCapacity(n)),a=dt(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=Uc(l)||l===!0,u={};let f=n,h,g;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 v=o.ticks.source==="data"&&this.getDataTimestamps();for(h=f,g=0;h<r;h=+t.add(h,a,s),g++)oP(u,h,v);return(h===r||o.bounds==="ticks"||g===1)&&oP(u,h,v),Object.keys(u).sort(tP).map(b=>+b)}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],h=r[n],g=c&&f&&h&&h.major;return this._adapter.format(t,o||(g?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=Yo(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,iP(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(nP(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return IA(t.sort(tP))}}Ne(Fd,"id","time"),Ne(Fd,"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}=ts(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}=ts(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 px extends Fd{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(px,"id","timeseries"),Ne(px,"defaults",Fd.defaults);var qK=Object.freeze({__proto__:null,CategoryScale:ux,LinearScale:dx,LogarithmicScale:fx,RadialLinearScale:sd,TimeScale:Fd,TimeSeriesScale:px});const GK=[Zq,TY,SK,qK];/*!
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 sP=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}(),vd={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*sP)/sP}};function sy(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 YK(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 KK=0,S$=1,C$=2,E$=4,R$=8;function fp(e,t,n){var r=KK;return e<n.left?r|=S$:e>n.right&&(r|=C$),t<n.top?r|=R$:t>n.bottom&&(r|=E$),r}function XK(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=fp(n,r,t),a=fp(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&R$?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&E$?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&C$?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&S$&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=fp(n,r,t)):(o=c,i=u,a=fp(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function hp(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=XK(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),YK(o,i,e.vx,e.vy,t.align)}var pp={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 hp({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=sy(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return hp({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=sy(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)),hp({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=sy(e,t.origin);return hp({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)}},rs=vd.rasterize;function QK(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 JK(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 ZK(e){return e instanceof pc?pp.arc:e instanceof gd?pp.point:e instanceof md?pp.bar:pp.fallback}function eX(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 tX(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),eX(e,rs(t.x)+i/2,rs(t.y)+i/2,rs(t.w)-i,rs(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 nX(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 rX(e,t,n){var r=e.shadowBlur,o=n.stroked,i=rs(n.x),s=rs(n.y),a=rs(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 oX(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,h;if(!(!l||!s&&!f))for(n=nX(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),h=0,l=t.length;h<l;++h)rX(e,t[h],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*h})}var O$=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};_i(O$.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=$n(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:JK(o._el,r),padding:Jn(hn([n.padding,4],r,i)),positioner:ZK(o._el),rotation:hn([n.rotation,0],r,i)*(Math.PI/180),size:vd.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)?[]:vd.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=QK(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=vd.bound(0,o.opacity,1),r.translate(rs(t.x),rs(t.y)),r.rotate(o.rotation),tX(r,i.frame,o),oX(r,o.lines,i.text,o),r.restore())}});var iX=Number.MIN_SAFE_INTEGER||-9007199254740991,sX=Number.MAX_SAFE_INTEGER||9007199254740991;function Bu(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 aP(e,t){var n=sX,r=iX,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 gp(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 P$=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};_i(P$.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=Bu(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=[gp(t[0],t[1]),gp(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(gp(n[0],n[1]),gp(n[0],n[3])),o=0;o<r.length;++o)if(i=aP(t,r[o]),s=aP(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[Bu({x:t.x,y:t.y},r,n),Bu({x:t.x+t.w,y:t.y},r,n),Bu({x:t.x+t.w,y:t.y+t.h},r,n),Bu({x:t.x,y:t.y+t.h},r,n)]}});function T$(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 aX(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 lX(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=T$(a,r.model(),i),o._box.update(s,i,r.rotation()));return aX(e,function(l,c){var u=l._hidable,f=c._hidable;u&&f||f?c._visible=!1:u&&(l._visible=!1)})}var bd={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 P$,_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&&lX(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=T$(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},cX=function(e){if(Rt(e))return null;var t=e,n,r,o;if(Dt(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},uX={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:cX,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},Ar="$datalabels",D$="$default";function dX(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=_i({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(_i({},[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||D$]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function gx(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[Ar]._dirty=!0,n.update(o)))}}function fX(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&gx(e,t.leave,n,o),i&&gx(e,t.enter,r,o))}function hX(e,t){var n=e[Ar],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=bd.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,fX(e,r,o,i,t)}}function pX(e,t){var n=e[Ar],r=n._listeners.click,o=r&&bd.lookup(n._labels,t);o&&gx(e,r,o,t)}var gX={id:"datalabels",defaults:uX,beforeInit:function(e){e[Ar]={_actives:[]}},beforeUpdate:function(e){var t=e[Ar];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Ar],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=dX(a,n),c=t.meta.data||[],u=e.ctx,f,h,g,v,b,w,x,_;for(u.save(),f=0,g=c.length;f<g;++f)if(x=c[f],x[Ar]=[],s&&x&&e.getDataVisibility(f)&&!x.skip)for(h=0,v=l.labels.length;h<v;++h)b=l.labels[h],w=b._key,_=new O$(b,u,x,f),_.$groups={_set:r,_key:w||D$},_.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},_.update(_.$context),x[Ar].push(_),i.push(_);u.restore(),_i(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[Ar]._labels=bd.prepare(e[Ar]._datasets)},afterDatasetsDraw:function(e){bd.draw(e,e[Ar]._labels)},beforeEvent:function(e,t){if(e[Ar]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":hX(e,n);break;case"click":pX(e,n);break}}},afterEvent:function(e){var t=e[Ar],n=t._actives,r=t._actives=e.getActiveElements(),o=vd.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[Ar]||[],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)&&(bd.update(t._labels),e.render()),delete t._dirty}};To.register(...GK);To.register(gX);function _1({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=ke(l=>l.themeStyle);m.useEffect(()=>{var u,f,h,g;(f=(u=i==null?void 0:i.chart)==null?void 0:u.font)!=null&&f.family&&(To.defaults.font={...To.defaults.font,...(h=i==null?void 0:i.chart)==null?void 0:h.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(g=n==null?void 0:n.current)==null?void 0:g.getContext("2d");if(!l)return;let c;try{c=new To(l,e),o(c)}catch(v){console.log("error creating chart",v)}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 h=c[0].datasetIndex,g=c[0].index,v=(f=(u=c[0].element)==null?void 0:u.$context)==null?void 0:f.raw;t==null||t(r,h,g,v)}}return O.jsx("div",{onClick:s,className:"relative h-[99%]",children:O.jsx("canvas",{ref:n})})}function jr(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 mX=["color"],A$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,mX);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"}))}),vX=["color"],bX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,vX);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"}))}),yX=["color"],xX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,yX);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"}))}),wX=["color"],$$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,wX);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"}))}),_X=["color"],SX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,_X);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}))}),CX=["color"],EX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,CX);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"}))}),RX=["color"],OX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,RX);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"}))}),PX=["color"],TX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,PX);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"}))}),DX=["color"],k$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,DX);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"}))}),AX=["color"],$X=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,AX);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"}))}),kX=["color"],MX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,kX);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"}))}),IX=["color"],NX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,IX);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"}))}),LX=["color"],S1=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,LX);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}))}),FX=["color"],C1=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,FX);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 mp;const jX=new Uint8Array(16);function zX(){if(!mp&&(mp=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mp))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mp(jX)}const Kn=[];for(let e=0;e<256;++e)Kn.push((e+256).toString(16).slice(1));function BX(e,t=0){return Kn[e[t+0]]+Kn[e[t+1]]+Kn[e[t+2]]+Kn[e[t+3]]+"-"+Kn[e[t+4]]+Kn[e[t+5]]+"-"+Kn[e[t+6]]+Kn[e[t+7]]+"-"+Kn[e[t+8]]+Kn[e[t+9]]+"-"+Kn[e[t+10]]+Kn[e[t+11]]+Kn[e[t+12]]+Kn[e[t+13]]+Kn[e[t+14]]+Kn[e[t+15]]}const VX=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lP={randomUUID:VX};function la(e,t,n){if(lP.randomUUID&&!t&&!e)return lP.randomUUID();e=e||{};const r=e.random||(e.rng||zX)();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 BX(r)}const br=Z2()(sD((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:la(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:la(),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})}}}))),Dm=()=>br(e=>e.actions);function HX(e,t,n){var l,c,u,f;const r=n==null?void 0:n.datasetOptions,o=ke.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((h,g)=>{var _;const v=r==null?void 0:r.find(S=>S.idx===g),b=i==null?void 0:i[g%i.length],w=s==null?void 0:s[g%s.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(S=>S[h]),...v,datalabels:{...v==null?void 0:v.datalabels,color:WX((_=v==null?void 0:v.datalabels)==null?void 0:_.align,b)},backgroundColor:b,borderColor:w}})}function WX(e,t){return Bc(e==="end"||e==="start"?Pd():t)}function UX(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=ar(e);let r=[];const o=ke.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(h=>({x:h[t[0]],y:h[t[1]],r:h[t[2]],label:h[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(h=>h[n==null?void 0:n[1]]))].map((h,g)=>{const v=e.filter(b=>b[n==null?void 0:n[1]]===h);return{label:h,data:v.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[g%i.length],borderColor:s==null?void 0:s[g%s.length]}})),r}function qX(e){var c,u,f,h;const{dimensionKeys:t,metricKeys:n}=ar(e),r=ke.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(h=(f=r==null?void 0:r.chart)==null?void 0:f.dataset)==null?void 0:h.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(g=>g==null?void 0:g[s]))].map((g,v)=>({label:g,data:e.filter(b=>(b==null?void 0:b[s])===g).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:o==null?void 0:o[v%o.length],borderColor:i==null?void 0:i[v%i.length],borderSkipped:!1}))}function GX(e,t){var s,a,l,c;const n=ke.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,h)=>r==null?void 0:r[h%r.length]),borderColor:t.map((f,h)=>o==null?void 0:o[h%o.length])}))}function YX(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 ar(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=YX(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,f,h,g;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((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((h=e==null?void 0:e[2])==null?void 0:h[i])&&typeof((g=e==null?void 0:e[2])==null?void 0:g[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function og(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 Tg({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 qo(e,t){var s;const n=ke.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=ol.cloneDeep(r);return ol.merge(o,e,t)}function mx(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 KX=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M$=(...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 XX={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 QX=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,...XX,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:M$("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 Dn=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(QX,{ref:i,iconNode:t,className:M$(`lucide-${KX(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 vx=Dn("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 I$=Dn("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 Ff=Dn("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 Am=Dn("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 N$=Dn("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 E1=Dn("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 JX=Dn("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 L$=Dn("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 ZX=Dn("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 eQ=Dn("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 tQ=Dn("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"}]]);/**
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 nQ=Dn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 rQ=Dn("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"}]]);/**
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 R1=Dn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 oQ=Dn("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"}]]);/**
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 O1=Dn("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"}]]);/**
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 F$=Dn("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"}]]);/**
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 iQ=Dn("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"}]]);/**
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 sQ=Dn("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
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 $m=Dn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),aQ=({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(`
253
- `),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 O.jsx(ZX,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function lQ({frame:e}){var S;const t=ke(C=>C.isDashboardEditing),n=ke(C=>C.filterValues),r=ke(C=>C.isVisualEditing),o=ke(C=>C.selectedSheetId);ke(C=>C.currentBreakpoint);const{removeFrame:i}=ke(C=>C.actions),s=ke(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),h=br(C=>C.actions.setSelectedConnectionId),g=br(C=>C.actions.setSelectedDatamodelId),v=br(C=>C.actions.setSelectedDatabaseName),b=br(C=>C.actions.setSelectedSchemaName),w=br(C=>C.actions.setSelectedTableName),x=e.cards.find(C=>C.id===e.activeCardId);function _(){s(!r),c(x);const{dimensionKeys:C}=ar((x==null?void 0:x.data)||[]);f(C),u(e),x!=null&&x.connectionId&&h(x==null?void 0:x.connectionId),x!=null&&x.datamodelId&&x.datamodelId!=="none"&&(g(x==null?void 0:x.datamodelId),v("")),x!=null&&x.lastSelectedDatabase&&x.lastSelectedDatabase!=="none"&&(v(x==null?void 0:x.lastSelectedDatabase),g("")),x!=null&&x.lastSelectedSchema&&b(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&w(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return O.jsx("section",{className:"absolute right-2 top-2 z-10",children:O.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?O.jsx(EX,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):O.jsx(OX,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&O.jsx($$,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((S=x.preferences)==null?void 0:S.allowDownload)===!0&&O.jsx(aQ,{data:(x==null?void 0:x.data)||[],filename:x.title})]})})}function cQ(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const bx="dismissableLayer.update",uQ="dismissableLayer.pointerDownOutside",dQ="dismissableLayer.focusOutside";let cP;const fQ=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jf=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(fQ),[f,h]=m.useState(null),g=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=_t(t,k=>h(k)),w=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=w.indexOf(x),S=f?w.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,P=hQ(k=>{const I=k.target,$=[...u.branches].some(L=>L.contains(I));!E||$||(i==null||i(k),a==null||a(k),k.defaultPrevented||l==null||l())},g),A=pQ(k=>{const I=k.target;[...u.branches].some(L=>L.contains(I))||(s==null||s(k),a==null||a(k),k.defaultPrevented||l==null||l())},g);return cQ(k=>{S===u.layers.size-1&&(o==null||o(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},g),m.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(cP=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),uP(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=cP)}},[f,g,r,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),uP())},[f,u]),m.useEffect(()=>{const k=()=>v({});return document.addEventListener(bx,k),()=>document.removeEventListener(bx,k)},[]),m.createElement(Qe.div,he({},c,{ref:b,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:Me(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Me(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Me(e.onPointerDownCapture,P.onPointerDownCapture)}))});function hQ(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){j$(uQ,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 pQ(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&j$(dQ,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 uP(){const e=new CustomEvent(bx);document.dispatchEvent(e)}function j$(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?PD(o,i):o.dispatchEvent(i)}const gQ=["top","right","bottom","left"],ca=Math.min,no=Math.max,Dg=Math.round,vp=Math.floor,ua=e=>({x:e,y:e}),mQ={left:"right",right:"left",bottom:"top",top:"bottom"},vQ={start:"end",end:"start"};function yx(e,t,n){return no(e,ca(t,n))}function ss(e,t){return typeof e=="function"?e(t):e}function as(e){return e.split("-")[0]}function iu(e){return e.split("-")[1]}function P1(e){return e==="x"?"y":"x"}function T1(e){return e==="y"?"height":"width"}function su(e){return["top","bottom"].includes(as(e))?"y":"x"}function D1(e){return P1(su(e))}function bQ(e,t,n){n===void 0&&(n=!1);const r=iu(e),o=D1(e),i=T1(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ag(s)),[s,Ag(s)]}function yQ(e){const t=Ag(e);return[xx(e),t,xx(t)]}function xx(e){return e.replace(/start|end/g,t=>vQ[t])}function xQ(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 wQ(e,t,n,r){const o=iu(e);let i=xQ(as(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(xx)))),i}function Ag(e){return e.replace(/left|right|bottom|top/g,t=>mQ[t])}function _Q(e){return{top:0,right:0,bottom:0,left:0,...e}}function z$(e){return typeof e!="number"?_Q(e):{top:e,right:e,bottom:e,left:e}}function $g(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function dP(e,t,n){let{reference:r,floating:o}=e;const i=su(t),s=D1(t),a=T1(s),l=as(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-o.width,y:f};break;default:g={x:r.x,y:r.y}}switch(iu(t)){case"start":g[s]-=h*(n&&c?-1:1);break;case"end":g[s]+=h*(n&&c?-1:1);break}return g}const SQ=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}=dP(c,r,l),h=r,g={},v=0;for(let b=0;b<a.length;b++){const{name:w,fn:x}=a[b],{x:_,y:S,data:C,reset:E}=await x({x:u,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=_??u,f=S??f,g={...g,[w]:{...g[w],...C}},E&&v<=50){v++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:f}=dP(c,h,l)),b=-1;continue}}return{x:u,y:f,placement:h,strategy:o,middlewareData:g}};async function jd(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:h=!1,padding:g=0}=ss(t,e),v=z$(g),w=a[h?f==="floating"?"reference":"floating":f],x=$g(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=$g(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(x.top-E.top+v.top)/C.y,bottom:(E.bottom-x.bottom+v.bottom)/C.y,left:(x.left-E.left+v.left)/C.x,right:(E.right-x.right+v.right)/C.x}}const fP=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}=ss(e,t)||{};if(c==null)return{};const f=z$(u),h={x:n,y:r},g=D1(o),v=T1(g),b=await s.getDimensions(c),w=g==="y",x=w?"top":"left",_=w?"bottom":"right",S=w?"clientHeight":"clientWidth",C=i.reference[v]+i.reference[g]-h[g]-i.floating[v],E=h[g]-i.reference[g],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=P?P[S]:0;(!A||!await(s.isElement==null?void 0:s.isElement(P)))&&(A=a.floating[S]||i.floating[v]);const k=C/2-E/2,I=A/2-b[v]/2-1,$=ca(f[x],I),L=ca(f[_],I),j=$,Q=A-b[v]-L,ee=A/2-b[v]/2+k,B=yx(j,ee,Q),Z=!l.arrow&&iu(o)!=null&&ee!=B&&i.reference[v]/2-(ee<j?$:L)-b[v]/2<0,G=Z?ee<j?ee-j:ee-Q:0;return{[g]:h[g]+G,data:{[g]:B,centerOffset:ee-B-G,...Z&&{alignmentOffset:G}},reset:Z}}}),CQ=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:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...w}=ss(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=as(o),_=as(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=h||(_||!b?[Ag(a)]:yQ(a));!h&&v!=="none"&&C.push(...wQ(a,b,v,S));const E=[a,...C],P=await jd(t,w),A=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&A.push(P[x]),f){const j=bQ(o,s,S);A.push(P[j[0]],P[j[1]])}if(k=[...k,{placement:o,overflows:A}],!A.every(j=>j<=0)){var I,$;const j=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=E[j];if(Q)return{data:{index:j,overflows:k},reset:{placement:Q}};let ee=($=k.filter(B=>B.overflows[0]<=0).sort((B,Z)=>B.overflows[1]-Z.overflows[1])[0])==null?void 0:$.placement;if(!ee)switch(g){case"bestFit":{var L;const B=(L=k.map(Z=>[Z.placement,Z.overflows.filter(G=>G>0).reduce((G,q)=>G+q,0)]).sort((Z,G)=>Z[1]-G[1])[0])==null?void 0:L[0];B&&(ee=B);break}case"initialPlacement":ee=a;break}if(o!==ee)return{reset:{placement:ee}}}return{}}}};function hP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pP(e){return gQ.some(t=>e[t]>=0)}const EQ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ss(e,t);switch(r){case"referenceHidden":{const i=await jd(t,{...o,elementContext:"reference"}),s=hP(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:pP(s)}}}case"escaped":{const i=await jd(t,{...o,altBoundary:!0}),s=hP(i,n.floating);return{data:{escapedOffsets:s,escaped:pP(s)}}}default:return{}}}}};async function RQ(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=as(n),a=iu(n),l=su(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,f=ss(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*u,y:h*c}:{x:h*c,y:g*u}}const OQ=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 RQ(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}}}}},PQ=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:_}=w;return{x,y:_}}},...l}=ss(e,t),c={x:n,y:r},u=await jd(t,l),f=su(as(o)),h=P1(f);let g=c[h],v=c[f];if(i){const w=h==="y"?"top":"left",x=h==="y"?"bottom":"right",_=g+u[w],S=g-u[x];g=yx(_,g,S)}if(s){const w=f==="y"?"top":"left",x=f==="y"?"bottom":"right",_=v+u[w],S=v-u[x];v=yx(_,v,S)}const b=a.fn({...t,[h]:g,[f]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},TQ=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}=ss(e,t),u={x:n,y:r},f=su(o),h=P1(f);let g=u[h],v=u[f];const b=ss(a,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=h==="y"?"height":"width",C=i.reference[h]-i.floating[S]+w.mainAxis,E=i.reference[h]+i.reference[S]-w.mainAxis;g<C?g=C:g>E&&(g=E)}if(c){var x,_;const S=h==="y"?"width":"height",C=["top","left"].includes(as(o)),E=i.reference[f]-i.floating[S]+(C&&((x=s.offset)==null?void 0:x[f])||0)+(C?0:w.crossAxis),P=i.reference[f]+i.reference[S]+(C?0:((_=s.offset)==null?void 0:_[f])||0)-(C?w.crossAxis:0);v<E?v=E:v>P&&(v=P)}return{[h]:g,[f]:v}}}},DQ=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}=ss(e,t),l=await jd(t,a),c=as(n),u=iu(n),f=su(n)==="y",{width:h,height:g}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(b=c,v=u==="end"?"top":"bottom");const w=g-l[v],x=h-l[b],_=!t.middlewareData.shift;let S=w,C=x;if(f){const P=h-l.left-l.right;C=u||_?ca(x,P):P}else{const P=g-l.top-l.bottom;S=u||_?ca(w,P):P}if(_&&!u){const P=no(l.left,0),A=no(l.right,0),k=no(l.top,0),I=no(l.bottom,0);f?C=h-2*(P!==0||A!==0?P+A:no(l.left,l.right)):S=g-2*(k!==0||I!==0?k+I:no(l.top,l.bottom))}await s({...t,availableWidth:C,availableHeight:S});const E=await o.getDimensions(i.floating);return h!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function da(e){return B$(e)?(e.nodeName||"").toLowerCase():"#document"}function so(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ds(e){var t;return(t=(B$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function B$(e){return e instanceof Node||e instanceof so(e).Node}function ls(e){return e instanceof Element||e instanceof so(e).Element}function Si(e){return e instanceof HTMLElement||e instanceof so(e).HTMLElement}function gP(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof so(e).ShadowRoot}function zf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$o(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function AQ(e){return["table","td","th"].includes(da(e))}function A1(e){const t=$1(),n=$o(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 $Q(e){let t=Yc(e);for(;Si(t)&&!km(t);){if(A1(t))return t;t=Yc(t)}return null}function $1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function km(e){return["html","body","#document"].includes(da(e))}function $o(e){return so(e).getComputedStyle(e)}function Mm(e){return ls(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Yc(e){if(da(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gP(e)&&e.host||ds(e);return gP(t)?t.host:t}function V$(e){const t=Yc(e);return km(t)?e.ownerDocument?e.ownerDocument.body:e.body:Si(t)&&zf(t)?t:V$(t)}function zd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=V$(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=so(o);return i?t.concat(s,s.visualViewport||[],zf(o)?o:[],s.frameElement&&n?zd(s.frameElement):[]):t.concat(o,zd(o,[],n))}function H$(e){const t=$o(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Si(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Dg(n)!==i||Dg(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function k1(e){return ls(e)?e:e.contextElement}function yc(e){const t=k1(e);if(!Si(t))return ua(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=H$(t);let s=(i?Dg(n.width):n.width)/r,a=(i?Dg(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const kQ=ua(0);function W$(e){const t=so(e);return!$1()||!t.visualViewport?kQ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MQ(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==so(e)?!1:t}function ml(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=k1(e);let s=ua(1);t&&(r?ls(r)&&(s=yc(r)):s=yc(e));const a=MQ(i,n,r)?W$(i):ua(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 h=so(i),g=r&&ls(r)?so(r):r;let v=h.frameElement;for(;v&&r&&g!==h;){const b=yc(v),w=v.getBoundingClientRect(),x=$o(v),_=w.left+(v.clientLeft+parseFloat(x.paddingLeft))*b.x,S=w.top+(v.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,f*=b.y,l+=_,c+=S,v=so(v).frameElement}}return $g({width:u,height:f,x:l,y:c})}function IQ(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Si(n),i=ds(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=ua(1);const l=ua(0);if((o||!o&&r!=="fixed")&&((da(n)!=="body"||zf(i))&&(s=Mm(n)),Si(n))){const c=ml(n);a=yc(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 NQ(e){return Array.from(e.getClientRects())}function U$(e){return ml(ds(e)).left+Mm(e).scrollLeft}function LQ(e){const t=ds(e),n=Mm(e),r=e.ownerDocument.body,o=no(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=no(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+U$(e);const a=-n.scrollTop;return $o(r).direction==="rtl"&&(s+=no(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function FQ(e,t){const n=so(e),r=ds(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=$1();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function jQ(e,t){const n=ml(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Si(e)?yc(e):ua(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 mP(e,t,n){let r;if(t==="viewport")r=FQ(e,n);else if(t==="document")r=LQ(ds(e));else if(ls(t))r=jQ(t,n);else{const o=W$(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return $g(r)}function q$(e,t){const n=Yc(e);return n===t||!ls(n)||km(n)?!1:$o(n).position==="fixed"||q$(n,t)}function zQ(e,t){const n=t.get(e);if(n)return n;let r=zd(e,[],!1).filter(a=>ls(a)&&da(a)!=="body"),o=null;const i=$o(e).position==="fixed";let s=i?Yc(e):e;for(;ls(s)&&!km(s);){const a=$o(s),l=A1(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||zf(s)&&!l&&q$(e,s))?r=r.filter(u=>u!==s):o=a,s=Yc(s)}return t.set(e,r),r}function BQ(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?zQ(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=mP(t,u,o);return c.top=no(f.top,c.top),c.right=ca(f.right,c.right),c.bottom=ca(f.bottom,c.bottom),c.left=no(f.left,c.left),c},mP(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function VQ(e){return H$(e)}function HQ(e,t,n){const r=Si(t),o=ds(t),i=n==="fixed",s=ml(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ua(0);if(r||!r&&!i)if((da(t)!=="body"||zf(o))&&(a=Mm(t)),r){const c=ml(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=U$(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function vP(e,t){return!Si(e)||$o(e).position==="fixed"?null:t?t(e):e.offsetParent}function G$(e,t){const n=so(e);if(!Si(e))return n;let r=vP(e,t);for(;r&&AQ(r)&&$o(r).position==="static";)r=vP(r,t);return r&&(da(r)==="html"||da(r)==="body"&&$o(r).position==="static"&&!A1(r))?n:r||$Q(e)||n}const WQ=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||G$,i=this.getDimensions;return{reference:HQ(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function UQ(e){return $o(e).direction==="rtl"}const qQ={convertOffsetParentRelativeRectToViewportRelativeRect:IQ,getDocumentElement:ds,getClippingRect:BQ,getOffsetParent:G$,getElementRects:WQ,getClientRects:NQ,getDimensions:VQ,getScale:yc,isElement:ls,isRTL:UQ};function GQ(e,t){let n=null,r;const o=ds(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:h}=e.getBoundingClientRect();if(a||t(),!f||!h)return;const g=vp(u),v=vp(o.clientWidth-(c+f)),b=vp(o.clientHeight-(u+h)),w=vp(c),_={rootMargin:-g+"px "+-v+"px "+-b+"px "+-w+"px",threshold:no(0,ca(1,l))||1};let S=!0;function C(E){const P=E[0].intersectionRatio;if(P!==l){if(!S)return s();P?s(!1,P):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 YQ(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=k1(e),u=o||i?[...c?zd(c):[],...zd(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=c&&a?GQ(c,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(x=>{let[_]=x;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let v,b=l?ml(e):null;l&&w();function w(){const x=ml(e);b&&(x.x!==b.x||x.y!==b.y||x.width!==b.width||x.height!==b.height)&&n(),b=x,v=requestAnimationFrame(w)}return n(),()=>{u.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f&&f(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(v)}}const KQ=(e,t,n)=>{const r=new Map,o={platform:qQ,...n},i={...o.platform,_c:r};return SQ(e,t,{...o,platform:i})},XQ=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?fP({element:r.current,padding:o}).fn(n):{}:r?fP({element:r,padding:o}).fn(n):{}}}};var ig=typeof document<"u"?m.useLayoutEffect:m.useEffect;function kg(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(!kg(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)&&!kg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Y$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bP(e,t){const n=Y$(e);return Math.round(t*n)/n}function yP(e){const t=H.useRef(e);return ig(()=>{t.current=e}),t}function QQ(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]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=H.useState(r);kg(h,r)||g(r);const[v,b]=H.useState(null),[w,x]=H.useState(null),_=H.useCallback(Z=>{Z!=P.current&&(P.current=Z,b(Z))},[b]),S=H.useCallback(Z=>{Z!==A.current&&(A.current=Z,x(Z))},[x]),C=i||v,E=s||w,P=H.useRef(null),A=H.useRef(null),k=H.useRef(u),I=yP(l),$=yP(o),L=H.useCallback(()=>{if(!P.current||!A.current)return;const Z={placement:t,strategy:n,middleware:h};$.current&&(Z.platform=$.current),KQ(P.current,A.current,Z).then(G=>{const q={...G,isPositioned:!0};j.current&&!kg(k.current,q)&&(k.current=q,pw.flushSync(()=>{f(q)}))})},[h,t,n,$]);ig(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(Z=>({...Z,isPositioned:!1})))},[c]);const j=H.useRef(!1);ig(()=>(j.current=!0,()=>{j.current=!1}),[]),ig(()=>{if(C&&(P.current=C),E&&(A.current=E),C&&E){if(I.current)return I.current(C,E,L);L()}},[C,E,L,I]);const Q=H.useMemo(()=>({reference:P,floating:A,setReference:_,setFloating:S}),[_,S]),ee=H.useMemo(()=>({reference:C,floating:E}),[C,E]),B=H.useMemo(()=>{const Z={position:n,left:0,top:0};if(!ee.floating)return Z;const G=bP(ee.floating,u.x),q=bP(ee.floating,u.y);return a?{...Z,transform:"translate("+G+"px, "+q+"px)",...Y$(ee.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:q}},[n,a,ee.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:L,refs:Q,elements:ee,floatingStyles:B}),[u,L,Q,ee,B])}function Im(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 K$="Popper",[X$,Ti]=Zn(K$),[JQ,Q$]=X$(K$),ZQ=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(JQ,{scope:t,anchor:r,onAnchorChange:o},n)},eJ="PopperAnchor",tJ=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Q$(eJ,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,he({},o,{ref:a}))}),J$="PopperContent",[nJ,dye]=X$(J$),rJ=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:h=0,align:g="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:w=!0,collisionBoundary:x=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:P,...A}=e,k=Q$(J$,u),[I,$]=m.useState(null),L=_t(t,Pe=>$(Pe)),[j,Q]=m.useState(null),ee=Im(j),B=(n=ee==null?void 0:ee.width)!==null&&n!==void 0?n:0,Z=(r=ee==null?void 0:ee.height)!==null&&r!==void 0?r:0,G=f+(g!=="center"?"-"+g:""),q=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},K=Array.isArray(x)?x:[x],T=K.length>0,V={padding:q,boundary:K.filter(oJ),altBoundary:T},{refs:X,floatingStyles:N,placement:ie,isPositioned:fe,middlewareData:ue}=QQ({strategy:"fixed",placement:G,whileElementsMounted:(...Pe)=>YQ(...Pe,{animationFrame:E==="always"}),elements:{reference:k.anchor},middleware:[OQ({mainAxis:h+Z,alignmentAxis:v}),w&&PQ({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?TQ():void 0,...V}),w&&CQ({...V}),DQ({...V,apply:({elements:Pe,rects:Te,availableWidth:Ue,availableHeight:Be})=>{const{width:Ie,height:Ke}=Te.reference,lt=Pe.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`)}}),j&&XQ({element:j,padding:b}),iJ({arrowWidth:B,arrowHeight:Z}),C&&EQ({strategy:"referenceHidden",...V})]}),[pe,se]=Z$(ie),ne=Ln(P);ur(()=>{fe&&(ne==null||ne())},[fe,ne]);const le=(o=ue.arrow)===null||o===void 0?void 0:o.x,ye=(i=ue.arrow)===null||i===void 0?void 0:i.y,Y=((s=ue.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[be,_e]=m.useState();return ur(()=>{I&&_e(window.getComputedStyle(I).zIndex)},[I]),m.createElement("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:fe?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(a=ue.transformOrigin)===null||a===void 0?void 0:a.x,(l=ue.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(nJ,{scope:u,placedSide:pe,onArrowChange:Q,arrowX:le,arrowY:ye,shouldHideArrow:Y},m.createElement(Qe.div,he({"data-side":pe,"data-align":se},A,{ref:L,style:{...A.style,animation:fe?void 0:"none",opacity:(c=ue.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function oJ(e){return e!==null}const iJ=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,h=f?0:e.arrowWidth,g=f?0:e.arrowHeight,[v,b]=Z$(a),w={start:"0%",center:"50%",end:"100%"}[b],x=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+h/2,_=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+g/2;let S="",C="";return v==="bottom"?(S=f?w:`${x}px`,C=`${-g}px`):v==="top"?(S=f?w:`${x}px`,C=`${l.floating.height+g}px`):v==="right"?(S=`${-g}px`,C=f?w:`${_}px`):v==="left"&&(S=`${l.floating.width+g}px`,C=f?w:`${_}px`),{data:{x:S,y:C}}}});function Z$(e){const[t,n="center"]=e.split("-");return[t,n]}const Bf=ZQ,Vf=tJ,Hf=rJ,M1=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?Mo.createPortal(m.createElement(Qe.div,he({},o,{ref:t})),r):null}),sJ=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(aJ);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(wx,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(wx,he({},r,{ref:t}),n)});sJ.displayName="Slot";const wx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...lJ(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});wx.displayName="SlotClone";const ek=({children:e})=>m.createElement(m.Fragment,null,e);function aJ(e){return m.isValidElement(e)&&e.type===ek}function lJ(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 tk=m.forwardRef((e,t)=>m.createElement(Qe.span,he({},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}}))),cJ=tk,[Nm,fye]=Zn("Tooltip",[Ti]),I1=Ti(),uJ="TooltipProvider",dJ=700,_x="tooltip.open",[fJ,N1]=Nm(uJ),hJ=e=>{const{__scopeTooltip:t,delayDuration:n=dJ,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(fJ,{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)},L1="Tooltip",[pJ,Lm]=Nm(L1),gJ=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=N1(L1,e.__scopeTooltip),c=I1(t),[u,f]=m.useState(null),h=Jo(),g=m.useRef(0),v=s??l.disableHoverableContent,b=a??l.delayDuration,w=m.useRef(!1),[x=!1,_]=wr({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(_x))):l.onClose(),i==null||i(A)}}),S=m.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),C=m.useCallback(()=>{window.clearTimeout(g.current),w.current=!1,_(!0)},[_]),E=m.useCallback(()=>{window.clearTimeout(g.current),_(!1)},[_]),P=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{w.current=!0,_(!0)},b)},[b,_]);return m.useEffect(()=>()=>window.clearTimeout(g.current),[]),m.createElement(Bf,c,m.createElement(pJ,{scope:t,contentId:h,open:x,stateAttribute:S,trigger:u,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?P():C()},[l.isOpenDelayed,P,C]),onTriggerLeave:m.useCallback(()=>{v?E():window.clearTimeout(g.current)},[E,v]),onOpen:C,onClose:E,disableHoverableContent:v},n))},xP="TooltipTrigger",nk=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Lm(xP,n),i=N1(xP,n),s=I1(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(Vf,he({asChild:!0},s),m.createElement(Qe.button,he({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:Me(e.onPointerMove,h=>{h.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)})))}),mJ="TooltipPortal",[hye,vJ]=Nm(mJ,{forceMount:void 0}),Bd="TooltipContent",bJ=m.forwardRef((e,t)=>{const n=vJ(Bd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Lm(Bd,e.__scopeTooltip);return m.createElement(er,{present:r||s.open},s.disableHoverableContent?m.createElement(rk,he({side:o},i,{ref:t})):m.createElement(yJ,he({side:o},i,{ref:t})))}),yJ=m.forwardRef((e,t)=>{const n=Lm(Bd,e.__scopeTooltip),r=N1(Bd,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,h=m.useCallback(()=>{a(null),f(!1)},[f]),g=m.useCallback((v,b)=>{const w=v.currentTarget,x={x:v.clientX,y:v.clientY},_=wJ(x,w.getBoundingClientRect()),S=_J(x,_),C=SJ(b.getBoundingClientRect()),E=EJ([...S,...C]);a(E),f(!0)},[f]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(l&&u){const v=w=>g(w,u),b=w=>g(w,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",b)}}},[l,u,g,h]),m.useEffect(()=>{if(s){const v=b=>{const w=b.target,x={x:b.clientX,y:b.clientY},_=(l==null?void 0:l.contains(w))||(u==null?void 0:u.contains(w)),S=!CJ(x,s);_?h():S&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,s,c,h]),m.createElement(rk,he({},e,{ref:i}))}),[xJ,pye]=Nm(L1,{isInside:!1}),rk=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Lm(Bd,n),c=I1(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(_x,u),()=>document.removeEventListener(_x,u)),[u]),m.useEffect(()=>{if(l.trigger){const f=h=>{const g=h.target;g!=null&&g.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},m.createElement(Hf,he({"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(ek,null,r),m.createElement(xJ,{scope:n,isInside:!0},m.createElement(cJ,{id:l.contentId,role:"tooltip"},o||r))))});function wJ(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 _J(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 SJ(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 CJ(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 EJ(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),RJ(t)}function RJ(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 OJ=hJ,PJ=gJ,TJ=nk,ok=bJ,DJ=OJ,ik=PJ,sk=TJ,F1=H.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(ok,{ref:r,sideOffset:t,className:Ce("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}));F1.displayName=ok.displayName;function ll({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 g=new Intl.NumberFormat(l,f).format(u);return n&&(g+=a),g}function ak(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function lk({card:e}){var w,x,_,S,C,E,P,A,k,I,$,L,j,Q,ee,B,Z,G,q,K,T,V,X,N;const t=ke(ie=>ie.actions.setCardTitle),n=ke(ie=>ie.actions.setCardDescription),r=ke(ie=>ie.isVisualEditing),o=br(ie=>ie.card),i=br(ie=>ie.actions.setCard);br(ie=>ie.actions.setNumberFormat);const s=ke(ie=>ie.selectedSheetId),a=e.data,l=(x=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:x.colorRanges,{metricKeys:c}=ar(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]],h=!!e.data&&e.data.length>0;function g(ie){r?i({...o,title:ie}):t(s,e.id,ie)}function v(ie){r?i({...o,description:ie}):n(s,e.id,ie)}const b=f&&f-u!==0?(u-f)/f:null;return O.jsxs("div",{className:"kpi-card flex grow flex-col overflow-scroll",children:[O.jsxs(lm,{className:"grow pb-3",children:[O.jsx(is,{text:r?o.title:e.title,onSave:g,children:O.jsx("div",{className:"flex items-center gap-2",children:O.jsx(Af,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),h&&O.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[O.jsx("p",{style:{color:ak(u,l)},className:"text-3xl font-semibold",children:ll({number:u,decimalPlaces:((E=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:E.decimalPlaces)||0,useSuffix:!!((A=(P=e.preferences)==null?void 0:P.formatNumber)!=null&&A.suffix),customSuffix:((I=(k=e.preferences)==null?void 0:k.formatNumber)==null?void 0:I.suffix)||"",locale:((L=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:L.locale)||"",currency:((Q=(j=e.preferences)==null?void 0:j.formatNumber)==null?void 0:Q.currency)||""})}),f&&O.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",ll({number:f,decimalPlaces:((B=(ee=e.preferences)==null?void 0:ee.formatNumber)==null?void 0:B.decimalPlaces)||0,useSuffix:!!((G=(Z=e.preferences)==null?void 0:Z.formatNumber)!=null&&G.suffix),customSuffix:((K=(q=e.preferences)==null?void 0:q.formatNumber)==null?void 0:K.suffix)||"",locale:((V=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:V.locale)||"",currency:((N=(X=e.preferences)==null?void 0:X.formatNumber)==null?void 0:N.currency)||""})]})]})]}),b&&O.jsxs(cm,{className:"grow items-start gap-1 pb-4 text-sm",children:[O.jsx(AJ,{children:b}),O.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[b>0?"up ":"down ",O.jsx(is,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function AJ({children:e}){const t=e>0?O.jsx(C1,{className:"h-4 w-4"}):O.jsx(S1,{className:"h-4 w-4"}),n=`${Math.abs(e*100).toFixed(0)}%`;return O.jsxs("div",{className:Ce("flex items-center",{"text-green-600":e>0,"text-destructive":e<0}),children:[t,O.jsx("span",{className:"ml-[1px]",children:n})]})}var Kc=1e3,Xc=Kc*60,Qc=Xc*60,vl=Qc*24,$J=vl*7,kJ=vl*365.25,MJ=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return IJ(e);if(n==="number"&&isFinite(e))return t.long?LJ(e):NJ(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function IJ(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*kJ;case"weeks":case"week":case"w":return n*$J;case"days":case"day":case"d":return n*vl;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Qc;case"minutes":case"minute":case"mins":case"min":case"m":return n*Xc;case"seconds":case"second":case"secs":case"sec":case"s":return n*Kc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function NJ(e){var t=Math.abs(e);return t>=vl?Math.round(e/vl)+"d":t>=Qc?Math.round(e/Qc)+"h":t>=Xc?Math.round(e/Xc)+"m":t>=Kc?Math.round(e/Kc)+"s":e+"ms"}function LJ(e){var t=Math.abs(e);return t>=vl?bp(e,t,vl,"day"):t>=Qc?bp(e,t,Qc,"hour"):t>=Xc?bp(e,t,Xc,"minute"):t>=Kc?bp(e,t,Kc,"second"):e+" ms"}function bp(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const FJ=nu(MJ);function ck({children:e}){const{setIsSessionExpired:t}=co(),n=new eB({queryCache:new bD({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return O.jsx(oB,{client:n,children:e})}const au=m.forwardRef(({children:e,className:t,...n},r)=>O.jsx("div",{className:Ce("semaphor-scope",t),ref:r,...n,children:e})),jJ={id:"",authToken:void 0},uk=m.createContext(jJ),dk=({children:e,dashboardProps:t})=>O.jsx(ck,{children:O.jsx(uk.Provider,{value:t,children:O.jsx(au,{style:{height:"100%"},children:e})})});function ma(){const e=m.useContext(uk);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function zJ(e){ke(l=>l.bookmarkKey),ke(l=>l.selectedSheetId);const t=ke(l=>l.dashboard.baseQueries);ke(l=>l.actions.getCardSheet),ke(l=>l.actions.getSelectedFrame());const{authToken:n}=ma(),r=ke(l=>l.authToken),o=ke(l=>l.filterValues),i=FJ((e==null?void 0:e.refreshInterval)||"0"),s=Q2(e.sql,t);return Df({queryKey:[e.id,s,JSON.stringify(o)],queryFn:()=>Of("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===uD?"":e.python,active_filters:o}),refetchInterval:i,enabled:!!e.connectionId})}function Ia({data:e,cfg:t,customCfg:n,preferences:r}){const{dimensionKeys:o,metricKeys:i}=ar(e),s=HX(i,e,r),a=og(s,n),l=o[0],c=mx(e,l);j1(r,t),fk(r);const u=hk(t,r),f=qo((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions),h=qo(u,f),g=qo(h,(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:g}}function j1(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 fk(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 hk(e,t){var i,s,a,l,c,u,f,h,g,v,b,w;const n=j1(t,e),r=fk(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:x=>{var _,S,C,E;return ll({number:Number(x),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]:{...(g=(h=(f=e==null?void 0:e.options)==null?void 0:f.scales)==null?void 0:h[r])==null?void 0:g.ticks,callback:null}},plugins:{...(v=e==null?void 0:e.options)==null?void 0:v.plugins,datalabels:{...(w=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:w.datalabels,formatter:function(x){var _,S,C,E;return ll({number:Number(x),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 BJ(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function VJ(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 HJ(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function WJ(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 UJ(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 qJ(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function GJ(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 YJ(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function KJ(e){const n=new Function("getDatalabelColor",e)(E0);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}function z1({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=HJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const u=BJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pyramid"){const u=VJ(n),{dimensionKeys:f,metricKeys:h}=ar(e),g=Tg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:h[0]}),v=Ia({data:g,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s}),b="x2";return{...v,data:{...v.data,datasets:v.data.datasets.map((x,_)=>_===1?{...x,xAxisID:b}:x)},options:{...v.options,scales:{...(a=v==null?void 0:v.options)==null?void 0:a.scales,[b]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const u=UJ(n,t),{dimensionKeys:f,metricKeys:h}=ar(e),g=Tg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:h[0]});return Ia({data:g,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const u=qJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="range"){const u=WJ(n),f=qX(e),h=og(f,r),{plugins:g,options:v}=KJ((s==null?void 0:s.customVisualCode)||""),b=qo((u==null?void 0:u.options)||{},(n==null?void 0:n.options)||{}),w=qo(b,(s==null?void 0:s.chartOptions)||{}),x=qo(w,(r==null?void 0:r.options)||{}),_=qo(x,v),S=hk(n,s),C=qo(_,S),E={...C,plugins:{...C==null?void 0:C.plugins,datalabels:{...(l=C==null?void 0:C.plugins)==null?void 0:l.datalabels,formatter:($,L)=>$.map(Q=>{var ee,B,Z,G;return ll({number:Number(Q),decimalPlaces:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.decimalPlaces)||0,useSuffix:!!((B=s==null?void 0:s.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((Z=s==null?void 0:s.numberAxisFormat)==null?void 0:Z.locale)||"",currency:((G=s==null?void 0:s.numberAxisFormat)==null?void 0:G.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:P}=ar(e),A=P[0];return{type:"bar",data:{labels:[...new Set(mx(e,A))],datasets:h},options:E,plugins:[...g]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const u=GJ(t,n),{dimensionKeys:f,metricKeys:h}=ar(e),g=GX(h,e),v=og(g,r),b=f[0],w=mx(e,b),x=qo((u==null?void 0:u.options)||{},(r==null?void 0:r.options)||{}),_=qo(x,(s==null?void 0:s.chartOptions)||{}),S={..._,plugins:{..._.plugins,datalabels:{...(c=_.plugins)==null?void 0:c.datalabels,formatter:(P,A)=>{var k,I,$,L;return ll({number:Number(P),decimalPlaces:((k=s==null?void 0:s.numberAxisFormat)==null?void 0:k.decimalPlaces)||0,useSuffix:!!((I=s==null?void 0:s.numberAxisFormat)!=null&&I.suffix),customSuffix:"",locale:(($=s==null?void 0:s.numberAxisFormat)==null?void 0:$.locale)||"",currency:((L=s==null?void 0:s.numberAxisFormat)==null?void 0:L.currency)||""})}}}};return{type:t,data:{labels:w,datasets:v},options:S,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(P,A,k){var Z,G,q,K;const{ctx:I,data:$}=P;I.save();const L=P.getDatasetMeta(0).data[0].x,j=P.getDatasetMeta(0).data[0].y,Q=Bc(Pd());I.font="1.2rem Arial",I.fontWeight="bolder",I.fillStyle=Q,I.textAlign="center",I.textBaseline="middle";const ee=$.datasets[0].data.reduce((T,V)=>T+V,0),B=ll({number:Number(ee),decimalPlaces:((Z=s==null?void 0:s.numberAxisFormat)==null?void 0:Z.decimalPlaces)||0,useSuffix:!!((G=s==null?void 0:s.numberAxisFormat)!=null&&G.suffix),customSuffix:"",locale:((q=s==null?void 0:s.numberAxisFormat)==null?void 0:q.locale)||"",currency:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.currency)||""});I.fillText(B,L,j)}}:""]}}if(t==="radar"){const u=YJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:u}=ar(e);if(u.length<3){console.log("Bubble charts require 3 numeric columns");return}const f=UX(e),h=og(f,r),g={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}}}},v=qo(g,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:h},options:v}}return Ia({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function XJ({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=ke.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)&&JJ(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&ZJ(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&QJ({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function QJ(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,h)=>{var g,v;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=(g=f==null?void 0:f.backgroundColor)==null?void 0:g.map((b,w)=>w===n&&h===r?b:s),f.borderColor=(v=f==null?void 0:f.borderColor)==null?void 0:v.map((b,w)=>w===n&&h===r?b:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((f,h)=>{var g,v,b,w,x,_;f.backgroundColor=new Array(f.data.length).fill((b=(v=(g=o==null?void 0:o.data)==null?void 0:g.datasets)==null?void 0:v[h])==null?void 0:b.backgroundColor),f.borderColor=new Array(f.data.length).fill((_=(x=(w=o==null?void 0:o.data)==null?void 0:w.datasets)==null?void 0:x[h])==null?void 0:_.borderColor)}),t==null||t.update()}function JJ(e,t,n,r,o){var i,s,a,l;console.log("clicked index",t),r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(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((h,g)=>g===t?h:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((h,g)=>g===t?h:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,h,g,v,b,w;c.backgroundColor=new Array(c.data.length).fill((g=(h=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:h[u])==null?void 0:g.backgroundColor),c.borderColor=new Array(c.data.length).fill((w=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:w.borderColor)}),e==null||e.update()}function ZJ(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((h,g)=>g===t?h:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((h,g)=>g===t?h:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,h,g,v,b,w,x,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(g=(h=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:h[u])==null?void 0:g.backgroundColor,c.borderColor=(w=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:w.borderColor),c.backgroundColor=(x=c==null?void 0:c.backgroundColor)==null?void 0:x.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 eZ(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=ar(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=Tg({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:h}=ar(l),g=h[t];return[{columnName:c,columnValue:u,metric:a[0],value:r},{columnName:f,columnValue:g,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 tZ(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=co(),r=n(e),o=B1(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 B1(e){var ee,B,Z,G;const{onChartElementClicked:t}=ma(),[n,r]=m.useState(0),o=((ee=e==null?void 0:e.preferences)==null?void 0:ee.filterOnClickColumnIndex)===void 0?0:(B=e.preferences)==null?void 0:B.filterOnClickColumnIndex,i=ke(q=>q.bookmarkKey);ke(q=>q.isVisualEditing);const s=ke(q=>q.filteringCards),a=ke(q=>q.selectedSheetId);ke(q=>q.selectedCardId),ke(q=>q.isDashboardEditing);const l=ke(q=>q.themeStyle),c=ke(q=>q.filterValues),u=m.useRef(c),f=(Z=e==null?void 0:e.preferences)==null?void 0:Z.onClickFilter,{addFrame:h,addFilteringCard:g,setFrameCardData:v,getCardFrame:b,addOrUpdateFilterValue:w,addOrUpdateFilterValues:x,removeFilterValue:_,removeFilteringCard:S}=co(),{data:C,isLoading:E,isFetching:P,isError:A,refetch:k}=zJ(e),I=s==null?void 0:s.find(q=>q.id===e.id),$=((G=b(e.id))==null?void 0:G.cards)||[],L=($==null?void 0:$.length)==1;let j;e.data&&e.data.length>0&&(j=z1({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences})),m.useEffect(()=>{!C||!C.records||I&&L||(console.log("I am firing"),v(a,e.id,(C==null?void 0:C.records)||[]))},[C,a,e.id,v,c]),m.useEffect(()=>{e.data&&(I&&L||r(n+1))},[JSON.stringify(e.data),e.type,e.cfg,e.customCfg,e.preferences,l]),m.useEffect(()=>{e.connectionId&&!I&&(u.current=c)},[c,i]);function Q(q,K,T,V){var ie,fe;let X=!1;if(!e.data)return;const N=eZ(e,K,T,V);if(console.log("fieldValues",N),t==null||t(e,N),!!(((ie=e==null?void 0:e.preferences)==null?void 0:ie.onClickFilter)??[]).length){if(I){const ue=e.id;_(ue),S(e)}else{if(X=!0,!N)return;const ue=[];N.forEach((pe,se)=>{const ne=f==null?void 0:f.find(ye=>ye.columnIndex===se);if(!ne)return;const le={filterId:e.id+"-"+pe.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:pe.columnName,expression:ne.expression,valueType:Td(N[ne.columnIndex].columnValue),operation:"=",values:[N[ne.columnIndex].columnValue]};ue.push(le)}),e.id,e==null||e.connectionId,e.lastSelectedTable,N[o].columnName,(fe=e.preferences)==null||fe.filterOnClickField,Td(N[o].columnValue),N[o].columnValue,x(ue),g(e)}XJ({chart:q,elementIndex:T,datasetIndex:K,cardType:e.type,cfg:j,apply:X})}}return{isError:A,isLoading:E,isFetching:P,data:C,visualKey:n,handleDatapointClick:Q,cfg:j}}var nZ=e=>{switch(e){case"success":return iZ;case"info":return aZ;case"warning":return sZ;case"error":return lZ;default:return null}},rZ=Array(12).fill(0),oZ=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},rZ.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),iZ=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"})),sZ=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"})),aZ=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"})),lZ=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"})),cZ=()=>{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},Sx=1,uZ=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:Sx++,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(fZ(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)||Sx++;return this.create({jsx:t(r),id:r,...n}),r},this.subscribers=[],this.toasts=[]}},Qr=new uZ,dZ=(e,t)=>{let n=(t==null?void 0:t.id)||Sx++;return Qr.addToast({title:e,...t,id:n}),n},fZ=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",hZ=dZ,pZ=()=>Qr.toasts,pk=Object.assign(hZ,{success:Qr.success,info:Qr.info,warning:Qr.warning,error:Qr.error,custom:Qr.custom,message:Qr.message,promise:Qr.promise,dismiss:Qr.dismiss,loading:Qr.loading},{getHistory:pZ});function gZ(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))}gZ(`: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%)}
254
- `);function yp(e){return e.label!==void 0}var mZ=3,vZ="32px",bZ=4e3,yZ=356,xZ=14,wZ=20,_Z=200;function SZ(...e){return e.filter(Boolean).join(" ")}var CZ=e=>{var t,n,r,o,i,s,a,l,c,u;let{invert:f,toast:h,unstyled:g,interacting:v,setHeights:b,visibleToasts:w,heights:x,index:_,toasts:S,expanded:C,removeToast:E,defaultRichColors:P,closeButton:A,style:k,cancelButtonStyle:I,actionButtonStyle:$,className:L="",descriptionClassName:j="",duration:Q,position:ee,gap:B,loadingIcon:Z,expandByDefault:G,classNames:q,icons:K,closeButtonAriaLabel:T="Close toast",pauseWhenPageIsHidden:V,cn:X}=e,[N,ie]=m.useState(!1),[fe,ue]=m.useState(!1),[pe,se]=m.useState(!1),[ne,le]=m.useState(!1),[ye,Y]=m.useState(0),[be,_e]=m.useState(0),Pe=m.useRef(null),Te=m.useRef(null),Ue=_===0,Be=_+1<=w,Ie=h.type,Ke=h.dismissible!==!1,lt=h.className||"",It=h.descriptionClassName||"",At=m.useMemo(()=>x.findIndex(nt=>nt.toastId===h.id)||0,[x,h.id]),Ht=m.useMemo(()=>{var nt;return(nt=h.closeButton)!=null?nt:A},[h.closeButton,A]),de=m.useMemo(()=>h.duration||Q||bZ,[h.duration,Q]),Ee=m.useRef(0),Le=m.useRef(0),Ge=m.useRef(0),Ze=m.useRef(null),[Wt,Zt]=ee.split("-"),Kt=m.useMemo(()=>x.reduce((nt,ht,$t)=>$t>=At?nt:nt+ht.height,0),[x,At]),vn=cZ(),ln=h.invert||f,Lt=Ie==="loading";Le.current=m.useMemo(()=>At*B+Kt,[At,Kt]),m.useEffect(()=>{ie(!0)},[]),m.useLayoutEffect(()=>{if(!N)return;let nt=Te.current,ht=nt.style.height;nt.style.height="auto";let $t=nt.getBoundingClientRect().height;nt.style.height=ht,_e($t),b(Xt=>Xt.find(bt=>bt.toastId===h.id)?Xt.map(bt=>bt.toastId===h.id?{...bt,height:$t}:bt):[{toastId:h.id,height:$t,position:h.position},...Xt])},[N,h.title,h.description,b,h.id]);let tn=m.useCallback(()=>{ue(!0),Y(Le.current),b(nt=>nt.filter(ht=>ht.toastId!==h.id)),setTimeout(()=>{E(h)},_Z)},[h,E,b,Le]);m.useEffect(()=>{if(h.promise&&Ie==="loading"||h.duration===1/0||h.type==="loading")return;let nt,ht=de;return C||v||V&&vn?(()=>{if(Ge.current<Ee.current){let $t=new Date().getTime()-Ee.current;ht=ht-$t}Ge.current=new Date().getTime()})():ht!==1/0&&(Ee.current=new Date().getTime(),nt=setTimeout(()=>{var $t;($t=h.onAutoClose)==null||$t.call(h,h),tn()},ht)),()=>clearTimeout(nt)},[C,v,G,h,de,tn,h.promise,Ie,V,vn]),m.useEffect(()=>{let nt=Te.current;if(nt){let ht=nt.getBoundingClientRect().height;return _e(ht),b($t=>[{toastId:h.id,height:ht,position:h.position},...$t]),()=>b($t=>$t.filter(Xt=>Xt.toastId!==h.id))}},[b,h.id]),m.useEffect(()=>{h.delete&&tn()},[tn,h.delete]);function xn(){return K!=null&&K.loading?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},K.loading):Z?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},Z):m.createElement(oZ,{visible:Ie==="loading"})}return m.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Te,className:X(L,lt,q==null?void 0:q.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,q==null?void 0:q.default,q==null?void 0:q[Ie],(n=h==null?void 0:h.classNames)==null?void 0:n[Ie]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:P,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":N,"data-promise":!!h.promise,"data-removed":fe,"data-visible":Be,"data-y-position":Wt,"data-x-position":Zt,"data-index":_,"data-front":Ue,"data-swiping":pe,"data-dismissible":Ke,"data-type":Ie,"data-invert":ln,"data-swipe-out":ne,"data-expanded":!!(C||G&&N),style:{"--index":_,"--toasts-before":_,"--z-index":S.length-_,"--offset":`${fe?ye:Le.current}px`,"--initial-height":G?"auto":`${be}px`,...k,...h.style},onPointerDown:nt=>{Lt||!Ke||(Pe.current=new Date,Y(Le.current),nt.target.setPointerCapture(nt.pointerId),nt.target.tagName!=="BUTTON"&&(se(!0),Ze.current={x:nt.clientX,y:nt.clientY}))},onPointerUp:()=>{var nt,ht,$t,Xt;if(ne||!Ke)return;Ze.current=null;let bt=Number(((nt=Te.current)==null?void 0:nt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Rn=new Date().getTime()-((ht=Pe.current)==null?void 0:ht.getTime()),Lo=Math.abs(bt)/Rn;if(Math.abs(bt)>=wZ||Lo>.11){Y(Le.current),($t=h.onDismiss)==null||$t.call(h,h),tn(),le(!0);return}(Xt=Te.current)==null||Xt.style.setProperty("--swipe-amount","0px"),se(!1)},onPointerMove:nt=>{var ht;if(!Ze.current||!Ke)return;let $t=nt.clientY-Ze.current.y,Xt=nt.clientX-Ze.current.x,bt=(Wt==="top"?Math.min:Math.max)(0,$t),Rn=nt.pointerType==="touch"?10:2;Math.abs(bt)>Rn?(ht=Te.current)==null||ht.style.setProperty("--swipe-amount",`${$t}px`):Math.abs(Xt)>Rn&&(Ze.current=null)}},Ht&&!h.jsx?m.createElement("button",{"aria-label":T,"data-disabled":Lt,"data-close-button":!0,onClick:Lt||!Ke?()=>{}:()=>{var nt;tn(),(nt=h.onDismiss)==null||nt.call(h,h)},className:X(q==null?void 0:q.closeButton,(o=h==null?void 0:h.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,h.jsx||m.isValidElement(h.title)?h.jsx||h.title:m.createElement(m.Fragment,null,Ie||h.icon||h.promise?m.createElement("div",{"data-icon":"",className:X(q==null?void 0:q.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||xn():null,h.type!=="loading"?h.icon||(K==null?void 0:K[Ie])||nZ(Ie):null):null,m.createElement("div",{"data-content":"",className:X(q==null?void 0:q.content,(s=h==null?void 0:h.classNames)==null?void 0:s.content)},m.createElement("div",{"data-title":"",className:X(q==null?void 0:q.title,(a=h==null?void 0:h.classNames)==null?void 0:a.title)},h.title),h.description?m.createElement("div",{"data-description":"",className:X(j,It,q==null?void 0:q.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),m.isValidElement(h.cancel)?h.cancel:h.cancel&&yp(h.cancel)?m.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||I,onClick:nt=>{var ht,$t;yp(h.cancel)&&Ke&&(($t=(ht=h.cancel).onClick)==null||$t.call(ht,nt),tn())},className:X(q==null?void 0:q.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,m.isValidElement(h.action)?h.action:h.action&&yp(h.action)?m.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:nt=>{var ht,$t;yp(h.action)&&(nt.defaultPrevented||(($t=(ht=h.action).onClick)==null||$t.call(ht,nt),tn()))},className:X(q==null?void 0:q.actionButton,(u=h==null?void 0:h.classNames)==null?void 0:u.actionButton)},h.action.label):null))};function wP(){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 EZ=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:h=mZ,toastOptions:g,dir:v=wP(),gap:b=xZ,loadingIcon:w,icons:x,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S,cn:C=SZ}=e,[E,P]=m.useState([]),A=m.useMemo(()=>Array.from(new Set([n].concat(E.filter(V=>V.position).map(V=>V.position)))),[E,n]),[k,I]=m.useState([]),[$,L]=m.useState(!1),[j,Q]=m.useState(!1),[ee,B]=m.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=m.useRef(null),G=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=m.useRef(null),K=m.useRef(!1),T=m.useCallback(V=>{var X;(X=E.find(N=>N.id===V.id))!=null&&X.delete||Qr.dismiss(V.id),P(N=>N.filter(({id:ie})=>ie!==V.id))},[E]);return m.useEffect(()=>Qr.subscribe(V=>{if(V.dismiss){P(X=>X.map(N=>N.id===V.id?{...N,delete:!0}:N));return}setTimeout(()=>{Mo.flushSync(()=>{P(X=>{let N=X.findIndex(ie=>ie.id===V.id);return N!==-1?[...X.slice(0,N),{...X[N],...V},...X.slice(N+1)]:[V,...X]})})})}),[]),m.useEffect(()=>{if(l!=="system"){B(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:V})=>{B(V?"dark":"light")})},[l]),m.useEffect(()=>{E.length<=1&&L(!1)},[E]),m.useEffect(()=>{let V=X=>{var N,ie;r.every(fe=>X[fe]||X.code===fe)&&(L(!0),(N=Z.current)==null||N.focus()),X.code==="Escape"&&(document.activeElement===Z.current||(ie=Z.current)!=null&&ie.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[r]),m.useEffect(()=>{if(Z.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,K.current=!1)}},[Z.current]),E.length?m.createElement("section",{"aria-label":`${_} ${G}`,tabIndex:-1},A.map((V,X)=>{var N;let[ie,fe]=V.split("-");return m.createElement("ol",{key:V,dir:v==="auto"?wP():v,tabIndex:-1,ref:Z,className:s,"data-sonner-toaster":!0,"data-theme":ee,"data-y-position":ie,"data-x-position":fe,style:{"--front-toast-height":`${((N=k[0])==null?void 0:N.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||vZ,"--width":`${yZ}px`,"--gap":`${b}px`,...f},onBlur:ue=>{K.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(K.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||K.current||(K.current=!0,q.current=ue.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{j||L(!1)},onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||Q(!0)},onPointerUp:()=>Q(!1)},E.filter(ue=>!ue.position&&X===0||ue.position===V).map((ue,pe)=>{var se,ne;return m.createElement(CZ,{key:ue.id,icons:x,index:pe,toast:ue,defaultRichColors:c,duration:(se=g==null?void 0:g.duration)!=null?se:u,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:t,visibleToasts:h,closeButton:(ne=g==null?void 0:g.closeButton)!=null?ne:i,interacting:j,position:V,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:T,toasts:E.filter(le=>le.position==ue.position),heights:k.filter(le=>le.position==ue.position),setHeights:I,expandByDefault:o,gap:b,loadingIcon:w,expanded:$,pauseWhenPageIsHidden:S,cn:C})}))})):null};function RZ(e,t){const n=ke(u=>u.selectedSheetId),r=ke(u=>u.selectedFrameId),o=ke(u=>u.isDashboardEditing),i=ke(u=>u.isVisualEditing),{addFrame:s,getSelectedFrame:a,setSelectedFrameId:l}=ke(u=>u.actions);m.useEffect(()=>{const u=h=>{if(o&&((h.metaKey||h.ctrlKey)&&h.key==="c"&&(navigator.clipboard.writeText(JSON.stringify(a())),pk.success("Card copied to clipboard")),(h.ctrlKey||h.metaKey)&&h.key==="v")){console.log("Ctrl+V has been pressed");try{navigator.clipboard.readText().then(g=>{try{const v=JSON.parse(g);if(v&&v.id){v.id=la();const b=v.activeCardId;v.cards.forEach(w=>{const x=w.id;w.id=la(),x===b&&(v.activeCardId=w.id,w.title=`${w.title} (Copy)`)}),s(n,v),l(v.id)}}catch(v){console.error("Failed to parse clipboard contents: ",v)}})}catch(g){console.error("Failed to read clipboard contents: ",g)}}},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 ay;const gk="HoverCard",[mk,mye]=Zn(gk,[Ti]),V1=Ti(),[OZ,H1]=mk(gk),PZ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=V1(t),c=m.useRef(0),u=m.useRef(0),f=m.useRef(!1),h=m.useRef(!1),[g=!1,v]=wr({prop:r,defaultProp:o,onChange:i}),b=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),w=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!h.current&&(u.current=window.setTimeout(()=>v(!1),a))},[a,v]),x=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(OZ,{scope:t,open:g,onOpenChange:v,onOpen:b,onClose:w,onDismiss:x,hasSelectionRef:f,isPointerDownOnContentRef:h},m.createElement(Bf,l,n))},TZ="HoverCardTrigger",DZ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=H1(TZ,n),i=V1(n);return m.createElement(Vf,he({asChild:!0},i),m.createElement(Qe.a,he({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:Me(e.onPointerEnter,Mg(o.onOpen)),onPointerLeave:Me(e.onPointerLeave,Mg(o.onClose)),onFocus:Me(e.onFocus,o.onOpen),onBlur:Me(e.onBlur,o.onClose),onTouchStart:Me(e.onTouchStart,s=>s.preventDefault())})))}),AZ="HoverCardPortal",[vye,$Z]=mk(AZ,{forceMount:void 0}),Cx="HoverCardContent",kZ=m.forwardRef((e,t)=>{const n=$Z(Cx,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=H1(Cx,e.__scopeHoverCard);return m.createElement(er,{present:r||i.open},m.createElement(MZ,he({"data-state":i.open?"open":"closed"},o,{onPointerEnter:Me(e.onPointerEnter,Mg(i.onOpen)),onPointerLeave:Me(e.onPointerLeave,Mg(i.onClose)),ref:t})))}),MZ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=H1(Cx,n),c=V1(n),u=m.useRef(null),f=_t(t,u),[h,g]=m.useState(!1);return m.useEffect(()=>{if(h){const v=document.body;return ay=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=ay,v.style.webkitUserSelect=ay}}},[h]),m.useEffect(()=>{if(u.current){const v=()=>{g(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var b;((b=document.getSelection())===null||b===void 0?void 0:b.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{u.current&&IZ(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Me(i,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Hf,he({},c,a,{onPointerDown:Me(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"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 Mg(e){return t=>t.pointerType==="touch"?void 0:e()}function IZ(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 NZ=PZ,LZ=DZ,vk=kZ,W1=NZ,U1=LZ,Fm=H.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>O.jsx(vk,{ref:o,align:t,sideOffset:n,className:Ce("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}));Fm.displayName=vk.displayName;function FZ({card:e}){const{setCardInfo:t}=co();return O.jsxs(W1,{openDelay:0,children:[O.jsx(U1,{children:O.jsx(nQ,{className:"size-4 text-muted-foreground/40"})}),O.jsx(Fm,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:O.jsx(is,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:O.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}const q1=H.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>O.jsx("div",{style:n,className:Ce("relative w-full overflow-auto",t),children:O.jsx("table",{ref:o,className:Ce("w-full caption-bottom text-sm",e),...r})}));q1.displayName="Table";const G1=H.forwardRef(({className:e,...t},n)=>O.jsx("thead",{ref:n,className:Ce("[&_tr]:border-b",e),...t}));G1.displayName="TableHeader";const Y1=H.forwardRef(({className:e,...t},n)=>O.jsx("tbody",{ref:n,className:Ce("[&_tr:last-child]:border-0",e),...t}));Y1.displayName="TableBody";const jZ=H.forwardRef(({className:e,...t},n)=>O.jsx("tfoot",{ref:n,className:Ce("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));jZ.displayName="TableFooter";const yd=H.forwardRef(({className:e,...t},n)=>O.jsx("tr",{ref:n,className:Ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));yd.displayName="TableRow";const K1=H.forwardRef(({className:e,...t},n)=>O.jsx("th",{ref:n,className:Ce("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));K1.displayName="TableHead";const Ig=H.forwardRef(({className:e,...t},n)=>O.jsx("td",{ref:n,className:Ce("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ig.displayName="TableCell";const zZ=H.forwardRef(({className:e,...t},n)=>O.jsx("caption",{ref:n,className:Ce("mt-4 text-sm text-muted-foreground",e),...t}));zZ.displayName="TableCaption";/**
255
- * table-core
256
- *
257
- * Copyright (c) TanStack
258
- *
259
- * This source code is licensed under the MIT license found in the
260
- * LICENSE.md file in the root directory of this source tree.
261
- *
262
- * @license MIT
263
- */function ea(e,t){return typeof e=="function"?e(t):e}function uo(e,t){return n=>{t.setState(r=>({...r,[e]:ea(n,r[e])}))}}function Ng(e){return e instanceof Function}function BZ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function VZ(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,h=(g,v)=>{for(g=String(g);g.length<v;)g=" "+g;return g};console.info(`%c⏱ ${h(u,5)} /${h(c,5)} ms`,`
264
- font-size: .6rem;
265
- font-weight: bold;
266
- color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function HZ(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=h=>{let g=h;for(const b of l.split(".")){var v;g=(v=g)==null?void 0:v[b],process.env.NODE_ENV!=="production"&&g===void 0&&console.warn(`"${b}" in deeply nested key "${l}" returned undefined.`)}return g}:u=h=>h[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 h;return[f,...(h=f.columns)==null?void 0:h.flatMap(g=>g.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var h;return(h=e.options.debugAll)!=null?h:e.options.debugColumns}}),getLeafColumns:at(()=>[e._getOrderColumnsFn()],h=>{var g;if((g=f.columns)!=null&&g.length){let v=f.columns.flatMap(b=>b.getLeafColumns());return h(v)}return[f]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var h;return(h=e.options.debugAll)!=null?h:e.options.debugColumns}})};for(const h of e._features)h.createColumn==null||h.createColumn(f,e);return f}function _P(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 WZ={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(h=>h.id===f)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return xp(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))),xp(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 xp(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 xp(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 xp(e,t,n,r){var o,i;let s=0;const a=function(h,g){g===void 0&&(g=1),s=Math.max(s,g),h.filter(v=>v.getIsVisible()).forEach(v=>{var b;(b=v.columns)!=null&&b.length&&a(v.columns,g+1)},0)};a(e);let l=[];const c=(h,g)=>{const v={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},b=[];h.forEach(w=>{const x=[...b].reverse()[0],_=w.column.depth===v.depth;let S,C=!1;if(_&&w.column.parent?S=w.column.parent:(S=w.column,C=!0),x&&(x==null?void 0:x.column)===S)x.subHeaders.push(w);else{const E=_P(n,S,{id:[r,g,S.id,w==null?void 0:w.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${b.filter(P=>P.column===S).length}`:void 0,depth:g,index:b.length});E.subHeaders.push(w),b.push(E)}v.headers.push(w),w.headerGroup=v}),l.push(v),g>0&&c(b,g-1)},u=t.map((h,g)=>_P(n,h,{depth:s,index:g}));c(u,s-1),l.reverse();const f=h=>h.filter(v=>v.column.getIsVisible()).map(v=>{let b=0,w=0,x=[0];v.subHeaders&&v.subHeaders.length?(x=[],f(v.subHeaders).forEach(S=>{let{colSpan:C,rowSpan:E}=S;b+=C,x.push(E)})):b=1;const _=Math.min(...x);return w=w+_,v.colSpan=b,v.rowSpan=w,{colSpan:b,rowSpan:w}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const wp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ly=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),UZ={getDefaultColumnDef:()=>wp,getInitialState:e=>({columnSizing:{},columnSizingInfo:ly(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:uo("columnSizing",e),onColumnSizingInfoChange:uo("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:wp.minSize,(r=i??e.columnDef.size)!=null?r:wp.size),(o=e.columnDef.maxSize)!=null?o:wp.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(),cy(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(x=>[x.column.id,x.column.getSize()]):[[r.id,r.getSize()]],l=cy(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(x,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(S=>{var C,E;const P=t.options.columnResizeDirection==="rtl"?-1:1,A=(_-((C=S==null?void 0:S.startOffset)!=null?C:0))*P,k=Math.max(A/((E=S==null?void 0:S.startSize)!=null?E:0),-.999999);return S.columnSizingStart.forEach(I=>{let[$,L]=I;c[$]=Math.round(Math.max(L+L*k,0)*100)/100}),{...S,deltaOffset:A,deltaPercentage:k}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(S=>({...S,...c})))},f=x=>u("move",x),h=x=>{u("end",x),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,v={moveHandler:x=>f(x.clientX),upHandler:x=>{g==null||g.removeEventListener("mousemove",v.moveHandler),g==null||g.removeEventListener("mouseup",v.upHandler),h(x.clientX)}},b={moveHandler:x=>(x.cancelable&&(x.preventDefault(),x.stopPropagation()),f(x.touches[0].clientX),!1),upHandler:x=>{var _;g==null||g.removeEventListener("touchmove",b.moveHandler),g==null||g.removeEventListener("touchend",b.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),h((_=x.touches[0])==null?void 0:_.clientX)}},w=qZ()?{passive:!1}:!1;cy(i)?(g==null||g.addEventListener("touchmove",b.moveHandler,w),g==null||g.addEventListener("touchend",b.upHandler,w)):(g==null||g.addEventListener("mousemove",v.moveHandler,w),g==null||g.addEventListener("mouseup",v.upHandler,w)),t.setColumnSizingInfo(x=>({...x,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?ly():(n=e.initialState.columnSizingInfo)!=null?n:ly())},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 _p=null;function qZ(){if(typeof _p=="boolean")return _p;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 _p=e,_p}function cy(e){return e.type==="touchstart"}const GZ={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:uo("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()}}}},bk=(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))};bk.autoRemove=e=>Xo(e);const yk=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};yk.autoRemove=e=>Xo(e);const xk=(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())};xk.autoRemove=e=>Xo(e);const wk=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};wk.autoRemove=e=>Xo(e)||!(e!=null&&e.length);const _k=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});_k.autoRemove=e=>Xo(e)||!(e!=null&&e.length);const Sk=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Sk.autoRemove=e=>Xo(e)||!(e!=null&&e.length);const Ck=(e,t,n)=>e.getValue(t)===n;Ck.autoRemove=e=>Xo(e);const Ek=(e,t,n)=>e.getValue(t)==n;Ek.autoRemove=e=>Xo(e);const X1=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};X1.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]};X1.autoRemove=e=>Xo(e)||Xo(e[0])&&Xo(e[1]);const Wi={includesString:bk,includesStringSensitive:yk,equalsString:xk,arrIncludes:wk,arrIncludesAll:_k,arrIncludesSome:Sk,equals:Ck,weakEquals:Ek,inNumberRange:X1};function Xo(e){return e==null||e===""}const YZ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:uo("columnFilters",e),onGlobalFilterChange:uo("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"?Wi.includesString:typeof r=="number"?Wi.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Wi.equals:Array.isArray(r)?Wi.arrIncludes:Wi.weakEquals},e.getFilterFn=()=>{var n,r;return Ng(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:Wi[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=ea(n,i?i.value:void 0);if(SP(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=()=>Wi.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Ng(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Wi[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=ea(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(SP(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 SP(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const KZ=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),XZ=(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},QZ=(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},JZ=(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]},ZZ=(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},eee=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!BZ(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},tee=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),nee=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,ree=(e,t)=>t.length,uy={sum:KZ,min:XZ,max:QZ,extent:JZ,mean:ZZ,median:eee,unique:tee,uniqueCount:nee,count:ree},oee={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:uo("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 uy.sum;if(Object.prototype.toString.call(r)==="[object Date]")return uy.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Ng(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:uy[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 iee(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 see={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:uo("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 iee(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},Ex=0,Rx=10,dy=()=>({pageIndex:Ex,pageSize:Rx}),aee={getInitialState:e=>({...e,pagination:{...dy(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:uo("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=>ea(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?dy():(o=e.initialState.pagination)!=null?o:dy())},e.setPageIndex=r=>{e.setPagination(o=>{let i=ea(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?Ex:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Ex)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Rx:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Rx)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,ea(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=ea(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)}}},fy=()=>({left:[],right:[]}),hy=()=>({top:[],bottom:[]}),lee={getInitialState:e=>({columnPinning:fy(),rowPinning:hy(),...e}),getDefaultOptions:e=>({onColumnPinningChange:uo("columnPinning",e),onRowPinningChange:uo("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,h;return{top:((f=l==null?void 0:l.top)!=null?f:[]).filter(b=>!(a!=null&&a.has(b))),bottom:[...((h=l==null?void 0:l.bottom)!=null?h:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)]}}if(n==="top"){var g,v;return{top:[...((g=l==null?void 0:l.top)!=null?g:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)],bottom:((v=l==null?void 0:l.bottom)!=null?v:[]).filter(b=>!(a!=null&&a.has(b)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(b=>!(a!=null&&a.has(b))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(b=>!(a!=null&&a.has(b)))}})},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?fy():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:fy())},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?hy():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:hy())},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}})}},cee={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:uo("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=>{Ox(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?py(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?py(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?py(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 Ox(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Q1(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Px(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Px(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)}}}},Ox=(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=>Ox(e,a.id,n,r,o))};function py(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=Q1(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 Q1(e,t){var n;return(n=t[e.id])!=null?n:!1}function Px(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()&&(Q1(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Px(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Tx=/([0-9]+)/gm,uee=(e,t,n)=>Rk(fa(e.getValue(n)).toLowerCase(),fa(t.getValue(n)).toLowerCase()),dee=(e,t,n)=>Rk(fa(e.getValue(n)),fa(t.getValue(n))),fee=(e,t,n)=>J1(fa(e.getValue(n)).toLowerCase(),fa(t.getValue(n)).toLowerCase()),hee=(e,t,n)=>J1(fa(e.getValue(n)),fa(t.getValue(n))),pee=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},gee=(e,t,n)=>J1(e.getValue(n),t.getValue(n));function J1(e,t){return e===t?0:e>t?1:-1}function fa(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Rk(e,t){const n=e.split(Tx).filter(Boolean),r=t.split(Tx).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 Vu={alphanumeric:uee,alphanumericCaseSensitive:dee,text:fee,textCaseSensitive:hee,datetime:pee,basic:gee},mee={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:uo("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 Vu.datetime;if(typeof i=="string"&&(r=!0,i.split(Tx).length>1))return Vu.alphanumeric}return r?Vu.text:Vu.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 Ng(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:Vu[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(g=>g.id===e.id),l=s==null?void 0:s.findIndex(g=>g.id===e.id);let 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 h;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((h=t.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(g=>g.id===e.id?{...g,desc:f}:g):u==="remove"?c=s.filter(g=>g.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())}},vee={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:uo("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)}}},CP=[WZ,vee,see,lee,YZ,mee,oee,GZ,aee,cee,UZ];function bee(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:CP};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:CP,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=ea(u,n.options);n.options=o(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,h)=>{var g;return(g=n.options.getRowId==null?void 0:n.options.getRowId(u,f,h))!=null?g:`${h?[h.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,f)=>{let h=(f?n.getPrePaginationRowModel():n.getRowModel()).rowsById[u];if(!h&&(h=n.getCoreRowModel().rowsById[u],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${u}`):new Error;return h},_getDefaultColumnDef:at(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:h=>{const g=h.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:h=>{var g,v;return(g=(v=h.renderValue())==null||v.toString==null?void 0:v.toString())!=null?g:null},...n._features.reduce((h,g)=>Object.assign(h,g.getDefaultColumnDef==null?void 0:g.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(h,g,v){return v===void 0&&(v=0),h.map(b=>{const w=HZ(n,b,v,g),x=b;return w.columns=x.columns?f(x.columns,w,v+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,h)=>(f[h.id]=h,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 h=u.flatMap(g=>g.getLeafColumns());return f(h)},{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 yee(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 xee=(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:()=>VZ(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=>yee(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 Ok(){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=xee(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 Pk(){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 g=0;g<i.length;g+=1){var h;const v=i[g],b=s[v.id],w=(h=v==null?void 0:v.desc)!=null?h:!1;let x=0;if(b.sortUndefined){const _=u.getValue(v.id),S=f.getValue(v.id),C=_===void 0,E=S===void 0;(C||E)&&(x=C&&E?0:C?b.sortUndefined:-b.sortUndefined)}if(x===0&&(x=b.sortingFn(u,f,v.id)),x!==0)return w&&(x*=-1),b.invertSorting&&(x*=-1),x}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 wee(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 Tk(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=wee({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const h=g=>{f.flatRows.push(g),g.subRows.length&&g.subRows.forEach(h)};return f.rows.forEach(h),f},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
267
- * react-table
268
- *
269
- * Copyright (c) TanStack
270
- *
271
- * This source code is licensed under the MIT license found in the
272
- * LICENSE.md file in the root directory of this source tree.
273
- *
274
- * @license MIT
275
- */function Dx(e,t){return e?_ee(e)?H.createElement(e,t):e:null}function _ee(e){return See(e)||typeof e=="function"||Cee(e)}function See(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Cee(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Dk(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=H.useState(()=>({current:bee(t)})),[r,o]=H.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 Ax(e,[t,n]){return Math.min(n,Math.max(t,e))}let gy=0;function Z1(){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:EP()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:EP()),gy++,()=>{gy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),gy--}},[])}function EP(){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 my="focusScope.autoFocusOnMount",vy="focusScope.autoFocusOnUnmount",RP={bubbles:!1,cancelable:!0},e_=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=m.useState(null),c=Ln(o),u=Ln(i),f=m.useRef(null),h=_t(t,b=>l(b)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let b=function(S){if(g.paused||!a)return;const C=S.target;a.contains(C)?f.current=C:Fs(f.current,{select:!0})},w=function(S){if(g.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||Fs(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Fs(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const _=new MutationObserver(x);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),_.disconnect()}}},[r,a,g.paused]),m.useEffect(()=>{if(a){PP.add(g);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(my,RP);a.addEventListener(my,c),a.dispatchEvent(x),x.defaultPrevented||(Eee(Dee(Ak(a)),{select:!0}),document.activeElement===b&&Fs(a))}return()=>{a.removeEventListener(my,c),setTimeout(()=>{const x=new CustomEvent(vy,RP);a.addEventListener(vy,u),a.dispatchEvent(x),x.defaultPrevented||Fs(b??document.body,{select:!0}),a.removeEventListener(vy,u),PP.remove(g)},0)}}},[a,c,u,g]);const v=m.useCallback(b=>{if(!n&&!r||g.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(w&&x){const _=b.currentTarget,[S,C]=Ree(_);S&&C?!b.shiftKey&&x===C?(b.preventDefault(),n&&Fs(S,{select:!0})):b.shiftKey&&x===S&&(b.preventDefault(),n&&Fs(C,{select:!0})):x===_&&b.preventDefault()}},[n,r,g.paused]);return m.createElement(Qe.div,he({tabIndex:-1},s,{ref:h,onKeyDown:v}))});function Eee(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Fs(r,{select:t}),document.activeElement!==n)return}function Ree(e){const t=Ak(e),n=OP(t,e),r=OP(t.reverse(),e);return[n,r]}function Ak(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 OP(e,t){for(const n of e)if(!Oee(n,{upTo:t}))return n}function Oee(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 Pee(e){return e instanceof HTMLInputElement&&"select"in e}function Fs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Pee(e)&&t&&e.select()}}const PP=Tee();function Tee(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=TP(e,t),e.unshift(t)},remove(t){var n;e=TP(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function TP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Dee(e){return e.filter(t=>t.tagName!=="A")}const $k=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find($ee);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($x,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement($x,he({},r,{ref:t}),n)});$k.displayName="Slot";const $x=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...kee(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});$x.displayName="SlotClone";const Aee=({children:e})=>m.createElement(m.Fragment,null,e);function $ee(e){return m.isValidElement(e)&&e.type===Aee}function kee(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 jm(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 Mee=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zl=new WeakMap,Sp=new WeakMap,Cp={},by=0,kk=function(e){return e&&(e.host||kk(e.parentNode))},Iee=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kk(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})},Nee=function(e,t,n,r){var o=Iee(t,Array.isArray(e)?e:[e]);Cp[n]||(Cp[n]=new WeakMap);var i=Cp[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(h){if(a.has(h))u(h);else{var g=h.getAttribute(r),v=g!==null&&g!=="false",b=(Zl.get(h)||0)+1,w=(i.get(h)||0)+1;Zl.set(h,b),i.set(h,w),s.push(h),b===1&&v&&Sp.set(h,!0),w===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}})};return u(t),a.clear(),by++,function(){s.forEach(function(f){var h=Zl.get(f)-1,g=i.get(f)-1;Zl.set(f,h),i.set(f,g),h||(Sp.has(f)||f.removeAttribute(r),Sp.delete(f)),g||f.removeAttribute(n)}),by--,by||(Zl=new WeakMap,Zl=new WeakMap,Sp=new WeakMap,Cp={})}},zm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Mee(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Nee(r,o,n,"aria-hidden")):function(){return null}},lr=function(){return lr=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},lr.apply(this,arguments)};function t_(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 Mk(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 xd="right-scroll-bar-position",wd="width-before-scroll-bar",Lee="with-scroll-bars-hidden",Fee="--removed-body-scroll-bar-size";function jee(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function zee(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 Ik(e,t){return zee(t||null,function(n){return e.forEach(function(r){return jee(r,n)})})}function Bee(e){return e}function Vee(e,t){t===void 0&&(t=Bee);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 Nk(e){e===void 0&&(e={});var t=Vee(null);return t.options=lr({async:!0,ssr:!1},e),t}var Lk=function(e){var t=e.sideCar,n=t_(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 H.createElement(r,lr({},n))};Lk.isSideCarExport=!0;function Fk(e,t){return e.useMedium(t),Lk}var jk=Nk(),yy=function(){},Bm=H.forwardRef(function(e,t){var n=H.useRef(null),r=H.useState({onScrollCapture:yy,onWheelCapture:yy,onTouchMoveCapture:yy}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,h=e.sideCar,g=e.noIsolation,v=e.inert,b=e.allowPinchZoom,w=e.as,x=w===void 0?"div":w,_=t_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=h,C=Ik([n,t]),E=lr(lr({},_),o);return H.createElement(H.Fragment,null,u&&H.createElement(S,{sideCar:jk,removeScrollBar:c,shards:f,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!b,lockRef:n}),s?H.cloneElement(H.Children.only(a),lr(lr({},E),{ref:C})):H.createElement(x,lr({},E,{className:l,ref:C}),a))});Bm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bm.classNames={fullWidth:wd,zeroRight:xd};var DP,Hee=function(){if(DP)return DP;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wee(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Hee();return t&&e.setAttribute("nonce",t),e}function Uee(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qee(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Gee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Wee())&&(Uee(t,n),qee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yee=function(){var e=Gee();return function(t,n){H.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},n_=function(){var e=Yee(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Kee={left:0,top:0,right:0,gap:0},xy=function(e){return parseInt(e||"",10)||0},Xee=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[xy(n),xy(r),xy(o)]},Qee=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kee;var t=Xee(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])}},Jee=n_(),Zee=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
276
- .`.concat(Lee,` {
277
- overflow: hidden `).concat(r,`;
278
- padding-right: `).concat(a,"px ").concat(r,`;
279
- }
280
- body {
281
- overflow: hidden `).concat(r,`;
282
- overscroll-behavior: contain;
283
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
284
- padding-left: `.concat(o,`px;
285
- padding-top: `).concat(i,`px;
286
- padding-right: `).concat(s,`px;
287
- margin-left:0;
288
- margin-top:0;
289
- margin-right: `).concat(a,"px ").concat(r,`;
290
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
291
- }
292
-
293
- .`).concat(xd,` {
294
- right: `).concat(a,"px ").concat(r,`;
295
- }
296
-
297
- .`).concat(wd,` {
298
- margin-right: `).concat(a,"px ").concat(r,`;
299
- }
300
-
301
- .`).concat(xd," .").concat(xd,` {
302
- right: 0 `).concat(r,`;
303
- }
304
-
305
- .`).concat(wd," .").concat(wd,` {
306
- margin-right: 0 `).concat(r,`;
307
- }
308
-
309
- body {
310
- `).concat(Fee,": ").concat(a,`px;
311
- }
312
- `)},zk=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=H.useMemo(function(){return Qee(o)},[o]);return H.createElement(Jee,{styles:Zee(i,!t,o,n?"":"!important")})},kx=!1;if(typeof window<"u")try{var Ep=Object.defineProperty({},"passive",{get:function(){return kx=!0,!0}});window.addEventListener("test",Ep,Ep),window.removeEventListener("test",Ep,Ep)}catch{kx=!1}var ec=kx?{passive:!1}:!1,ete=function(e){return e.tagName==="TEXTAREA"},Bk=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ete(e)&&n[t]==="visible")},tte=function(e){return Bk(e,"overflowY")},nte=function(e){return Bk(e,"overflowX")},AP=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Vk(e,n);if(r){var o=Hk(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},rte=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ote=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Vk=function(e,t){return e==="v"?tte(t):nte(t)},Hk=function(e,t){return e==="v"?rte(t):ote(t)},ite=function(e,t){return e==="h"&&t==="rtl"?-1:1},ste=function(e,t,n,r,o){var i=ite(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,h=0;do{var g=Hk(e,a),v=g[0],b=g[1],w=g[2],x=b-w-i*v;(v||x)&&Vk(e,a)&&(f+=x,h+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&f===0||!o&&s>f)||!u&&(o&&h===0||!o&&-s>h))&&(c=!0),c},Rp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$P=function(e){return[e.deltaX,e.deltaY]},kP=function(e){return e&&"current"in e?e.current:e},ate=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lte=function(e){return`
313
- .block-interactivity-`.concat(e,` {pointer-events: none;}
314
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
315
- `)},cte=0,tc=[];function ute(e){var t=H.useRef([]),n=H.useRef([0,0]),r=H.useRef(),o=H.useState(cte++)[0],i=H.useState(function(){return n_()})[0],s=H.useRef(e);H.useEffect(function(){s.current=e},[e]),H.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=Mk([e.lockRef.current],(e.shards||[]).map(kP),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=H.useCallback(function(b,w){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=Rp(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-x[0],C="deltaY"in b?b.deltaY:_[1]-x[1],E,P=b.target,A=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in b&&A==="h"&&P.type==="range")return!1;var k=AP(A,P);if(!k)return!0;if(k?E=A:(E=A==="v"?"h":"v",k=AP(A,P)),!k)return!1;if(!r.current&&"changedTouches"in b&&(S||C)&&(r.current=E),!E)return!0;var I=r.current||E;return ste(I,w,b,I==="h"?S:C,!0)},[]),l=H.useCallback(function(b){var w=b;if(!(!tc.length||tc[tc.length-1]!==i)){var x="deltaY"in w?$P(w):Rp(w),_=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&ate(E.delta,x)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(kP).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=H.useCallback(function(b,w,x,_){var S={name:b,delta:w,target:x,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=H.useCallback(function(b){n.current=Rp(b),r.current=void 0},[]),f=H.useCallback(function(b){c(b.type,$P(b),b.target,a(b,e.lockRef.current))},[]),h=H.useCallback(function(b){c(b.type,Rp(b),b.target,a(b,e.lockRef.current))},[]);H.useEffect(function(){return tc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ec),document.addEventListener("touchmove",l,ec),document.addEventListener("touchstart",u,ec),function(){tc=tc.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,ec),document.removeEventListener("touchmove",l,ec),document.removeEventListener("touchstart",u,ec)}},[]);var g=e.removeScrollBar,v=e.inert;return H.createElement(H.Fragment,null,v?H.createElement(i,{styles:lte(o)}):null,g?H.createElement(zk,{gapMode:"margin"}):null)}const dte=Fk(jk,ute);var Wk=H.forwardRef(function(e,t){return H.createElement(Bm,lr({},e,{ref:t,sideCar:dte}))});Wk.classNames=Bm.classNames;const r_=Wk,fte=[" ","Enter","ArrowUp","ArrowDown"],hte=[" ","Enter"],Vm="Select",[Hm,Wm,pte]=um(Vm),[lu,bye]=Zn(Vm,[pte,Ti]),o_=Ti(),[gte,Rl]=lu(Vm),[mte,vte]=lu(Vm),bte=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:h,required:g}=e,v=o_(t),[b,w]=m.useState(null),[x,_]=m.useState(null),[S,C]=m.useState(!1),E=_l(c),[P=!1,A]=wr({prop:r,defaultProp:o,onChange:i}),[k,I]=wr({prop:s,defaultProp:a,onChange:l}),$=m.useRef(null),L=b?!!b.closest("form"):!0,[j,Q]=m.useState(new Set),ee=Array.from(j).map(B=>B.props.value).join(";");return m.createElement(Bf,v,m.createElement(gte,{required:g,scope:t,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Jo(),value:k,onValueChange:I,open:P,onOpenChange:A,dir:E,triggerPointerDownPosRef:$,disabled:h},m.createElement(Hm.Provider,{scope:t},m.createElement(mte,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(B=>{Q(Z=>new Set(Z).add(B))},[]),onNativeOptionRemove:m.useCallback(B=>{Q(Z=>{const G=new Set(Z);return G.delete(B),G})},[])},n)),L?m.createElement(Kk,{key:ee,"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:f,value:k,onChange:B=>I(B.target.value),disabled:h},k===void 0?m.createElement("option",{value:""}):null,Array.from(j)):null))},yte="SelectTrigger",xte=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=o_(n),s=Rl(yte,n),a=s.disabled||r,l=_t(t,s.onTriggerChange),c=Wm(n),[u,f,h]=Xk(v=>{const b=c().filter(_=>!_.disabled),w=b.find(_=>_.value===s.value),x=Qk(b,v,w);x!==void 0&&s.onValueChange(x.value)}),g=()=>{a||(s.onOpenChange(!0),h())};return m.createElement(Vf,he({asChild:!0},i),m.createElement(Qe.button,he({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":Yk(s.value)?"":void 0},o,{ref:l,onClick:Me(o.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Me(o.onPointerDown,v=>{const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(g(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Me(o.onKeyDown,v=>{const b=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(b&&v.key===" ")&&fte.includes(v.key)&&(g(),v.preventDefault())})})))}),wte="SelectValue",_te=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Rl(wte,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=_t(t,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),m.createElement(Qe.span,he({},a,{ref:f,style:{pointerEvents:"none"}}),Yk(l.value)?m.createElement(m.Fragment,null,s):i)}),Ste=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Qe.span,he({"aria-hidden":!0},o,{ref:t}),r||"▼")}),Cte=e=>m.createElement(M1,he({asChild:!0},e)),Jc="SelectContent",Ete=m.forwardRef((e,t)=>{const n=Rl(Jc,e.__scopeSelect),[r,o]=m.useState();if(ur(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Mo.createPortal(m.createElement(Uk,{scope:e.__scopeSelect},m.createElement(Hm.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(Rte,he({},e,{ref:t}))}),Ki=10,[Uk,Ol]=lu(Jc),Rte=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:h,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:w,...x}=e,_=Rl(Jc,n),[S,C]=m.useState(null),[E,P]=m.useState(null),A=_t(t,pe=>C(pe)),[k,I]=m.useState(null),[$,L]=m.useState(null),j=Wm(n),[Q,ee]=m.useState(!1),B=m.useRef(!1);m.useEffect(()=>{if(S)return zm(S)},[S]),Z1();const Z=m.useCallback(pe=>{const[se,...ne]=j().map(Y=>Y.ref.current),[le]=ne.slice(-1),ye=document.activeElement;for(const Y of pe)if(Y===ye||(Y==null||Y.scrollIntoView({block:"nearest"}),Y===se&&E&&(E.scrollTop=0),Y===le&&E&&(E.scrollTop=E.scrollHeight),Y==null||Y.focus(),document.activeElement!==ye))return},[j,E]),G=m.useCallback(()=>Z([k,S]),[Z,k,S]);m.useEffect(()=>{Q&&G()},[Q,G]);const{onOpenChange:q,triggerPointerDownPosRef:K}=_;m.useEffect(()=>{if(S){let pe={x:0,y:0};const se=le=>{var ye,Y,be,_e;pe={x:Math.abs(Math.round(le.pageX)-((ye=(Y=K.current)===null||Y===void 0?void 0:Y.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(le.pageY)-((be=(_e=K.current)===null||_e===void 0?void 0:_e.y)!==null&&be!==void 0?be:0))}},ne=le=>{pe.x<=10&&pe.y<=10?le.preventDefault():S.contains(le.target)||q(!1),document.removeEventListener("pointermove",se),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",ne,{capture:!0})}}},[S,q,K]),m.useEffect(()=>{const pe=()=>q(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[q]);const[T,V]=Xk(pe=>{const se=j().filter(ye=>!ye.disabled),ne=se.find(ye=>ye.ref.current===document.activeElement),le=Qk(se,pe,ne);le&&setTimeout(()=>le.ref.current.focus())}),X=m.useCallback((pe,se,ne)=>{const le=!B.current&&!ne;(_.value!==void 0&&_.value===se||le)&&(I(pe),le&&(B.current=!0))},[_.value]),N=m.useCallback(()=>S==null?void 0:S.focus(),[S]),ie=m.useCallback((pe,se,ne)=>{const le=!B.current&&!ne;(_.value!==void 0&&_.value===se||le)&&L(pe)},[_.value]),fe=r==="popper"?MP:Ote,ue=fe===MP?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:w}:{};return m.createElement(Uk,{scope:n,content:S,viewport:E,onViewportChange:P,itemRefCallback:X,selectedItem:k,onItemLeave:N,itemTextRefCallback:ie,focusSelectedItem:G,selectedItemText:$,position:r,isPositioned:Q,searchRef:T},m.createElement(r_,{as:$k,allowPinchZoom:!0},m.createElement(e_,{asChild:!0,trapped:_.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:Me(o,pe=>{var se;(se=_.trigger)===null||se===void 0||se.focus({preventScroll:!0}),pe.preventDefault()})},m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(fe,he({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:pe=>pe.preventDefault()},x,ue,{onPlaced:()=>ee(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Me(x.onKeyDown,pe=>{const se=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!se&&pe.key.length===1&&V(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let le=j().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const ye=pe.target,Y=le.indexOf(ye);le=le.slice(Y+1)}setTimeout(()=>Z(le)),pe.preventDefault()}})}))))))}),Ote=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Rl(Jc,n),s=Ol(Jc,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=_t(t,A=>u(A)),h=Wm(n),g=m.useRef(!1),v=m.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:x,focusSelectedItem:_}=s,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&b&&w&&x){const A=i.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),$=x.getBoundingClientRect();if(i.dir!=="rtl"){const ye=$.left-k.left,Y=I.left-ye,be=A.left-Y,_e=A.width+be,Pe=Math.max(_e,k.width),Te=window.innerWidth-Ki,Ue=Ax(Y,[Ki,Te-Pe]);a.style.minWidth=_e+"px",a.style.left=Ue+"px"}else{const ye=k.right-$.right,Y=window.innerWidth-I.right-ye,be=window.innerWidth-A.right-Y,_e=A.width+be,Pe=Math.max(_e,k.width),Te=window.innerWidth-Ki,Ue=Ax(Y,[Ki,Te-Pe]);a.style.minWidth=_e+"px",a.style.right=Ue+"px"}const L=h(),j=window.innerHeight-Ki*2,Q=b.scrollHeight,ee=window.getComputedStyle(c),B=parseInt(ee.borderTopWidth,10),Z=parseInt(ee.paddingTop,10),G=parseInt(ee.borderBottomWidth,10),q=parseInt(ee.paddingBottom,10),K=B+Z+Q+q+G,T=Math.min(w.offsetHeight*5,K),V=window.getComputedStyle(b),X=parseInt(V.paddingTop,10),N=parseInt(V.paddingBottom,10),ie=A.top+A.height/2-Ki,fe=j-ie,ue=w.offsetHeight/2,pe=w.offsetTop+ue,se=B+Z+pe,ne=K-se;if(se<=ie){const ye=w===L[L.length-1].ref.current;a.style.bottom="0px";const Y=c.clientHeight-b.offsetTop-b.offsetHeight,be=Math.max(fe,ue+(ye?N:0)+Y+G),_e=se+be;a.style.height=_e+"px"}else{const ye=w===L[0].ref.current;a.style.top="0px";const be=Math.max(ie,B+b.offsetTop+(ye?X:0)+ue)+ne;a.style.height=be+"px",b.scrollTop=se-ie+b.offsetTop}a.style.margin=`${Ki}px 0`,a.style.minHeight=T+"px",a.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[h,i.trigger,i.valueNode,a,c,b,w,x,i.dir,r]);ur(()=>S(),[S]);const[C,E]=m.useState();ur(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const P=m.useCallback(A=>{A&&v.current===!0&&(S(),_==null||_(),v.current=!1)},[S,_]);return m.createElement(Pte,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:P},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C}},m.createElement(Qe.div,he({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),MP=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ki,...i}=e,s=o_(n);return m.createElement(Hf,he({},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)"}}))}),[Pte,i_]=lu(Jc,{}),IP="SelectViewport",Tte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ol(IP,n),i=i_(IP,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(Hm.Slot,{scope:n},m.createElement(Qe.div,he({"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 h=Math.abs(a.current-c.scrollTop);if(h>0){const g=window.innerHeight-Ki*2,v=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),w=Math.max(v,b);if(w<g){const x=w+h,_=Math.min(g,x),S=x-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),Dte="SelectGroup",[Ate,$te]=lu(Dte),kte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Jo();return m.createElement(Ate,{scope:n,id:o},m.createElement(Qe.div,he({role:"group","aria-labelledby":o},r,{ref:t})))}),Mte="SelectLabel",Ite=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=$te(Mte,n);return m.createElement(Qe.div,he({id:o.id},r,{ref:t}))}),Mx="SelectItem",[Nte,qk]=lu(Mx),Lte=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Rl(Mx,n),l=Ol(Mx,n),c=a.value===r,[u,f]=m.useState(i??""),[h,g]=m.useState(!1),v=_t(t,x=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,x,r,o)}),b=Jo(),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(Nte,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:m.useCallback(x=>{f(_=>{var S;return _||((S=x==null?void 0:x.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(Hm.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Qe.div,he({role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:v,onFocus:Me(s.onFocus,()=>g(!0)),onBlur:Me(s.onBlur,()=>g(!1)),onPointerUp:Me(s.onPointerUp,w),onPointerMove:Me(s.onPointerMove,x=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(s.onPointerLeave,x=>{if(x.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Me(s.onKeyDown,x=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&x.key===" "||(hte.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})}))))}),Op="SelectItemText",Fte=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Rl(Op,n),a=Ol(Op,n),l=qk(Op,n),c=vte(Op,n),[u,f]=m.useState(null),h=_t(t,x=>f(x),l.onItemTextChange,x=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,x,l.value,l.disabled)}),g=u==null?void 0:u.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=c;return ur(()=>(b(v),()=>w(v)),[b,w,v]),m.createElement(m.Fragment,null,m.createElement(Qe.span,he({id:l.textId},i,{ref:h})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Mo.createPortal(i.children,s.valueNode):null)}),jte="SelectItemIndicator",zte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qk(jte,n).isSelected?m.createElement(Qe.span,he({"aria-hidden":!0},r,{ref:t})):null}),NP="SelectScrollUpButton",Bte=m.forwardRef((e,t)=>{const n=Ol(NP,e.__scopeSelect),r=i_(NP,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(Gk,he({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),LP="SelectScrollDownButton",Vte=m.forwardRef((e,t)=>{const n=Ol(LP,e.__scopeSelect),r=i_(LP,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(Gk,he({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),Gk=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ol("SelectScrollButton",n),s=m.useRef(null),a=Wm(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,he({"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()})}))}),Hte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Qe.div,he({"aria-hidden":!0},r,{ref:t}))});function Yk(e){return e===""||e===void 0}const Kk=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=_t(t,o),s=jm(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(tk,{asChild:!0},m.createElement("select",he({},r,{ref:i,defaultValue:n})))});Kk.displayName="BubbleSelect";function Xk(e){const t=Ln(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 Qk(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=Wte(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 Wte(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Ute=bte,Jk=xte,qte=_te,Gte=Ste,Yte=Cte,Zk=Ete,Kte=Tte,Xte=kte,eM=Ite,tM=Lte,Qte=Fte,Jte=zte,nM=Bte,rM=Vte,oM=Hte,zs=Ute,dc=Xte,Bs=qte,Qi=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(Jk,{ref:r,className:Ce("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,O.jsx(Gte,{asChild:!0,children:O.jsx(Am,{className:"h-4 w-4 opacity-50"})})]}));Qi.displayName=Jk.displayName;const iM=H.forwardRef(({className:e,...t},n)=>O.jsx(nM,{ref:n,className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(JX,{className:"h-4 w-4"})}));iM.displayName=nM.displayName;const sM=H.forwardRef(({className:e,...t},n)=>O.jsx(rM,{ref:n,className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(Am,{className:"h-4 w-4"})}));sM.displayName=rM.displayName;const Ji=H.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>O.jsx(Yte,{children:O.jsx(au,{children:O.jsxs(Zk,{ref:o,className:Ce("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:[O.jsx(iM,{}),O.jsx(Kte,{className:Ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),O.jsx(sM,{})]})})}));Ji.displayName=Zk.displayName;const Va=H.forwardRef(({className:e,...t},n)=>O.jsx(eM,{ref:n,className:Ce("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Va.displayName=eM.displayName;const Hn=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(tM,{ref:r,className:Ce("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(Jte,{children:O.jsx(Ff,{className:"h-4 w-4"})})}),O.jsx(Qte,{children:t})]}));Hn.displayName=tM.displayName;const Lg=H.forwardRef(({className:e,...t},n)=>O.jsx(oM,{ref:n,className:Ce("-mx-1 my-1 h-px bg-muted",e),...t}));Lg.displayName=oM.displayName;function Zte(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ene(...e){return t=>e.forEach(n=>Zte(n,t))}var Um=H.forwardRef((e,t)=>{const{children:n,...r}=e,o=H.Children.toArray(n),i=o.find(tne);if(i){const s=i.props.children,a=o.map(l=>l===i?H.Children.count(s)>1?H.Children.only(null):H.isValidElement(s)?s.props.children:null:l);return O.jsx(Ix,{...r,ref:t,children:H.isValidElement(s)?H.cloneElement(s,void 0,a):null})}return O.jsx(Ix,{...r,ref:t,children:n})});Um.displayName="Slot";var Ix=H.forwardRef((e,t)=>{const{children:n,...r}=e;if(H.isValidElement(n)){const o=rne(n);return H.cloneElement(n,{...nne(r,n.props),ref:t?ene(t,o):o})}return H.Children.count(n)>1?H.Children.only(null):null});Ix.displayName="SlotClone";var aM=({children:e})=>O.jsx(O.Fragment,{children:e});function tne(e){return H.isValidElement(e)&&e.type===aM}function nne(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 rne(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 FP=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,jP=ug,s_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return jP(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 h=FP(u)||FP(f);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...g}=u;return Object.entries(g).every(v=>{let[b,w]=v;return Array.isArray(w)?w.includes({...i,...a}[b]):{...i,...a}[b]===w})?[...c,f,h]:c},[]);return jP(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Vd=s_("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=H.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Um:"button";return O.jsx(s,{className:Ce(Vd({variant:t,size:n,className:e})),ref:i,...o})});xr.displayName="Button";const one=m.forwardRef((e,t)=>m.createElement(Qe.label,he({},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()}}))),lM=one,ine=s_("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wn=H.forwardRef(({className:e,...t},n)=>O.jsx(lM,{ref:n,className:Ce(ine(),e),...t}));Wn.displayName=lM.displayName;const cM=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(ane);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(Nx,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Nx,he({},r,{ref:t}),n)});cM.displayName="Slot";const Nx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...lne(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Nx.displayName="SlotClone";const sne=({children:e})=>m.createElement(m.Fragment,null,e);function ane(e){return m.isValidElement(e)&&e.type===sne}function lne(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 uM="Popover",[dM,yye]=Zn(uM,[Ti]),a_=Ti(),[cne,cu]=dM(uM),une=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=a_(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,h]=wr({prop:r,defaultProp:o,onChange:i});return m.createElement(Bf,a,m.createElement(cne,{scope:t,contentId:Jo(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(g=>!g),[h]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},dne="PopoverTrigger",fne=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cu(dne,n),i=a_(n),s=_t(t,o.triggerRef),a=m.createElement(Qe.button,he({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":pM(o.open)},r,{ref:s,onClick:Me(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(Vf,he({asChild:!0},i),a)}),fM="PopoverPortal",[hne,pne]=dM(fM,{forceMount:void 0}),gne=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=cu(fM,t);return m.createElement(hne,{scope:t,forceMount:n},m.createElement(er,{present:n||i.open},m.createElement(M1,{asChild:!0,container:o},r)))},Hd="PopoverContent",mne=m.forwardRef((e,t)=>{const n=pne(Hd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=cu(Hd,e.__scopePopover);return m.createElement(er,{present:r||i.open},i.modal?m.createElement(vne,he({},o,{ref:t})):m.createElement(bne,he({},o,{ref:t})))}),vne=m.forwardRef((e,t)=>{const n=cu(Hd,e.__scopePopover),r=m.useRef(null),o=_t(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return zm(s)},[]),m.createElement(r_,{as:cM,allowPinchZoom:!0},m.createElement(hM,he({},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})})))}),bne=m.forwardRef((e,t)=>{const n=cu(Hd,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(hM,he({},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()}}))}),hM=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,h=cu(Hd,n),g=a_(n);return Z1(),m.createElement(e_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1)},m.createElement(Hf,he({"data-state":pM(h.open),role:"dialog",id:h.contentId},g,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 pM(e){return e?"open":"closed"}const yne=une,xne=fne,wne=gne,gM=mne,qm=yne,Gm=xne,Wf=H.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>O.jsx(wne,{children:O.jsx(au,{children:O.jsx(gM,{ref:o,align:t,sideOffset:n,className:Ce("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})})}));Wf.displayName=gM.displayName;function _ne(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 xc=H.forwardRef(({className:e,type:t,...n},r)=>O.jsx("input",{type:t,className:Ce("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}));xc.displayName="Input";function mM({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 O.jsxs("div",{className:"space-y-3",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Wn,{children:"Color Range"}),O.jsx(xr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:O.jsx(R1,{className:"size-3"})})]}),e.map((s,a)=>O.jsxs("div",{className:"flex items-center gap-2 px-2",children:[O.jsx(xc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:Ce(`h-7 ${Kp}`)}),O.jsx("span",{children:"-"}),O.jsx(xc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:Ce(`h-7 ${Kp}`)}),O.jsx(xc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:Ce(`h-7 min-w-14 p-0 ${Kp}`),type:"color",list:"presetColors"}),O.jsxs("datalist",{id:"presetColors",children:[O.jsx("option",{children:Bt.green[600]}),O.jsx("option",{children:Bt.red[500]}),O.jsx("option",{children:Bt.yellow[400]}),O.jsx("option",{children:Bt.orange[500]})]}),O.jsx(xr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:O.jsx($m,{className:"size-3"})})]},a))]})}const Sne=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=wr({prop:n,onChange:o,defaultProp:r});return m.createElement(Qe.button,he({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)})}))}),vM=Sne,Cne=s_("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"}}),l_=H.forwardRef(({className:e,variant:t,size:n,...r},o)=>O.jsx(vM,{ref:o,className:Ce(Cne({variant:t,size:n,className:e})),...r}));l_.displayName=vM.displayName;function Ene(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 Rne(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 One(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 Pne(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 Tne(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 Dne(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 Ane(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 $ne({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=br(I=>{var $;return($=I.card)==null?void 0:$.preferences}),[i,s]=m.useState(Ene(o,e)),[a,l]=m.useState(Dne(o,e)),[c,u]=m.useState(Rne(o,e)),[f,h]=m.useState(One(o,e)),[g,v]=m.useState(Pne(o,e)),[b,w]=m.useState(Tne(o,e).toString()),[x,_]=m.useState(Ane(o,e));m.useState("");const S=br(I=>I.actions.setCardPreferences);function C(){const I=[...new Set(S0.map($=>$.currency))];return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),O.jsxs(zs,{value:c,onValueChange:$=>u($),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Locale"}),S0.map($=>O.jsx(Hn,{value:$.locale,children:$.locale},$.locale))]})})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),O.jsxs(zs,{value:g||"none",onValueChange:$=>v($==="none"?void 0:$),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Currency"}),O.jsx(Hn,{value:"none",children:"None"}),I.map($=>O.jsx(Hn,{value:$,children:$},$))]})})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),O.jsxs(zs,{value:b,onValueChange:$=>w($),children:[O.jsx(Qi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:["0","1","2","3","4"].map($=>O.jsx(Hn,{value:$,children:$},$))})]}),!g&&O.jsx(l_,{onPressedChange:$=>_($),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:O.jsx(rQ,{className:"size-3"})})]})})}function E(){return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),O.jsxs(zs,{defaultValue:"en-US",value:c,onValueChange:I=>u(I),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:Az.map(I=>O.jsxs(dc,{children:[O.jsx(Va,{children:I.label}),I.locales.map($=>O.jsx(Hn,{value:$.code,children:$.name},$.code))]},I.label))})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Format"}),O.jsxs(zs,{defaultValue:"short-date-time",value:f,onValueChange:I=>{console.log("format",I),h(I)},children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{className:"",id:"type",children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Option"}),O.jsx(Hn,{value:"full-date-time",children:"Full Date-Time"}),O.jsx(Hn,{value:"short-date-time",children:"Short Date-Time"}),O.jsx(Hn,{value:"hours-date-time",children:"24-Hour Date-Time"}),O.jsx(Hn,{value:"short-date",children:"Short Date"}),O.jsx(Hn,{value:"long-date",children:"Long Date"})]})})]})]})})}function P(){S({...o,columnSettings:[]})}function A(){var I;S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter($=>$.columnIdx!==e))||[]]})}function k(){var I,$,L;if(i==="date"){const j=_ne(c,f),Q={columnIdx:e,type:i,options:j};S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(ee=>ee.columnIdx!==e))||[],Q]})}else if(i==="number"){let j;g?j={locale:c,currency:g,options:{style:"currency",currency:g,minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0}:j={locale:c,currency:void 0,options:{style:x?"percent":"decimal",minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0};const Q={columnIdx:e,type:i,options:j};S({...o,columnSettings:[...(($=o==null?void 0:o.columnSettings)==null?void 0:$.filter(ee=>ee.columnIdx!==e))||[],Q]})}else S({...o,columnSettings:[...((L=o==null?void 0:o.columnSettings)==null?void 0:L.filter(j=>j.columnIdx!==e))||[]]})}return O.jsxs(qm,{onOpenChange:I=>r(I),children:[O.jsx(Gm,{asChild:!0,children:O.jsx(O1,{className:"size-3.5 cursor-pointer text-muted"})}),O.jsx(Wf,{align:"center",className:"max-w-70",children:O.jsxs("div",{className:"grid gap-4",children:[O.jsxs("div",{className:"space-y-2",children:[O.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),O.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),O.jsxs("div",{className:"grid gap-2",children:[O.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[O.jsx(Wn,{htmlFor:"scale",children:"Type"}),O.jsxs(zs,{value:i||"none",onValueChange:I=>s(I),children:[O.jsx(Qi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{id:"type",children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Option"}),O.jsx(Hn,{value:"number",children:"Number"}),O.jsx(Hn,{value:"date",children:"Date"}),O.jsx(Hn,{value:"none",children:"None"})]})})]})]}),i==="number"&&C(),i==="date"&&E(),i==="number"&&O.jsxs(O.Fragment,{children:[O.jsx(Lg,{}),O.jsx(mM,{colorRanges:a,setColorRanges:l})]}),O.jsx(Lg,{}),O.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[O.jsx(xr,{onClick:P,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),O.jsx(xr,{onClick:A,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),O.jsx(xr,{onClick:k,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function kne(e){const t=new Date(e);return!isNaN(t.getTime())}function bM({data:e,card:t}){var C,E,P,A;const[n,r]=m.useState([]),{keys:o}=ar(e),i=ke(k=>k.filteringCards),s=ke(k=>k.themeStyle),a=ke(k=>k.isVisualEditing),l=i==null?void 0:i.find(k=>k.id===t.id),c=(C=t==null?void 0:t.preferences)==null?void 0:C.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:f,removeFilterValue:h,removeFilteringCard:g}=co(),v=t==null?void 0:t.preferences;function b(k,I){if((I==null?void 0:I.type)==="date"&&kne(k)){const{locale:$,options:L}=I.options,j=new Date(k);return new Date(j.getTime()).toLocaleDateString($,L)}if((I==null?void 0:I.type)==="number"){const{locale:$,currency:L,options:j}=I.options;return L?new Intl.NumberFormat($,{style:"currency",currency:L,...j}).format(k):new Intl.NumberFormat($,j).format(k)}return k}const w=o.map((k,I)=>({accessorKey:k,header:({column:$})=>{const L=$.getIsSorted();return O.jsxs("div",{className:"flex items-center justify-between gap-2",children:[O.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>$.toggleSorting($.getIsSorted()==="asc"),children:[k,L==="asc"?O.jsx(C1,{className:"ml-2 h-5 w-5"}):L==="desc"?O.jsx(S1,{className:"ml-2 h-5 w-5"}):null]}),a&&O.jsx($ne,{columnName:$.id,columnIndex:I})]})},cell:({cell:$})=>{var B,Z;const L=$.getValue(),j=(B=v==null?void 0:v.columnSettings)==null?void 0:B.find(G=>G.columnIdx===I),Q=b(L,j),ee=ak(L,(Z=j==null?void 0:j.options)==null?void 0:Z.colorRanges);return O.jsx("div",{className:"px-2 py-1",style:{backgroundColor:ee},children:Q})}})),x=Dk({data:e,columns:w,getCoreRowModel:Ok(),getPaginationRowModel:Tk(),onSortingChange:r,getSortedRowModel:Pk(),manualPagination:!0,state:{sorting:n}}),_=x.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const k=t.id;h(k),g(t)}return}if(c){const{dimensionKeys:k}=ar(e),I=c.map($=>{const L=k==null?void 0:k[$.columnIndex],j=_.map(ee=>ee.getValue(L));return{filterId:t.id+"-"+L,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:L,expression:$.expression,valueType:Td(j[0]===void 0?"":j[0]),operation:"in",values:j}});u(I),f(t)}},[f,u,t,e,l,c,h,g,_]);function S(k){k.toggleSelected()}return O.jsxs(q1,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius,borderTopLeftRadius:(P=s==null?void 0:s.chart)==null?void 0:P.options.borderRadius},onMouseDown:k=>k.stopPropagation(),children:[O.jsx(G1,{children:x.getHeaderGroups().map(k=>O.jsx(yd,{children:k.headers.map((I,$)=>{var L,j,Q,ee,B,Z,G;return O.jsx(K1,{style:{backgroundColor:(Q=(j=(L=s==null?void 0:s.chart)==null?void 0:L.dataset)==null?void 0:j.backgroundColor)==null?void 0:Q[0],color:Bc((Z=(B=(ee=s==null?void 0:s.chart)==null?void 0:ee.dataset)==null?void 0:B.backgroundColor)==null?void 0:Z[0])},className:Ce("sticky -top-[1px] z-50 h-9 bg-muted-foreground px-2 text-background",{"border-x":$>0&&$<k.headers.length-1,"border-l":$===1&&k.headers.length==2},(G=s==null?void 0:s.table)==null?void 0:G.tableHeaderColor),children:I.isPlaceholder?null:Dx(I.column.columnDef.header,I.getContext())},I.id)})},k.id))}),O.jsx(Y1,{children:(A=x.getRowModel().rows)!=null&&A.length?x.getRowModel().rows.map((k,I)=>O.jsx(yd,{onClick:()=>S(k),className:Ce("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":k.getIsSelected()&&"selected",children:k.getVisibleCells().map(($,L)=>{var j;return O.jsx(Ig,{onClick:Q=>{var B;const ee=((B=window==null?void 0:window.getSelection())==null?void 0:B.toString())||"";(ee==null?void 0:ee.length)>0&&Q.stopPropagation()},className:Ce("p-0",{"border-x":L>0&&L<w.length-1||L===1&&w.length==2,"border-l":L==0,"border-r":L===w.length-1,"border-b":I===((j=x.getRowModel().rows)==null?void 0:j.length)-1}),children:Dx($.column.columnDef.cell,$.getContext())},$.id)})},k.id)):O.jsx(yd,{children:O.jsx(Ig,{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:yM,setPrototypeOf:zP,isFrozen:Mne,getPrototypeOf:Ine,getOwnPropertyDescriptor:Nne}=Object;let{freeze:_r,seal:ko,create:xM}=Object,{apply:Lx,construct:Fx}=typeof Reflect<"u"&&Reflect;_r||(_r=function(t){return t});ko||(ko=function(t){return t});Lx||(Lx=function(t,n,r){return t.apply(n,r)});Fx||(Fx=function(t,n){return new t(...n)});const Pp=fo(Array.prototype.forEach),BP=fo(Array.prototype.pop),Hu=fo(Array.prototype.push),sg=fo(String.prototype.toLowerCase),wy=fo(String.prototype.toString),VP=fo(String.prototype.match),Wu=fo(String.prototype.replace),Lne=fo(String.prototype.indexOf),Fne=fo(String.prototype.trim),Uo=fo(Object.prototype.hasOwnProperty),gr=fo(RegExp.prototype.test),Uu=jne(TypeError);function fo(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 Lx(e,t,r)}}function jne(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fx(e,n)}}function Tt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sg;zP&&zP(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(Mne(t)||(t[r]=i),o=i)}e[o]=!0}return e}function zne(e){for(let t=0;t<e.length;t++)Uo(e,t)||(e[t]=null);return e}function za(e){const t=xM(null);for(const[n,r]of yM(e))Uo(e,n)&&(Array.isArray(r)?t[n]=zne(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=za(r):t[n]=r);return t}function qu(e,t){for(;e!==null;){const r=Nne(e,t);if(r){if(r.get)return fo(r.get);if(typeof r.value=="function")return fo(r.value)}e=Ine(e)}function n(){return null}return n}const HP=_r(["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"]),_y=_r(["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"]),Sy=_r(["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"]),Bne=_r(["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"]),Cy=_r(["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"]),Vne=_r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),WP=_r(["#text"]),UP=_r(["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"]),Ey=_r(["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"]),qP=_r(["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"]),Tp=_r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Hne=ko(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Wne=ko(/<%[\w\W]*|[\w\W]*%>/gm),Une=ko(/\${[\w\W]*}/gm),qne=ko(/^data-[\-\w.\u00B7-\uFFFF]/),Gne=ko(/^aria-[\-\w]+$/),wM=ko(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yne=ko(/^(?:\w+script|data):/i),Kne=ko(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_M=ko(/^html$/i),Xne=ko(/^[a-z][.\w]*(-[.\w]+)+$/i);var GP=Object.freeze({__proto__:null,MUSTACHE_EXPR:Hne,ERB_EXPR:Wne,TMPLIT_EXPR:Une,DATA_ATTR:qne,ARIA_ATTR:Gne,IS_ALLOWED_URI:wM,IS_SCRIPT_OR_DATA:Yne,ATTR_WHITESPACE:Kne,DOCTYPE_NAME:_M,CUSTOM_ELEMENT:Xne});const Gu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qne=function(){return typeof window>"u"?null:window},Jne=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 SM(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qne();const t=Ae=>SM(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==Gu.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:h,trustedTypes:g}=e,v=l.prototype,b=qu(v,"cloneNode"),w=qu(v,"remove"),x=qu(v,"nextSibling"),_=qu(v,"childNodes"),S=qu(v,"parentNode");if(typeof s=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let C,E="";const{implementation:P,createNodeIterator:A,createDocumentFragment:k,getElementsByTagName:I}=n,{importNode:$}=r;let L={};t.isSupported=typeof yM=="function"&&typeof S=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:j,ERB_EXPR:Q,TMPLIT_EXPR:ee,DATA_ATTR:B,ARIA_ATTR:Z,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:K}=GP;let{IS_ALLOWED_URI:T}=GP,V=null;const X=Tt({},[...HP,..._y,...Sy,...Cy,...WP]);let N=null;const ie=Tt({},[...UP,...Ey,...qP,...Tp]);let fe=Object.seal(xM(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}})),ue=null,pe=null,se=!0,ne=!0,le=!1,ye=!0,Y=!1,be=!0,_e=!1,Pe=!1,Te=!1,Ue=!1,Be=!1,Ie=!1,Ke=!0,lt=!1;const It="user-content-";let At=!0,Ht=!1,de={},Ee=null;const Le=Tt({},["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=Tt({},["audio","video","img","source","image","track"]);let Wt=null;const Zt=Tt({},["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=Tt({},[Kt,vn,ln],wy);let ht=null;const $t=["application/xhtml+xml","text/html"],Xt="text/html";let bt=null,Rn=null;const Lo=n.createElement("form"),ms=function(U){return U instanceof RegExp||U instanceof Function},Fo=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Rn&&Rn===U)){if((!U||typeof U!="object")&&(U={}),U=za(U),ht=$t.indexOf(U.PARSER_MEDIA_TYPE)===-1?Xt:U.PARSER_MEDIA_TYPE,bt=ht==="application/xhtml+xml"?wy:sg,V=Uo(U,"ALLOWED_TAGS")?Tt({},U.ALLOWED_TAGS,bt):X,N=Uo(U,"ALLOWED_ATTR")?Tt({},U.ALLOWED_ATTR,bt):ie,xn=Uo(U,"ALLOWED_NAMESPACES")?Tt({},U.ALLOWED_NAMESPACES,wy):nt,Wt=Uo(U,"ADD_URI_SAFE_ATTR")?Tt(za(Zt),U.ADD_URI_SAFE_ATTR,bt):Zt,Ge=Uo(U,"ADD_DATA_URI_TAGS")?Tt(za(Ze),U.ADD_DATA_URI_TAGS,bt):Ze,Ee=Uo(U,"FORBID_CONTENTS")?Tt({},U.FORBID_CONTENTS,bt):Le,ue=Uo(U,"FORBID_TAGS")?Tt({},U.FORBID_TAGS,bt):{},pe=Uo(U,"FORBID_ATTR")?Tt({},U.FORBID_ATTR,bt):{},de=Uo(U,"USE_PROFILES")?U.USE_PROFILES:!1,se=U.ALLOW_ARIA_ATTR!==!1,ne=U.ALLOW_DATA_ATTR!==!1,le=U.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=U.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=U.SAFE_FOR_TEMPLATES||!1,be=U.SAFE_FOR_XML!==!1,_e=U.WHOLE_DOCUMENT||!1,Ue=U.RETURN_DOM||!1,Be=U.RETURN_DOM_FRAGMENT||!1,Ie=U.RETURN_TRUSTED_TYPE||!1,Te=U.FORCE_BODY||!1,Ke=U.SANITIZE_DOM!==!1,lt=U.SANITIZE_NAMED_PROPS||!1,At=U.KEEP_CONTENT!==!1,Ht=U.IN_PLACE||!1,T=U.ALLOWED_URI_REGEXP||wM,Lt=U.NAMESPACE||ln,fe=U.CUSTOM_ELEMENT_HANDLING||{},U.CUSTOM_ELEMENT_HANDLING&&ms(U.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(fe.tagNameCheck=U.CUSTOM_ELEMENT_HANDLING.tagNameCheck),U.CUSTOM_ELEMENT_HANDLING&&ms(U.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(fe.attributeNameCheck=U.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),U.CUSTOM_ELEMENT_HANDLING&&typeof U.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=U.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(ne=!1),Be&&(Ue=!0),de&&(V=Tt({},WP),N=[],de.html===!0&&(Tt(V,HP),Tt(N,UP)),de.svg===!0&&(Tt(V,_y),Tt(N,Ey),Tt(N,Tp)),de.svgFilters===!0&&(Tt(V,Sy),Tt(N,Ey),Tt(N,Tp)),de.mathMl===!0&&(Tt(V,Cy),Tt(N,qP),Tt(N,Tp))),U.ADD_TAGS&&(V===X&&(V=za(V)),Tt(V,U.ADD_TAGS,bt)),U.ADD_ATTR&&(N===ie&&(N=za(N)),Tt(N,U.ADD_ATTR,bt)),U.ADD_URI_SAFE_ATTR&&Tt(Wt,U.ADD_URI_SAFE_ATTR,bt),U.FORBID_CONTENTS&&(Ee===Le&&(Ee=za(Ee)),Tt(Ee,U.FORBID_CONTENTS,bt)),At&&(V["#text"]=!0),_e&&Tt(V,["html","head","body"]),V.table&&(Tt(V,["tbody"]),delete ue.tbody),U.TRUSTED_TYPES_POLICY){if(typeof U.TRUSTED_TYPES_POLICY.createHTML!="function")throw Uu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof U.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Uu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=U.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Jne(g,o)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));_r&&_r(U),Rn=U}},Ai=Tt({},["mi","mo","mn","ms","mtext"]),ni=Tt({},["foreignobject","annotation-xml"]),$i=Tt({},["title","style","font","a","script"]),vs=Tt({},[..._y,...Sy,...Bne]),ri=Tt({},[...Cy,...Vne]),ki=function(U){let me=S(U);(!me||!me.tagName)&&(me={namespaceURI:Lt,tagName:"template"});const $e=sg(U.tagName),st=sg(me.tagName);return xn[U.namespaceURI]?U.namespaceURI===vn?me.namespaceURI===ln?$e==="svg":me.namespaceURI===Kt?$e==="svg"&&(st==="annotation-xml"||Ai[st]):!!vs[$e]:U.namespaceURI===Kt?me.namespaceURI===ln?$e==="math":me.namespaceURI===vn?$e==="math"&&ni[st]:!!ri[$e]:U.namespaceURI===ln?me.namespaceURI===vn&&!ni[st]||me.namespaceURI===Kt&&!Ai[st]?!1:!ri[$e]&&($i[$e]||!vs[$e]):!!(ht==="application/xhtml+xml"&&xn[U.namespaceURI]):!1},jn=function(U){Hu(t.removed,{element:U});try{S(U).removeChild(U)}catch{w(U)}},oi=function(U,me){try{Hu(t.removed,{attribute:me.getAttributeNode(U),from:me})}catch{Hu(t.removed,{attribute:null,from:me})}if(me.removeAttribute(U),U==="is"&&!N[U])if(Ue||Be)try{jn(me)}catch{}else try{me.setAttribute(U,"")}catch{}},bs=function(U){let me=null,$e=null;if(Te)U="<remove></remove>"+U;else{const ft=VP(U,/^[\r\n\t ]+/);$e=ft&&ft[0]}ht==="application/xhtml+xml"&&Lt===ln&&(U='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+U+"</body></html>");const st=C?C.createHTML(U):U;if(Lt===ln)try{me=new h().parseFromString(st,ht)}catch{}if(!me||!me.documentElement){me=P.createDocument(Lt,"template",null);try{me.documentElement.innerHTML=tn?E:st}catch{}}const bn=me.body||me.documentElement;return U&&$e&&bn.insertBefore(n.createTextNode($e),bn.childNodes[0]||null),Lt===ln?I.call(me,_e?"html":"body")[0]:_e?me.documentElement:bn},ys=function(U){return A.call(U.ownerDocument||U,U,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},D=function(U){return U instanceof f&&(typeof U.nodeName!="string"||typeof U.textContent!="string"||typeof U.removeChild!="function"||!(U.attributes instanceof u)||typeof U.removeAttribute!="function"||typeof U.setAttribute!="function"||typeof U.namespaceURI!="string"||typeof U.insertBefore!="function"||typeof U.hasChildNodes!="function")},te=function(U){return typeof a=="function"&&U instanceof a},ce=function(U,me,$e){L[U]&&Pp(L[U],st=>{st.call(t,me,$e,Rn)})},Oe=function(U){let me=null;if(ce("beforeSanitizeElements",U,null),D(U))return jn(U),!0;const $e=bt(U.nodeName);if(ce("uponSanitizeElement",U,{tagName:$e,allowedTags:V}),U.hasChildNodes()&&!te(U.firstElementChild)&&gr(/<[/\w]/g,U.innerHTML)&&gr(/<[/\w]/g,U.textContent)||U.nodeType===Gu.progressingInstruction||be&&U.nodeType===Gu.comment&&gr(/<[/\w]/g,U.data))return jn(U),!0;if(!V[$e]||ue[$e]){if(!ue[$e]&&qe($e)&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,$e)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck($e)))return!1;if(At&&!Ee[$e]){const st=S(U)||U.parentNode,bn=_(U)||U.childNodes;if(bn&&st){const ft=bn.length;for(let tr=ft-1;tr>=0;--tr){const go=b(bn[tr],!0);go.__removalCount=(U.__removalCount||0)+1,st.insertBefore(go,x(U))}}}return jn(U),!0}return U instanceof l&&!ki(U)||($e==="noscript"||$e==="noembed"||$e==="noframes")&&gr(/<\/no(script|embed|frames)/i,U.innerHTML)?(jn(U),!0):(Y&&U.nodeType===Gu.text&&(me=U.textContent,Pp([j,Q,ee],st=>{me=Wu(me,st," ")}),U.textContent!==me&&(Hu(t.removed,{element:U.cloneNode()}),U.textContent=me)),ce("afterSanitizeElements",U,null),!1)},He=function(U,me,$e){if(Ke&&(me==="id"||me==="name")&&($e in n||$e in Lo))return!1;if(!(ne&&!pe[me]&&gr(B,me))){if(!(se&&gr(Z,me))){if(!N[me]||pe[me]){if(!(qe(U)&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,U)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(U))&&(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,$e)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck($e))))return!1}else if(!Wt[me]){if(!gr(T,Wu($e,q,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&U!=="script"&&Lne($e,"data:")===0&&Ge[U])){if(!(le&&!gr(G,Wu($e,q,"")))){if($e)return!1}}}}}}return!0},qe=function(U){return U!=="annotation-xml"&&VP(U,K)},ze=function(U){ce("beforeSanitizeAttributes",U,null);const{attributes:me}=U;if(!me)return;const $e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:N};let st=me.length;for(;st--;){const bn=me[st],{name:ft,namespaceURI:tr,value:go}=bn,ya=bt(ft);let zn=ft==="value"?go:Fne(go);if($e.attrName=ya,$e.attrValue=zn,$e.keepAttr=!0,$e.forceKeepAttr=void 0,ce("uponSanitizeAttribute",U,$e),zn=$e.attrValue,be&&gr(/((--!?|])>)|<\/(style|title)/i,zn)){oi(ft,U);continue}if($e.forceKeepAttr||(oi(ft,U),!$e.keepAttr))continue;if(!ye&&gr(/\/>/i,zn)){oi(ft,U);continue}Y&&Pp([j,Q,ee],pu=>{zn=Wu(zn,pu," ")});const hu=bt(U.nodeName);if(He(hu,ya,zn)){if(lt&&(ya==="id"||ya==="name")&&(oi(ft,U),zn=It+zn),C&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!tr)switch(g.getAttributeType(hu,ya)){case"TrustedHTML":{zn=C.createHTML(zn);break}case"TrustedScriptURL":{zn=C.createScriptURL(zn);break}}try{tr?U.setAttributeNS(tr,ft,zn):U.setAttribute(ft,zn),D(U)?jn(U):BP(t.removed)}catch{}}}ce("afterSanitizeAttributes",U,null)},Fe=function Ae(U){let me=null;const $e=ys(U);for(ce("beforeSanitizeShadowDOM",U,null);me=$e.nextNode();)ce("uponSanitizeShadowNode",me,null),!Oe(me)&&(me.content instanceof i&&Ae(me.content),ze(me));ce("afterSanitizeShadowDOM",U,null)};return t.sanitize=function(Ae){let U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,$e=null,st=null,bn=null;if(tn=!Ae,tn&&(Ae="<!-->"),typeof Ae!="string"&&!te(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw Uu("dirty is not a string, aborting")}else throw Uu("toString is not a function");if(!t.isSupported)return Ae;if(Pe||Fo(U),t.removed=[],typeof Ae=="string"&&(Ht=!1),Ht){if(Ae.nodeName){const go=bt(Ae.nodeName);if(!V[go]||ue[go])throw Uu("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof a)me=bs("<!---->"),$e=me.ownerDocument.importNode(Ae,!0),$e.nodeType===Gu.element&&$e.nodeName==="BODY"||$e.nodeName==="HTML"?me=$e:me.appendChild($e);else{if(!Ue&&!Y&&!_e&&Ae.indexOf("<")===-1)return C&&Ie?C.createHTML(Ae):Ae;if(me=bs(Ae),!me)return Ue?null:Ie?E:""}me&&Te&&jn(me.firstChild);const ft=ys(Ht?Ae:me);for(;st=ft.nextNode();)Oe(st)||(st.content instanceof i&&Fe(st.content),ze(st));if(Ht)return Ae;if(Ue){if(Be)for(bn=k.call(me.ownerDocument);me.firstChild;)bn.appendChild(me.firstChild);else bn=me;return(N.shadowroot||N.shadowrootmode)&&(bn=$.call(r,bn,!0)),bn}let tr=_e?me.outerHTML:me.innerHTML;return _e&&V["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&gr(_M,me.ownerDocument.doctype.name)&&(tr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
316
- `+tr),Y&&Pp([j,Q,ee],go=>{tr=Wu(tr,go," ")}),C&&Ie?C.createHTML(tr):tr},t.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fo(Ae),Pe=!0},t.clearConfig=function(){Rn=null,Pe=!1},t.isValidAttribute=function(Ae,U,me){Rn||Fo({});const $e=bt(Ae),st=bt(U);return He($e,st,me)},t.addHook=function(Ae,U){typeof U=="function"&&(L[Ae]=L[Ae]||[],Hu(L[Ae],U))},t.removeHook=function(Ae){if(L[Ae])return BP(L[Ae])},t.removeHooks=function(Ae){L[Ae]&&(L[Ae]=[])},t.removeAllHooks=function(){L={}},t}var YP=SM();function CM({card:e,isLoading:t}){var f,h;const n=(e==null?void 0:e.data)||[],{keys:r}=ar(n),o=ke(g=>g.selectedSheetId),i=ke(g=>g.isVisualEditing),s=(h=(f=e==null?void 0:e.preferences)==null?void 0:f.textVisualOptions)==null?void 0:h.isDynamicText,{setCardDescription:a}=co(),{setCard:l}=Dm();function c(){var w;if(t)return O.jsx(am,{className:"h-7 animate-pulse bg-muted"});const g=(w=n==null?void 0:n[0])==null?void 0:w[r[0]],v=YP.sanitize(g),b=O.jsx("div",{dangerouslySetInnerHTML:{__html:v}});return O.jsx("div",{className:"hover:cursor-text",onMouseDown:x=>x.stopPropagation(),children:b})}function u(){return O.jsx("div",{onMouseDown:g=>g.stopPropagation(),children:O.jsx(is,{type:"textarea",className:"w-full",text:(e==null?void 0:e.description)||"Double click to add description",onSave:g=>{i===!1&&a(o,e.id,g),i===!0&&l({...e,description:g})},children:O.jsx("div",{dangerouslySetInnerHTML:{__html:YP.sanitize((e==null?void 0:e.description)||"")}})})})}return O.jsxs("div",{className:"break-words p-6",children:[!s&&u(),s===!0&&c()]})}function Zne({frame:e,footer:t,className:n,...r}){var B,Z,G,q;const{customCards:o}=ma(),i=m.useRef(null),s=ke(K=>K.themeStyle),a=ke(K=>K.selectedSheetId),l=ke(K=>K.selectedFrameId),c=ke(K=>K.isDashboardEditing);ke(K=>K.filterValues);const{updateFrame:u}=co(),f=e.cards.find(K=>K.id===e.activeCardId);RZ(e,i);const{isError:h,isLoading:g,isFetching:v,cfg:b,visualKey:w,handleDatapointClick:x}=B1(f),{setCardTitle:_,setCardDescription:S,setSelectedFrameId:C}=co(),{setSelectedConnectionId:E,setSelectedDatabaseName:P,setSelectedSchemaName:A,setSelectedTableName:k}=Dm();function I(K){K.stopPropagation(),C(e.id),f!=null&&f.connectionId&&E(f==null?void 0:f.connectionId),f!=null&&f.lastSelectedDatabase&&P(f==null?void 0:f.lastSelectedDatabase),f!=null&&f.lastSelectedSchema&&A(f==null?void 0:f.lastSelectedSchema),f!=null&&f.lastSelectedTable&&k(f==null?void 0:f.lastSelectedTable)}function $(){if(o&&o.length>0){const K=o.find(T=>T.cardId===f.id);if(K&&K.replaceDefault){const T=K.content;if(T)return O.jsx(T,{card:f})}}return f.type==="kpi"?O.jsx(lk,{isLoading:g||v,card:f}):f.type==="text"?O.jsx(CM,{isLoading:g||v,card:f}):ee}function L(){if(h)return O.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(f.type==="table"&&f.data&&f.data.length>0)return O.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:O.jsx(bM,{card:f,data:f.data})});if(o&&o.length>0){const K=o.find(T=>T.cardId===f.id);if(K&&K.content){const T=K.content;return O.jsx(T,{card:f})}}if(b)return O.jsx(_1,{cfg:b,onDatapointClick:x},w)}function j(){if(o&&o.length>0){const K=o.find(T=>T.cardId===f.id);if(K&&K.footer){const T=K.footer;if(T)return O.jsx(T,{card:f})}}return t||null}if(!f.id)return null;function Q(){var K,T;return O.jsx(kw,{value:e.activeCardId,className:"flex justify-end",onValueChange:V=>{const X={...e,activeCardId:V};u(a,X)},children:O.jsx(dm,{style:{borderRadius:(T=(K=s==null?void 0:s.chart)==null?void 0:K.options)==null?void 0:T.borderRadius},className:"flex-end",children:e.cards.map(V=>{var X,N;return O.jsx(fm,{style:{borderRadius:(N=(X=s==null?void 0:s.chart)==null?void 0:X.options)==null?void 0:N.borderRadius},value:V.id,children:V.tabTitle||V.title},V.id)})})})}const ee=O.jsxs(O.Fragment,{children:[O.jsx(lm,{className:"pb-4",children:O.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[O.jsxs("div",{children:[O.jsxs("div",{role:"carc-title-container",className:"flex items-center gap-2",children:[O.jsx(is,{text:f.title,onSave:K=>_(a,f.id,K),children:O.jsx(Af,{className:Ce("text-base",{}),children:f.title})}),(c||f.info)&&O.jsx(FZ,{card:f}),f.refreshInterval&&O.jsxs(ik,{children:[O.jsx(sk,{className:"pr-1",children:O.jsx("div",{className:Ce("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":g||v})})}),O.jsx(F1,{side:"right",align:"center",children:O.jsx("p",{className:"text-xs",children:`Realtime (${f==null?void 0:f.refreshInterval})`})})]})]}),O.jsx("div",{role:"card-description-container",children:O.jsx(is,{text:(f==null?void 0:f.description)||"",onSave:K=>S(a,f.id,K),children:O.jsxs(Ow,{className:Ce("",{}),children:[" ",f.description]})})})]}),e.cards.length>1&&Q()]})}),O.jsx(cm,{className:"relative flex grow flex-col",children:L()}),O.jsx(Pw,{children:j()})]});return O.jsxs(Rw,{tabIndex:-1,ref:i,role:"card-frame",onClick:I,style:{borderRadius:(Z=(B=s==null?void 0:s.chart)==null?void 0:B.options)==null?void 0:Z.borderRadius,fontFamily:(q=(G=s==null?void 0:s.chart)==null?void 0:G.font)==null?void 0:q.family},className:Ce("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":l===e.id&&c,"animate-pulse":g},s==null?void 0:s.dashboardCard,n,"semaphor-card-frame"),...r,children:[O.jsx(lQ,{frame:e}),$()]})}const c_=H.forwardRef(({className:e,...t},n)=>O.jsx("textarea",{className:Ce("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}));c_.displayName="Textarea";const jx="horizontal",ere=["horizontal","vertical"],EM=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=jx,...o}=e,i=RM(r)?r:jx,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(Qe.div,he({"data-orientation":i},a,o,{ref:t}))});EM.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!RM(r)?new Error(tre(o,n)):null}};function tre(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
317
- - horizontal
318
- - vertical
319
-
320
- Defaulting to \`${jx}\`.`}function RM(e){return ere.includes(e)}const OM=EM,Ym=H.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>O.jsx(OM,{ref:o,decorative:n,orientation:t,className:Ce("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Ym.displayName=OM.displayName;const PM="Radio",[nre,TM]=Zn(PM),[rre,ore]=nre(PM),ire=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),h=_t(t,b=>f(b)),g=m.useRef(!1),v=u?!!u.closest("form"):!0;return m.createElement(rre,{scope:n,checked:o,disabled:s},m.createElement(Qe.button,he({type:"button",role:"radio","aria-checked":o,"data-state":DM(o),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:h,onClick:Me(e.onClick,b=>{o||l==null||l(),v&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})})),v&&m.createElement(lre,{control:u,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),sre="RadioIndicator",are=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=ore(sre,n);return m.createElement(er,{present:r||i.checked},m.createElement(Qe.span,he({"data-state":DM(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),lre=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=jm(n),a=Im(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",he({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 DM(e){return e?"checked":"unchecked"}const cre=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],AM="RadioGroup",[ure,xye]=Zn(AM,[ou,TM]),$M=ou(),kM=TM(),[dre,fre]=ure(AM),hre=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,...h}=e,g=$M(n),v=_l(c),[b,w]=wr({prop:i,defaultProp:o,onChange:f});return m.createElement(dre,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:w},m.createElement(Dw,he({asChild:!0},g,{orientation:l,dir:v,loop:u}),m.createElement(Qe.div,he({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},h,{ref:t}))))}),pre="RadioGroupItem",gre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=fre(pre,n),s=i.disabled||r,a=$M(n),l=kM(n),c=m.useRef(null),u=_t(t,c),f=i.value===o.value,h=m.useRef(!1);return m.useEffect(()=>{const g=b=>{cre.includes(b.key)&&(h.current=!0)},v=()=>h.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",v)}},[]),m.createElement(Aw,he({asChild:!0},a,{focusable:!s,active:f}),m.createElement(ire,he({disabled:s,required:i.required,checked:f},l,o,{name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Me(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:Me(o.onFocus,()=>{var g;h.current&&((g=c.current)===null||g===void 0||g.click())})})))}),mre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=kM(n);return m.createElement(are,he({},o,r,{ref:t}))}),MM=hre,IM=gre,vre=mre,u_=H.forwardRef(({className:e,...t},n)=>O.jsx(MM,{className:Ce("grid gap-2",e),...t,ref:n}));u_.displayName=MM.displayName;const Fg=H.forwardRef(({className:e,...t},n)=>O.jsx(IM,{ref:n,className:Ce("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:O.jsx(vre,{className:"flex items-center justify-center",children:O.jsx(L$,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Fg.displayName=IM.displayName;function bre({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),{updateFilter:i}=co();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 O.jsxs(qm,{open:r,onOpenChange:o,children:[O.jsx(Gm,{children:O.jsx(O1,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),O.jsxs(Wf,{onDoubleClick:c=>c.stopPropagation(),className:"m-2 w-full min-w-[350px] space-y-4",children:[O.jsxs("div",{className:"space-y-2",children:[O.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),O.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),O.jsx(Ym,{}),O.jsxs("div",{className:"space-y-2",children:[O.jsx("div",{children:"Type"}),O.jsxs(u_,{onValueChange:l,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[O.jsxs("div",{className:"flex items-center space-x-2",children:[O.jsx(Fg,{value:"multiple",id:"r1"}),O.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),O.jsxs("div",{className:"flex items-center space-x-2",children:[O.jsx(Fg,{value:"single",id:"r2"}),O.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),O.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[O.jsxs("div",{className:"col-span-2 space-y-1",children:[O.jsx(Wn,{children:"Table Column"}),O.jsx(Wn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),O.jsxs("div",{className:"col-span-2 space-y-1",children:[O.jsx(Wn,{children:"Data Type"}),O.jsx(Wn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),O.jsxs("div",{className:"col-span-2 space-y-1",children:[O.jsx(Wn,{className:"text-sm",children:"Filter Operation"}),O.jsx(yre,{updateFilterOperation:a,value:e.operation})]})]}),O.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[O.jsx(Wn,{className:"text-sm",children:"Values SQL"}),O.jsx(c_,{value:t,onChange:c=>n(c.target.value),className:`min-w-full grow resize font-mono text-xs ${Kp}`})]}),O.jsx("div",{className:"flex justify-end gap-2",children:O.jsxs(xr,{onClick:s,size:"sm",variant:"outline",children:[O.jsx(Ff,{className:"mr-2 size-4"}),"Save SQL"]})})]})]})}function yre({value:e,updateFilterOperation:t}){return O.jsxs(zs,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[O.jsx(Qi,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:O.jsx(Bs,{placeholder:"Operation"})}),O.jsxs(Ji,{children:[O.jsx(Hn,{value:"=",children:"Equals"}),O.jsx(Hn,{value:"in",children:"Contains"}),O.jsx(Hn,{value:"like",children:"Like"})]})]})}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 ho(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function yr(e,t){const n=Nt(e);return isNaN(t)?ho(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Zo(e,t){const n=Nt(e);if(isNaN(t))return ho(e,NaN);if(!t)return n;const r=n.getDate(),o=ho(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 d_=6048e5,xre=864e5;let wre={};function Uf(){return wre}function Ci(e,t){var a,l,c,u;const n=Uf(),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 bl(e){return Ci(e,{weekStartsOn:1})}function NM(e){const t=Nt(e),n=t.getFullYear(),r=ho(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=bl(r),i=ho(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=bl(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Zc(e){const t=Nt(e);return t.setHours(0,0,0,0),t}function jg(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 bi(e,t){const n=Zc(e),r=Zc(t),o=+n-jg(n),i=+r-jg(r);return Math.round((o-i)/xre)}function _re(e){const t=NM(e),n=ho(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),bl(n)}function zx(e,t){const n=t*7;return yr(e,n)}function Sre(e,t){return Zo(e,t*12)}function Cre(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 Ere(e){let t;return e.forEach(n=>{const r=Nt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Nr(e,t){const n=Zc(e),r=Zc(t);return+n==+r}function f_(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Rre(e){if(!f_(e)&&typeof e!="number")return!1;const t=Nt(e);return!isNaN(Number(t))}function Wd(e,t){const n=Nt(e),r=Nt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function Ore(e,t,n){const r=Ci(e,n),o=Ci(t,n),i=+r-jg(r),s=+o-jg(o);return Math.round((i-s)/d_)}function h_(e){const t=Nt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Lr(e){const t=Nt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function LM(e){const t=Nt(e),n=ho(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function p_(e,t){var a,l,c,u;const n=Uf(),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 FM(e){return p_(e,{weekStartsOn:1})}const Pre={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"}},Tre=(e,t,n)=>{let r;const o=Pre[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 Ry(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Dre={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Are={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$re={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kre={date:Ry({formats:Dre,defaultWidth:"full"}),time:Ry({formats:Are,defaultWidth:"full"}),dateTime:Ry({formats:$re,defaultWidth:"full"})},Mre={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ire=(e,t,n,r)=>Mre[e];function Yu(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 Nre={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Lre={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Fre={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"]},jre={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"]},zre={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"}},Bre={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"}},Vre=(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"},Hre={ordinalNumber:Vre,era:Yu({values:Nre,defaultWidth:"wide"}),quarter:Yu({values:Lre,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yu({values:Fre,defaultWidth:"wide"}),day:Yu({values:jre,defaultWidth:"wide"}),dayPeriod:Yu({values:zre,defaultWidth:"wide",formattingValues:Bre,defaultFormattingWidth:"wide"})};function Ku(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)?Ure(a,f=>f.test(s)):Wre(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 Wre(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Ure(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function qre(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 Gre=/^(\d+)(th|st|nd|rd)?/i,Yre=/\d+/i,Kre={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},Xre={any:[/^b/i,/^(a|c)/i]},Qre={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Jre={any:[/1/i,/2/i,/3/i,/4/i]},Zre={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},eoe={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]},toe={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},noe={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]},roe={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},ooe={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}},ioe={ordinalNumber:qre({matchPattern:Gre,parsePattern:Yre,valueCallback:e=>parseInt(e,10)}),era:Ku({matchPatterns:Kre,defaultMatchWidth:"wide",parsePatterns:Xre,defaultParseWidth:"any"}),quarter:Ku({matchPatterns:Qre,defaultMatchWidth:"wide",parsePatterns:Jre,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ku({matchPatterns:Zre,defaultMatchWidth:"wide",parsePatterns:eoe,defaultParseWidth:"any"}),day:Ku({matchPatterns:toe,defaultMatchWidth:"wide",parsePatterns:noe,defaultParseWidth:"any"}),dayPeriod:Ku({matchPatterns:roe,defaultMatchWidth:"any",parsePatterns:ooe,defaultParseWidth:"any"})},jM={code:"en-US",formatDistance:Tre,formatLong:kre,formatRelative:Ire,localize:Hre,match:ioe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function soe(e){const t=Nt(e);return bi(t,LM(t))+1}function zM(e){const t=Nt(e),n=+bl(t)-+_re(t);return Math.round(n/d_)+1}function BM(e,t){var u,f,h,g;const n=Nt(e),r=n.getFullYear(),o=Uf(),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??((g=(h=o.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,s=ho(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=Ci(s,t),l=ho(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Ci(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function aoe(e,t){var a,l,c,u;const n=Uf(),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=BM(e,t),i=ho(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Ci(i,t)}function VM(e,t){const n=Nt(e),r=+Ci(n,t)-+aoe(n,t);return Math.round(r/d_)+1}function Jt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ks={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)}},nc={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},KP={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 ks.y(e,t)},Y:function(e,t,n,r){const o=BM(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=NM(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 ks.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=VM(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Jt(o,t.length)},I:function(e,t,n){const r=zM(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"}):ks.d(e,t)},D:function(e,t,n){const r=soe(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=nc.noon:r===0?o=nc.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=nc.evening:r>=12?o=nc.afternoon:r>=4?o=nc.morning:o=nc.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 ks.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ks.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"}):ks.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ks.s(e,t)},S:function(e,t){return ks.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return QP(r);case"XXXX":case"XX":return Ba(r);case"XXXXX":case"XXX":default:return Ba(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return QP(r);case"xxxx":case"xx":return Ba(r);case"xxxxx":case"xxx":default:return Ba(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+XP(r,":");case"OOOO":default:return"GMT"+Ba(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+XP(r,":");case"zzzz":default:return"GMT"+Ba(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 XP(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 QP(e,t){return e%60===0?(e>0?"-":"+")+Jt(Math.abs(e)/60,2):Ba(e,t)}function Ba(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 JP=(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"})}},HM=(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"})}},loe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return JP(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}}",JP(r,t)).replace("{{time}}",HM(o,t))},coe={p:HM,P:loe},uoe=/^D+$/,doe=/^Y+$/,foe=["D","DD","YY","YYYY"];function hoe(e){return uoe.test(e)}function poe(e){return doe.test(e)}function goe(e,t,n){const r=moe(e,t,n);if(console.warn(r),foe.includes(e))throw new RangeError(r)}function moe(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 voe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,boe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yoe=/^'([^]*?)'?$/,xoe=/''/g,woe=/[a-zA-Z]/;function xi(e,t,n){var u,f,h,g,v,b,w,x;const r=Uf(),o=(n==null?void 0:n.locale)??r.locale??jM,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??((g=(h=r.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((b=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:b.weekStartsOn)??r.weekStartsOn??((x=(w=r.locale)==null?void 0:w.options)==null?void 0:x.weekStartsOn)??0,a=Nt(e);if(!Rre(a))throw new RangeError("Invalid time value");let l=t.match(boe).map(_=>{const S=_[0];if(S==="p"||S==="P"){const C=coe[S];return C(_,o.formatLong)}return _}).join("").match(voe).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const S=_[0];if(S==="'")return{isToken:!1,value:_oe(_)};if(KP[S])return{isToken:!0,value:_};if(S.match(woe))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)&&poe(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&hoe(S))&&goe(S,t,String(e));const C=KP[S[0]];return C(a,S,o.localize,c)}).join("")}function _oe(e){const t=e.match(yoe);return t?t[1].replace(xoe,"'"):e}function Soe(e){const t=Nt(e),n=t.getFullYear(),r=t.getMonth(),o=ho(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function Coe(e){return Math.trunc(+Nt(e)/1e3)}function Eoe(e){const t=Nt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function Roe(e,t){return Ore(Eoe(e),Lr(e),t)+1}function Bx(e,t){const n=Nt(e),r=Nt(t);return n.getTime()>r.getTime()}function WM(e,t){const n=Nt(e),r=Nt(t);return+n<+r}function g_(e,t){const n=Nt(e),r=Nt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Ooe(e,t){const n=Nt(e),r=Nt(t);return n.getFullYear()===r.getFullYear()}function Oy(e,t){return yr(e,-t)}function Py(e,t){const n=Nt(e),r=n.getFullYear(),o=n.getDate(),i=ho(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=Soe(i);return n.setMonth(t,Math.min(o,s)),n}function ZP(e,t){const n=Nt(e);return isNaN(+n)?ho(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 Poe(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 UM(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 Vx={exports:{}},Xu={};/**
321
- * @license React
322
- * react-jsx-runtime.development.js
323
- *
324
- * Copyright (c) Facebook, Inc. and its affiliates.
325
- *
326
- * This source code is licensed under the MIT license found in the
327
- * LICENSE file in the root directory of this source tree.
328
- */var eT;function Toe(){return eT||(eT=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"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function w(D){if(D===null||typeof D!="object")return null;var te=v&&D[v]||D[b];return typeof te=="function"?te:null}var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(D){{for(var te=arguments.length,ce=new Array(te>1?te-1:0),Oe=1;Oe<te;Oe++)ce[Oe-1]=arguments[Oe];S("error",D,ce)}}function S(D,te,ce){{var Oe=x.ReactDebugCurrentFrame,He=Oe.getStackAddendum();He!==""&&(te+="%s",ce=ce.concat([He]));var qe=ce.map(function(ze){return String(ze)});qe.unshift("Warning: "+te),Function.prototype.apply.call(console[D],console,qe)}}var C=!1,E=!1,P=!1,A=!1,k=!1,I;I=Symbol.for("react.module.reference");function $(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===i||k||D===o||D===c||D===u||A||D===g||C||E||P||typeof D=="object"&&D!==null&&(D.$$typeof===h||D.$$typeof===f||D.$$typeof===s||D.$$typeof===a||D.$$typeof===l||D.$$typeof===I||D.getModuleId!==void 0))}function L(D,te,ce){var Oe=D.displayName;if(Oe)return Oe;var He=te.displayName||te.name||"";return He!==""?ce+"("+He+")":ce}function j(D){return D.displayName||"Context"}function Q(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 te=D;return j(te)+".Consumer";case s:var ce=D;return j(ce._context)+".Provider";case l:return L(D,D.render,"ForwardRef");case f:var Oe=D.displayName||null;return Oe!==null?Oe:Q(D.type)||"Memo";case h:{var He=D,qe=He._payload,ze=He._init;try{return Q(ze(qe))}catch{return null}}}return null}var ee=Object.assign,B=0,Z,G,q,K,T,V,X;function N(){}N.__reactDisabledLog=!0;function ie(){{if(B===0){Z=console.log,G=console.info,q=console.warn,K=console.error,T=console.group,V=console.groupCollapsed,X=console.groupEnd;var D={configurable:!0,enumerable:!0,value:N,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}B++}}function fe(){{if(B--,B===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},D,{value:Z}),info:ee({},D,{value:G}),warn:ee({},D,{value:q}),error:ee({},D,{value:K}),group:ee({},D,{value:T}),groupCollapsed:ee({},D,{value:V}),groupEnd:ee({},D,{value:X})})}B<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=x.ReactCurrentDispatcher,pe;function se(D,te,ce){{if(pe===void 0)try{throw Error()}catch(He){var Oe=He.stack.trim().match(/\n( *(at )?)/);pe=Oe&&Oe[1]||""}return`
329
- `+pe+D}}var ne=!1,le;{var ye=typeof WeakMap=="function"?WeakMap:Map;le=new ye}function Y(D,te){if(!D||ne)return"";{var ce=le.get(D);if(ce!==void 0)return ce}var Oe;ne=!0;var He=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qe;qe=ue.current,ue.current=null,ie();try{if(te){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){Oe=ft}Reflect.construct(D,[],ze)}else{try{ze.call()}catch(ft){Oe=ft}D.call(ze.prototype)}}else{try{throw Error()}catch(ft){Oe=ft}D()}}catch(ft){if(ft&&Oe&&typeof ft.stack=="string"){for(var Fe=ft.stack.split(`
330
- `),Ae=Oe.stack.split(`
331
- `),U=Fe.length-1,me=Ae.length-1;U>=1&&me>=0&&Fe[U]!==Ae[me];)me--;for(;U>=1&&me>=0;U--,me--)if(Fe[U]!==Ae[me]){if(U!==1||me!==1)do if(U--,me--,me<0||Fe[U]!==Ae[me]){var $e=`
332
- `+Fe[U].replace(" at new "," at ");return D.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",D.displayName)),typeof D=="function"&&le.set(D,$e),$e}while(U>=1&&me>=0);break}}}finally{ne=!1,ue.current=qe,fe(),Error.prepareStackTrace=He}var st=D?D.displayName||D.name:"",bn=st?se(st):"";return typeof D=="function"&&le.set(D,bn),bn}function be(D,te,ce){return Y(D,!1)}function _e(D){var te=D.prototype;return!!(te&&te.isReactComponent)}function Pe(D,te,ce){if(D==null)return"";if(typeof D=="function")return Y(D,_e(D));if(typeof D=="string")return se(D);switch(D){case c:return se("Suspense");case u:return se("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return be(D.render);case f:return Pe(D.type,te,ce);case h:{var Oe=D,He=Oe._payload,qe=Oe._init;try{return Pe(qe(He),te,ce)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Ue={},Be=x.ReactDebugCurrentFrame;function Ie(D){if(D){var te=D._owner,ce=Pe(D.type,D._source,te?te.type:null);Be.setExtraStackFrame(ce)}else Be.setExtraStackFrame(null)}function Ke(D,te,ce,Oe,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((Oe||"React class")+": "+ce+" 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](te,ze,Oe,ce,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(U){Fe=U}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).",Oe||"React class",ce,ze,typeof Fe),Ie(null)),Fe instanceof Error&&!(Fe.message in Ue)&&(Ue[Fe.message]=!0,Ie(He),_("Failed %s type: %s",ce,Fe.message),Ie(null))}}}var lt=Array.isArray;function It(D){return lt(D)}function At(D){{var te=typeof Symbol=="function"&&Symbol.toStringTag,ce=te&&D[Symbol.toStringTag]||D.constructor.name||"Object";return ce}}function Ht(D){try{return de(D),!1}catch{return!0}}function de(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.",At(D)),de(D)}var Le=x.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Ze,Wt,Zt;Zt={};function Kt(D){if(Te.call(D,"ref")){var te=Object.getOwnPropertyDescriptor(D,"ref").get;if(te&&te.isReactWarning)return!1}return D.ref!==void 0}function vn(D){if(Te.call(D,"key")){var te=Object.getOwnPropertyDescriptor(D,"key").get;if(te&&te.isReactWarning)return!1}return D.key!==void 0}function ln(D,te){if(typeof D.ref=="string"&&Le.current&&te&&Le.current.stateNode!==te){var ce=Q(Le.current.type);Zt[ce]||(_('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',Q(Le.current.type),D.ref),Zt[ce]=!0)}}function Lt(D,te){{var ce=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)",te))};ce.isReactWarning=!0,Object.defineProperty(D,"key",{get:ce,configurable:!0})}}function tn(D,te){{var ce=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)",te))};ce.isReactWarning=!0,Object.defineProperty(D,"ref",{get:ce,configurable:!0})}}var xn=function(D,te,ce,Oe,He,qe,ze){var Fe={$$typeof:t,type:D,key:te,ref:ce,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:Oe}),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,te,ce,Oe,He){{var qe,ze={},Fe=null,Ae=null;ce!==void 0&&(Ee(ce),Fe=""+ce),vn(te)&&(Ee(te.key),Fe=""+te.key),Kt(te)&&(Ae=te.ref,ln(te,He));for(qe in te)Te.call(te,qe)&&!Ge.hasOwnProperty(qe)&&(ze[qe]=te[qe]);if(D&&D.defaultProps){var U=D.defaultProps;for(qe in U)ze[qe]===void 0&&(ze[qe]=U[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,Oe,Le.current,ze)}}var ht=x.ReactCurrentOwner,$t=x.ReactDebugCurrentFrame;function Xt(D){if(D){var te=D._owner,ce=Pe(D.type,D._source,te?te.type:null);$t.setExtraStackFrame(ce)}else $t.setExtraStackFrame(null)}var bt;bt=!1;function Rn(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Lo(){{if(ht.current){var D=Q(ht.current.type);if(D)return`
333
-
334
- Check the render method of \``+D+"`."}return""}}function ms(D){{if(D!==void 0){var te=D.fileName.replace(/^.*[\\\/]/,""),ce=D.lineNumber;return`
335
-
336
- Check your code at `+te+":"+ce+"."}return""}}var Fo={};function Ai(D){{var te=Lo();if(!te){var ce=typeof D=="string"?D:D.displayName||D.name;ce&&(te=`
337
-
338
- Check the top-level render call using <`+ce+">.")}return te}}function ni(D,te){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var ce=Ai(te);if(Fo[ce])return;Fo[ce]=!0;var Oe="";D&&D._owner&&D._owner!==ht.current&&(Oe=" It was passed a child from "+Q(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.',ce,Oe),Xt(null)}}function $i(D,te){{if(typeof D!="object")return;if(It(D))for(var ce=0;ce<D.length;ce++){var Oe=D[ce];Rn(Oe)&&ni(Oe,te)}else if(Rn(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;)Rn(ze.value)&&ni(ze.value,te)}}}function vs(D){{var te=D.type;if(te==null||typeof te=="string")return;var ce;if(typeof te=="function")ce=te.propTypes;else if(typeof te=="object"&&(te.$$typeof===l||te.$$typeof===f))ce=te.propTypes;else return;if(ce){var Oe=Q(te);Ke(ce,D.props,"prop",Oe,D)}else if(te.PropTypes!==void 0&&!bt){bt=!0;var He=Q(te);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof te.getDefaultProps=="function"&&!te.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ri(D){{for(var te=Object.keys(D.props),ce=0;ce<te.length;ce++){var Oe=te[ce];if(Oe!=="children"&&Oe!=="key"){Xt(D),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Xt(null);break}}D.ref!==null&&(Xt(D),_("Invalid attribute `ref` supplied to `React.Fragment`."),Xt(null))}}function ki(D,te,ce,Oe,He,qe){{var ze=$(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=ms(He);Ae?Fe+=Ae:Fe+=Lo();var U;D===null?U="null":It(D)?U="array":D!==void 0&&D.$$typeof===t?(U="<"+(Q(D.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):U=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",U,Fe)}var me=nt(D,te,ce,He,qe);if(me==null)return me;if(ze){var $e=te.children;if($e!==void 0)if(Oe)if(It($e)){for(var st=0;st<$e.length;st++)$i($e[st],D);Object.freeze&&Object.freeze($e)}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 $i($e,D)}return D===r?ri(me):vs(me),me}}function jn(D,te,ce){return ki(D,te,ce,!0)}function oi(D,te,ce){return ki(D,te,ce,!1)}var bs=oi,ys=jn;Xu.Fragment=r,Xu.jsx=bs,Xu.jsxs=ys}()),Xu}var Qu={};/**
339
- * @license React
340
- * react-jsx-runtime.production.min.js
341
- *
342
- * Copyright (c) Facebook, Inc. and its affiliates.
343
- *
344
- * This source code is licensed under the MIT license found in the
345
- * LICENSE file in the root directory of this source tree.
346
- */var tT;function Doe(){if(tT)return Qu;tT=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={},h=null,g=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(g=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:h,ref:g,props:f,_owner:o.current}}return Qu.Fragment=n,Qu.jsx=s,Qu.jsxs=s,Qu}process.env.NODE_ENV==="production"?Vx.exports=Doe():Vx.exports=Toe();var Se=Vx.exports;function qf(e){return e.mode==="multiple"}function Gf(e){return e.mode==="range"}function Km(e){return e.mode==="single"}var Aoe={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 $oe(e,t){return xi(e,"LLLL y",t)}function koe(e,t){return xi(e,"d",t)}function Moe(e,t){return xi(e,"LLLL",t)}function Ioe(e){return"".concat(e)}function Noe(e,t){return xi(e,"cccccc",t)}function Loe(e,t){return xi(e,"yyyy",t)}var Foe=Object.freeze({__proto__:null,formatCaption:$oe,formatDay:koe,formatMonthCaption:Moe,formatWeekNumber:Ioe,formatWeekdayName:Noe,formatYearCaption:Loe}),joe=function(e,t,n){return xi(e,"do MMMM (EEEE)",n)},zoe=function(){return"Month: "},Boe=function(){return"Go to next month"},Voe=function(){return"Go to previous month"},Hoe=function(e,t){return xi(e,"cccc",t)},Woe=function(e){return"Week n. ".concat(e)},Uoe=function(){return"Year: "},qoe=Object.freeze({__proto__:null,labelDay:joe,labelMonthDropdown:zoe,labelNext:Boe,labelPrevious:Voe,labelWeekNumber:Woe,labelWeekday:Hoe,labelYearDropdown:Uoe});function Goe(){var e="buttons",t=Aoe,n=jM,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:Foe,labels:qoe,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function Yoe(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=Lr(r):t&&(i=new Date(t,0,1)),o?s=h_(o):n&&(s=new Date(n,11,31)),{fromDate:i?Zc(i):void 0,toDate:s?Zc(s):void 0}}var qM=m.createContext(void 0);function Koe(e){var t,n=e.initialProps,r=Goe(),o=Yoe(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;(Km(n)||qf(n)||Gf(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 Se.jsx(qM.Provider,{value:c,children:e.children})}function an(){var e=m.useContext(qM);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function GM(e){var t=an(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return Se.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 Xoe(e){return Se.jsx("svg",rt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:Se.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 YM(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:Xoe;return Se.jsxs("div",{className:a,style:l,children:[Se.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),Se.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),Se.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,Se.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function Qoe(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 Se.jsx(Se.Fragment,{});if(!o)return Se.jsx(Se.Fragment,{});var f=[];if(Ooe(r,o))for(var h=Lr(r),g=r.getMonth();g<=o.getMonth();g++)f.push(Py(h,g));else for(var h=Lr(new Date),g=0;g<=11;g++)f.push(Py(h,g));var v=function(w){var x=Number(w.target.value),_=Py(Lr(e.displayMonth),x);e.onChange(_)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:YM;return Se.jsx(b,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(w){return Se.jsx("option",{value:w.getMonth(),children:a(w,{locale:s})},w.getMonth())})})}function Joe(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,h=[];if(!o)return Se.jsx(Se.Fragment,{});if(!i)return Se.jsx(Se.Fragment,{});for(var g=o.getFullYear(),v=i.getFullYear(),b=g;b<=v;b++)h.push(ZP(LM(new Date),b));var w=function(_){var S=ZP(Lr(n),Number(_.target.value));e.onChange(S)},x=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:YM;return Se.jsx(x,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:w,value:n.getFullYear(),caption:u(n,{locale:s}),children:h.map(function(_){return Se.jsx("option",{value:_.getFullYear(),children:u(_,{locale:s})},_.getFullYear())})})}function Zoe(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function eie(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&&Wd(i,o)<0){var c=-1*(l-1);o=Zo(i,c)}return s&&Wd(o,s)<0&&(o=s),Lr(o)}function tie(){var e=an(),t=eie(e),n=Zoe(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=Lr(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function nie(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=Lr(e),i=Lr(Zo(o,r)),s=Wd(i,o),a=[],l=0;l<s;l++){var c=Zo(o,l);a.push(c)}return n&&(a=a.reverse()),a}function rie(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=Lr(e);if(!n)return Zo(a,s);var l=Wd(n,e);if(!(l<i))return Zo(a,s)}}function oie(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=Lr(e);if(!n)return Zo(a,-s);var l=Wd(a,n);if(!(l<=0))return Zo(a,-s)}}var KM=m.createContext(void 0);function iie(e){var t=an(),n=tie(),r=n[0],o=n[1],i=nie(r,t),s=rie(r,t),a=oie(r,t),l=function(f){return i.some(function(h){return g_(f,h)})},c=function(f,h){l(f)||(h&&WM(f,h)?o(Zo(f,1+t.numberOfMonths*-1)):o(f))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return Se.jsx(KM.Provider,{value:u,children:e.children})}function Yf(){var e=m.useContext(KM);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function nT(e){var t,n=an(),r=n.classNames,o=n.styles,i=n.components,s=Yf().goToMonth,a=function(u){s(Zo(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:GM,c=Se.jsx(l,{id:e.id,displayMonth:e.displayMonth});return Se.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[Se.jsx("div",{className:r.vhidden,children:c}),Se.jsx(Qoe,{onChange:a,displayMonth:e.displayMonth}),Se.jsx(Joe,{onChange:a,displayMonth:e.displayMonth})]})}function sie(e){return Se.jsx("svg",rt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Se.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 aie(e){return Se.jsx("svg",rt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Se.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 zg=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),Se.jsx("button",rt({},e,{ref:t,type:"button",className:s,style:a}))});function lie(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 Se.jsx(Se.Fragment,{});var h=c(e.previousMonth,{locale:i}),g=[s.nav_button,s.nav_button_previous].join(" "),v=u(e.nextMonth,{locale:i}),b=[s.nav_button,s.nav_button_next].join(" "),w=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:aie,x=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:sie;return Se.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&Se.jsx(zg,{name:"previous-month","aria-label":h,className:g,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?Se.jsx(w,{className:s.nav_icon,style:a.nav_icon}):Se.jsx(x,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&Se.jsx(zg,{name:"next-month","aria-label":v,className:b,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?Se.jsx(x,{className:s.nav_icon,style:a.nav_icon}):Se.jsx(w,{className:s.nav_icon,style:a.nav_icon})})]})}function rT(e){var t=an().numberOfMonths,n=Yf(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return g_(e.displayMonth,v)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),f=t>1&&(c||!l),h=function(){r&&i(r)},g=function(){o&&i(o)};return Se.jsx(lie,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:f,nextMonth:o,previousMonth:r,onPreviousClick:h,onNextClick:g})}function cie(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:GM,c;return o?c=Se.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=Se.jsx(nT,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=Se.jsxs(Se.Fragment,{children:[Se.jsx(nT,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),Se.jsx(rT,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=Se.jsxs(Se.Fragment,{children:[Se.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Se.jsx(rT,{displayMonth:e.displayMonth,id:e.id})]}),Se.jsx("div",{className:r.caption,style:i.caption,children:c})}function uie(e){var t=an(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?Se.jsx("tfoot",{className:o,style:r.tfoot,children:Se.jsx("tr",{children:Se.jsx("td",{colSpan:8,children:n})})}):Se.jsx(Se.Fragment,{})}function die(e,t,n){for(var r=n?bl(new Date):Ci(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=yr(r,i);o.push(s)}return o}function fie(){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=die(o,i,s);return Se.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&Se.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,f){return Se.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 hie(){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:fie;return Se.jsx("thead",{style:r.head,className:n.head,children:Se.jsx(i,{})})}function pie(e){var t=an(),n=t.locale,r=t.formatters.formatDay;return Se.jsx(Se.Fragment,{children:r(e.date,{locale:n})})}var m_=m.createContext(void 0);function gie(e){if(!qf(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return Se.jsx(m_.Provider,{value:t,children:e.children})}return Se.jsx(mie,{initialProps:e.initialProps,children:e.children})}function mie(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,f){var h,g;(h=t.onDayClick)===null||h===void 0||h.call(t,c,u,f);var v=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!v){var b=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!b){var w=r?UM([],r,!0):[];if(u.selected){var x=w.findIndex(function(_){return Nr(c,_)});w.splice(x,1)}else w.push(c);(g=t.onSelect)===null||g===void 0||g.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(h){return Nr(h,c)});return!!(u&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return Se.jsx(m_.Provider,{value:l,children:n})}function v_(){var e=m.useContext(m_);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function vie(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?Nr(o,e)&&Nr(r,e)?void 0:Nr(o,e)?{from:o,to:void 0}:Nr(r,e)?void 0:Bx(r,e)?{from:e,to:o}:{from:r,to:e}:o?Bx(e,o)?{from:o,to:e}:{from:e,to:o}:r?WM(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var b_=m.createContext(void 0);function bie(e){if(!Gf(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return Se.jsx(b_.Provider,{value:t,children:e.children})}return Se.jsx(yie,{initialProps:e.initialProps,children:e.children})}function yie(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(g,v,b){var w,x;(w=t.onDayClick)===null||w===void 0||w.call(t,g,v,b);var _=vie(g,r);(x=t.onSelect)===null||x===void 0||x.call(t,_,g,v,b)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],Nr(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:Oy(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:Oy(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=bi(s,i)+1,h=l-f;u.disabled.push({before:Oy(i,h)}),u.disabled.push({after:yr(s,h)})}!i&&s&&(u.disabled.push({before:yr(s,-l+1)}),u.disabled.push({after:yr(s,l-1)}))}return Se.jsx(b_.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function y_(){var e=m.useContext(b_);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function ag(e){return Array.isArray(e)?UM([],e,!0):e!==void 0?[e]:[]}function xie(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=ag(o)}),t}var ei;(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"})(ei||(ei={}));var wie=ei.Selected,Ui=ei.Disabled,_ie=ei.Hidden,Sie=ei.Today,Ty=ei.RangeEnd,Dy=ei.RangeMiddle,Ay=ei.RangeStart,Cie=ei.Outside;function Eie(e,t,n){var r,o=(r={},r[wie]=ag(e.selected),r[Ui]=ag(e.disabled),r[_ie]=ag(e.hidden),r[Sie]=[e.today],r[Ty]=[],r[Dy]=[],r[Ay]=[],r[Cie]=[],r);return e.fromDate&&o[Ui].push({before:e.fromDate}),e.toDate&&o[Ui].push({after:e.toDate}),qf(e)?o[Ui]=o[Ui].concat(t.modifiers[Ui]):Gf(e)&&(o[Ui]=o[Ui].concat(n.modifiers[Ui]),o[Ay]=n.modifiers[Ay],o[Dy]=n.modifiers[Dy],o[Ty]=n.modifiers[Ty]),o}var XM=m.createContext(void 0);function Rie(e){var t=an(),n=v_(),r=y_(),o=Eie(t,n,r),i=xie(t.modifiers),s=rt(rt({},o),i);return Se.jsx(XM.Provider,{value:s,children:e.children})}function QM(){var e=m.useContext(XM);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Oie(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Pie(e){return!!(e&&typeof e=="object"&&"from"in e)}function Tie(e){return!!(e&&typeof e=="object"&&"after"in e)}function Die(e){return!!(e&&typeof e=="object"&&"before"in e)}function Aie(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function $ie(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=bi(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=bi(e,r)>=0&&bi(o,e)>=0;return s}return o?Nr(o,e):r?Nr(r,e):!1}function kie(e){return f_(e)}function Mie(e){return Array.isArray(e)&&e.every(f_)}function Iie(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(kie(n))return Nr(e,n);if(Mie(n))return n.includes(e);if(Pie(n))return $ie(e,n);if(Aie(n))return n.dayOfWeek.includes(e.getDay());if(Oie(n)){var r=bi(n.before,e),o=bi(n.after,e),i=r>0,s=o<0,a=Bx(n.before,n.after);return a?s&&i:i||s}return Tie(n)?bi(e,n.after)>0:Die(n)?bi(n.before,e)>0:typeof n=="function"?n(e):!1})}function x_(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return Iie(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!g_(e,n)&&(o.outside=!0),o}function Nie(e,t){for(var n=Lr(e[0]),r=h_(e[e.length-1]),o,i,s=n;s<=r;){var a=x_(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 Lie=365;function JM(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,h={day:yr,week:zx,month:Zo,year:Sre,startOfWeek:function(w){return o.ISOWeek?bl(w):Ci(w,{locale:f,weekStartsOn:l})},endOfWeek:function(w){return o.ISOWeek?FM(w):p_(w,{locale:f,weekStartsOn:l})}},g=h[n](e,r==="after"?1:-1);r==="before"&&c?g=Cre([c,g]):r==="after"&&u&&(g=Ere([u,g]));var v=!0;if(i){var b=x_(g,i);v=!b.disabled&&!b.hidden}return v?g:a.count>Lie?a.lastFocused:JM(g,{moveBy:n,direction:r,context:o,modifiers:i,retry:rt(rt({},a),{count:a.count+1})})}var ZM=m.createContext(void 0);function Fie(e){var t=Yf(),n=QM(),r=m.useState(),o=r[0],i=r[1],s=m.useState(),a=s[0],l=s[1],c=Nie(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(o),i(void 0)},h=function(w){i(w)},g=an(),v=function(w,x){if(o){var _=JM(o,{moveBy:w,direction:x,context:g,modifiers:n});Nr(o,_)||(t.goToDate(_,o),h(_))}},b={focusedDay:o,focusTarget:u,blur:f,focus:h,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return Se.jsx(ZM.Provider,{value:b,children:e.children})}function w_(){var e=m.useContext(ZM);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function jie(e,t){var n=QM(),r=x_(e,n,t);return r}var __=m.createContext(void 0);function zie(e){if(!Km(e.initialProps)){var t={selected:void 0};return Se.jsx(__.Provider,{value:t,children:e.children})}return Se.jsx(Bie,{initialProps:e.initialProps,children:e.children})}function Bie(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 Se.jsx(__.Provider,{value:o,children:n})}function eI(){var e=m.useContext(__);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Vie(e,t){var n=an(),r=eI(),o=v_(),i=y_(),s=w_(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,f=s.blur,h=s.focus,g=s.focusMonthBefore,v=s.focusMonthAfter,b=s.focusYearBefore,w=s.focusYearAfter,x=s.focusStartOfWeek,_=s.focusEndOfWeek,S=function(G){var q,K,T,V;Km(n)?(q=r.onDayClick)===null||q===void 0||q.call(r,e,t,G):qf(n)?(K=o.onDayClick)===null||K===void 0||K.call(o,e,t,G):Gf(n)?(T=i.onDayClick)===null||T===void 0||T.call(i,e,t,G):(V=n.onDayClick)===null||V===void 0||V.call(n,e,t,G)},C=function(G){var q;h(e),(q=n.onDayFocus)===null||q===void 0||q.call(n,e,t,G)},E=function(G){var q;f(),(q=n.onDayBlur)===null||q===void 0||q.call(n,e,t,G)},P=function(G){var q;(q=n.onDayMouseEnter)===null||q===void 0||q.call(n,e,t,G)},A=function(G){var q;(q=n.onDayMouseLeave)===null||q===void 0||q.call(n,e,t,G)},k=function(G){var q;(q=n.onDayPointerEnter)===null||q===void 0||q.call(n,e,t,G)},I=function(G){var q;(q=n.onDayPointerLeave)===null||q===void 0||q.call(n,e,t,G)},$=function(G){var q;(q=n.onDayTouchCancel)===null||q===void 0||q.call(n,e,t,G)},L=function(G){var q;(q=n.onDayTouchEnd)===null||q===void 0||q.call(n,e,t,G)},j=function(G){var q;(q=n.onDayTouchMove)===null||q===void 0||q.call(n,e,t,G)},Q=function(G){var q;(q=n.onDayTouchStart)===null||q===void 0||q.call(n,e,t,G)},ee=function(G){var q;(q=n.onDayKeyUp)===null||q===void 0||q.call(n,e,t,G)},B=function(G){var q;switch(G.key){case"ArrowLeft":G.preventDefault(),G.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":G.preventDefault(),G.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":G.preventDefault(),G.stopPropagation(),c();break;case"ArrowUp":G.preventDefault(),G.stopPropagation(),u();break;case"PageUp":G.preventDefault(),G.stopPropagation(),G.shiftKey?b():g();break;case"PageDown":G.preventDefault(),G.stopPropagation(),G.shiftKey?w():v();break;case"Home":G.preventDefault(),G.stopPropagation(),x();break;case"End":G.preventDefault(),G.stopPropagation(),_();break}(q=n.onDayKeyDown)===null||q===void 0||q.call(n,e,t,G)},Z={onClick:S,onFocus:C,onBlur:E,onKeyDown:B,onKeyUp:ee,onMouseEnter:P,onMouseLeave:A,onPointerEnter:k,onPointerLeave:I,onTouchCancel:$,onTouchEnd:L,onTouchMove:j,onTouchStart:Q};return Z}function Hie(){var e=an(),t=eI(),n=v_(),r=y_(),o=Km(e)?t.selected:qf(e)?n.selected:Gf(e)?r.selected:void 0;return o}function Wie(e){return Object.values(ei).includes(e)}function Uie(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(Wie(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function qie(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 Gie(e,t,n){var r,o,i,s=an(),a=w_(),l=jie(e,t),c=Vie(e,l),u=Hie(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var P;l.outside||a.focusedDay&&f&&Nr(a.focusedDay,e)&&((P=n.current)===null||P===void 0||P.focus())},[a.focusedDay,e,n,f,l.outside]);var h=Uie(s,l).join(" "),g=qie(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),b=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:pie,w=Se.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),x={style:g,className:h,children:w,role:"gridcell"},_=a.focusTarget&&Nr(a.focusTarget,e)&&!l.outside,S=a.focusedDay&&Nr(a.focusedDay,e),C=rt(rt(rt({},x),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=S||_?0:-1,r)),c),E={isButton:f,isHidden:v,activeModifiers:l,selectedDays:u,buttonProps:C,divProps:x};return E}function Yie(e){var t=m.useRef(null),n=Gie(e.date,e.displayMonth,t);return n.isHidden?Se.jsx("div",{role:"gridcell"}):n.isButton?Se.jsx(zg,rt({name:"day",ref:t},n.buttonProps)):Se.jsx("div",rt({},n.divProps))}function Kie(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 Se.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var f=l(Number(t),{locale:a}),h=function(g){o(t,n,g)};return Se.jsx(zg,{name:"week-number","aria-label":f,className:s.weeknumber,style:i.weeknumber,onClick:h,children:u})}function Xie(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:Yie,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:Kie,u;return s&&(u=Se.jsx("td",{className:i.cell,style:o.cell,children:Se.jsx(c,{number:e.weekNumber,dates:e.dates})})),Se.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(f){return Se.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:Se.jsx(l,{displayMonth:e.displayMonth,date:f})},Coe(f))})]})}function oT(e,t,n){for(var r=n!=null&&n.ISOWeek?FM(t):p_(t,n),o=n!=null&&n.ISOWeek?bl(e):Ci(e,n),i=bi(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?zM(u):VM(u,n),h=c.find(function(g){return g.weekNumber===f});return h?(h.dates.push(u),c):(c.push({weekNumber:f,dates:[u]}),c)},[]);return l}function Qie(e,t){var n=oT(Lr(e),h_(e),t);if(t!=null&&t.useFixedWeeks){var r=Roe(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=zx(i,6-r),a=oT(zx(i,1),s,t);n.push.apply(n,a)}}return n}function Jie(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,h=o.firstWeekContainsDate,g=o.ISOWeek,v=Qie(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:g,locale:i,weekStartsOn:f,firstWeekContainsDate:h}),b=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:hie,w=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:Xie,x=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:uie;return Se.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&Se.jsx(b,{}),Se.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(_){return Se.jsx(w,{displayMonth:e.displayMonth,dates:_.dates,weekNumber:_.weekNumber},_.weekNumber)})}),Se.jsx(x,{displayMonth:e.displayMonth})]})}function Zie(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var ese=Zie()?m.useLayoutEffect:m.useEffect,$y=!1,tse=0;function iT(){return"react-day-picker-".concat(++tse)}function nse(e){var t,n=e??($y?iT():null),r=m.useState(n),o=r[0],i=r[1];return ese(function(){o===null&&i(iT())},[]),m.useEffect(function(){$y===!1&&($y=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function rse(e){var t,n,r=an(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=Yf().displayMonths,c=nse(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],h=s.month,g=e.displayIndex===0,v=e.displayIndex===l.length-1,b=!g&&!v;o==="rtl"&&(t=[g,v],v=t[0],g=t[1]),g&&(f.push(i.caption_start),h=rt(rt({},h),s.caption_start)),v&&(f.push(i.caption_end),h=rt(rt({},h),s.caption_end)),b&&(f.push(i.caption_between),h=rt(rt({},h),s.caption_between));var w=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:cie;return Se.jsxs("div",{className:f.join(" "),style:h,children:[Se.jsx(w,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Se.jsx(Jie,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function ose(e){var t=an(),n=t.classNames,r=t.styles;return Se.jsx("div",{className:n.months,style:r.months,children:e.children})}function ise(e){var t,n,r=e.initialProps,o=an(),i=w_(),s=Yf(),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),h=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,b){var w;return rt(rt({},v),(w={},w[b]=r[b],w))},{}),g=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:ose;return Se.jsx("div",rt({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:Se.jsx(g,{children:s.displayMonths.map(function(v,b){return Se.jsx(rse,{displayIndex:b,displayMonth:v},b)})})}))}function sse(e){var t=e.children,n=Poe(e,["children"]);return Se.jsx(Koe,{initialProps:n,children:Se.jsx(iie,{children:Se.jsx(zie,{initialProps:n,children:Se.jsx(gie,{initialProps:n,children:Se.jsx(bie,{initialProps:n,children:Se.jsx(Rie,{children:Se.jsx(Fie,{children:t})})})})})})})}function ase(e){return Se.jsx(sse,rt({},e,{children:Se.jsx(ise,{initialProps:e})}))}function tI({className:e,classNames:t,showOutsideDays:n=!0,...r}){return O.jsx(ase,{showOutsideDays:n,className:Ce("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:Ce(Vd({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:Ce(Vd({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})=>O.jsx(N$,{...o,className:"h-4 w-4"}),IconRight:({...o})=>O.jsx(E1,{...o,className:"h-4 w-4"})},...r})}tI.displayName="Calendar";function lse({filter:e,className:t}){const[n,r]=m.useState(!1),[o,i]=m.useState(),[s,a]=m.useState(),l=ke(S=>S.filterValues),{authToken:c}=ma(),u=ke(S=>S.actions.addOrUpdateFilterValue),f=ke(S=>S.actions.removeFilterValue),{data:h,isLoading:g,isFetching:v,isError:b,refetch:w}=Df({queryKey:[e.sql],queryFn:()=>Of("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=h==null?void 0:h.records)==null?void 0:S.length)>0){const C=h.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)})}},[h]),m.useEffect(()=>{if(l&&!l.find(C=>C.filterId===e.id)){i(s);return}},[l,e.id,s]);function x(){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:hg(e),name:e.column,operation:"between",values:S};u(C),r(!1)}return g?O.jsx("div",{children:O.jsx(am,{className:"h-8 w-full bg-foreground/10"})}):b?O.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):h?O.jsx("div",{className:Ce("grid gap-2",t),children:O.jsxs(qm,{open:n,onOpenChange:r,children:[O.jsx(Gm,{asChild:!0,children:O.jsxs(xr,{size:"sm",id:"date",variant:"outline",className:Ce("h-[34px] w-full justify-start rounded-sm text-left font-normal",!o&&"text-muted-foreground"),children:[O.jsx(I$,{className:"mr-2 h-4 w-4"}),o!=null&&o.from?o.to?O.jsxs(O.Fragment,{children:[xi(o.from,"LLL dd, y")," -"," ",xi(o.to,"LLL dd, y")]}):xi(o.from,"LLL dd, y"):O.jsx("span",{children:"Pick a date"})]})}),O.jsxs(Wf,{className:"w-auto p-0",align:"start",children:[O.jsx(tI,{initialFocus:!0,mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:i,numberOfMonths:2}),O.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[O.jsx(xr,{size:"sm",variant:"outline",onClick:_,children:"Apply"}),O.jsx(xr,{size:"sm",variant:"outline",onClick:x,children:"Clear"})]})]})]})}):O.jsxs(Wn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}/**
347
- * react-virtual
348
- *
349
- * Copyright (c) TanStack
350
- *
351
- * This source code is licensed under the MIT license found in the
352
- * LICENSE.md file in the root directory of this source tree.
353
- *
354
- * @license MIT
355
- */function Bg(){return Bg=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},Bg.apply(this,arguments)}/**
356
- * virtual-core
357
- *
358
- * Copyright (c) TanStack
359
- *
360
- * This source code is licensed under the MIT license found in the
361
- * LICENSE.md file in the root directory of this source tree.
362
- *
363
- * @license MIT
364
- */function Vg(){return Vg=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},Vg.apply(this,arguments)}/**
365
- * virtual-core
366
- *
367
- * Copyright (c) TanStack
368
- *
369
- * This source code is licensed under the MIT license found in the
370
- * LICENSE.md file in the root directory of this source tree.
371
- *
372
- * @license MIT
373
- */function rc(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(v,b){return o[b]!==v});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,h=f/16,g=function(b,w){for(b=String(b);b.length<w;)b=" "+b;return b};console.info("%c⏱ "+g(f,5)+" /"+g(u,5)+" ms",`
374
- font-size: .6rem;
375
- font-weight: bold;
376
- color: hsl(`+Math.max(0,Math.min(120-120*h,120))+"deg 100% 31%);",n==null?void 0:n.key)}return n==null||n.onChange==null||n.onChange(i),i}}function ky(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var cse=function(t,n){return Math.abs(t-n)<1};/**
377
- * virtual-core
378
- *
379
- * Copyright (c) TanStack
380
- *
381
- * This source code is licensed under the MIT license found in the
382
- * LICENSE.md file in the root directory of this source tree.
383
- *
384
- * @license MIT
385
- */var use=function(t){return t},dse=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},fse=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)}}},hse=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)}}},pse=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"])},gse=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))},mse=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=Vg({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:use,rangeExtractor:dse,onChange:function(){},measureElement:pse,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=rc(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=rc(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=rc(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 h=l(f),g=n.options.lanes===1?u[f-1]:n.getFurthestMeasurement(u,f),v=g?g.end:s+a,b=o.get(h),w=typeof b=="number"?b:n.options.estimateSize(f),x=v+w,_=g?g.lane:f%n.options.lanes;u[f]={index:f,start:v,size:w,end:x,key:h,lane:_}}return n.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return n.options.debug}}),this.calculateRange=rc(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,o,i){return n.range=r.length>0&&o>0?vse({measurements:r,outerSize:o,scrollOffset:i}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=rc(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,o,i,s){return o===null?[]:r(Vg({},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=rc(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 ky(o[nI(0,o.length-1,function(i){return ky(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=ky(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 h=n.measureElementCache.has(n.options.getItemKey(r));if(h){var g=n.getOffsetForIndex(r,f),v=g[0];cse(v,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()},nI=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 vse(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,o=t.length-1,i=function(c){return t[c].start},s=nI(0,o,i,r),a=s;a<o&&t[a].end<r+n;)a++;return{startIndex:s,endIndex:a}}/**
386
- * react-virtual
387
- *
388
- * Copyright (c) TanStack
389
- *
390
- * This source code is licensed under the MIT license found in the
391
- * LICENSE.md file in the root directory of this source tree.
392
- *
393
- * @license MIT
394
- */var bse=typeof document<"u"?H.useLayoutEffect:H.useEffect;function yse(e){var t=H.useReducer(function(){return{}},{})[1],n=Bg({},e,{onChange:function(s,a){a?Mo.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=H.useState(function(){return new mse(n)}),o=r[0];return o.setOptions(n),H.useEffect(function(){return o._didMount()},[]),bse(function(){return o._willUpdate()}),o}function xse(e){return yse(Bg({observeElementRect:fse,observeElementOffset:hse,scrollToFn:gse},e))}var wse=Object.defineProperty,_se=(e,t,n)=>t in e?wse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,My=(e,t,n)=>(_se(e,typeof t!="symbol"?t+"":t,n),n);let Sse=class{constructor(){My(this,"current",this.detect()),My(this,"handoffState","pending"),My(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"}},cl=new Sse,Fn=(e,t)=>{cl.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function wi(e){let t=m.useRef(e);return Fn(()=>{t.current=e},[e]),t}function S_(e,t){let[n,r]=m.useState(e),o=wi(e);return Fn(()=>r(o.current),[o,r,...t]),n}let Et=function(e){let t=wi(e);return m.useCallback((...n)=>t.current(...n),[t])};function Cse(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 Ese(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function yl(){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 Ese(()=>{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=yl();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 Kf(){let[e]=m.useState(yl);return m.useEffect(()=>()=>e.dispose(),[e]),e}function Rse(){let e=typeof document>"u";return"useSyncExternalStore"in H?(t=>t.useSyncExternalStore)(H)(()=>()=>{},()=>!1,()=>!e):!1}function C_(){let e=Rse(),[t,n]=H.useState(cl.isHandoffComplete);return t&&cl.isHandoffComplete===!1&&n(!1),H.useEffect(()=>{t!==!0&&n(!0)},[t]),H.useEffect(()=>cl.handoff(),[]),e?!1:t}var sT;let Xf=(sT=m.useId)!=null?sT:function(){let e=C_(),[t,n]=m.useState(e?()=>cl.nextId():null);return Fn(()=>{t===null&&n(cl.nextId())},[t]),t!=null?""+t:void 0};function Qn(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,Qn),r}function E_(e){return cl.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let aT=["[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 Ose=(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))(Ose||{}),Pse=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Pse||{}),Tse=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Tse||{}),rI=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(rI||{});function Dse(e,t=0){var n;return e===((n=E_(e))==null?void 0:n.body)?!1:Qn(t,{0(){return e.matches(aT)},1(){let r=e;for(;r!==null;){if(r.matches(aT))return!0;r=r.parentElement}return!1}})}var Ase=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ase||{});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 $se(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 kse(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Mse(){return/Android/gi.test(window.navigator.userAgent)}function oI(){return kse()||Mse()}function Dp(e,t,n){let r=wi(t);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function Ise(e,t,n){let r=wi(t);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function Nse(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!Dse(l,rI.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let i=m.useRef(null);Dp("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),Dp("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),Dp("click",s=>{oI()||i.current&&(o(s,()=>i.current),i.current=null)},!0),Dp("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),Ise("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Lse(...e){return m.useMemo(()=>E_(...e),[...e])}function lT(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 Fse(e,t){let[n,r]=m.useState(()=>lT(e));return Fn(()=>{r(lT(e))},[e.type,e.as]),Fn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let jse=Symbol();function Pl(...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[jse]))?void 0:n}function cT(e){return[e.screenX,e.screenY]}function zse(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=cT(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=cT(t)}}}function Bse({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]),Fn(()=>{if(!e||!r)return;let s=E_(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 uT(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 Hg(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Wg=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Wg||{}),ta=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ta||{});function fs({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??Vse;let l=iI(t,e);if(i)return Ap(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...f}=l;if(u)return Ap(f,n,r,s,a)}if(c&1){let{unmount:u=!0,...f}=l;return Qn(u?0:1,{0(){return null},1(){return Ap({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Ap(l,n,r,s,a)}function Ap(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Iy(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 h=!1,g=[];for(let[v,b]of Object.entries(t))typeof b=="boolean"&&(h=!0),b===!0&&g.push(v);h&&(f["data-headlessui-state"]=g.join(" "))}if(i===m.Fragment&&Object.keys(Hx(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(b=>` - ${b}`).join(`
395
- `),"","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(b=>` - ${b}`).join(`
396
- `)].join(`
397
- `));let h=u.props,g=typeof(h==null?void 0:h.className)=="function"?(...b)=>Hg(h==null?void 0:h.className(...b),l.className):Hg(h==null?void 0:h.className,l.className),v=g?{className:g}:{};return m.cloneElement(u,Object.assign({},iI(u.props,Hx(Iy(l,["ref"]))),f,c,{ref:o(u.ref,c.ref)},v))}return m.createElement(i,Object.assign({},Iy(l,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&f),u)}function Vse(...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 iI(...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 Di(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Hx(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Iy(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Hse="div";var sI=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(sI||{});function Wse(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 fs({ourProps:i,theirProps:o,slot:{},defaultTag:Hse,name:"Hidden"})}let Use=Di(Wse),R_=m.createContext(null);R_.displayName="OpenClosedContext";var ro=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ro||{});function O_(){return m.useContext(R_)}function aI({value:e,children:t}){return m.createElement(R_.Provider,{value:e},t)}function qse(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Ha=[];qse(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Ha[0]!==t.target&&(Ha.unshift(t.target),Ha=Ha.filter(n=>n!=null&&n.isConnected),Ha.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 Gse(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&&Yse(n)?!1:r}function Yse(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function Kse(e){throw new Error("Unexpected object: "+e)}var Nn=(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))(Nn||{});function dT(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:Kse(e)}}function lI(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))uI(n,cI(t,r),o);return n}function cI(e,t){return e?e+"["+t+"]":t}function uI(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())uI(e,cI(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,""]):lI(n,t,e)}var Jr=(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))(Jr||{}),Xse=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Xse||{}),Qse=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Qse||{}),Jse=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Jse||{}),Zse=(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))(Zse||{});function Ny(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):$se(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let eae={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===Nn.Specific?t.idx:dT(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var h,g;return(g=(h=e.activeOptionIndex)!=null?h:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?g: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=Ny(e);if(a.activeOptionIndex===null){let u=a.options.findIndex(f=>!f.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=t.focus===Nn.Specific?t.idx:dT(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=Ny(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=Ny(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})}}},P_=m.createContext(null);P_.displayName="ComboboxActionsContext";function Qf(e){let t=m.useContext(P_);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Qf),n}return t}let dI=m.createContext(null);function tae(e){var t;let n=Tl("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=xse({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 Fn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(dI.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 T_=m.createContext(null);T_.displayName="ComboboxDataContext";function Tl(e){let t=m.useContext(T_);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Tl),n}return t}function nae(e,t){return Qn(t.type,eae,e,t)}let rae=m.Fragment;function oae(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:h=!1,virtual:g=null,...v}=e,b=!1,w=null,[x=f?[]:void 0,_]=Cse(n,o,r),[S,C]=m.useReducer(nae,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=m.useRef(!1),P=m.useRef({static:!1,hold:!1}),A=m.useRef(null),k=m.useRef(null),I=m.useRef(null),$=m.useRef(null),L=Et(typeof a=="string"?(ne,le)=>{let ye=a;return(ne==null?void 0:ne[ye])===(le==null?void 0:le[ye])}:a??((ne,le)=>ne===le)),j=Et(ne=>S.options.findIndex(le=>L(le.dataRef.current.value,ne))),Q=m.useCallback(ne=>Qn(B.mode,{1:()=>x.some(le=>L(le,ne)),0:()=>L(x,ne)}),[x]),ee=Et(ne=>S.activeOptionIndex===j(ne)),B=m.useMemo(()=>({...S,immediate:b,optionsPropsRef:P,labelRef:A,inputRef:k,buttonRef:I,optionsRef:$,value:x,defaultValue:r,disabled:l,mode:f?1:0,virtual:S.virtual,get activeOptionIndex(){if(E.current&&S.activeOptionIndex===null&&S.options.length>0){let ne=S.options.findIndex(le=>!le.dataRef.current.disabled);if(ne!==-1)return ne}return S.activeOptionIndex},calculateIndex:j,compare:L,isSelected:Q,isActive:ee,nullable:u,__demoMode:c}),[x,r,l,f,u,c,S,w]);Fn(()=>{},[w,void 0]),Fn(()=>{S.dataRef.current=B},[B]),Nse([B.buttonRef,B.inputRef,B.optionsRef],()=>fe.closeCombobox(),B.comboboxState===0);let Z=m.useMemo(()=>{var ne,le,ye;return{open:B.comboboxState===0,disabled:l,activeIndex:B.activeOptionIndex,activeOption:B.activeOptionIndex===null?null:B.virtual?B.virtual.options[(ne=B.activeOptionIndex)!=null?ne:0]:(ye=(le=B.options[B.activeOptionIndex])==null?void 0:le.dataRef.current.value)!=null?ye:null,value:x}},[B,l,x]),G=Et(()=>{if(B.activeOptionIndex!==null){if(B.virtual)N(B.virtual.options[B.activeOptionIndex]);else{let{dataRef:ne}=B.options[B.activeOptionIndex];N(ne.current.value)}fe.goToOption(Nn.Specific,B.activeOptionIndex)}}),q=Et(()=>{C({type:0}),E.current=!0}),K=Et(()=>{C({type:1}),E.current=!1}),T=Et((ne,le,ye)=>(E.current=!1,ne===Nn.Specific?C({type:2,focus:Nn.Specific,idx:le,trigger:ye}):C({type:2,focus:ne,trigger:ye}))),V=Et((ne,le)=>(C({type:3,payload:{id:ne,dataRef:le}}),()=>{B.isActive(le.current.value)&&(E.current=!0),C({type:4,id:ne})})),X=Et(ne=>(C({type:5,id:ne}),()=>C({type:5,id:null}))),N=Et(ne=>Qn(B.mode,{0(){return _==null?void 0:_(ne)},1(){let le=B.value.slice(),ye=le.findIndex(Y=>L(Y,ne));return ye===-1?le.push(ne):le.splice(ye,1),_==null?void 0:_(le)}})),ie=Et(ne=>{C({type:6,trigger:ne})}),fe=m.useMemo(()=>({onChange:N,registerOption:V,registerLabel:X,goToOption:T,closeCombobox:K,openCombobox:q,setActivationTrigger:ie,selectActiveOption:G}),[]),ue=t===null?{}:{ref:t},pe=m.useRef(null),se=Kf();return m.useEffect(()=>{pe.current&&r!==void 0&&se.addEventListener(pe.current,"reset",()=>{_==null||_(r)})},[pe,_]),m.createElement(P_.Provider,{value:fe},m.createElement(T_.Provider,{value:B},m.createElement(aI,{value:Qn(B.comboboxState,{0:ro.Open,1:ro.Closed})},s!=null&&x!=null&&lI({[s]:x}).map(([ne,le],ye)=>m.createElement(Use,{features:sI.Hidden,ref:ye===0?Y=>{var be;pe.current=(be=Y==null?void 0:Y.closest("form"))!=null?be:null}:void 0,...Hx({key:ne,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:ne,value:le})})),fs({ourProps:ue,theirProps:v,slot:Z,defaultTag:rae,name:"Combobox"}))))}let iae="input";function sae(e,t){var n,r,o,i,s;let a=Xf(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:f="text",...h}=e,g=Tl("Combobox.Input"),v=Qf("Combobox.Input"),b=Pl(g.inputRef,t),w=Lse(g.inputRef),x=m.useRef(!1),_=Kf(),S=Et(()=>{v.onChange(null),g.optionsRef.current&&(g.optionsRef.current.scrollTop=0),v.goToOption(Nn.Nothing)}),C=function(){var B;return typeof u=="function"&&g.value!==void 0?(B=u(g.value))!=null?B:"":typeof g.value=="string"?g.value:""}();uT(([B,Z],[G,q])=>{if(x.current)return;let K=g.inputRef.current;K&&((q===0&&Z===1||B!==G)&&(K.value=B),requestAnimationFrame(()=>{if(x.current||!K||(w==null?void 0:w.activeElement)!==K)return;let{selectionStart:T,selectionEnd:V}=K;Math.abs((V??0)-(T??0))===0&&T===0&&K.setSelectionRange(K.value.length,K.value.length)}))},[C,g.comboboxState,w]),uT(([B],[Z])=>{if(B===0&&Z===1){if(x.current)return;let G=g.inputRef.current;if(!G)return;let q=G.value,{selectionStart:K,selectionEnd:T,selectionDirection:V}=G;G.value="",G.value=q,V!==null?G.setSelectionRange(K,T,V):G.setSelectionRange(K,T)}},[g.comboboxState]);let E=m.useRef(!1),P=Et(()=>{E.current=!0}),A=Et(()=>{_.nextFrame(()=>{E.current=!1})}),k=Et(B=>{switch(x.current=!0,B.key){case Jr.Enter:if(x.current=!1,g.comboboxState!==0||E.current)return;if(B.preventDefault(),B.stopPropagation(),g.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),g.mode===0&&v.closeCombobox();break;case Jr.ArrowDown:return x.current=!1,B.preventDefault(),B.stopPropagation(),Qn(g.comboboxState,{0:()=>v.goToOption(Nn.Next),1:()=>v.openCombobox()});case Jr.ArrowUp:return x.current=!1,B.preventDefault(),B.stopPropagation(),Qn(g.comboboxState,{0:()=>v.goToOption(Nn.Previous),1:()=>{v.openCombobox(),_.nextFrame(()=>{g.value||v.goToOption(Nn.Last)})}});case Jr.Home:if(B.shiftKey)break;return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.First);case Jr.PageUp:return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.First);case Jr.End:if(B.shiftKey)break;return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.Last);case Jr.PageDown:return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.Last);case Jr.Escape:return x.current=!1,g.comboboxState!==0?void 0:(B.preventDefault(),g.optionsRef.current&&!g.optionsPropsRef.current.static&&B.stopPropagation(),g.nullable&&g.mode===0&&g.value===null&&S(),v.closeCombobox());case Jr.Tab:if(x.current=!1,g.comboboxState!==0)return;g.mode===0&&g.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),I=Et(B=>{c==null||c(B),g.nullable&&g.mode===0&&B.target.value===""&&S(),v.openCombobox()}),$=Et(B=>{var Z,G,q;let K=(Z=B.relatedTarget)!=null?Z:Ha.find(T=>T!==B.currentTarget);if(x.current=!1,!((G=g.optionsRef.current)!=null&&G.contains(K))&&!((q=g.buttonRef.current)!=null&&q.contains(K))&&g.comboboxState===0)return B.preventDefault(),g.mode===0&&(g.nullable&&g.value===null?S():g.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),L=Et(B=>{var Z,G,q;let K=(Z=B.relatedTarget)!=null?Z:Ha.find(T=>T!==B.currentTarget);(G=g.buttonRef.current)!=null&&G.contains(K)||(q=g.optionsRef.current)!=null&&q.contains(K)||g.disabled||g.immediate&&g.comboboxState!==0&&(v.openCombobox(),_.nextFrame(()=>{v.setActivationTrigger(1)}))}),j=S_(()=>{if(g.labelId)return[g.labelId].join(" ")},[g.labelId]),Q=m.useMemo(()=>({open:g.comboboxState===0,disabled:g.disabled}),[g]),ee={ref:b,id:l,role:"combobox",type:f,"aria-controls":(n=g.optionsRef.current)==null?void 0:n.id,"aria-expanded":g.comboboxState===0,"aria-activedescendant":g.activeOptionIndex===null?void 0:g.virtual?(r=g.options.find(B=>{var Z;return!((Z=g.virtual)!=null&&Z.disabled(B.dataRef.current.value))&&g.compare(B.dataRef.current.value,g.virtual.options[g.activeOptionIndex])}))==null?void 0:r.id:(o=g.options[g.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":j,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:g.defaultValue!==void 0?u==null?void 0:u(g.defaultValue):null)!=null?s:g.defaultValue,disabled:g.disabled,onCompositionStart:P,onCompositionEnd:A,onKeyDown:k,onChange:I,onFocus:L,onBlur:$};return fs({ourProps:ee,theirProps:h,slot:Q,defaultTag:iae,name:"Combobox.Input"})}let aae="button";function lae(e,t){var n;let r=Tl("Combobox.Button"),o=Qf("Combobox.Button"),i=Pl(r.buttonRef,t),s=Xf(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=Kf(),u=Et(b=>{switch(b.key){case Jr.ArrowDown:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&o.openCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case Jr.ArrowUp:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),c.nextFrame(()=>{r.value||o.goToOption(Nn.Last)})),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case Jr.Escape:return r.comboboxState!==0?void 0:(b.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&b.stopPropagation(),o.closeCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})}));default:return}}),f=Et(b=>{if(Gse(b.currentTarget))return b.preventDefault();r.comboboxState===0?o.closeCombobox():(b.preventDefault(),o.openCombobox()),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})})}),h=S_(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),g=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:i,id:a,type:Fse(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":h,disabled:r.disabled,onClick:f,onKeyDown:u};return fs({ourProps:v,theirProps:l,slot:g,defaultTag:aae,name:"Combobox.Button"})}let cae="label";function uae(e,t){let n=Xf(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Tl("Combobox.Label"),s=Qf("Combobox.Label"),a=Pl(i.labelRef,t);Fn(()=>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 fs({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:c,defaultTag:cae,name:"Combobox.Label"})}let dae="ul",fae=Wg.RenderStrategy|Wg.Static;function hae(e,t){let n=Xf(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=Tl("Combobox.Options"),a=Pl(s.optionsRef,t),l=O_(),c=l!==null?(l&ro.Open)===ro.Open:s.comboboxState===0;Fn(()=>{var g;s.optionsPropsRef.current.static=(g=e.static)!=null?g:!1},[s.optionsPropsRef,e.static]),Fn(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),Bse({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(g){return g.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:g.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(g){g.setAttribute("role","none")}});let u=S_(()=>{var g,v;return(v=s.labelId)!=null?v:(g=s.buttonRef.current)==null?void 0:g.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),h={"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(tae,null,i.children)}),fs({ourProps:h,theirProps:i,slot:f,defaultTag:dae,features:fae,visible:c,name:"Combobox.Options"})}let pae="li";function gae(e,t){var n;let r=Xf(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,c=Tl("Combobox.Option"),u=Qf("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,h=c.isSelected(s),g=m.useRef(null),v=wi({disabled:i,value:s,domRef:g,order:a}),b=m.useContext(dI),w=Pl(t,g,b?b.measureElement:null),x=Et(()=>u.onChange(s));Fn(()=>u.registerOption(o,v),[v,o]);let _=m.useRef(!(c.virtual||c.__demoMode));Fn(()=>{if(!c.virtual||!c.__demoMode)return;let $=yl();return $.requestAnimationFrame(()=>{_.current=!0}),$.dispose},[c.virtual,c.__demoMode]),Fn(()=>{if(!_.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let $=yl();return $.requestAnimationFrame(()=>{var L,j;(j=(L=g.current)==null?void 0:L.scrollIntoView)==null||j.call(L,{block:"nearest"})}),$.dispose},[g,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let S=Et($=>{var L;if(i||(L=c.virtual)!=null&&L.disabled(s))return $.preventDefault();x(),oI()||requestAnimationFrame(()=>{var j;return(j=c.inputRef.current)==null?void 0:j.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),C=Et(()=>{var $;if(i||($=c.virtual)!=null&&$.disabled(s))return u.goToOption(Nn.Nothing);let L=c.calculateIndex(s);u.goToOption(Nn.Specific,L)}),E=zse(),P=Et($=>E.update($)),A=Et($=>{var L;if(!E.wasMoved($)||i||(L=c.virtual)!=null&&L.disabled(s)||f)return;let j=c.calculateIndex(s);u.goToOption(Nn.Specific,j,0)}),k=Et($=>{var L;E.wasMoved($)&&(i||(L=c.virtual)!=null&&L.disabled(s)||f&&(c.optionsPropsRef.current.hold||u.goToOption(Nn.Nothing)))}),I=m.useMemo(()=>({active:f,selected:h,disabled:i}),[f,h,i]);return fs({ourProps:{id:o,ref:w,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:S,onFocus:C,onPointerEnter:P,onMouseEnter:P,onPointerMove:A,onMouseMove:A,onPointerLeave:k,onMouseLeave:k},theirProps:l,slot:I,defaultTag:pae,name:"Combobox.Option"})}let mae=Di(oae),vae=Di(lae),bae=Di(sae),yae=Di(uae),xae=Di(hae),wae=Di(gae),oc=Object.assign(mae,{Input:bae,Button:vae,Label:yae,Options:xae,Option:wae});function D_(){let e=m.useRef(!1);return Fn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function _ae(e=0){let[t,n]=m.useState(e),r=D_(),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 Sae(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 Fy(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Cae(e,t){let n=yl();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 Eae(e,t,n,r){let o=n?"enter":"leave",i=yl(),s=r!==void 0?Sae(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Qn(o,{enter:()=>t.enter,leave:()=>t.leave}),l=Qn(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Qn(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Fy(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(()=>{Fy(e,...t.base,...a,...c),Ly(e,...t.base,...a,...l),Cae(e,()=>(Fy(e,...t.base,...a),Ly(e,...t.base,...t.entered),s()))}),i.dispose}function Rae({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=D_(),a=Kf(),l=wi(n);Fn(()=>{e&&(l.current="enter")},[e]),Fn(()=>{let c=yl();a.add(c.dispose);let u=t.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),o.current(l.current),c.add(Eae(u,r.current,l.current==="enter",()=>{c.dispose(),i.current(l.current)})),c.dispose},[n])}function Ms(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Xm=m.createContext(null);Xm.displayName="TransitionContext";var Oae=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Oae||{});function Pae(){let e=m.useContext(Xm);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Tae(){let e=m.useContext(Qm);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Qm=m.createContext(null);Qm.displayName="NestingContext";function Jm(e){return"children"in e?Jm(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function fI(e,t){let n=wi(e),r=m.useRef([]),o=D_(),i=Kf(),s=Et((g,v=ta.Hidden)=>{let b=r.current.findIndex(({el:w})=>w===g);b!==-1&&(Qn(v,{[ta.Unmount](){r.current.splice(b,1)},[ta.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var w;!Jm(r)&&o.current&&((w=n.current)==null||w.call(n))}))}),a=Et(g=>{let v=r.current.find(({el:b})=>b===g);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:g,state:"visible"}),()=>s(g,ta.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),u=m.useRef({enter:[],leave:[],idle:[]}),f=Et((g,v,b)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([w])=>w!==g)),t==null||t.chains.current[v].push([g,new Promise(w=>{l.current.push(w)})]),t==null||t.chains.current[v].push([g,new Promise(w=>{Promise.all(u.current[v].map(([x,_])=>_)).then(()=>w())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(v)):b(v)}),h=Et((g,v,b)=>{Promise.all(u.current[v].splice(0).map(([w,x])=>x)).then(()=>{var w;(w=l.current.shift())==null||w()}).then(()=>b(v))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:h,wait:c,chains:u}),[a,s,r,f,h,u,c])}function Dae(){}let Aae=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function fT(e){var t;let n={};for(let r of Aae)n[r]=(t=e[r])!=null?t:Dae;return n}function $ae(e){let t=m.useRef(fT(e));return m.useEffect(()=>{t.current=fT(e)},[e]),t}let kae="div",hI=Wg.RenderStrategy;function Mae(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:f,leave:h,leaveFrom:g,leaveTo:v,...b}=e,w=m.useRef(null),x=Pl(w,t),_=(n=b.unmount)==null||n?ta.Unmount:ta.Hidden,{show:S,appear:C,initial:E}=Pae(),[P,A]=m.useState(S?"visible":"hidden"),k=Tae(),{register:I,unregister:$}=k;m.useEffect(()=>I(w),[I,w]),m.useEffect(()=>{if(_===ta.Hidden&&w.current){if(S&&P!=="visible"){A("visible");return}return Qn(P,{hidden:()=>$(w),visible:()=>I(w)})}},[P,w,I,$,S,_]);let L=wi({base:Ms(b.className),enter:Ms(l),enterFrom:Ms(c),enterTo:Ms(u),entered:Ms(f),leave:Ms(h),leaveFrom:Ms(g),leaveTo:Ms(v)}),j=$ae({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),Q=C_();m.useEffect(()=>{if(Q&&P==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,P,Q]);let ee=E&&!C,B=C&&S&&E,Z=!Q||ee?"idle":S?"enter":"leave",G=_ae(0),q=Et(ie=>Qn(ie,{enter:()=>{G.addFlag(ro.Opening),j.current.beforeEnter()},leave:()=>{G.addFlag(ro.Closing),j.current.beforeLeave()},idle:()=>{}})),K=Et(ie=>Qn(ie,{enter:()=>{G.removeFlag(ro.Opening),j.current.afterEnter()},leave:()=>{G.removeFlag(ro.Closing),j.current.afterLeave()},idle:()=>{}})),T=fI(()=>{A("hidden"),$(w)},k),V=m.useRef(!1);Rae({immediate:B,container:w,classes:L,direction:Z,onStart:wi(ie=>{V.current=!0,T.onStart(w,ie,q)}),onStop:wi(ie=>{V.current=!1,T.onStop(w,ie,K),ie==="leave"&&!Jm(T)&&(A("hidden"),$(w))})});let X=b,N={ref:x};return B?X={...X,className:Hg(b.className,...L.current.enter,...L.current.enterFrom)}:V.current&&(X.className=Hg(b.className,(r=w.current)==null?void 0:r.className),X.className===""&&delete X.className),m.createElement(Qm.Provider,{value:T},m.createElement(aI,{value:Qn(P,{visible:ro.Open,hidden:ro.Closed})|G.flags},fs({ourProps:N,theirProps:X,defaultTag:kae,features:hI,visible:P==="visible",name:"Transition.Child"})))}function Iae(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=Pl(s,t);C_();let l=O_();if(n===void 0&&l!==null&&(n=(l&ro.Open)===ro.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=fI(()=>{u("hidden")}),[h,g]=m.useState(!0),v=m.useRef([n]);Fn(()=>{h!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),g(!1))},[v,n]);let b=m.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);m.useEffect(()=>{if(n)u("visible");else if(!Jm(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},x=Et(()=>{var S;h&&g(!1),(S=e.beforeEnter)==null||S.call(e)}),_=Et(()=>{var S;h&&g(!1),(S=e.beforeLeave)==null||S.call(e)});return m.createElement(Qm.Provider,{value:f},m.createElement(Xm.Provider,{value:b},fs({ourProps:{...w,as:m.Fragment,children:m.createElement(pI,{ref:a,...w,...i,beforeEnter:x,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:hI,visible:c==="visible",name:"Transition"})))}function Nae(e,t){let n=m.useContext(Xm)!==null,r=O_()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Wx,{ref:t,...e}):m.createElement(pI,{ref:t,...e}))}let Wx=Di(Iae),pI=Di(Mae),Lae=Di(Nae),Fae=Object.assign(Wx,{Child:Lae,Root:Wx});function jae(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 zae(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 Pf.includes(e)?o:r}function Bae({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null),{authToken:l}=ma(),c=ke($=>$.filterValues),u=ke($=>$.selectedSheetId),f=ke($=>$.actions.addOrUpdateFilterValue),h=ke($=>$.actions.removeFilterValue),g=C(c),{data:v,isLoading:b,isFetching:w,isError:x,refetch:_}=Df({queryKey:["filter",e.id,e.sql,JSON.stringify(g)],queryFn:()=>Of("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:g}),enabled:!!e.sql&&!!e.connectionId}),S=m.useMemo(()=>{var $;return($=v==null?void 0:v.records)==null?void 0:$.map(L=>{let j=e.column.split(".").slice(-1)[0].replace(/"/g,"");return L[j]===void 0&&(j=j.toLowerCase()),{id:L[j],value:L[j]}})},[v,e.column]);m.useEffect(()=>{if(c){const $=c.find(L=>L.filterId===e.id);if(!$){n([]);return}if($.operation==="in"){const L=S==null?void 0:S.filter(j=>$.values.includes(j.value));L&&n(L)}else o(`${$.operation} ${$.values[0]}`)}},[v,u]),m.useEffect(()=>{if(c&&!c.find(L=>L.filterId===e.id)){n([]);return}},[c,e.id]);function C($){return $?$.filter(L=>{const Q=L.name.split(".");if(Q.slice(0,Q.length-1).join(".")===e.table&&L.name!==e.column)return!0}):[]}function E($){const L=jae($[0].toString());if(!(L!=null&&L.value)||!(L!=null&&L.operation))return;const j={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:hg(e),name:e.column,operation:L.operation,values:[Number(L.value)]};f(j)}function P($){if(Array.isArray($)||($=[$]),console.log("onComboBoxChange",$),$.length===1&&S.find(j=>j.value===$[0].value)===void 0){E($);return}if(n($),$.length===0){h(e.id);return}const L={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:hg(e),operation:e.operation,values:$.map(j=>j.value)};f(L)}function A(){var $;o(""),h(e.id),console.log(e.id),($=a.current)==null||$.click()}if(b)return O.jsx("div",{children:O.jsx(am,{className:"h-8 w-full bg-foreground/10"})});if(x)return O.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let k=[];Vc.includes(e.dataType)?k=S:k=i===""?S:S==null?void 0:S.filter($=>$.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,"")));const I=e.type==="single";return O.jsx("div",{className:"w-full",children:O.jsx(oc,{value:t,multiple:!I,onChange:P,children:O.jsxs("div",{className:"relative",children:[O.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:[O.jsx(oc.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:$=>$.map(j=>j.value).join(", ")||r,onChange:$=>{o($.target.value),s($.target.value)}}),O.jsx(oc.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:O.jsx(bX,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),O.jsx(Fae,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:O.jsxs(oc.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:[Vc.includes(e.dataType)&&O.jsxs(oc.Option,{value:r,className:"flex items-center justify-between gap-2 px-3 py-2",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("span",{className:"font-thin",children:"#"}),O.jsx("span",{children:r})]}),r&&O.jsx(xr,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:$=>{$.stopPropagation(),A()},children:"Clear"})]},"custom"),(k==null?void 0:k.length)===0&&i!==""?O.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):k==null?void 0:k.map($=>O.jsx(oc.Option,{className:({active:L})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${L?"bg-muted":"text-foreground-900"}`,value:$,children:({selected:L,active:j})=>O.jsxs("div",{className:"",children:[O.jsx("span",{className:`block ${L?"font-medium":"font-normal"}`,children:typeof $.value=="boolean"?$.value?"True":"False":$.value}),L?O.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:O.jsx(A$,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},$.value))]})})]})})})}const Vae=IR.WidthProvider(IR.Responsive);function Hae(){var P,A;const e=ke(k=>k.isDashboardEditing);ke(k=>k.currentBreakpoint);const t=ke(k=>k.themeStyle),n=ke(k=>k.selectedSheetId),r=(P=ke(k=>{var I,$;return($=(I=k.dashboard)==null?void 0:I.sheets)==null?void 0:$.filter(L=>L.id===n)}))==null?void 0:P[0].layouts,o=ke(k=>k.dashboard.filters),i=ke(k=>{var I,$,L;return(L=($=(I=k.dashboard)==null?void 0:I.sheets)==null?void 0:$.find(j=>j.id===n))==null?void 0:L.frames}),{getSelectedSheet:s,getSelectedSheetLayout:a,getSelectedSheetLayouts:l,setSheetLayout:c,setSheetLayouts:u,setCurrentBreakpoint:f,removeFilter:h,updateFilter:g,removeFilterValue:v}=ke(k=>k.actions),b=s(),w=m.useCallback(k=>{f(k)},[]),x=m.useCallback((k,I)=>{b!=null&&b.id&&u(b.id,I)},[b==null?void 0:b.id,u]);if(!n)return null;const _=(k,I)=>O.jsx(gI,{className:"after:content-none",ref:I,handleAxis:k}),S=k=>Pf.includes(k.dataType)?O.jsx(lse,{filter:k}):O.jsx(Bae,{filter:k});function C(){return o==null?void 0:o.map(k=>{var I,$,L,j;return O.jsxs("div",{style:{borderRadius:($=(I=t==null?void 0:t.chart)==null?void 0:I.options)==null?void 0:$.borderRadius,fontFamily:(j=(L=t==null?void 0:t.chart)==null?void 0:L.font)==null?void 0:j.family},className:Ce("z-50 flex w-full flex-col rounded-md border bg-background px-3 py-2"),children:[O.jsx(is,{className:"my-1",text:k.title||k.column,onSave:Q=>g({...k,title:Q}),children:O.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[O.jsxs("div",{className:"flex grow items-center gap-2",children:[O.jsx(Wn,{className:"inline-block text-sm",children:k.title}),e&&O.jsx(bre,{filter:k})]}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("div",{onClick:()=>v(k.id),className:"invisible cursor-pointer text-xs text-muted-foreground hover:text-foreground hover:underline group-hover:visible",children:O.jsx(eQ,{className:"size-3.5"})}),e&&O.jsx(iQ,{onClick:()=>{v(k.id),h(k.id)},className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})]})]})}),S(k)]},k.id)})}function E(){return i==null?void 0:i.map(k=>O.jsx("div",{role:"dashboard-frame-container",className:Ce("group overflow-hidden",t==null?void 0:t.dashboardCardContainer),children:O.jsx(Zne,{frame:k})},k.id))}return O.jsx(O.Fragment,{children:O.jsxs(Vae,{margin:[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],className:Ce((A=t==null?void 0:t.gridLayout)==null?void 0:A.className),layouts:r,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:w,onLayoutChange:x,resizeHandle:_,children:[C(),E()]})})}const gI=m.forwardRef(({className:e,handleAxis:t,...n},r)=>(ke(o=>o.themeStyle),O.jsx("div",{ref:r,className:Ce(`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})));gI.displayName="ResizeHandle";let Wae=(e,t=21)=>(n=t)=>{let r="",o=n;for(;o--;)r+=e[Math.random()*e.length|0];return r};var uu={exports:{}};const Uae=typeof Buffer<"u",hT=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,pT=/"(?: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 mI(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),Uae&&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(hT.test(e)===!1&&pT.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(hT.test(e)===!1)return r}else if(pT.test(e)===!1)return r;return vI(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function vI(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 A_(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return mI(e,t,n)}finally{Error.stackTraceLimit=r}}function qae(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return mI(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}uu.exports=A_;uu.exports.default=A_;uu.exports.parse=A_;uu.exports.safeParse=qae;uu.exports.scan=vI;var Gae=uu.exports;const gT=nu(Gae);var bI=Wae("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function Yae(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 Kae(e){if(e!=null)try{return gT.parse(e)}catch{try{const n=Yae(e);return gT.parse(n)}catch{}}}var Ud={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},qd={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}}},Gd={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},Yd={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Kd={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}}},Xd={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}}}},Qd={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}}},Jd={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}}},Zd={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}}},ef={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}}},tf={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}}},nf={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}}},rf={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}}},of={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}}},Xae=[Ud,qd,Gd,Yd,Kd,Xd,Qd,Jd,Zd,ef,tf,nf,rf,of],Qae={[Ud.code]:Ud,[qd.code]:qd,[Gd.code]:Gd,[Yd.code]:Yd,[Kd.code]:Kd,[Xd.code]:Xd,[Qd.code]:Qd,[Jd.code]:Jd,[Zd.code]:Zd,[ef.code]:ef,[tf.code]:tf,[nf.code]:nf,[rf.code]:rf,[of.code]:of};Ud.name+"",Ud.code,qd.name+"",qd.code,Gd.name+"",Gd.code,Yd.name+"",Yd.code,Kd.name+"",Kd.code,Xd.name+"",Xd.code,Qd.name+"",Qd.code,Jd.name+"",Jd.code,Zd.name+"",Zd.code,ef.name+"",ef.code,tf.name+"",tf.code,nf.name+"",nf.code,rf.name+"",rf.code,of.name+"",of.code;var Jae=Xae.map(e=>e.code),yI=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(!Jae.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 Qae[r].parse(i)},Zae=10;function ele(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*tle(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]!==Zae))continue;if(r.length===0)break;const s=ele(r,o);o=0;const a=n.decode(s,{stream:!0}).split(`
398
- `).filter(l=>l!=="").map(yI);for(const l of a)yield l;if(t!=null&&t()){e.cancel();break}}}function $p(e,t){return!e||!t||!t.length?e:{...e,annotations:[...t]}}async function nle({reader:e,abortControllerRef:t,update:n,onToolCall:r,onFinish:o,generateId:i=bI,getCurrentDate:s=()=>new Date}){var a;const l=s(),c={data:[]};let u;const f={};let h={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},g="unknown";for await(const{type:v,value:b}of tle(e,{isAborted:()=>(t==null?void 0:t.current)===null})){if(v==="text"&&(c.text?c.text={...c.text,content:(c.text.content||"")+b}:c.text={id:i(),role:"assistant",content:b,createdAt:l}),v==="finish_message"){const{completionTokens:C,promptTokens:E}=b.usage;g=b.finishReason,h={completionTokens:C,promptTokens:E,totalTokens:C+E}}if(v==="tool_call_streaming_start")c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),f[b.toolCallId]={text:"",toolName:b.toolName,prefixMapIndex:c.text.toolInvocations.length},c.text.toolInvocations.push({state:"partial-call",toolCallId:b.toolCallId,toolName:b.toolName,args:void 0});else if(v==="tool_call_delta"){const C=f[b.toolCallId];C.text+=b.argsTextDelta,c.text.toolInvocations[C.prefixMapIndex]={state:"partial-call",toolCallId:b.toolCallId,toolName:C.toolName,args:Kae(C.text)},c.text.internalUpdateId=i()}else if(v==="tool_call"){if(f[b.toolCallId]!=null?c.text.toolInvocations[f[b.toolCallId].prefixMapIndex]={state:"call",...b}:(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",...b})),c.text.internalUpdateId=i(),r){const C=await r({toolCall:b});C!=null&&(c.text.toolInvocations[c.text.toolInvocations.length-1]={state:"result",...b,result:C})}}else if(v==="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(P=>P.toolCallId===b.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",...b}}let w=null;v==="function_call"&&(c.function_call={id:i(),role:"assistant",content:"",function_call:b.function_call,name:b.function_call.name,createdAt:l},w=c.function_call);let x=null;v==="tool_calls"&&(c.tool_calls={id:i(),role:"assistant",content:"",tool_calls:b.tool_calls,createdAt:l},x=c.tool_calls),v==="data"&&c.data.push(...b);let _=c.text;v==="message_annotations"&&(u?u.push(...b):u=[...b],w=$p(c.function_call,u),x=$p(c.tool_calls,u),_=$p(c.text,u)),u!=null&&u.length&&["text","function_call","tool_calls"].forEach(E=>{c[E]&&(c[E].annotations=[...u])});const S=[w,x,_].filter(Boolean).map(C=>({...$p(C,u)}));n(S,[...c.data])}return o==null||o({prefixMap:c,finishReason:g,usage:h}),{messages:[c.text,c.function_call,c.tool_calls].filter(Boolean),data:c.data}}var rle=()=>fetch;async function ole({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:h=rle()}){var g,v;const b=await h(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(g=i==null?void 0:i())==null?void 0:g.signal,credentials:r}).catch(x=>{throw s(),x});if(a)try{await a(b)}catch(x){throw x}if(!b.ok)throw s(),new Error((v=await b.text())!=null?v:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");const w=b.body.getReader();switch(n){case"text":{const x=ile(),_={id:f(),createdAt:new Date,role:"assistant",content:""};for(;;){const{done:S,value:C}=await w.read();if(S)break;if(_.content+=x(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 nle({reader:w,abortControllerRef:i!=null?{current:i()}:void 0,update:l,onToolCall:u,onFinish({prefixMap:x,finishReason:_,usage:S}){c&&x.text!=null&&c(x.text,{usage:S,finishReason:_})},generateId:f});default:{const x=n;throw new Error(`Unknown stream protocol: ${x}`)}}}function ile(e){const t=new TextDecoder;return e?function(n){return t.decode(n,{stream:!0}).split(`
399
- `).filter(o=>o!=="").map(yI).filter(Boolean)}:function(n){return n?t.decode(n,{stream:!0}):""}}async function sle({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 ale=vw();const na=()=>{},kr=na(),jy=Object,Ft=e=>e===kr,mi=e=>typeof e=="function",ha=(e,t)=>({...e,...t}),lle=e=>mi(e.then),kp=new WeakMap;let cle=0;const sf=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(jy(e)===e&&!r&&n!=RegExp){if(o=kp.get(e),o)return o;if(o=++cle+"~",kp.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=sf(e[i])+",";kp.set(e,o)}if(n==jy){o="#";const s=jy.keys(e).sort();for(;!Ft(i=s.pop());)Ft(e[i])||(o+=i+":"+sf(e[i])+",");kp.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Zi=new WeakMap,zy={},Mp={},$_="undefined",Zm=typeof window!=$_,Ux=typeof document!=$_,ule=()=>Zm&&typeof window.requestAnimationFrame!=$_,xI=(e,t)=>{const n=Zi.get(e);return[()=>!Ft(t)&&e.get(t)||zy,r=>{if(!Ft(t)){const o=e.get(t);t in Mp||(Mp[t]=o),n[5](t,ha(o,r),o||zy)}},n[6],()=>!Ft(t)&&t in Mp?Mp[t]:!Ft(t)&&e.get(t)||zy]};let qx=!0;const dle=()=>qx,[Gx,Yx]=Zm&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[na,na],fle=()=>{const e=Ux&&document.visibilityState;return Ft(e)||e!=="hidden"},hle=e=>(Ux&&document.addEventListener("visibilitychange",e),Gx("focus",e),()=>{Ux&&document.removeEventListener("visibilitychange",e),Yx("focus",e)}),ple=e=>{const t=()=>{qx=!0,e()},n=()=>{qx=!1};return Gx("online",t),Gx("offline",n),()=>{Yx("online",t),Yx("offline",n)}},gle={isOnline:dle,isVisible:fle},mle={initFocus:hle,initReconnect:ple},mT=!m.useId,af=!Zm||"Deno"in window,vle=e=>ule()?window.requestAnimationFrame(e):setTimeout(e,1),By=af?m.useEffect:m.useLayoutEffect,Vy=typeof navigator<"u"&&navigator.connection,vT=!af&&Vy&&(["slow-2g","2g"].includes(Vy.effectiveType)||Vy.saveData),k_=e=>{if(mi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?sf(e):"",[e,t]};let ble=0;const Kx=()=>++ble,wI=0,_I=1,SI=2,yle=3;var Ju={__proto__:null,ERROR_REVALIDATE_EVENT:yle,FOCUS_EVENT:wI,MUTATE_EVENT:SI,RECONNECT_EVENT:_I};async function CI(...e){const[t,n,r,o]=e,i=ha({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=h=>typeof a=="function"?a(h):a!==!1,u=i.throwOnError;if(mi(n)){const h=n,g=[],v=t.keys();for(const b of v)!/^\$(inf|sub)\$/.test(b)&&h(t.get(b)._k)&&g.push(b);return Promise.all(g.map(f))}return f(n);async function f(h){const[g]=k_(h);if(!g)return;const[v,b]=xI(t,g),[w,x,_,S]=Zi.get(t),C=()=>{const Q=w[g];return(mi(i.revalidate)?i.revalidate(v().data,h):i.revalidate!==!1)&&(delete _[g],delete S[g],Q&&Q[0])?Q[0](SI).then(()=>v().data):v().data};if(e.length<3)return C();let E=r,P;const A=Kx();x[g]=[A,0];const k=!Ft(l),I=v(),$=I.data,L=I._c,j=Ft(L)?$:L;if(k&&(l=mi(l)?l(j,$):l,b({data:l,_c:j})),mi(E))try{E=E(j)}catch(Q){P=Q}if(E&&lle(E))if(E=await E.catch(Q=>{P=Q}),A!==x[g][0]){if(P)throw P;return E}else P&&k&&c(P)&&(s=!0,b({data:j,_c:kr}));if(s&&!P)if(mi(s)){const Q=s(E,j);b({data:Q,error:kr,_c:kr})}else b({data:E,error:kr,_c:kr});if(x[g][1]=Kx(),Promise.resolve(C()).then(()=>{b({_c:kr})}),P){if(u)throw P;return}return E}}const bT=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},xle=(e,t)=>{if(!Zi.has(e)){const n=ha(mle,t),r={},o=CI.bind(kr,e);let i=na;const s={},a=(u,f)=>{const h=s[u]||[];return s[u]=h,h.push(f),()=>h.splice(h.indexOf(f),1)},l=(u,f,h)=>{e.set(u,f);const g=s[u];if(g)for(const v of g)v(f,h)},c=()=>{if(!Zi.has(e)&&(Zi.set(e,[r,{},{},{},o,l,a]),!af)){const u=n.initFocus(setTimeout.bind(kr,bT.bind(kr,r,wI))),f=n.initReconnect(setTimeout.bind(kr,bT.bind(kr,r,_I)));i=()=>{u&&u(),f&&f(),Zi.delete(e)}}};return c(),[e,o,c,i]}return[e,Zi.get(e)[4]]},wle=(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)},_le=(e,t)=>sf(e)==sf(t),[EI,Sle]=xle(new Map),Cle=ha({onLoadingSlow:na,onSuccess:na,onError:na,onErrorRetry:wle,onDiscarded:na,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:vT?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:vT?5e3:3e3,compare:_le,isPaused:()=>!1,cache:EI,mutate:Sle,fallback:{}},gle),Ele=(e,t)=>{const n=ha(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=ha(o,s))}return n},Rle=m.createContext({}),Ole="$inf$",RI=Zm&&window.__SWR_DEVTOOLS_USE__,Ple=RI?window.__SWR_DEVTOOLS_USE__:[],Tle=()=>{RI&&(window.__SWR_DEVTOOLS_REACT__=m)},Dle=e=>mi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Ale=()=>ha(Cle,m.useContext(Rle)),$le=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=k_(t),[,,,a]=Zi.get(EI);if(s.startsWith(Ole))return n(...i);const l=a[s];return Ft(l)?n(...i):(delete a[s],l)}),r),kle=Ple.concat($le),Mle=e=>function(...n){const r=Ale(),[o,i,s]=Dle(n),a=Ele(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(kle);for(let f=u.length;f--;)l=u[f](l);return l(o,i||a.fetcher||null,a)},Ile=(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())}};Tle();const yT=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)}),Hy={dedupe:!0},Nle=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:f,keepPreviousData:h}=n,[g,v,b,w]=Zi.get(r),[x,_]=k_(e),S=m.useRef(!1),C=m.useRef(!1),E=m.useRef(x),P=m.useRef(t),A=m.useRef(n),k=()=>A.current,I=()=>k().isVisible()&&k().isOnline(),[$,L,j,Q]=xI(r,x),ee=m.useRef({}).current,B=Ft(s)?n.fallback[x]:s,Z=(Y,be)=>{for(const _e in ee){const Pe=_e;if(Pe==="data"){if(!o(Y[Pe],be[Pe])&&(!Ft(Y[Pe])||!o(fe,be[Pe])))return!1}else if(be[Pe]!==Y[Pe])return!1}return!0},G=m.useMemo(()=>{const Y=!x||!t?!1:Ft(a)?k().isPaused()||i?!1:Ft(l)?!0:l:a,be=Ie=>{const Ke=ha(Ie);return delete Ke._k,Y?{isValidating:!0,isLoading:!0,...Ke}:Ke},_e=$(),Pe=Q(),Te=be(_e),Ue=_e===Pe?Te:be(Pe);let Be=Te;return[()=>{const Ie=be($());return Z(Ie,Be)?(Be.data=Ie.data,Be.isLoading=Ie.isLoading,Be.isValidating=Ie.isValidating,Be.error=Ie.error,Be):(Be=Ie,Ie)},()=>Ue]},[r,x]),q=ale.useSyncExternalStore(m.useCallback(Y=>j(x,(be,_e)=>{Z(_e,be)||Y()}),[r,x]),G[0],G[1]),K=!S.current,T=g[x]&&g[x].length>0,V=q.data,X=Ft(V)?B:V,N=q.error,ie=m.useRef(X),fe=h?Ft(V)?ie.current:V:X,ue=T&&!Ft(N)?!1:K&&!Ft(a)?a:k().isPaused()?!1:i?Ft(X)?!1:l:Ft(X)||l,pe=!!(x&&t&&K&&ue),se=Ft(q.isValidating)?pe:q.isValidating,ne=Ft(q.isLoading)?pe:q.isLoading,le=m.useCallback(async Y=>{const be=P.current;if(!x||!be||C.current||k().isPaused())return!1;let _e,Pe,Te=!0;const Ue=Y||{},Be=!b[x]||!Ue.dedupe,Ie=()=>mT?!C.current&&x===E.current&&S.current:x===E.current,Ke={isValidating:!1,isLoading:!1},lt=()=>{L(Ke)},It=()=>{const Ht=b[x];Ht&&Ht[1]===Pe&&delete b[x]},At={isValidating:!0};Ft($().data)&&(At.isLoading=!0);try{if(Be&&(L(At),n.loadingTimeout&&Ft($().data)&&setTimeout(()=>{Te&&Ie()&&k().onLoadingSlow(x,n)},n.loadingTimeout),b[x]=[be(_),Kx()]),[_e,Pe]=b[x],_e=await _e,Be&&setTimeout(It,n.dedupingInterval),!b[x]||b[x][1]!==Pe)return Be&&Ie()&&k().onDiscarded(x),!1;Ke.error=kr;const Ht=v[x];if(!Ft(Ht)&&(Pe<=Ht[0]||Pe<=Ht[1]||Ht[1]===0))return lt(),Be&&Ie()&&k().onDiscarded(x),!1;const de=$().data;Ke.data=o(de,_e)?de:_e,Be&&Ie()&&k().onSuccess(_e,x,n)}catch(Ht){It();const de=k(),{shouldRetryOnError:Ee}=de;de.isPaused()||(Ke.error=Ht,Be&&Ie()&&(de.onError(Ht,x,de),(Ee===!0||mi(Ee)&&Ee(Ht))&&(!k().revalidateOnFocus||!k().revalidateOnReconnect||I())&&de.onErrorRetry(Ht,x,de,Le=>{const Ge=g[x];Ge&&Ge[0]&&Ge[0](Ju.ERROR_REVALIDATE_EVENT,Le)},{retryCount:(Ue.retryCount||0)+1,dedupe:!0})))}return Te=!1,lt(),!0},[x,r]),ye=m.useCallback((...Y)=>CI(r,E.current,...Y),[]);if(By(()=>{P.current=t,A.current=n,Ft(V)||(ie.current=V)}),By(()=>{if(!x)return;const Y=le.bind(kr,Hy);let be=0;const Pe=Ile(x,g,(Te,Ue={})=>{if(Te==Ju.FOCUS_EVENT){const Be=Date.now();k().revalidateOnFocus&&Be>be&&I()&&(be=Be+k().focusThrottleInterval,Y())}else if(Te==Ju.RECONNECT_EVENT)k().revalidateOnReconnect&&I()&&Y();else{if(Te==Ju.MUTATE_EVENT)return le();if(Te==Ju.ERROR_REVALIDATE_EVENT)return le(Ue)}});return C.current=!1,E.current=x,S.current=!0,L({_k:_}),ue&&(Ft(X)||af?Y():vle(Y)),()=>{C.current=!0,Pe()}},[x]),By(()=>{let Y;function be(){const Pe=mi(c)?c($().data):c;Pe&&Y!==-1&&(Y=setTimeout(_e,Pe))}function _e(){!$().error&&(u||k().isVisible())&&(f||k().isOnline())?le(Hy).then(be):be()}return be(),()=>{Y&&(clearTimeout(Y),Y=-1)}},[c,u,f,x]),m.useDebugValue(fe),i&&Ft(X)&&x){if(!mT&&af)throw new Error("Fallback data is required when using suspense in SSR.");P.current=t,A.current=n,C.current=!1;const Y=w[x];if(!Ft(Y)){const be=ye(Y);yT(be)}if(Ft(N)){const be=le(Hy);Ft(fe)||(be.status="fulfilled",be.value=!0),yT(be)}else throw N}return{mutate:ye,get data(){return ee.data=!0,fe},get error(){return ee.error=!0,N},get isValidating(){return ee.isValidating=!0,se},get isLoading(){return ee.isLoading=!0,ne}}},Ip=Mle(Nle);var Lle=async(e,t,n,r,o,i,s,a,l,c,u,f,h,g,v,b,w)=>{var x;const _=s.current;n(t.messages,!1);const S=g?t.messages:t.messages.map(({role:C,content:E,experimental_attachments:P,name:A,data:k,annotations:I,toolInvocations:$,function_call:L,tool_calls:j,tool_call_id:Q})=>({role:C,content:E,...P!==void 0&&{experimental_attachments:P},...A!==void 0&&{name:A},...k!==void 0&&{data:k},...I!==void 0&&{annotations:I},...$!==void 0&&{toolInvocations:$},tool_call_id:Q,...L!==void 0&&{function_call:L},...j!==void 0&&{tool_calls:j}}));return await ole({api:e,body:(x=v==null?void 0:v({messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?x:{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:h,onFinish:u,generateId:l,fetch:b})};function Fle({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:h,streamProtocol:g,onResponse:v,onFinish:b,onError:w,credentials:x,headers:_,body:S,generateId:C=bI,fetch:E,keepLastMessageOnError:P=!1}={}){h&&(g??(g=h==="text"?"text":void 0));const A=m.useId(),k=t??A,I=typeof e=="string"?[e,k]:k,[$]=m.useState([]),{data:L,mutate:j}=Ip([I,"messages"],null,{fallbackData:n??$}),{data:Q=!1,mutate:ee}=Ip([I,"loading"],null),{data:B,mutate:Z}=Ip([I,"streamData"],null),{data:G=void 0,mutate:q}=Ip([I,"error"],null),K=m.useRef(L||[]);m.useEffect(()=>{K.current=L||[]},[L]);const T=m.useRef(null),V=m.useRef({credentials:x,headers:_,body:S});m.useEffect(()=>{V.current={credentials:x,headers:_,body:S}},[x,_,S]);const X=m.useCallback(async Y=>{const be=K.current.length;try{ee(!0),q(void 0);const Te=new AbortController;T.current=Te,await sle({getStreamedResponse:()=>Lle(e,Y,j,Z,B,V,K,T,C,g,b,v,a,o,l,E,P),experimental_onFunctionCall:i,experimental_onToolCall:s,updateChatRequest:Ue=>{Y=Ue},getCurrentMessages:()=>K.current}),T.current=null}catch(Te){if(Te.name==="AbortError")return T.current=null,null;w&&Te instanceof Error&&w(Te),q(Te)}finally{ee(!1)}const _e=K.current,Pe=_e[_e.length-1];_e.length>be&&Pe!=null&&f>0&&xT(Pe)&&jle(_e)<=f&&await X({messages:_e})},[j,ee,e,V,v,b,w,q,Z,B,g,o,i,s,l,a,f,K,T,C,E,P]),N=m.useCallback(async(Y,{options:be,functions:_e,function_call:Pe,tools:Te,tool_choice:Ue,data:Be,headers:Ie,body:Ke}={})=>{Y.id||(Y.id=C());const lt={headers:Ie??(be==null?void 0:be.headers),body:Ke??(be==null?void 0:be.body)},It={messages:K.current.concat(Y),options:lt,headers:lt.headers,body:lt.body,data:Be,..._e!==void 0&&{functions:_e},...Pe!==void 0&&{function_call:Pe},...Te!==void 0&&{tools:Te},...Ue!==void 0&&{tool_choice:Ue}};return X(It)},[X,C]),ie=m.useCallback(async({options:Y,functions:be,function_call:_e,tools:Pe,tool_choice:Te,data:Ue,headers:Be,body:Ie}={})=>{if(K.current.length===0)return null;const Ke={headers:Be??(Y==null?void 0:Y.headers),body:Ie??(Y==null?void 0:Y.body)};if(K.current[K.current.length-1].role==="assistant"){const At={messages:K.current.slice(0,-1),options:Ke,headers:Ke.headers,body:Ke.body,data:Ue,...be!==void 0&&{functions:be},..._e!==void 0&&{function_call:_e},...Pe!==void 0&&{tools:Pe},...Te!==void 0&&{tool_choice:Te}};return X(At)}const It={messages:K.current,options:Ke,headers:Ke.headers,body:Ke.body,data:Ue,...be!==void 0&&{functions:be},..._e!==void 0&&{function_call:_e},...Pe!==void 0&&{tools:Pe},...Te!==void 0&&{tool_choice:Te}};return X(It)},[X]),fe=m.useCallback(()=>{T.current&&(T.current.abort(),T.current=null)},[]),ue=m.useCallback(Y=>{typeof Y=="function"&&(Y=Y(K.current)),j(Y,!1),K.current=Y},[j]),[pe,se]=m.useState(r),ne=m.useCallback(async(Y,be={},_e)=>{var Pe,Te,Ue,Be,Ie;if((Pe=Y==null?void 0:Y.preventDefault)==null||Pe.call(Y),!pe&&!be.allowEmptySubmit)return;_e&&(V.current={...V.current,..._e});const Ke=[],lt=be.experimental_attachments;if(lt)if(lt instanceof FileList)for(const de of Array.from(lt)){const{name:Ee,type:Le}=de,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(de)});Ke.push({name:Ee,contentType:Le,url:Ge})}else if(Array.isArray(lt))for(const de of lt){const{name:Ee,url:Le,contentType:Ge}=de;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:!pe&&be.allowEmptySubmit?K.current:K.current.concat({id:C(),createdAt:new Date,role:"user",content:pe,experimental_attachments:Ke.length>0?Ke:void 0}),options:It,headers:It.headers,body:It.body,data:be.data};X(Ht),se("")},[pe,C,X]),le=Y=>{se(Y.target.value)},ye=({toolCallId:Y,result:be})=>{const _e=K.current.map((Te,Ue,Be)=>Ue===Be.length-1&&Te.role==="assistant"&&Te.toolInvocations?{...Te,toolInvocations:Te.toolInvocations.map(Ie=>Ie.toolCallId===Y?{...Ie,result:be}:Ie)}:Te);j(_e,!1);const Pe=_e[_e.length-1];xT(Pe)&&X({messages:_e})};return{messages:L||[],error:G,append:N,reload:ie,stop:fe,setMessages:ue,input:pe,setInput:se,handleInputChange:le,handleSubmit:ne,isLoading:Q,data:B,addToolResult:ye,experimental_addToolResult:ye}}function xT(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function jle(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}function zle(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const OI="ScrollArea",[PI,_ye]=Zn(OI),[Ble,Io]=PI(OI),TI=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,h]=m.useState(null),[g,v]=m.useState(null),[b,w]=m.useState(null),[x,_]=m.useState(0),[S,C]=m.useState(0),[E,P]=m.useState(!1),[A,k]=m.useState(!1),I=_t(t,L=>l(L)),$=_l(o);return m.createElement(Ble,{scope:n,type:r,dir:$,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:f,onContentChange:h,scrollbarX:g,onScrollbarXChange:v,scrollbarXEnabled:E,onScrollbarXEnabledChange:P,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:A,onScrollbarYEnabledChange:k,onCornerWidthChange:_,onCornerHeightChange:C},m.createElement(Qe.div,he({dir:$},s,{ref:I,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})))}),Vle="ScrollAreaViewport",Hle=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=Io(Vle,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,he({"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)))}),hs="ScrollAreaScrollbar",DI=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Io(hs,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(Wle,he({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(Ule,he({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(AI,he({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(M_,he({},r,{ref:t})):null}),Wle=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Io(hs,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(er,{present:n||i},m.createElement(AI,he({"data-state":i?"visible":"hidden"},r,{ref:t})))}),Ule=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Io(hs,e.__scopeScrollArea),i=e.orientation==="horizontal",s=tv(()=>l("SCROLL_END"),100),[a,l]=zle("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 h=()=>{const g=c[u];f!==g&&(l("SCROLL"),s()),f=g};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[o.viewport,i,l,s]),m.createElement(er,{present:n||a!=="hidden"},m.createElement(M_,he({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Me(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Me(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),AI=m.forwardRef((e,t)=>{const n=Io(hs,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=m.useState(!1),a=e.orientation==="horizontal",l=tv(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return eu(n.viewport,l),eu(n.content,l),m.createElement(er,{present:r||i},m.createElement(M_,he({"data-state":i?"visible":"hidden"},o,{ref:t})))}),M_=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Io(hs,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=II(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:h=>s.current=h};function f(h,g){return Zle(h,s.current,a,g)}return n==="horizontal"?m.createElement(qle,he({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,g=wT(h,a,o.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=f(h,o.dir))}})):n==="vertical"?m.createElement(Gle,he({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,g=wT(h,a);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=f(h))}})):null}),qle=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Io(hs,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(kI,he({"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":ev(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(i.viewport){const h=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),LI(h,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ug(s.paddingLeft),paddingEnd:Ug(s.paddingRight)}})}}))}),Gle=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Io(hs,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(kI,he({"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":ev(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(i.viewport){const h=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),LI(h,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ug(s.paddingTop),paddingEnd:Ug(s.paddingBottom)}})}}))}),[Yle,$I]=PI(hs),kI=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,...h}=e,g=Io(hs,n),[v,b]=m.useState(null),w=_t(t,I=>b(I)),x=m.useRef(null),_=m.useRef(""),S=g.viewport,C=r.content-r.viewport,E=Ln(u),P=Ln(l),A=tv(f,10);function k(I){if(x.current){const $=I.clientX-x.current.left,L=I.clientY-x.current.top;c({x:$,y:L})}}return m.useEffect(()=>{const I=$=>{const L=$.target;(v==null?void 0:v.contains(L))&&E($,C)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[S,v,C,E]),m.useEffect(P,[r,P]),eu(v,A),eu(g.content,A),m.createElement(Yle,{scope:n,scrollbar:v,hasThumb:o,onThumbChange:Ln(i),onThumbPointerUp:Ln(s),onThumbPositionChange:P,onThumbPointerDown:Ln(a)},m.createElement(Qe.div,he({},h,{ref:w,style:{position:"absolute",...h.style},onPointerDown:Me(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),x.current=v.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),k(I))}),onPointerMove:Me(e.onPointerMove,k),onPointerUp:Me(e.onPointerUp,I=>{const $=I.target;$.hasPointerCapture(I.pointerId)&&$.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),x.current=null})})))}),Xx="ScrollAreaThumb",Kle=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=$I(Xx,e.__scopeScrollArea);return m.createElement(er,{present:n||o.hasThumb},m.createElement(Xle,he({ref:t},r)))}),Xle=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=Io(Xx,n),s=$I(Xx,n),{onThumbPositionChange:a}=s,l=_t(t,f=>s.onThumbChange(f)),c=m.useRef(),u=tv(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const f=i.viewport;if(f){const h=()=>{if(u(),!c.current){const g=ece(f,a);c.current=g,a()}};return a(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[i.viewport,u,a]),m.createElement(Qe.div,he({"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 g=f.target.getBoundingClientRect(),v=f.clientX-g.left,b=f.clientY-g.top;s.onThumbPointerDown({x:v,y:b})}),onPointerUp:Me(e.onPointerUp,s.onThumbPointerUp)}))}),MI="ScrollAreaCorner",Qle=m.forwardRef((e,t)=>{const n=Io(MI,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(Jle,he({},e,{ref:t})):null}),Jle=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Io(MI,n),[i,s]=m.useState(0),[a,l]=m.useState(0),c=!!(i&&a);return eu(o.scrollbarX,()=>{var u;const f=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(f),l(f)}),eu(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,he({},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 Ug(e){return e?parseInt(e,10):0}function II(e,t){const n=e/t;return isNaN(n)?0:n}function ev(e){const t=II(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Zle(e,t,n,r="ltr"){const o=ev(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 NI([l,c],f)(e)}function wT(e,t,n="ltr"){const r=ev(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=Ax(e,l);return NI([0,s],[0,a])(c)}function NI(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 LI(e,t){return e>0&&e<t}const ece=(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 tv(e,t){const n=Ln(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 eu(e,t){const n=Ln(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 FI=TI,tce=Hle,nce=Qle,I_=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(FI,{ref:r,className:Ce("relative overflow-hidden",e),...n,children:[O.jsx(tce,{className:"h-full w-full rounded-[inherit]",children:t}),O.jsx(nv,{}),O.jsx(nce,{})]}));I_.displayName=FI.displayName;const nv=H.forwardRef(({className:e,orientation:t="vertical",...n},r)=>O.jsx(DI,{ref:r,orientation:t,className:Ce("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:O.jsx(Kle,{className:"relative flex-1 rounded-full bg-border"})}));nv.displayName=DI.displayName;const jI="Switch",[rce,Sye]=Zn(jI),[oce,ice]=rce(jI),sce=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,h]=m.useState(null),g=_t(t,_=>h(_)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[w=!1,x]=wr({prop:o,defaultProp:i,onChange:c});return m.createElement(oce,{scope:n,checked:w,disabled:a},m.createElement(Qe.button,he({type:"button",role:"switch","aria-checked":w,"aria-required":s,"data-state":zI(w),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onClick:Me(e.onClick,_=>{x(S=>!S),b&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})})),b&&m.createElement(cce,{control:f,bubbles:!v.current,name:r,value:l,checked:w,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),ace="SwitchThumb",lce=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=ice(ace,n);return m.createElement(Qe.span,he({"data-state":zI(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),cce=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=jm(n),a=Im(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",he({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 zI(e){return e?"checked":"unchecked"}const rv=sce,BI=lce,VI=H.forwardRef(({className:e,...t},n)=>O.jsx(rv,{className:Ce("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:O.jsx(BI,{className:Ce("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")})}));VI.displayName=rv.displayName;const uce=H.forwardRef(({className:e,...t},n)=>O.jsx(rv,{className:Ce("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:O.jsx(BI,{className:Ce("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")})}));uce.displayName=rv.displayName;function dce(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const fce=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hce=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pce={};function _T(e,t){return((t||pce).jsx?hce:fce).test(e)}const gce=/[ \t\n\f\r]/g;function mce(e){return typeof e=="object"?e.type==="text"?ST(e.value):!1:ST(e)}function ST(e){return e.replace(gce,"")===""}class Jf{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Jf.prototype.property={};Jf.prototype.normal={};Jf.prototype.space=null;function HI(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 Jf(n,r,t)}function Qx(e){return e.toLowerCase()}class No{constructor(t,n){this.property=t,this.attribute=n}}No.prototype.space=null;No.prototype.boolean=!1;No.prototype.booleanish=!1;No.prototype.overloadedBoolean=!1;No.prototype.number=!1;No.prototype.commaSeparated=!1;No.prototype.spaceSeparated=!1;No.prototype.commaOrSpaceSeparated=!1;No.prototype.mustUseProperty=!1;No.prototype.defined=!1;let vce=0;const mt=Dl(),An=Dl(),WI=Dl(),De=Dl(),on=Dl(),wc=Dl(),Gr=Dl();function Dl(){return 2**++vce}const Jx=Object.freeze(Object.defineProperty({__proto__:null,boolean:mt,booleanish:An,commaOrSpaceSeparated:Gr,commaSeparated:wc,number:De,overloadedBoolean:WI,spaceSeparated:on},Symbol.toStringTag,{value:"Module"})),Wy=Object.keys(Jx);class N_ extends No{constructor(t,n,r,o){let i=-1;if(super(t,n),CT(this,"space",o),typeof r=="number")for(;++i<Wy.length;){const s=Wy[i];CT(this,Wy[i],(r&Jx[s])===Jx[s])}}}N_.prototype.defined=!0;function CT(e,t,n){n&&(e[t]=n)}const bce={}.hasOwnProperty;function du(e){const t={},n={};let r;for(r in e.properties)if(bce.call(e.properties,r)){const o=e.properties[r],i=new N_(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Qx(r)]=r,n[Qx(i.attribute)]=r}return new Jf(t,n,e.space)}const UI=du({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}}),qI=du({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function GI(e,t){return t in e?e[t]:t}function YI(e,t){return GI(e,t.toLowerCase())}const KI=du({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:YI,properties:{xmlns:null,xmlnsXLink:null}}),XI=du({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}}),yce=du({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:YI,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:wc,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|wc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mt,defer:mt,dir:null,dirName:null,disabled:mt,download:WI,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}}),xce=du({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:GI,properties:{about:Gr,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:wc,g2:wc,glyphName:wc,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:Gr,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:Gr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gr,rev:Gr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gr,requiredFeatures:Gr,requiredFonts:Gr,requiredFormats:Gr,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:Gr,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:Gr,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:Gr,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}}),wce=/^data[-\w.:]+$/i,ET=/-[a-z]/g,_ce=/[A-Z]/g;function Sce(e,t){const n=Qx(t);let r=t,o=No;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&wce.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ET,Ece);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ET.test(i)){let s=i.replace(_ce,Cce);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=N_}return new o(r,t)}function Cce(e){return"-"+e.toLowerCase()}function Ece(e){return e.charAt(1).toUpperCase()}const Rce={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"},Oce=HI([qI,UI,KI,XI,yce],"html"),L_=HI([qI,UI,KI,XI,xce],"svg");function Pce(e){return e.join(" ").trim()}var QI={},RT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Tce=/\n/g,Dce=/^\s*/,Ace=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$ce=/^:\s*/,kce=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Mce=/^[;\s]*/,Ice=/^\s+|\s+$/g,Nce=`
400
- `,OT="/",PT="*",Wa="",Lce="comment",Fce="declaration",jce=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(v){var b=v.match(Tce);b&&(n+=b.length);var w=v.lastIndexOf(Nce);r=~w?v.length-w:r+v.length}function i(){var v={line:n,column:r};return function(b){return b.position=new s(v),c(),b}}function s(v){this.start=v,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(v){var b=new Error(t.source+":"+n+":"+r+": "+v);if(b.reason=v,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(v){var b=v.exec(e);if(b){var w=b[0];return o(w),e=e.slice(w.length),b}}function c(){l(Dce)}function u(v){var b;for(v=v||[];b=f();)b!==!1&&v.push(b);return v}function f(){var v=i();if(!(OT!=e.charAt(0)||PT!=e.charAt(1))){for(var b=2;Wa!=e.charAt(b)&&(PT!=e.charAt(b)||OT!=e.charAt(b+1));)++b;if(b+=2,Wa===e.charAt(b-1))return a("End of comment missing");var w=e.slice(2,b-2);return r+=2,o(w),e=e.slice(b),r+=2,v({type:Lce,comment:w})}}function h(){var v=i(),b=l(Ace);if(b){if(f(),!l($ce))return a("property missing ':'");var w=l(kce),x=v({type:Fce,property:TT(b[0].replace(RT,Wa)),value:w?TT(w[0].replace(RT,Wa)):Wa});return l(Mce),x}}function g(){var v=[];u(v);for(var b;b=h();)b!==!1&&(v.push(b),u(v));return v}return c(),g()};function TT(e){return e?e.replace(Ice,Wa):Wa}var zce=Vs&&Vs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(QI,"__esModule",{value:!0});var Bce=zce(jce);function Vce(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Bce.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 DT=QI.default=Vce;const Hce=DT.default||DT,JI=ZI("end"),F_=ZI("start");function ZI(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 Wce(e){const t=F_(e),n=JI(e);if(t&&n)return{start:t,end:n}}function _d(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?AT(e.position):"start"in e||"end"in e?AT(e):"line"in e||"column"in e?Zx(e):""}function Zx(e){return $T(e&&e.line)+":"+$T(e&&e.column)}function AT(e){return Zx(e&&e.start)+"-"+Zx(e&&e.end)}function $T(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=_d(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 j_={}.hasOwnProperty,Uce=new Map,qce=/[A-Z]/g,Gce=/-([a-z])/g,Yce=new Set(["table","tbody","thead","tfoot","tr"]),Kce=new Set(["td","th"]),eN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Xce(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=oue(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=rue(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"?L_:Oce,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=tN(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function tN(e,t,n){if(t.type==="element")return Qce(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Jce(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eue(e,t,n);if(t.type==="mdxjsEsm")return Zce(e,t);if(t.type==="root")return tue(e,t,n);if(t.type==="text")return nue(e,t)}function Qce(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=L_,e.schema=o),e.ancestors.push(t);const i=rN(e,t.tagName,!1),s=iue(e,t);let a=B_(e,t);return Yce.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!mce(l):!0})),nN(e,s,i,t),z_(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Jce(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)}lf(e,t.position)}function Zce(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lf(e,t.position)}function eue(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=L_,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:rN(e,t.name,!0),s=sue(e,t),a=B_(e,t);return nN(e,s,i,t),z_(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function tue(e,t,n){const r={};return z_(r,B_(e,t)),e.create(t,e.Fragment,r,n)}function nue(e,t){return t.value}function nN(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function z_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function rue(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 oue(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=F_(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 iue(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&j_.call(t.properties,o)){const i=aue(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Kce.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 sue(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 lf(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 lf(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function B_(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Uce;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=tN(e,i,s);a!==void 0&&n.push(a)}return n}function aue(e,t,n){const r=Sce(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?dce(n):Pce(n)),r.property==="style"){let o=typeof n=="object"?n:lue(e,String(n));return e.stylePropertyNameCase==="css"&&(o=cue(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Rce[r.property]||r.property:r.attribute,n]}}function lue(e,t){const n={};try{Hce(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=eN+"#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(Gce,due)),n[s]=i}}function rN(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=_T(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=_T(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return j_.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);lf(e)}function lf(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=eN+"#cannot-handle-mdx-estrees-without-createevaluater",n}function cue(e){const t={};let n;for(n in e)j_.call(e,n)&&(t[uue(n)]=e[n]);return t}function uue(e){let t=e.replace(qce,fue);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function due(e,t){return t.toUpperCase()}function fue(e){return"-"+e.toLowerCase()}const Uy={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"]},hue={};function pue(e,t){const n=t||hue,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return oN(e,r,o)}function oN(e,t,n){if(gue(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 kT(e.children,t,n)}return Array.isArray(e)?kT(e,t,n):""}function kT(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=oN(e[o],t,n);return r.join("")}function gue(e){return!!(e&&typeof e=="object")}const MT=document.createElement("i");function V_(e){const t="&"+e+";";MT.innerHTML=t;const n=MT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ei(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 Do(e,t){return e.length>0?(Ei(e,e.length,0,t),e):t}const IT={}.hasOwnProperty;function mue(e){const t={};let n=-1;for(;++n<e.length;)vue(t,e[n]);return t}function vue(e,t){let n;for(n in t){const o=(IT.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){IT.call(o,s)||(o[s]=[]);const a=i[s];bue(o[s],Array.isArray(a)?a:a?[a]:[])}}}function bue(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ei(e,0,0,r)}function iN(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 _c(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yue=va(new RegExp("\\p{P}","u")),vi=va(/[A-Za-z]/),oo=va(/[\dA-Za-z]/),xue=va(/[#-'*+\--9=?A-Z^-~]/);function ew(e){return e!==null&&(e<32||e===127)}const tw=va(/\d/),wue=va(/[\dA-Fa-f]/),sN=va(/[!-/:-@[-`{-~]/);function ot(e){return e!==null&&e<-2}function Fr(e){return e!==null&&(e<0||e===32)}function Vt(e){return e===-2||e===-1||e===32}function _ue(e){return sN(e)||yue(e)}const Sue=va(/\s/);function va(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function fu(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&oo(e.charCodeAt(n+1))&&oo(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 Cue={tokenize:Eue};function Eue(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 Rue={tokenize:Oue},NT={tokenize:Pue};function Oue(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,P;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){P=t.events[E][1].end;break}x(r);let A=C;for(;A<t.events.length;)t.events[A][1].end=Object.assign({},P),A++;return Ei(t.events,E+1,0,t.events.slice(C)),t.events.length=A,c(S)}return a(S)}function c(S){if(r===n.length){if(!o)return h(S);if(o.currentConstruct&&o.currentConstruct.concrete)return v(S);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(NT,u,f)(S)}function u(S){return o&&_(),x(r),h(S)}function f(S){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(S)}function h(S){return t.containerState={},e.attempt(NT,g,v)(S)}function g(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function v(S){if(S===null){o&&_(),x(0),e.consume(S);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:o}),b(S)}function b(S){if(S===null){w(e.exit("chunkFlow"),!0),x(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),b)}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 P=o.events.length;for(;P--;)if(o.events[P][1].start.offset<s&&(!o.events[P][1].end||o.events[P][1].end.offset>s))return;const A=t.events.length;let k=A,I,$;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(I){$=t.events[k][1].end;break}I=!0}for(x(r),P=A;P<t.events.length;)t.events[P][1].end=Object.assign({},$),P++;Ei(t.events,k+1,0,t.events.slice(A)),t.events.length=P}}function x(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 Pue(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 LT(e){if(e===null||Fr(e)||Sue(e))return 1;if(_ue(e))return 2}function H_(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 nw={name:"attention",tokenize:Due,resolveAll:Tue};function Tue(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),h=Object.assign({},e[n][1].start);FT(f,-l),FT(h,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:h},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=Do(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Do(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=Do(c,H_(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Do(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=Do(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Ei(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 Due(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=LT(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=LT(l),f=!u||u===2&&o||n.includes(l),h=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(o||!h)),c._close=!!(i===42?h:h&&(u||!f)),t(l)}}function FT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Aue={name:"autolink",tokenize:$ue};function $ue(e,t,n){let r=0;return o;function o(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(g){return vi(g)?(e.consume(g),s):c(g)}function s(g){return g===43||g===45||g===46||oo(g)?(r=1,a(g)):c(g)}function a(g){return g===58?(e.consume(g),r=0,l):(g===43||g===45||g===46||oo(g))&&r++<32?(e.consume(g),a):(r=0,c(g))}function l(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||ew(g)?n(g):(e.consume(g),l)}function c(g){return g===64?(e.consume(g),u):xue(g)?(e.consume(g),c):n(g)}function u(g){return oo(g)?f(g):n(g)}function f(g){return g===46?(e.consume(g),r=0,u):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):h(g)}function h(g){if((g===45||oo(g))&&r++<63){const v=g===45?h:f;return e.consume(g),v}return n(g)}}const ov={tokenize:kue,partial:!0};function kue(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 aN={name:"blockQuote",tokenize:Mue,continuation:{tokenize:Iue},exit:Nue};function Mue(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 Iue(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(aN,t,n)(s)}}function Nue(e){e.exit("blockQuote")}const lN={name:"characterEscape",tokenize:Lue};function Lue(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 sN(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const cN={name:"characterReference",tokenize:Fue};function Fue(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=oo,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=wue,u):(e.enter("characterReferenceValue"),i=7,s=tw,u(f))}function u(f){if(f===59&&o){const h=e.exit("characterReferenceValue");return s===oo&&!V_(r.sliceSerialize(h))?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 jT={tokenize:zue,partial:!0},zT={name:"codeFenced",tokenize:jue,concrete:!0};function jue(e,t,n){const r=this,o={tokenize:E,partial:!0};let i=0,s=0,a;return l;function l(P){return c(P)}function c(P){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(P)}function u(P){return P===a?(s++,e.consume(P),u):s<3?n(P):(e.exit("codeFencedFenceSequence"),Vt(P)?sn(e,f,"whitespace")(P):f(P))}function f(P){return P===null||ot(P)?(e.exit("codeFencedFence"),r.interrupt?t(P):e.check(jT,b,C)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(P))}function h(P){return P===null||ot(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(P)):Vt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),sn(e,g,"whitespace")(P)):P===96&&P===a?n(P):(e.consume(P),h)}function g(P){return P===null||ot(P)?f(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(P))}function v(P){return P===null||ot(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(P)):P===96&&P===a?n(P):(e.consume(P),v)}function b(P){return e.attempt(o,C,w)(P)}function w(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),x}function x(P){return i>0&&Vt(P)?sn(e,_,"linePrefix",i+1)(P):_(P)}function _(P){return P===null||ot(P)?e.check(jT,b,C)(P):(e.enter("codeFlowValue"),S(P))}function S(P){return P===null||ot(P)?(e.exit("codeFlowValue"),_(P)):(e.consume(P),S)}function C(P){return e.exit("codeFenced"),t(P)}function E(P,A,k){let I=0;return $;function $(B){return P.enter("lineEnding"),P.consume(B),P.exit("lineEnding"),L}function L(B){return P.enter("codeFencedFence"),Vt(B)?sn(P,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):j(B)}function j(B){return B===a?(P.enter("codeFencedFenceSequence"),Q(B)):k(B)}function Q(B){return B===a?(I++,P.consume(B),Q):I>=s?(P.exit("codeFencedFenceSequence"),Vt(B)?sn(P,ee,"whitespace")(B):ee(B)):k(B)}function ee(B){return B===null||ot(B)?(P.exit("codeFencedFence"),A(B)):k(B)}}}function zue(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 qy={name:"codeIndented",tokenize:Vue},Bue={tokenize:Hue,partial:!0};function Vue(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(Bue,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 Hue(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 Wue={name:"codeText",tokenize:Gue,resolve:Uue,previous:que};function Uue(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 que(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Gue(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 uN(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,Yue(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),Ei(e,o,n-o+1,a))}}return!c}function Yue(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,h=-1,g=n,v=0,b=0;const w=[b];for(;g;){for(;e[++o][1]!==g;);i.push(o),g._tokenizer||(u=r.sliceStream(g),g.next||u.push(null),f&&s.defineSkip(g.start),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=g,g=g.next}for(g=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(b=h+1,w.push(b),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(s.events=[],g?(g._tokenizer=void 0,g.previous=void 0):w.pop(),h=w.length;h--;){const x=a.slice(w[h],w[h+1]),_=i.pop();l.unshift([_,_+x.length-1]),Ei(e,_,2,x)}for(h=-1;++h<l.length;)c[v+l[h][0]]=v+l[h][1],v+=l[h][1]-l[h][0]-1;return c}const Kue={tokenize:Jue,resolve:Que},Xue={tokenize:Zue,partial:!0};function Que(e){return uN(e),e}function Jue(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(Xue,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 Zue(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 dN(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(x){return x===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(x),e.exit(i),h):x===null||x===32||x===41||ew(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function h(x){return x===62?(e.enter(i),e.consume(x),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||ot(x)?n(x):(e.consume(x),x===92?v:g)}function v(x){return x===60||x===62||x===92?(e.consume(x),g):g(x)}function b(x){return!u&&(x===null||x===41||Fr(x))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,b):x===41?(e.consume(x),u--,b):x===null||x===32||x===40||ew(x)?n(x):(e.consume(x),x===92?w:b)}function w(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function fN(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(g){return e.enter(r),e.enter(o),e.consume(g),e.exit(o),e.enter(i),u}function u(g){return a>999||g===null||g===91||g===93&&!l||g===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(i),e.enter(o),e.consume(g),e.exit(o),e.exit(r),t):ot(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||ot(g)||a++>999?(e.exit("chunkString"),u(g)):(e.consume(g),l||(l=!Vt(g)),g===92?h:f)}function h(g){return g===91||g===92||g===93?(e.consume(g),a++,f):f(g)}}function hN(e,t,n,r,o,i){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(o),e.consume(h),e.exit(o),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):(e.enter(i),c(h))}function c(h){return h===s?(e.exit(i),l(s)):h===null?n(h):ot(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),sn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||ot(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:u)}function f(h){return h===s||h===92?(e.consume(h),u):u(h)}}function Sd(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 ede={name:"definition",tokenize:nde},tde={tokenize:rde,partial:!0};function nde(e,t,n){const r=this;let o;return i;function i(g){return e.enter("definition"),s(g)}function s(g){return fN.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return o=_c(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),l):n(g)}function l(g){return Fr(g)?Sd(e,c)(g):c(g)}function c(g){return dN(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function u(g){return e.attempt(tde,f,f)(g)}function f(g){return Vt(g)?sn(e,h,"whitespace")(g):h(g)}function h(g){return g===null||ot(g)?(e.exit("definition"),r.parser.defined.push(o),t(g)):n(g)}}function rde(e,t,n){return r;function r(a){return Fr(a)?Sd(e,o)(a):n(a)}function o(a){return hN(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 ode={name:"hardBreakEscape",tokenize:ide};function ide(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 sde={name:"headingAtx",tokenize:lde,resolve:ade};function ade(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"},Ei(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function lde(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||Fr(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||Fr(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const cde=["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"],BT=["pre","script","style","textarea"],ude={name:"htmlFlow",tokenize:pde,resolveTo:hde,concrete:!0},dde={tokenize:mde,partial:!0},fde={tokenize:gde,partial:!0};function hde(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 pde(e,t,n){const r=this;let o,i,s,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),i=!0,b):N===63?(e.consume(N),o=3,r.interrupt?t:T):vi(N)?(e.consume(N),s=String.fromCharCode(N),w):n(N)}function h(N){return N===45?(e.consume(N),o=2,g):N===91?(e.consume(N),o=5,a=0,v):vi(N)?(e.consume(N),o=4,r.interrupt?t:T):n(N)}function g(N){return N===45?(e.consume(N),r.interrupt?t:T):n(N)}function v(N){const ie="CDATA[";return N===ie.charCodeAt(a++)?(e.consume(N),a===ie.length?r.interrupt?t:j:v):n(N)}function b(N){return vi(N)?(e.consume(N),s=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||Fr(N)){const ie=N===47,fe=s.toLowerCase();return!ie&&!i&&BT.includes(fe)?(o=1,r.interrupt?t(N):j(N)):cde.includes(s.toLowerCase())?(o=6,ie?(e.consume(N),x):r.interrupt?t(N):j(N)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?_(N):S(N))}return N===45||oo(N)?(e.consume(N),s+=String.fromCharCode(N),w):n(N)}function x(N){return N===62?(e.consume(N),r.interrupt?t:j):n(N)}function _(N){return Vt(N)?(e.consume(N),_):$(N)}function S(N){return N===47?(e.consume(N),$):N===58||N===95||vi(N)?(e.consume(N),C):Vt(N)?(e.consume(N),S):$(N)}function C(N){return N===45||N===46||N===58||N===95||oo(N)?(e.consume(N),C):E(N)}function E(N){return N===61?(e.consume(N),P):Vt(N)?(e.consume(N),E):S(N)}function P(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,A):Vt(N)?(e.consume(N),P):k(N)}function A(N){return N===l?(e.consume(N),l=null,I):N===null||ot(N)?n(N):(e.consume(N),A)}function k(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Fr(N)?E(N):(e.consume(N),k)}function I(N){return N===47||N===62||Vt(N)?S(N):n(N)}function $(N){return N===62?(e.consume(N),L):n(N)}function L(N){return N===null||ot(N)?j(N):Vt(N)?(e.consume(N),L):n(N)}function j(N){return N===45&&o===2?(e.consume(N),Z):N===60&&o===1?(e.consume(N),G):N===62&&o===4?(e.consume(N),V):N===63&&o===3?(e.consume(N),T):N===93&&o===5?(e.consume(N),K):ot(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(dde,X,Q)(N)):N===null||ot(N)?(e.exit("htmlFlowData"),Q(N)):(e.consume(N),j)}function Q(N){return e.check(fde,ee,X)(N)}function ee(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),B}function B(N){return N===null||ot(N)?Q(N):(e.enter("htmlFlowData"),j(N))}function Z(N){return N===45?(e.consume(N),T):j(N)}function G(N){return N===47?(e.consume(N),s="",q):j(N)}function q(N){if(N===62){const ie=s.toLowerCase();return BT.includes(ie)?(e.consume(N),V):j(N)}return vi(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),q):j(N)}function K(N){return N===93?(e.consume(N),T):j(N)}function T(N){return N===62?(e.consume(N),V):N===45&&o===2?(e.consume(N),T):j(N)}function V(N){return N===null||ot(N)?(e.exit("htmlFlowData"),X(N)):(e.consume(N),V)}function X(N){return e.exit("htmlFlow"),t(N)}}function gde(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 mde(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(ov,t,n)}}const vde={name:"htmlText",tokenize:bde};function bde(e,t,n){const r=this;let o,i,s;return a;function a(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),l}function l(T){return T===33?(e.consume(T),c):T===47?(e.consume(T),E):T===63?(e.consume(T),S):vi(T)?(e.consume(T),k):n(T)}function c(T){return T===45?(e.consume(T),u):T===91?(e.consume(T),i=0,v):vi(T)?(e.consume(T),_):n(T)}function u(T){return T===45?(e.consume(T),g):n(T)}function f(T){return T===null?n(T):T===45?(e.consume(T),h):ot(T)?(s=f,G(T)):(e.consume(T),f)}function h(T){return T===45?(e.consume(T),g):f(T)}function g(T){return T===62?Z(T):T===45?h(T):f(T)}function v(T){const V="CDATA[";return T===V.charCodeAt(i++)?(e.consume(T),i===V.length?b:v):n(T)}function b(T){return T===null?n(T):T===93?(e.consume(T),w):ot(T)?(s=b,G(T)):(e.consume(T),b)}function w(T){return T===93?(e.consume(T),x):b(T)}function x(T){return T===62?Z(T):T===93?(e.consume(T),x):b(T)}function _(T){return T===null||T===62?Z(T):ot(T)?(s=_,G(T)):(e.consume(T),_)}function S(T){return T===null?n(T):T===63?(e.consume(T),C):ot(T)?(s=S,G(T)):(e.consume(T),S)}function C(T){return T===62?Z(T):S(T)}function E(T){return vi(T)?(e.consume(T),P):n(T)}function P(T){return T===45||oo(T)?(e.consume(T),P):A(T)}function A(T){return ot(T)?(s=A,G(T)):Vt(T)?(e.consume(T),A):Z(T)}function k(T){return T===45||oo(T)?(e.consume(T),k):T===47||T===62||Fr(T)?I(T):n(T)}function I(T){return T===47?(e.consume(T),Z):T===58||T===95||vi(T)?(e.consume(T),$):ot(T)?(s=I,G(T)):Vt(T)?(e.consume(T),I):Z(T)}function $(T){return T===45||T===46||T===58||T===95||oo(T)?(e.consume(T),$):L(T)}function L(T){return T===61?(e.consume(T),j):ot(T)?(s=L,G(T)):Vt(T)?(e.consume(T),L):I(T)}function j(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),o=T,Q):ot(T)?(s=j,G(T)):Vt(T)?(e.consume(T),j):(e.consume(T),ee)}function Q(T){return T===o?(e.consume(T),o=void 0,B):T===null?n(T):ot(T)?(s=Q,G(T)):(e.consume(T),Q)}function ee(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Fr(T)?I(T):(e.consume(T),ee)}function B(T){return T===47||T===62||Fr(T)?I(T):n(T)}function Z(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function G(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),q}function q(T){return Vt(T)?sn(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):K(T)}function K(T){return e.enter("htmlTextData"),s(T)}}const W_={name:"labelEnd",tokenize:Cde,resolveTo:Sde,resolveAll:_de},yde={tokenize:Ede},xde={tokenize:Rde},wde={tokenize:Ode};function _de(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 Sde(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=Do(a,e.slice(i+1,i+r+3)),a=Do(a,[["enter",u,t]]),a=Do(a,H_(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=Do(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=Do(a,e.slice(s+1)),a=Do(a,[["exit",l,t]]),Ei(e,i,e.length,a),e}function Cde(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(h){return i?i._inactive?f(h):(s=r.parser.defined.includes(_c(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(yde,u,s?u:f)(h):h===91?e.attempt(xde,u,s?c:f)(h):s?u(h):f(h)}function c(h){return e.attempt(wde,u,f)(h)}function u(h){return t(h)}function f(h){return i._balanced=!0,n(h)}}function Ede(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 Fr(f)?Sd(e,i)(f):i(f)}function i(f){return f===41?u(f):dN(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Fr(f)?Sd(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?hN(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Fr(f)?Sd(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 Rde(e,t,n){const r=this;return o;function o(a){return fN.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(_c(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Ode(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 Pde={name:"labelStartImage",tokenize:Tde,resolveAll:W_.resolveAll};function Tde(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 Dde={name:"labelStartLink",tokenize:Ade,resolveAll:W_.resolveAll};function Ade(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 Gy={name:"lineEnding",tokenize:$de};function $de(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),sn(e,t,"linePrefix")}}const lg={name:"thematicBreak",tokenize:kde};function kde(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 Dr={name:"list",tokenize:Nde,continuation:{tokenize:Lde},exit:jde},Mde={tokenize:zde,partial:!0},Ide={tokenize:Fde,partial:!0};function Nde(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(g){const v=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:tw(g)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(lg,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(g)}return n(g)}function l(g){return tw(g)&&++s<10?(e.consume(g),l):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(ov,r.interrupt?n:u,e.attempt(Mde,h,f))}function u(g){return r.containerState.initialBlankLine=!0,i++,h(g)}function f(g){return Vt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),h):n(g)}function h(g){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function Lde(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ov,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(Ide,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,sn(e,e.attempt(Dr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Fde(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 jde(e){e.exit(this.containerState.type)}function zde(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 VT={name:"setextUnderline",tokenize:Vde,resolveTo:Bde};function Bde(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 Vde(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 Hde={tokenize:Wde};function Wde(e){const t=this,n=e.attempt(ov,r,e.attempt(this.parser.constructs.flowInitial,o,sn(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Kue,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 Ude={resolveAll:gN()},qde=pN("string"),Gde=pN("text");function pN(e){return{tokenize:t,resolveAll:gN(e==="text"?Yde: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 h=-1;if(f)for(;++h<f.length;){const g=f[h];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function gN(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 Yde(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 Kde(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:A(E),check:A(P),interrupt:A(P,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:g,sliceSerialize:h,now:v,defineSkip:b,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(L){return s=Do(s,L),w(),s[s.length-1]!==null?[]:(k(t,0),c.events=H_(i,c.events,c),c.events)}function h(L,j){return Qde(g(L),j)}function g(L){return Xde(s,L)}function v(){const{line:L,column:j,offset:Q,_index:ee,_bufferIndex:B}=r;return{line:L,column:j,offset:Q,_index:ee,_bufferIndex:B}}function b(L){o[L.line]=L.column,$()}function w(){let L;for(;r._index<s.length;){const j=s[r._index];if(typeof j=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<j.length;)x(j.charCodeAt(r._bufferIndex));else x(j)}}function x(L){u=u(L)}function _(L){ot(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,$()):L!==-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=L}function S(L,j){const Q=j||{};return Q.type=L,Q.start=v(),c.events.push(["enter",Q,c]),a.push(Q),Q}function C(L){const j=a.pop();return j.end=v(),c.events.push(["exit",j,c]),j}function E(L,j){k(L,j.from)}function P(L,j){j.restore()}function A(L,j){return Q;function Q(ee,B,Z){let G,q,K,T;return Array.isArray(ee)?X(ee):"tokenize"in ee?X([ee]):V(ee);function V(ue){return pe;function pe(se){const ne=se!==null&&ue[se],le=se!==null&&ue.null,ye=[...Array.isArray(ne)?ne:ne?[ne]:[],...Array.isArray(le)?le:le?[le]:[]];return X(ye)(se)}}function X(ue){return G=ue,q=0,ue.length===0?Z:N(ue[q])}function N(ue){return pe;function pe(se){return T=I(),K=ue,ue.partial||(c.currentConstruct=ue),ue.name&&c.parser.constructs.disable.null.includes(ue.name)?fe():ue.tokenize.call(j?Object.assign(Object.create(c),j):c,l,ie,fe)(se)}}function ie(ue){return L(K,T),B}function fe(ue){return T.restore(),++q<G.length?N(G[q]):Z}}}function k(L,j){L.resolveAll&&!i.includes(L)&&i.push(L),L.resolve&&Ei(c.events,j,c.events.length-j,L.resolve(c.events.slice(j),c)),L.resolveTo&&(c.events=L.resolveTo(c.events,c))}function I(){const L=v(),j=c.previous,Q=c.currentConstruct,ee=c.events.length,B=Array.from(a);return{restore:Z,from:ee};function Z(){r=L,c.previous=j,c.currentConstruct=Q,c.events.length=ee,a=B,$()}}function $(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function Xde(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 Qde(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=`
401
- `;break}case-3:{s=`\r
402
- `;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 Jde={42:Dr,43:Dr,45:Dr,48:Dr,49:Dr,50:Dr,51:Dr,52:Dr,53:Dr,54:Dr,55:Dr,56:Dr,57:Dr,62:aN},Zde={91:ede},efe={[-2]:qy,[-1]:qy,32:qy},tfe={35:sde,42:lg,45:[VT,lg],60:ude,61:VT,95:lg,96:zT,126:zT},nfe={38:cN,92:lN},rfe={[-5]:Gy,[-4]:Gy,[-3]:Gy,33:Pde,38:cN,42:nw,60:[Aue,vde],91:Dde,92:[ode,lN],93:W_,95:nw,96:Wue},ofe={null:[nw,Ude]},ife={null:[42,95]},sfe={null:[]},afe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ife,contentInitial:Zde,disable:sfe,document:Jde,flow:tfe,flowInitial:efe,insideSpan:ofe,string:nfe,text:rfe},Symbol.toStringTag,{value:"Module"}));function lfe(e){const n=mue([afe,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(Cue),document:o(Rue),flow:o(Hde),string:o(qde),text:o(Gde)};return r;function o(i){return s;function s(a){return Kde(r,i,a)}}}function cfe(e){for(;!uN(e););return e}const HT=/[\0\t\n\r]/g;function ufe(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,f,h,g;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(HT.lastIndex=f,c=HT.exec(i),h=c&&c.index!==void 0?c.index:i.length,g=i.charCodeAt(h),!c){t=i.slice(f);break}if(g===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(i.slice(f,h)),e+=h-f),g){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=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const dfe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ffe(e){return e.replace(dfe,hfe)}function hfe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return iN(n.slice(i?2:1),i?16:10)}return V_(n)||e}const mN={}.hasOwnProperty;function pfe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),gfe(n)(cfe(lfe(n).document().write(ufe()(e,t,!0))))}function gfe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Be),autolinkProtocol:I,autolinkEmail:I,atxHeading:i(_e),blockQuote:i(ne),characterEscape:I,characterReference:I,codeFenced:i(le),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(le,s),codeText:i(ye,s),codeTextData:I,data:I,codeFlowValue:I,definition:i(Y),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(be),hardBreakEscape:i(Pe),hardBreakTrailing:i(Pe),htmlFlow:i(Te,s),htmlFlowData:I,htmlText:i(Te,s),htmlTextData:I,image:i(Ue),label:s,link:i(Be),listItem:i(Ke),listItemValue:h,listOrdered:i(Ie,f),listUnordered:i(Ie),paragraph:i(lt),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(_e),strong:i(It),thematicBreak:i(Ht)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:se,autolinkProtocol:pe,blockQuote:l(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ue,codeFenced:l(w),codeFencedFence:b,codeFencedFenceInfo:g,codeFencedFenceMeta:v,codeFlowValue:$,codeIndented:l(x),codeText:l(B),codeTextData:$,data:$,definition:l(),definitionDestinationString:C,definitionLabelString:_,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(Q),htmlFlowData:$,htmlText:l(ee),htmlTextData:$,image:l(G),label:K,labelText:q,lineEnding:L,link:l(Z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ie,resourceDestinationString:T,resourceTitleString:V,resource:X,setextHeading:l(k),setextHeadingLineSequence:A,setextHeadingText:P,strong:l(),thematicBreak:l()}};vN(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(de){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<de.length;)if(de[Ze][1].type==="listOrdered"||de[Ze][1].type==="listUnordered")if(de[Ze][0]==="enter")Ge.push(Ze);else{const Wt=Ge.pop();Ze=o(de,Wt,Ze)}for(Ze=-1;++Ze<de.length;){const Wt=t[de[Ze][0]];mN.call(Wt,de[Ze][1].type)&&Wt[de[Ze][1].type].call(Object.assign({sliceSerialize:de[Ze][2].sliceSerialize},Le),de[Ze][1])}if(Le.tokenStack.length>0){const Wt=Le.tokenStack[Le.tokenStack.length-1];(Wt[1]||WT).call(Le,void 0,Wt[0])}for(Ee.position={start:Is(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:Is(de.length>0?de[de.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(de,Ee,Le){let Ge=Ee-1,Ze=-1,Wt=!1,Zt,Kt,vn,ln;for(;++Ge<=Le;){const Lt=de[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=de[tn];if(xn[1].type==="lineEnding"||xn[1].type==="lineEndingBlank"){if(xn[0]==="exit")continue;Kt&&(de[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?de[Kt][1].start:Lt[1].end),de.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,de.splice(Ge,0,["enter",tn,Lt[2]]),Ge++,Le++,vn=void 0,ln=!0}}}return de[Ee][1]._spread=Wt,Le}function i(de,Ee){return Le;function Le(Ge){a.call(this,de(Ge),Ge),Ee&&Ee.call(this,Ge)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(de,Ee,Le){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([Ee,Le]),de.position={start:Is(Ee.start),end:void 0}}function l(de){return Ee;function Ee(Le){de&&de.call(this,Le),c.call(this,Le)}}function c(de,Ee){const Le=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==de.type&&(Ee?Ee.call(this,de,Ge[0]):(Ge[1]||WT).call(this,de,Ge[0]));else throw new Error("Cannot close `"+de.type+"` ("+_d({start:de.start,end:de.end})+"): it’s not open");Le.position.end=Is(de.end)}function u(){return pue(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(de){if(this.data.expectingFirstListItemValue){const Ee=this.stack[this.stack.length-2];Ee.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function g(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.lang=de}function v(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.meta=de}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=de.replace(/(\r?\n|\r)$/g,"")}function _(de){const Ee=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Ee,Le.identifier=_c(this.sliceSerialize(de)).toLowerCase()}function S(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=de}function C(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=de}function E(de){const Ee=this.stack[this.stack.length-1];if(!Ee.depth){const Le=this.sliceSerialize(de).length;Ee.depth=Le}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function A(de){const Ee=this.stack[this.stack.length-1];Ee.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function I(de){const Le=this.stack[this.stack.length-1].children;let Ge=Le[Le.length-1];(!Ge||Ge.type!=="text")&&(Ge=At(),Ge.position={start:Is(de.start),end:void 0},Le.push(Ge)),this.stack.push(Ge)}function $(de){const Ee=this.stack.pop();Ee.value+=this.sliceSerialize(de),Ee.position.end=Is(de.end)}function L(de){const Ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=Ee.children[Ee.children.length-1];Le.position.end=Is(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ee.type)&&(I.call(this,de),$.call(this,de))}function j(){this.data.atHardBreak=!0}function Q(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=de}function ee(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=de}function B(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=de}function Z(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Ee,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function G(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Ee,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function q(de){const Ee=this.sliceSerialize(de),Le=this.stack[this.stack.length-2];Le.label=ffe(Ee),Le.identifier=_c(Ee).toLowerCase()}function K(){const de=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=de.children;Le.children=Ge}else Le.alt=Ee}function T(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=de}function V(){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=de}function X(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ie(de){const Ee=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Ee,Le.identifier=_c(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function fe(de){this.data.characterReferenceType=de.type}function ue(de){const Ee=this.sliceSerialize(de),Le=this.data.characterReferenceType;let Ge;Le?(Ge=iN(Ee,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=V_(Ee);const Ze=this.stack.pop();Ze.value+=Ge,Ze.position.end=Is(de.end)}function pe(de){$.call(this,de);const Ee=this.stack[this.stack.length-1];Ee.url=this.sliceSerialize(de)}function se(de){$.call(this,de);const Ee=this.stack[this.stack.length-1];Ee.url="mailto:"+this.sliceSerialize(de)}function ne(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function ye(){return{type:"inlineCode",value:""}}function Y(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function Pe(){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(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function Ke(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function lt(){return{type:"paragraph",children:[]}}function It(){return{type:"strong",children:[]}}function At(){return{type:"text",value:""}}function Ht(){return{type:"thematicBreak"}}}function Is(e){return{line:e.line,column:e.column,offset:e.offset}}function vN(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?vN(e,r):mfe(e,r)}}function mfe(e,t){let n;for(n in t)if(mN.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 WT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_d({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_d({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_d({start:t.start,end:t.end})+") is still open")}function vfe(e){const t=this;t.parser=n;function n(r){return pfe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function bfe(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 yfe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
403
- `}]}function xfe(e,t){const n=t.value?t.value+`
404
- `:"",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 wfe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _fe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sfe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=fu(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 Cfe(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 Efe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function bN(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 Rfe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bN(e,t);const o={src:fu(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 Ofe(e,t){const n={src:fu(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 Pfe(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 Tfe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bN(e,t);const o={href:fu(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 Dfe(e,t){const n={href:fu(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 Afe(e,t,n){const r=e.all(t),o=n?$fe(n):yN(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:`
405
- `}),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:`
406
- `});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function $fe(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=yN(n[r])}return t}function yN(e){const t=e.spread;return t??e.children.length>1}function kfe(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 Mfe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ife(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Nfe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lfe(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=F_(t.children[1]),l=JI(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 Ffe(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],h={},g=s?s[l]:void 0;g&&(h.align=g);let v={type:"element",tagName:i,properties:h,children:[]};f&&(v.children=e.all(f),e.patch(f,v),v=e.applyData(f,v)),c.push(v)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function jfe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const UT=9,qT=32;function zfe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(GT(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(GT(t.slice(o),o>0,!1)),i.join("")}function GT(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===UT||i===qT;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===UT||i===qT;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function Bfe(e,t){const n={type:"text",value:zfe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Vfe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Hfe={blockquote:bfe,break:yfe,code:xfe,delete:wfe,emphasis:_fe,footnoteReference:Sfe,heading:Cfe,html:Efe,imageReference:Rfe,image:Ofe,inlineCode:Pfe,linkReference:Tfe,link:Dfe,listItem:Afe,list:kfe,paragraph:Mfe,root:Ife,strong:Nfe,table:Lfe,tableCell:jfe,tableRow:Ffe,text:Bfe,thematicBreak:Vfe,toml:Np,yaml:Np,definition:Np,footnoteDefinition:Np};function Np(){}const xN=-1,iv=0,qg=1,Gg=2,U_=3,q_=4,G_=5,Y_=6,wN=7,_N=8,YT=typeof self=="object"?self:globalThis,Wfe=(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 iv:case xN:return n(s,o);case qg:{const a=n([],o);for(const l of s)a.push(r(l));return a}case Gg:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case U_:return n(new Date(s),o);case q_:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case G_:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case Y_:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case wN:{const{name:a,message:l}=s;return n(new YT[a](l),o)}case _N:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o)}return n(new YT[i](s),o)};return r},KT=e=>Wfe(new Map,e)(0),ic="",{toString:Ufe}={},{keys:qfe}=Object,Zu=e=>{const t=typeof e;if(t!=="object"||!e)return[iv,t];const n=Ufe.call(e).slice(8,-1);switch(n){case"Array":return[qg,ic];case"Object":return[Gg,ic];case"Date":return[U_,ic];case"RegExp":return[q_,ic];case"Map":return[G_,ic];case"Set":return[Y_,ic]}return n.includes("Array")?[qg,n]:n.includes("Error")?[wN,n]:[Gg,n]},Lp=([e,t])=>e===iv&&(t==="function"||t==="symbol"),Gfe=(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]=Zu(s);switch(a){case iv:{let u=s;switch(l){case"bigint":a=_N,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([xN],s)}return o([a,u],s)}case qg:{if(l)return o([l,[...s]],s);const u=[],f=o([a,u],s);for(const h of s)u.push(i(h));return f}case Gg:{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 h of qfe(s))(e||!Lp(Zu(s[h])))&&u.push([i(h),i(s[h])]);return f}case U_:return o([a,s.toISOString()],s);case q_:{const{source:u,flags:f}=s;return o([a,{source:u,flags:f}],s)}case G_:{const u=[],f=o([a,u],s);for(const[h,g]of s)(e||!(Lp(Zu(h))||Lp(Zu(g))))&&u.push([i(h),i(g)]);return f}case Y_:{const u=[],f=o([a,u],s);for(const h of s)(e||!Lp(Zu(h)))&&u.push(i(h));return f}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},XT=(e,{json:t,lossy:n}={})=>{const r=[];return Gfe(!(t||n),!!t,new Map,r)(e),r},Yg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?KT(XT(e,t)):structuredClone(e):(e,t)=>KT(XT(e,t));function Yfe(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 Kfe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Xfe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Yfe,r=e.options.footnoteBackLabel||Kfe,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(),h=fu(f.toLowerCase());let g=0;const v=[],b=e.footnoteCounts.get(f);for(;b!==void 0&&++g<=b;){v.length>0&&v.push({type:"text",value:" "});let _=typeof n=="string"?n:n(l,g);typeof _=="string"&&(_={type:"text",value:_}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,g),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(...v)}else u.push(...v);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Yg(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
407
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
408
- `}]}}const SN=function(e){if(e==null)return ehe;if(typeof e=="function")return sv(e);if(typeof e=="object")return Array.isArray(e)?Qfe(e):Jfe(e);if(typeof e=="string")return Zfe(e);throw new Error("Expected function, string, or object as test")};function Qfe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=SN(e[n]);return sv(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function Jfe(e){const t=e;return sv(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function Zfe(e){return sv(t);function t(n){return n&&n.type===e}}function sv(e){return t;function t(n,r,o){return!!(the(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function ehe(){return!0}function the(e){return e!==null&&typeof e=="object"&&"type"in e}const CN=[],nhe=!0,QT=!1,rhe="skip";function ohe(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=SN(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 g=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(g?"<"+g+">":""))+")"})}return h;function h(){let g=CN,v,b,w;if((!t||i(l,c,u[u.length-1]||void 0))&&(g=ihe(n(l,u)),g[0]===QT))return g;if("children"in l&&l.children){const x=l;if(x.children&&g[0]!==rhe)for(b=(r?x.children.length:-1)+s,w=u.concat(x);b>-1&&b<x.children.length;){const _=x.children[b];if(v=a(_,b,w)(),v[0]===QT)return v;b=typeof v[1]=="number"?v[1]:b+s}}return g}}}function ihe(e){return Array.isArray(e)?e:typeof e=="number"?[nhe,e]:e==null?CN:[e]}function EN(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),ohe(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 rw={}.hasOwnProperty,she={};function ahe(e,t){const n=t||she,r=new Map,o=new Map,i=new Map,s={...Hfe,...n.handlers},a={all:c,applyData:che,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:lhe,wrap:dhe};return EN(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:o,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),a;function l(u,f){const h=u.type,g=a.handlers[h];if(rw.call(a.handlers,h)&&g)return g(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:b,...w}=u,x=Yg(w);return x.children=a.all(u),x}return Yg(u)}return(a.options.unknownHandler||uhe)(a,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let g=-1;for(;++g<h.length;){const v=a.one(h[g],u);if(v){if(g&&h[g-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=JT(v.value)),!Array.isArray(v)&&v.type==="element")){const b=v.children[0];b&&b.type==="text"&&(b.value=JT(b.value))}Array.isArray(v)?f.push(...v):f.push(v)}}}return f}}function lhe(e,t){e.position&&(t.position=Wce(e))}function che(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,Yg(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function uhe(e,t){const n=t.data||{},r="value"in t&&!(rw.call(n,"hProperties")||rw.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 dhe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
409
- `});++r<e.length;)r&&n.push({type:"text",value:`
410
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
411
- `}),n}function JT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ZT(e,t){const n=ahe(e,t),r=n.one(e,void 0),o=Xfe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
412
- `},o),i}function fhe(e,t){return e&&"run"in e?async function(n,r){const o=ZT(n,{file:r,...t});await e.run(o,r)}:function(n,r){return ZT(n,{file:r,...t||e})}}function e2(e){if(e)throw e}var cg=Object.prototype.hasOwnProperty,RN=Object.prototype.toString,t2=Object.defineProperty,n2=Object.getOwnPropertyDescriptor,r2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):RN.call(t)==="[object Array]"},o2=function(t){if(!t||RN.call(t)!=="[object Object]")return!1;var n=cg.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cg.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||cg.call(t,o)},i2=function(t,n){t2&&n.name==="__proto__"?t2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},s2=function(t,n){if(n==="__proto__")if(cg.call(t,n)){if(n2)return n2(t,n).value}else return;return t[n]},hhe=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=s2(a,n),o=s2(t,n),a!==o&&(u&&o&&(o2(o)||(i=r2(o)))?(i?(i=!1,s=r&&r2(r)?r:[]):s=r&&o2(r)?r:{},i2(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&i2(a,{name:n,newValue:o}));return a};const Yy=nu(hhe);function ow(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 phe(){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?ghe(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 ghe(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 di={basename:mhe,dirname:vhe,extname:bhe,join:yhe,sep:"/"};function mhe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zf(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 vhe(e){if(Zf(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 bhe(e){Zf(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 yhe(...e){let t=-1,n;for(;++t<e.length;)Zf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":xhe(n)}function xhe(e){Zf(e);const t=e.codePointAt(0)===47;let n=whe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function whe(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 Zf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _he={cwd:She};function She(){return"/"}function iw(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Che(e){if(typeof e=="string")e=new URL(e);else if(!iw(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 Ehe(e)}function Ehe(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 Ky=["history","path","basename","stem","extname","dirname"];class ON{constructor(t){let n;t?iw(t)?n={path:t}:typeof t=="string"||Rhe(t)?n={value:t}:n=t:n={},this.cwd=_he.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ky.length;){const i=Ky[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)Ky.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?di.basename(this.path):void 0}set basename(t){Qy(t,"basename"),Xy(t,"basename"),this.path=di.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?di.dirname(this.path):void 0}set dirname(t){a2(this.basename,"dirname"),this.path=di.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?di.extname(this.path):void 0}set extname(t){if(Xy(t,"extname"),a2(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=di.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){iw(t)&&(t=Che(t)),Qy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?di.basename(this.path,this.extname):void 0}set stem(t){Qy(t,"stem"),Xy(t,"stem"),this.path=di.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 Xy(e,t){if(e&&e.includes(di.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+di.sep+"`")}function Qy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function a2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Rhe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ohe=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},Phe={}.hasOwnProperty;class K_ extends Ohe{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=phe()}copy(){const t=new K_;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?(e0("data",this.frozen),this.namespace[t]=n,this):Phe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(e0("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=Fp(t),r=this.parser||this.Parser;return Jy("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Jy("process",this.parser||this.Parser),Zy("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Fp(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const g=f,v=r.stringify(g,h);Ahe(v)?h.value=v:h.result=v,c(u,h)});function c(u,f){u||!f?s(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Jy("processSync",this.parser||this.Parser),Zy("processSync",this.compiler||this.Compiler),this.process(t,o),c2("processSync","process",n),r;function o(i,s){n=!0,e2(i),r=s}}run(t,n,r){l2(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=Fp(n);o.run(t,l,c);function c(u,f,h){const g=f||t;u?a(u):s?s(g):r(void 0,g,h)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),c2("runSync","run",r),o;function i(s,a){e2(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Fp(n),o=this.compiler||this.Compiler;return Zy("stringify",o),l2(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(e0("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,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[g,...v]=u;const b=r[h][1];ow(b)&&ow(g)&&(g=Yy(!0,b,g)),r[h]=[c,g,...v]}}}}const The=new K_().freeze();function Jy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Zy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function e0(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 l2(e){if(!ow(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function c2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Fp(e){return Dhe(e)?e:new ON(e)}function Dhe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ahe(e){return typeof e=="string"||$he(e)}function $he(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const khe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",u2=[],d2={allowDangerousHtml:!0},Mhe=/^(https?|ircs?|mailto|xmpp)$/i,Ihe=[{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 PN(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||u2,l=e.remarkPlugins||u2,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...d2}:d2,u=e.skipHtml,f=e.unwrapDisallowed,h=e.urlTransform||Nhe,g=The().use(vfe).use(l).use(fhe,c).use(a),v=new ON;typeof r=="string"&&(v.value=r);for(const _ of Ihe)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+khe+_.id,void 0);const b=g.parse(v);let w=g.runSync(b,v);return o&&(w={type:"element",tagName:"div",properties:{className:o},children:w.type==="root"?w.children:[w]}),EN(w,x),Xce(w,{Fragment:O.Fragment,components:i,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function x(_,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 Uy)if(Object.hasOwn(Uy,E)&&Object.hasOwn(_.properties,E)){const P=_.properties[E],A=Uy[E];(A===null||A.includes(_.tagName))&&(_.properties[E]=h(String(P||""),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 Nhe(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||Mhe.test(e.slice(0,t))?e:""}function Lhe(){const e=m.useRef(null),[t,n]=m.useState(""),[r,o]=m.useState(!1),i=ke(I=>I.dashboard.aiScopeTables);Dm();const s=ke(I=>I.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=co(),{authToken:u}=ma(),f=wD(),{messages:h,input:g,handleInputChange:v,handleSubmit:b,addToolResult:w,stop:x,isLoading:_}=Fle({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxToolRoundtrips:5,async onToolCall({toolCall:I}){if(C(I.toolName),I.toolName==="getLocation"){const $=["New York","Los Angeles","Chicago","San Francisco"];return $[Math.floor(Math.random()*$.length)]}if(I.toolName==="getTables")return JSON.stringify(i||[]);if(I.toolName==="getData"){console.log(I.args);const $=I.args;if(!($!=null&&$.sql)||!($!=null&&$.connectionId))return"Please provide sql, connectionId and table";const L=await f.fetchQuery({queryKey:["chat",$.connectionId,$.sql],queryFn:()=>Of("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:$.connectionId,sql:$.sql})});return n("Summarizing"),JSON.stringify(L)}},onFinish(I,$){console.log("onFinish",I,$),I.content&&n("")}}),S=()=>{var I;(I=e.current)==null||I.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{S()},[h]);function C(I){I==="getTables"&&n("Initializing"),I==="getSchemas"&&n("Analyzing"),I==="getData"&&n("Fetching")}function E(I){const $=I.toolInvocations||[];return $.length===0||$.find(j=>j.toolName==="getData"&&"result"in j)?!0:r}function P(I){return I==null?void 0:I.map($=>{var j;const L=$.role==="user";return E($)?O.jsxs("div",{className:Ce("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":L}),children:[O.jsx("div",{className:"space-y-2",children:O.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[O.jsx("div",{className:"text-muted-foreground",children:L?O.jsx(sQ,{className:"size-5 shrink-0"}):O.jsx(vx,{className:"size-5 shrink-0"})}),O.jsx("div",{children:O.jsx(PN,{components:Fhe,children:$.content})})]})}),(j=$.toolInvocations)==null?void 0:j.map(Q=>{const ee=Q.toolCallId;return"result"in Q?O.jsx("div",{children:A(Q)},ee):O.jsxs("div",{children:["Calling ",Q.toolName,"..."]},ee)})]},$.id):null})}function A(I){if("result"in I){let $;try{const L=JSON.parse(I.result);if($=O.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(L,null,2)}),I.toolName==="getData"){const j=z1({cardType:I.args.chartType,data:L.records});return O.jsxs("div",{className:"space-y-2",children:[r&&O.jsxs("div",{children:[O.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${I.toolName}: `,$]}),O.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[O.jsx(xr,{onClick:()=>{const Q=I.args.chartTitle,ee=I.args.connectionId;k({sql:I.args.sql,data:L.records,cardType:I.args.chartType,cardCfg:j,cardTitle:Q,connectionId:ee})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),j&&O.jsx(_1,{cfg:j})]})]})}}catch{$=O.jsx("span",{children:I.result})}return O.jsxs("div",{children:[O.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${I.toolName}: `,$]})}return`Calling ${I.toolName}...`}function k({sql:I,data:$,cardCfg:L,cardTitle:j,connectionId:Q,cardType:ee}){if(!s)return;const B={id:la(),title:j||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:ee==="horizontalBar"?"y":"x"}},type:L.type,cfg:L,sql:I,data:$,connectionId:Q},Z={id:la(),cards:[B],activeCardId:B.id};c(!0),a(s,Z,"start"),l(Z.id)}return O.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:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx(Wn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),O.jsxs(W1,{openDelay:700,children:[O.jsx(U1,{children:O.jsx(oQ,{className:"size-4 text-muted-foreground"})}),O.jsx(Fm,{className:"w-70",children:O.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[O.jsx(vx,{className:"size-5"}),O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-sm",children:i&&(i==null?void 0:i.length)>0?"I can analyze following datasets":"No datasets in scope"}),O.jsx("div",{className:"space-y-2 pt-2",children:i==null?void 0:i.map((I,$)=>O.jsxs("div",{className:"flex gap-2 text-xs",children:[O.jsx(F$,{className:"size-4 opacity-70"}),O.jsx("span",{children:I.tableName})]},$))})]})]})})]}),!1]}),O.jsx(Ym,{className:"my-4"}),O.jsx("div",{className:"",children:O.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:b,children:[O.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[O.jsx(xc,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:g,disabled:_,placeholder:"What can I help you with?",onChange:v}),O.jsx("button",{className:"mr-3",children:O.jsx(k$,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),_&&O.jsx(xr,{size:"sm",className:"rounded-full",onClick:()=>x(),children:O.jsx(NX,{className:"size-2.5 bg-background"})})]})}),O.jsxs(I_,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[O.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[_&&t!==""&&O.jsx(SX,{className:"size-10 animate-pulse"}),t]}),O.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:P(h)}),O.jsx(nv,{orientation:"vertical"})]})]})}const Fhe={li:({node:e,...t})=>O.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>O.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:tu,createContext:jhe,createRef:Cye,forwardRef:TN,useCallback:Yr,useContext:DN,useEffect:ul,useImperativeHandle:AN,useLayoutEffect:zhe,useMemo:Bhe,useRef:Ao,useState:Kg}=H,f2=H.useId,av=jhe(null);av.displayName="PanelGroupContext";const cf=zhe,Vhe=typeof f2=="function"?f2:()=>null;let Hhe=0;function X_(e=null){const t=Vhe(),n=Ao(e||t||null);return n.current===null&&(n.current=""+Hhe++),e??n.current}function $N({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:h,style:g,tagName:v="div",...b}){const w=DN(av);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:_,getPanelSize:S,getPanelStyle:C,groupId:E,isPanelCollapsed:P,registerPanel:A,resizePanel:k,unregisterPanel:I}=w,$=X_(s),L=Ao({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:$,idIsFromProps:s!==void 0,order:h});Ao({didLogMissingDefaultSizeWarning:!1}),cf(()=>{const{callbacks:Q,constraints:ee}=L.current;L.current.id=$,L.current.idIsFromProps=s!==void 0,L.current.order=h,Q.onCollapse=c,Q.onExpand=u,Q.onResize=f,ee.collapsedSize=n,ee.collapsible=r,ee.defaultSize=o,ee.maxSize=a,ee.minSize=l}),cf(()=>{const Q=L.current;return A(Q),()=>{I(Q)}},[h,$,A,I]),AN(i,()=>({collapse:()=>{x(L.current)},expand:()=>{_(L.current)},getId(){return $},getSize(){return S(L.current)},isCollapsed(){return P(L.current)},isExpanded(){return!P(L.current)},resize:Q=>{k(L.current,Q)}}),[x,_,S,P,$,k]);const j=C(L.current,o);return tu(v,{...b,children:e,className:t,style:{...j,...g},"data-panel":"","data-panel-id":$,"data-panel-group-id":E,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const kN=TN((e,t)=>tu($N,{...e,forwardedRef:t}));$N.displayName="Panel";kN.displayName="forwardRef(Panel)";function vt(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const MN=10;function uf(e,t,n=MN){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Zr(e,t,n){return uf(e,t,n)===0}function gc({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(uf(n,a)<0)if(i){const l=(o+a)/2;uf(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(MN)),n}function ad({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(Zr(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 h=t[u];vt(h!=null);const g=n[u];vt(g);const{collapsedSize:v=0,minSize:b=0}=g;if(Zr(h,v)){const w=b-h;uf(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}{const u=e<0?s:a,f=n[u];vt(f);const{collapsible:h}=f;if(h){const g=t[u];vt(g!=null);const v=n[u];vt(v);const{collapsedSize:b=0,minSize:w=0}=v;if(Zr(g,w)){const x=g-b;uf(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const u=e<0?1:-1;let f=e<0?a:s,h=0;for(;;){const v=t[f];vt(v!=null);const w=gc({panelConstraints:n,panelIndex:f,size:100})-v;if(h+=w,f+=u,f<0||f>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-g:g}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const h=Math.abs(e)-Math.abs(l),g=t[f];vt(g!=null);const v=g-h,b=gc({panelConstraints:n,panelIndex:f,size:v});if(!Zr(g,b)&&(l+=g-b,i[f]=b,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Zr(l,0))return t;{const u=e<0?a:s,f=t[u];vt(f!=null);const h=f+l,g=gc({panelConstraints:n,panelIndex:u,size:h});if(i[u]=g,!Zr(g,h)){let v=h-g,w=e<0?a:s;for(;w>=0&&w<n.length;){const x=i[w];vt(x!=null);const _=x+v,S=gc({panelConstraints:n,panelIndex:w,size:_});if(Zr(x,S)||(v-=S-x,i[w]=S),Zr(v,0))break;e>0?w--:w++}}}const c=i.reduce((u,f)=>f+u,0);return Zr(c,100)?i:t}function Whe({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,h)=>{const{constraints:g}=f,{maxSize:v=100,minSize:b=0}=g;h===a?(r=b,o=v):(i+=b,s+=v)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function df(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function IN(e,t){const r=df(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function NN(e,t){const n=IN(e,t);return n!=null?[n,n+1]:[-1,-1]}function LN(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function lv(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Uhe(e,t,n){var r,o,i,s;const a=lv(t),l=df(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 qhe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){Ao({didWarnAboutMissingResizeHandle:!1}),cf(()=>{const s=df(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:c,valueNow:u}=Whe({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const h=o[a];vt(h),f.setAttribute("aria-controls",h.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]),ul(()=>{const s=t.current;vt(s);const{panelDataArray:a}=s,l=LN(n);vt(l!=null,`No group found for id "${n}"`);const c=df(n);vt(c);const u=c.map(f=>{const h=f.getAttribute("data-panel-resize-handle-id");vt(h);const[g,v]=Uhe(n,h,a);if(g==null||v==null)return()=>{};const b=w=>{if(!w.defaultPrevented)switch(w.key){case"Enter":{w.preventDefault();const x=a.findIndex(_=>_.id===g);if(x>=0){const _=a[x];vt(_);const S=r[x],{collapsedSize:C=0,collapsible:E,minSize:P=0}=_.constraints;if(S!=null&&E){const A=ad({delta:Zr(S,C)?P-C:C-S,layout:r,panelConstraints:a.map(k=>k.constraints),pivotIndices:NN(n,h),trigger:"keyboard"});r!==A&&i(A)}}break}}};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}});return()=>{u.forEach(f=>f())}},[e,t,n,r,o,i])}function h2(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 FN(e){return e.type==="keydown"}function jN(e){return e.type.startsWith("mouse")}function zN(e){return e.type.startsWith("touch")}function BN(e,t){const n=e==="horizontal";if(jN(t))return n?t.clientX:t.clientY;if(zN(t)){const r=t.touches[0];return vt(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function Ghe(e,t,n,r){const o=n==="horizontal",i=lv(t);vt(i);const s=i.getAttribute("data-panel-group-id");vt(s);let{initialCursorPosition:a}=r;const l=BN(n,e),c=LN(s);vt(c);const u=c.getBoundingClientRect(),f=o?u.width:u.height;return(l-a)/f*100}function Yhe(e,t,n,r,o){if(FN(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:Ghe(e,t,n,r)}function Khe({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 sc(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:h,onExpand:g,onResize:v}=s;v&&v(r,f),u&&(h||g)&&(g&&(f==null||f===c)&&r!==c&&g(),h&&(f==null||f!==c)&&r===c&&h())}})}function jp(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 Xhe({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 sw=null,Ka=null;function VN(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 Qhe(){Ka!==null&&(document.head.removeChild(Ka),sw=null,Ka=null)}function t0(e){if(sw===e)return;sw=e;const t=VN(e);Ka===null&&(Ka=document.createElement("style"),document.head.appendChild(Ka)),Ka.innerHTML=`*{cursor: ${t}!important;}`}function Jhe(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function p2(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 HN(e){return`react-resizable-panels:${e}`}function WN(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 UN(e,t){try{const n=HN(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Zhe(e,t,n){var r,o;const i=(r=UN(e,n))!==null&&r!==void 0?r:{},s=WN(t);return(o=i[s])!==null&&o!==void 0?o:null}function epe(e,t,n,r,o){var i;const s=HN(e),a=WN(t),l=(i=UN(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 g2({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(!Zr(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=gc({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!Zr(o,0))for(let i=0;i<t.length;i++){const s=n[i];vt(s!=null);const a=s+o,l=gc({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,Zr(o,0)))break}return n}const tpe=100,ld={getItem:e=>(p2(ld),ld.getItem(e)),setItem:(e,t)=>{p2(ld),ld.setItem(e,t)}},m2={};function qN({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=ld,style:c,tagName:u="div",...f}){const h=X_(i),[g,v]=Kg(null),[b,w]=Kg([]),x=Ao({}),_=Ao(new Map),S=Ao(0),C=Ao({autoSaveId:e,direction:r,dragState:g,id:h,keyboardResizeBy:a,onLayout:s,storage:l}),E=Ao({layout:b,panelDataArray:[],panelDataArrayChanged:!1});Ao({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),AN(o,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:T}=E.current;return T},setLayout:T=>{const{onLayout:V}=C.current,{layout:X,panelDataArray:N}=E.current,ie=g2({layout:T,panelConstraints:N.map(fe=>fe.constraints)});h2(X,ie)||(w(ie),E.current.layout=ie,V&&V(ie),sc(N,ie,x.current))}}),[]),cf(()=>{C.current.autoSaveId=e,C.current.direction=r,C.current.dragState=g,C.current.id=h,C.current.onLayout=s,C.current.storage=l}),qhe({committedValuesRef:C,eagerValuesRef:E,groupId:h,layout:b,panelDataArray:E.current.panelDataArray,setLayout:w}),ul(()=>{const{panelDataArray:T}=E.current;if(e){if(b.length===0||b.length!==T.length)return;let V=m2[e];V==null&&(V=Jhe(epe,tpe),m2[e]=V);const X=[...T],N=new Map(_.current);V(e,X,N,b,l)}},[e,b,l]),ul(()=>{});const P=Yr(T=>{const{onLayout:V}=C.current,{layout:X,panelDataArray:N}=E.current;if(T.constraints.collapsible){const ie=N.map(se=>se.constraints),{collapsedSize:fe=0,panelSize:ue,pivotIndices:pe}=ac(N,T,X);if(vt(ue!=null),ue!==fe){_.current.set(T.id,ue);const ne=fc(N,T)===N.length-1?ue-fe:fe-ue,le=ad({delta:ne,layout:X,panelConstraints:ie,pivotIndices:pe,trigger:"imperative-api"});jp(X,le)||(w(le),E.current.layout=le,V&&V(le),sc(N,le,x.current))}}},[]),A=Yr(T=>{const{onLayout:V}=C.current,{layout:X,panelDataArray:N}=E.current;if(T.constraints.collapsible){const ie=N.map(ne=>ne.constraints),{collapsedSize:fe=0,panelSize:ue,minSize:pe=0,pivotIndices:se}=ac(N,T,X);if(ue===fe){const ne=_.current.get(T.id),le=ne!=null&&ne>=pe?ne:pe,Y=fc(N,T)===N.length-1?ue-le:le-ue,be=ad({delta:Y,layout:X,panelConstraints:ie,pivotIndices:se,trigger:"imperative-api"});jp(X,be)||(w(be),E.current.layout=be,V&&V(be),sc(N,be,x.current))}}},[]),k=Yr(T=>{const{layout:V,panelDataArray:X}=E.current,{panelSize:N}=ac(X,T,V);return vt(N!=null),N},[]),I=Yr((T,V)=>{const{panelDataArray:X}=E.current,N=fc(X,T);return Xhe({defaultSize:V,dragState:g,layout:b,panelData:X,panelIndex:N})},[g,b]),$=Yr(T=>{const{layout:V,panelDataArray:X}=E.current,{collapsedSize:N=0,collapsible:ie,panelSize:fe}=ac(X,T,V);return ie===!0&&fe===N},[]),L=Yr(T=>{const{layout:V,panelDataArray:X}=E.current,{collapsedSize:N=0,collapsible:ie,panelSize:fe}=ac(X,T,V);return vt(fe!=null),!ie||fe>N},[]),j=Yr(T=>{const{panelDataArray:V}=E.current;V.push(T),V.sort((X,N)=>{const ie=X.order,fe=N.order;return ie==null&&fe==null?0:ie==null?-1:fe==null?1:ie-fe}),E.current.panelDataArrayChanged=!0},[]);cf(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:T,onLayout:V,storage:X}=C.current,{layout:N,panelDataArray:ie}=E.current;let fe=null;if(T){const pe=Zhe(T,ie,X);pe&&(_.current=new Map(Object.entries(pe.expandToSizes)),fe=pe.layout)}fe==null&&(fe=Khe({panelDataArray:ie}));const ue=g2({layout:fe,panelConstraints:ie.map(pe=>pe.constraints)});h2(N,ue)||(w(ue),E.current.layout=ue,V&&V(ue),sc(ie,ue,x.current))}});const Q=Yr(T=>function(X){X.preventDefault();const{direction:N,dragState:ie,id:fe,keyboardResizeBy:ue,onLayout:pe}=C.current,{layout:se,panelDataArray:ne}=E.current,{initialLayout:le}=ie??{},ye=NN(fe,T);let Y=Yhe(X,T,N,ie,ue);if(Y===0)return;const be=N==="horizontal";document.dir==="rtl"&&be&&(Y=-Y);const _e=ne.map(Ue=>Ue.constraints),Pe=ad({delta:Y,layout:le??se,panelConstraints:_e,pivotIndices:ye,trigger:FN(X)?"keyboard":"mouse-or-touch"}),Te=!jp(se,Pe);(jN(X)||zN(X))&&S.current!=Y&&(S.current=Y,t0(Te?be?"horizontal":"vertical":be?Y<0?"horizontal-min":"horizontal-max":Y<0?"vertical-min":"vertical-max")),Te&&(w(Pe),E.current.layout=Pe,pe&&pe(Pe),sc(ne,Pe,x.current))},[]),ee=Yr((T,V)=>{const{onLayout:X}=C.current,{layout:N,panelDataArray:ie}=E.current,fe=ie.map(ye=>ye.constraints),{panelSize:ue,pivotIndices:pe}=ac(ie,T,N);vt(ue!=null);const ne=fc(ie,T)===ie.length-1?ue-V:V-ue,le=ad({delta:ne,layout:N,panelConstraints:fe,pivotIndices:pe,trigger:"imperative-api"});jp(N,le)||(w(le),E.current.layout=le,X&&X(le),sc(ie,le,x.current))},[]),B=Yr((T,V)=>{const{direction:X}=C.current,{layout:N}=E.current,ie=lv(T);vt(ie);const fe=BN(X,V);v({dragHandleId:T,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:fe,initialLayout:N})},[]),Z=Yr(()=>{Qhe(),v(null)},[]),G=Yr(T=>{const{panelDataArray:V}=E.current,X=fc(V,T);X>=0&&(V.splice(X,1),delete x.current[T.id],E.current.panelDataArrayChanged=!0)},[]),q=Bhe(()=>({collapsePanel:P,direction:r,dragState:g,expandPanel:A,getPanelSize:k,getPanelStyle:I,groupId:h,isPanelCollapsed:$,isPanelExpanded:L,registerPanel:j,registerResizeHandle:Q,resizePanel:ee,startDragging:B,stopDragging:Z,unregisterPanel:G}),[P,g,r,A,k,I,h,$,L,j,Q,ee,B,Z,G]),K={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return tu(av.Provider,{value:q},tu(u,{...f,children:t,className:n,style:{...K,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const GN=TN((e,t)=>tu(qN,{...e,forwardedRef:t}));qN.displayName="PanelGroup";GN.displayName="forwardRef(PanelGroup)";function fc(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function ac(e,t,n){const r=e.map(c=>c.constraints),o=fc(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 npe({disabled:e,handleId:t,resizeHandler:n}){ul(()=>{if(e||n==null)return;const r=lv(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=df(s),l=IN(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 Q_({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const c=Ao(null),u=Ao({onDragging:o});ul(()=>{u.current.onDragging=o});const f=DN(av);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:h,dragState:g,groupId:v,registerResizeHandle:b,startDragging:w,stopDragging:x}=f,_=X_(r),S=(g==null?void 0:g.dragHandleId)===_,[C,E]=Kg(!1),[P,A]=Kg(null),k=Yr(()=>{const $=c.current;vt($),$.blur(),x();const{onDragging:L}=u.current;L&&L(!1)},[x]);ul(()=>{if(n)A(null);else{const $=b(_);A(()=>$)}},[n,_,b]),ul(()=>{if(n||P==null||!S)return;const $=ee=>{P(ee)},L=ee=>{P(ee)},j=c.current;vt(j);const Q=j.ownerDocument;return Q.body.addEventListener("contextmenu",k),Q.body.addEventListener("mousemove",$),Q.body.addEventListener("touchmove",$),Q.body.addEventListener("mouseleave",L),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),()=>{Q.body.removeEventListener("contextmenu",k),Q.body.removeEventListener("mousemove",$),Q.body.removeEventListener("touchmove",$),Q.body.removeEventListener("mouseleave",L),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k)}},[h,n,S,P,k]),npe({disabled:n,handleId:_,resizeHandler:P});const I={cursor:VN(h),touchAction:"none",userSelect:"none"};return tu(a,{...l,children:e,className:t,onBlur:()=>E(!1),onFocus:()=>E(!0),onMouseDown:$=>{w(_,$.nativeEvent);const L=u.current;vt(L);const{onDragging:j}=L;j&&j(!0)},onMouseUp:k,onTouchCancel:k,onTouchEnd:k,onTouchStart:$=>{w(_,$.nativeEvent);const L=u.current;vt(L);const{onDragging:j}=L;j&&j(!0)},ref:c,role:"separator",style:{...I,...i},tabIndex:s,"data-panel-group-direction":h,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":S?"pointer":C?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}Q_.displayName="PanelResizeHandle";const YN=({className:e,...t})=>O.jsx(GN,{className:Ce("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),aw=kN,rpe=({withHandle:e,className:t,...n})=>O.jsx(Q_,{className:Ce("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&&O.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:O.jsx(tQ,{className:"h-2.5 w-2.5"})})}),ope=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>O.jsx(Q_,{className:Ce("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&&O.jsx("div",{className:Ce("z-50 flex items-center justify-start",{"border-l":r}),children:O.jsx(xr,{variant:"secondary",className:Ce("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?O.jsx(E1,{className:"size-4"}):O.jsx(N$,{className:"size-4"})})})});function ipe(e,t=[]){let n=[];function r(i,s){const a=H.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:g,...v}=f,b=(h==null?void 0:h[e][l])||a,w=H.useMemo(()=>v,Object.values(v));return O.jsx(b.Provider,{value:w,children:g})}function u(f,h){const g=(h==null?void 0:h[e][l])||a,v=H.useContext(g);if(v)return v;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=>H.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return H.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,spe(o,...t)]}function spe(...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 H.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ape(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function lpe(...e){return t=>e.forEach(n=>ape(n,t))}function KN(...e){return H.useCallback(lpe(...e),e)}function oa(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 cpe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function upe(...e){return t=>e.forEach(n=>cpe(n,t))}function Al(...e){return H.useCallback(upe(...e),e)}function dpe(e,t){const n=H.createContext(t);function r(i){const{children:s,...a}=i,l=H.useMemo(()=>a,Object.values(a));return O.jsx(n.Provider,{value:l,children:s})}function o(i){const s=H.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 fpe(e,t=[]){let n=[];function r(i,s){const a=H.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:g,...v}=f,b=(h==null?void 0:h[e][l])||a,w=H.useMemo(()=>v,Object.values(v));return O.jsx(b.Provider,{value:w,children:g})}function u(f,h){const g=(h==null?void 0:h[e][l])||a,v=H.useContext(g);if(v)return v;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=>H.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return H.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,hpe(o,...t)]}function hpe(...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 H.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Xg=globalThis!=null&&globalThis.document?H.useLayoutEffect:()=>{},ppe=H.useId||(()=>{}),gpe=0;function n0(e){const[t,n]=H.useState(ppe());return Xg(()=>{e||n(r=>r??String(gpe++))},[e]),e||(t?`radix-${t}`:"")}function xl(e){const t=H.useRef(e);return H.useEffect(()=>{t.current=e}),H.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function mpe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=vpe({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=xl(n),l=H.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 vpe({defaultProp:e,onChange:t}){const n=H.useState(e),[r]=n,o=H.useRef(r),i=xl(t);return H.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var bpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ps=bpe.reduce((e,t)=>{const n=H.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Um:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ype(e,t){e&&pw.flushSync(()=>e.dispatchEvent(t))}function xpe(e,t=globalThis==null?void 0:globalThis.document){const n=xl(e);H.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 wpe="DismissableLayer",lw="dismissableLayer.update",_pe="dismissableLayer.pointerDownOutside",Spe="dismissableLayer.focusOutside",v2,XN=H.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),QN=H.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=H.useContext(XN),[u,f]=H.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=H.useState({}),v=Al(t,A=>f(A)),b=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(w),_=u?b.indexOf(u):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,C=_>=x,E=Rpe(A=>{const k=A.target,I=[...c.branches].some($=>$.contains(k));!C||I||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},h),P=Ope(A=>{const k=A.target;[...c.branches].some($=>$.contains(k))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},h);return xpe(A=>{_===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},h),H.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(v2=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),b2(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=v2)}},[u,h,n,c]),H.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),b2())},[u,c]),H.useEffect(()=>{const A=()=>g({});return document.addEventListener(lw,A),()=>document.removeEventListener(lw,A)},[]),O.jsx(ps.div,{...l,ref:v,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:oa(e.onFocusCapture,P.onFocusCapture),onBlurCapture:oa(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:oa(e.onPointerDownCapture,E.onPointerDownCapture)})});QN.displayName=wpe;var Cpe="DismissableLayerBranch",Epe=H.forwardRef((e,t)=>{const n=H.useContext(XN),r=H.useRef(null),o=Al(t,r);return H.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),O.jsx(ps.div,{...e,ref:o})});Epe.displayName=Cpe;function Rpe(e,t=globalThis==null?void 0:globalThis.document){const n=xl(e),r=H.useRef(!1),o=H.useRef(()=>{});return H.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){JN(_pe,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 Ope(e,t=globalThis==null?void 0:globalThis.document){const n=xl(e),r=H.useRef(!1);return H.useEffect(()=>{const o=i=>{i.target&&!r.current&&JN(Spe,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 b2(){const e=new CustomEvent(lw);document.dispatchEvent(e)}function JN(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?ype(o,i):o.dispatchEvent(i)}var r0="focusScope.autoFocusOnMount",o0="focusScope.autoFocusOnUnmount",y2={bubbles:!1,cancelable:!0},Ppe="FocusScope",ZN=H.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=H.useState(null),c=xl(o),u=xl(i),f=H.useRef(null),h=Al(t,b=>l(b)),g=H.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;H.useEffect(()=>{if(r){let b=function(S){if(g.paused||!a)return;const C=S.target;a.contains(C)?f.current=C:js(f.current,{select:!0})},w=function(S){if(g.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||js(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&js(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const _=new MutationObserver(x);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),_.disconnect()}}},[r,a,g.paused]),H.useEffect(()=>{if(a){w2.add(g);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(r0,y2);a.addEventListener(r0,c),a.dispatchEvent(x),x.defaultPrevented||(Tpe(Mpe(e5(a)),{select:!0}),document.activeElement===b&&js(a))}return()=>{a.removeEventListener(r0,c),setTimeout(()=>{const x=new CustomEvent(o0,y2);a.addEventListener(o0,u),a.dispatchEvent(x),x.defaultPrevented||js(b??document.body,{select:!0}),a.removeEventListener(o0,u),w2.remove(g)},0)}}},[a,c,u,g]);const v=H.useCallback(b=>{if(!n&&!r||g.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(w&&x){const _=b.currentTarget,[S,C]=Dpe(_);S&&C?!b.shiftKey&&x===C?(b.preventDefault(),n&&js(S,{select:!0})):b.shiftKey&&x===S&&(b.preventDefault(),n&&js(C,{select:!0})):x===_&&b.preventDefault()}},[n,r,g.paused]);return O.jsx(ps.div,{tabIndex:-1,...s,ref:h,onKeyDown:v})});ZN.displayName=Ppe;function Tpe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(js(r,{select:t}),document.activeElement!==n)return}function Dpe(e){const t=e5(e),n=x2(t,e),r=x2(t.reverse(),e);return[n,r]}function e5(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 x2(e,t){for(const n of e)if(!Ape(n,{upTo:t}))return n}function Ape(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 $pe(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&&$pe(e)&&t&&e.select()}}var w2=kpe();function kpe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_2(e,t),e.unshift(t)},remove(t){var n;e=_2(e,t),(n=e[0])==null||n.resume()}}}function _2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mpe(e){return e.filter(t=>t.tagName!=="A")}var Ipe="Portal",t5=H.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=H.useState(!1);Xg(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Mo.createPortal(O.jsx(ps.div,{...r,ref:t}),s):null});t5.displayName=Ipe;function Npe(e,t){return H.useReducer((n,r)=>t[n][r]??n,e)}var cv=e=>{const{present:t,children:n}=e,r=Lpe(t),o=typeof n=="function"?n({present:r.isPresent}):H.Children.only(n),i=Al(r.ref,Fpe(o));return typeof n=="function"||r.isPresent?H.cloneElement(o,{ref:i}):null};cv.displayName="Presence";function Lpe(e){const[t,n]=H.useState(),r=H.useRef({}),o=H.useRef(e),i=H.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Npe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return H.useEffect(()=>{const c=zp(r.current);i.current=a==="mounted"?c:"none"},[a]),Xg(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,g=zp(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Xg(()=>{if(t){const c=f=>{const g=zp(r.current).includes(f.animationName);f.target===t&&g&&pw.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=zp(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:H.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function zp(e){return(e==null?void 0:e.animationName)||"none"}function Fpe(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 i0=0;function jpe(){H.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??S2()),document.body.insertAdjacentElement("beforeend",e[1]??S2()),i0++,()=>{i0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),i0--}},[])}function S2(){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 n5=Nk(),s0=function(){},uv=H.forwardRef(function(e,t){var n=H.useRef(null),r=H.useState({onScrollCapture:s0,onWheelCapture:s0,onTouchMoveCapture:s0}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,h=e.sideCar,g=e.noIsolation,v=e.inert,b=e.allowPinchZoom,w=e.as,x=w===void 0?"div":w,_=e.gapMode,S=t_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,E=Ik([n,t]),P=lr(lr({},S),o);return H.createElement(H.Fragment,null,u&&H.createElement(C,{sideCar:n5,removeScrollBar:c,shards:f,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:_}),s?H.cloneElement(H.Children.only(a),lr(lr({},P),{ref:E})):H.createElement(x,lr({},P,{className:l,ref:E}),a))});uv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};uv.classNames={fullWidth:wd,zeroRight:xd};var cw=!1;if(typeof window<"u")try{var Bp=Object.defineProperty({},"passive",{get:function(){return cw=!0,!0}});window.addEventListener("test",Bp,Bp),window.removeEventListener("test",Bp,Bp)}catch{cw=!1}var lc=cw?{passive:!1}:!1,zpe=function(e){return e.tagName==="TEXTAREA"},r5=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zpe(e)&&n[t]==="visible")},Bpe=function(e){return r5(e,"overflowY")},Vpe=function(e){return r5(e,"overflowX")},C2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=o5(e,r);if(o){var i=i5(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Hpe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Wpe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},o5=function(e,t){return e==="v"?Bpe(t):Vpe(t)},i5=function(e,t){return e==="v"?Hpe(t):Wpe(t)},Upe=function(e,t){return e==="h"&&t==="rtl"?-1:1},qpe=function(e,t,n,r,o){var i=Upe(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,h=0;do{var g=i5(e,a),v=g[0],b=g[1],w=g[2],x=b-w-i*v;(v||x)&&o5(e,a)&&(f+=x,h+=v),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(h)<1||!o&&-s>h))&&(c=!0),c},Vp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},E2=function(e){return[e.deltaX,e.deltaY]},R2=function(e){return e&&"current"in e?e.current:e},Gpe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ype=function(e){return`
413
- .block-interactivity-`.concat(e,` {pointer-events: none;}
414
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
415
- `)},Kpe=0,cc=[];function Xpe(e){var t=H.useRef([]),n=H.useRef([0,0]),r=H.useRef(),o=H.useState(Kpe++)[0],i=H.useState(n_)[0],s=H.useRef(e);H.useEffect(function(){s.current=e},[e]),H.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=Mk([e.lockRef.current],(e.shards||[]).map(R2),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=H.useCallback(function(b,w){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=Vp(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-x[0],C="deltaY"in b?b.deltaY:_[1]-x[1],E,P=b.target,A=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in b&&A==="h"&&P.type==="range")return!1;var k=C2(A,P);if(!k)return!0;if(k?E=A:(E=A==="v"?"h":"v",k=C2(A,P)),!k)return!1;if(!r.current&&"changedTouches"in b&&(S||C)&&(r.current=E),!E)return!0;var I=r.current||E;return qpe(I,w,b,I==="h"?S:C,!0)},[]),l=H.useCallback(function(b){var w=b;if(!(!cc.length||cc[cc.length-1]!==i)){var x="deltaY"in w?E2(w):Vp(w),_=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Gpe(E.delta,x)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(R2).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=H.useCallback(function(b,w,x,_){var S={name:b,delta:w,target:x,should:_,shadowParent:Qpe(x)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=H.useCallback(function(b){n.current=Vp(b),r.current=void 0},[]),f=H.useCallback(function(b){c(b.type,E2(b),b.target,a(b,e.lockRef.current))},[]),h=H.useCallback(function(b){c(b.type,Vp(b),b.target,a(b,e.lockRef.current))},[]);H.useEffect(function(){return cc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,lc),document.addEventListener("touchmove",l,lc),document.addEventListener("touchstart",u,lc),function(){cc=cc.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,lc),document.removeEventListener("touchmove",l,lc),document.removeEventListener("touchstart",u,lc)}},[]);var g=e.removeScrollBar,v=e.inert;return H.createElement(H.Fragment,null,v?H.createElement(i,{styles:Ype(o)}):null,g?H.createElement(zk,{gapMode:e.gapMode}):null)}function Qpe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Jpe=Fk(n5,Xpe);var s5=H.forwardRef(function(e,t){return H.createElement(uv,lr({},e,{ref:t,sideCar:Jpe}))});s5.classNames=uv.classNames;const Zpe=s5;var J_="Dialog",[a5,l5]=fpe(J_),[ege,ti]=a5(J_),c5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=H.useRef(null),l=H.useRef(null),[c=!1,u]=mpe({prop:r,defaultProp:o,onChange:i});return O.jsx(ege,{scope:t,triggerRef:a,contentRef:l,contentId:n0(),titleId:n0(),descriptionId:n0(),open:c,onOpenChange:u,onOpenToggle:H.useCallback(()=>u(f=>!f),[u]),modal:s,children:n})};c5.displayName=J_;var u5="DialogTrigger",d5=H.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ti(u5,n),i=Al(t,o.triggerRef);return O.jsx(ps.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":tS(o.open),...r,ref:i,onClick:oa(e.onClick,o.onOpenToggle)})});d5.displayName=u5;var Z_="DialogPortal",[tge,f5]=a5(Z_,{forceMount:void 0}),h5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=ti(Z_,t);return O.jsx(tge,{scope:t,forceMount:n,children:H.Children.map(r,s=>O.jsx(cv,{present:n||i.open,children:O.jsx(t5,{asChild:!0,container:o,children:s})}))})};h5.displayName=Z_;var Qg="DialogOverlay",p5=H.forwardRef((e,t)=>{const n=f5(Qg,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ti(Qg,e.__scopeDialog);return i.modal?O.jsx(cv,{present:r||i.open,children:O.jsx(nge,{...o,ref:t})}):null});p5.displayName=Qg;var nge=H.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ti(Qg,n);return O.jsx(Zpe,{as:Um,allowPinchZoom:!0,shards:[o.contentRef],children:O.jsx(ps.div,{"data-state":tS(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),wl="DialogContent",g5=H.forwardRef((e,t)=>{const n=f5(wl,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ti(wl,e.__scopeDialog);return O.jsx(cv,{present:r||i.open,children:i.modal?O.jsx(rge,{...o,ref:t}):O.jsx(oge,{...o,ref:t})})});g5.displayName=wl;var rge=H.forwardRef((e,t)=>{const n=ti(wl,e.__scopeDialog),r=H.useRef(null),o=Al(t,n.contentRef,r);return H.useEffect(()=>{const i=r.current;if(i)return zm(i)},[]),O.jsx(m5,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oa(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:oa(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:oa(e.onFocusOutside,i=>i.preventDefault())})}),oge=H.forwardRef((e,t)=>{const n=ti(wl,e.__scopeDialog),r=H.useRef(!1),o=H.useRef(!1);return O.jsx(m5,{...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()}})}),m5=H.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=ti(wl,n),l=H.useRef(null),c=Al(t,l);return jpe(),O.jsxs(O.Fragment,{children:[O.jsx(ZN,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:O.jsx(QN,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":tS(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),O.jsxs(O.Fragment,{children:[O.jsx(sge,{titleId:a.titleId}),O.jsx(lge,{contentRef:l,descriptionId:a.descriptionId})]})]})}),eS="DialogTitle",v5=H.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ti(eS,n);return O.jsx(ps.h2,{id:o.titleId,...r,ref:t})});v5.displayName=eS;var b5="DialogDescription",y5=H.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ti(b5,n);return O.jsx(ps.p,{id:o.descriptionId,...r,ref:t})});y5.displayName=b5;var x5="DialogClose",w5=H.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ti(x5,n);return O.jsx(ps.button,{type:"button",...r,ref:t,onClick:oa(e.onClick,()=>o.onOpenChange(!1))})});w5.displayName=x5;function tS(e){return e?"open":"closed"}var _5="DialogTitleWarning",[ige,S5]=dpe(_5,{contentName:wl,titleName:eS,docsSlug:"dialog"}),sge=({titleId:e})=>{const t=S5(_5),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
416
-
417
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
418
-
419
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return H.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},age="DialogDescriptionWarning",lge=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${S5(age).contentName}}.`;return H.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},C5=c5,E5=d5,R5=h5,nS=p5,rS=g5,oS=v5,iS=y5,sS=w5;function cge(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 O5="AlertDialog",[uge,Eye]=ipe(O5,[l5]),gs=l5(),P5=e=>{const{__scopeAlertDialog:t,...n}=e,r=gs(t);return O.jsx(C5,{...r,...n,modal:!0})};P5.displayName=O5;var dge="AlertDialogTrigger",fge=H.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=gs(n);return O.jsx(E5,{...o,...r,ref:t})});fge.displayName=dge;var hge="AlertDialogPortal",T5=e=>{const{__scopeAlertDialog:t,...n}=e,r=gs(t);return O.jsx(R5,{...r,...n})};T5.displayName=hge;var pge="AlertDialogOverlay",D5=H.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=gs(n);return O.jsx(nS,{...o,...r,ref:t})});D5.displayName=pge;var Sc="AlertDialogContent",[gge,mge]=uge(Sc),A5=H.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=gs(n),s=H.useRef(null),a=KN(t,s),l=H.useRef(null);return O.jsx(ige,{contentName:Sc,titleName:$5,docsSlug:"alert-dialog",children:O.jsx(gge,{scope:n,cancelRef:l,children:O.jsxs(rS,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:cge(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[O.jsx(aM,{children:r}),O.jsx(bge,{contentRef:s})]})})})});A5.displayName=Sc;var $5="AlertDialogTitle",k5=H.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=gs(n);return O.jsx(oS,{...o,...r,ref:t})});k5.displayName=$5;var M5="AlertDialogDescription",I5=H.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=gs(n);return O.jsx(iS,{...o,...r,ref:t})});I5.displayName=M5;var vge="AlertDialogAction",N5=H.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=gs(n);return O.jsx(sS,{...o,...r,ref:t})});N5.displayName=vge;var L5="AlertDialogCancel",F5=H.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=mge(L5,n),i=gs(n),s=KN(t,o);return O.jsx(sS,{...i,...r,ref:s})});F5.displayName=L5;var bge=({contentRef:e})=>{const t=`\`${Sc}\` requires a description for the component to be accessible for screen reader users.
420
-
421
- You can add a description to the \`${Sc}\` by passing a \`${M5}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
422
-
423
- 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 \`${Sc}\`. 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.
424
-
425
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return H.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},yge=P5,xge=T5,j5=D5,z5=A5,B5=N5,V5=F5,H5=k5,W5=I5;const wge=yge,_ge=xge,U5=H.forwardRef(({className:e,...t},n)=>O.jsx(j5,{className:Ce("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}));U5.displayName=j5.displayName;const q5=H.forwardRef(({className:e,...t},n)=>O.jsx(_ge,{children:O.jsxs(au,{children:[O.jsx(U5,{}),O.jsx(z5,{ref:n,className:Ce("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})]})}));q5.displayName=z5.displayName;const G5=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});G5.displayName="AlertDialogHeader";const Y5=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Y5.displayName="AlertDialogFooter";const K5=H.forwardRef(({className:e,...t},n)=>O.jsx(H5,{ref:n,className:Ce("text-lg font-semibold",e),...t}));K5.displayName=H5.displayName;const X5=H.forwardRef(({className:e,...t},n)=>O.jsx(W5,{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));X5.displayName=W5.displayName;const Q5=H.forwardRef(({className:e,...t},n)=>O.jsx(B5,{ref:n,className:Ce(Vd(),e),...t}));Q5.displayName=B5.displayName;const J5=H.forwardRef(({className:e,...t},n)=>O.jsx(V5,{ref:n,className:Ce(Vd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));J5.displayName=V5.displayName;function Sge({open:e,setOpen:t}){const n=ke(i=>i.selectedSheetId),{deleteSheet:r}=co();function o(){n&&(r(n),t(!1))}return O.jsx(wge,{open:e,onOpenChange:t,children:O.jsxs(q5,{children:[O.jsxs(G5,{children:[O.jsx(K5,{children:"Delete Sheet"}),O.jsx(X5,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),O.jsxs(Y5,{children:[O.jsx(J5,{children:"Cancel"}),O.jsx(Q5,{onClick:o,children:"Delete"})]})]})})}function Z5(){var b,w;const[e,t]=m.useState(!1),n=ke(x=>{var _;return(_=x.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=ma(),o=m.useRef(null),[i,s]=m.useState(!1),a=ke(x=>x.isDashboardEditing),l=ke(x=>x.themeStyle);ke(x=>x.isVisualEditing);const c=ke(x=>x.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:f,addSheet:h}=co();if(!n)return null;function g(x){var _,S;x?((_=o.current)==null||_.resize(35),s(!0)):(s(!1),(S=o.current)==null||S.resize(0))}function v(){const x={id:la(),title:"New Sheet"};h(x)}return O.jsxs(kw,{role:"dashboard-tabs-container",className:Ce("relative flex grow flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:x=>{u(x)},value:c||n[0].id,children:[O.jsx("div",{children:(n.length>1||a)&&O.jsxs(dm,{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(x=>{var _,S;return O.jsx(is,{text:x.title,onSave:C=>f(x.id,C),children:O.jsxs(fm,{style:{borderRadius:(S=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:S.borderRadius},onClick:()=>u(x.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:x.id,children:[x.title,a&&c===x.id&&n.length>1&&O.jsx($m,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},x.id)}),a&&O.jsx("div",{style:{borderRadius:(w=(b=l==null?void 0:l.chart)==null?void 0:b.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:v,children:O.jsx(R1,{className:"size-3"})})]})}),O.jsxs(YN,{className:"grow",direction:"horizontal",children:[O.jsx(aw,{children:O.jsx("div",{style:{},children:n==null?void 0:n.map(x=>O.jsx(Mw,{className:Ce("mt-0",{"bg-muted":(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)}),value:x.id,children:O.jsx(Hae,{})},x.id))})}),r===!0&&O.jsxs(O.Fragment,{children:[O.jsx(ope,{open:i,onTabClick:g,withHandle:!0}),O.jsx(aw,{onResize:x=>{x<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:O.jsx(Lhe,{})})]})]}),O.jsx(Sge,{open:e,setOpen:t})]})}function eL({children:e}){return O.jsx(bB,{defaultTheme:"system",storageKey:"vite-ui-theme",children:O.jsx(DJ,{delayDuration:0,children:e})})}function tL(e){return O.jsx(dk,{dashboardProps:e,children:O.jsx(eL,{children:O.jsx(RD,{...e,children:O.jsx(Z5,{})})})})}const nL=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Ege);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(uw,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(uw,he({},r,{ref:t}),n)});nL.displayName="Slot";const uw=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Rge(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});uw.displayName="SlotClone";const Cge=({children:e})=>m.createElement(m.Fragment,null,e);function Ege(e){return m.isValidElement(e)&&e.type===Cge}function Rge(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 dw=["Enter"," "],Oge=["ArrowDown","PageUp","Home"],rL=["ArrowUp","PageDown","End"],Pge=[...Oge,...rL],Tge={ltr:[...dw,"ArrowRight"],rtl:[...dw,"ArrowLeft"]},Dge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},dv="Menu",[ff,Age,$ge]=um(dv),[$l,oL]=Zn(dv,[$ge,Ti,ou]),aS=Ti(),iL=ou(),[kge,kl]=$l(dv),[Mge,eh]=$l(dv),Ige=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=aS(t),[l,c]=m.useState(null),u=m.useRef(!1),f=Ln(i),h=_l(o);return m.useEffect(()=>{const g=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Bf,a,m.createElement(kge,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(Mge,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:h,modal:s},r)))},sL=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=aS(n);return m.createElement(Vf,he({},o,r,{ref:t}))}),aL="MenuPortal",[Nge,lL]=$l(aL,{forceMount:void 0}),Lge=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=kl(aL,t);return m.createElement(Nge,{scope:t,forceMount:n},m.createElement(er,{present:n||i.open},m.createElement(M1,{asChild:!0,container:o},r)))},Qo="MenuContent",[Fge,lS]=$l(Qo),jge=m.forwardRef((e,t)=>{const n=lL(Qo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Qo,e.__scopeMenu),s=eh(Qo,e.__scopeMenu);return m.createElement(ff.Provider,{scope:e.__scopeMenu},m.createElement(er,{present:r||i.open},m.createElement(ff.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(zge,he({},o,{ref:t})):m.createElement(Bge,he({},o,{ref:t})))))}),zge=m.forwardRef((e,t)=>{const n=kl(Qo,e.__scopeMenu),r=m.useRef(null),o=_t(t,r);return m.useEffect(()=>{const i=r.current;if(i)return zm(i)},[]),m.createElement(cS,he({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),Bge=m.forwardRef((e,t)=>{const n=kl(Qo,e.__scopeMenu);return m.createElement(cS,he({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),cS=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:h,onDismiss:g,disableOutsideScroll:v,...b}=e,w=kl(Qo,n),x=eh(Qo,n),_=aS(n),S=iL(n),C=Age(n),[E,P]=m.useState(null),A=m.useRef(null),k=_t(t,A,w.onContentChange),I=m.useRef(0),$=m.useRef(""),L=m.useRef(0),j=m.useRef(null),Q=m.useRef("right"),ee=m.useRef(0),B=v?r_:m.Fragment,Z=v?{as:nL,allowPinchZoom:!0}:void 0,G=K=>{var T,V;const X=$.current+K,N=C().filter(ne=>!ne.disabled),ie=document.activeElement,fe=(T=N.find(ne=>ne.ref.current===ie))===null||T===void 0?void 0:T.textValue,ue=N.map(ne=>ne.textValue),pe=sme(ue,X,fe),se=(V=N.find(ne=>ne.textValue===pe))===null||V===void 0?void 0:V.ref.current;(function ne(le){$.current=le,window.clearTimeout(I.current),le!==""&&(I.current=window.setTimeout(()=>ne(""),1e3))})(X),se&&setTimeout(()=>se.focus())};m.useEffect(()=>()=>window.clearTimeout(I.current),[]),Z1();const q=m.useCallback(K=>{var T,V;return Q.current===((T=j.current)===null||T===void 0?void 0:T.side)&&lme(K,(V=j.current)===null||V===void 0?void 0:V.area)},[]);return m.createElement(Fge,{scope:n,searchRef:$,onItemEnter:m.useCallback(K=>{q(K)&&K.preventDefault()},[q]),onItemLeave:m.useCallback(K=>{var T;q(K)||((T=A.current)===null||T===void 0||T.focus(),P(null))},[q]),onTriggerLeave:m.useCallback(K=>{q(K)&&K.preventDefault()},[q]),pointerGraceTimerRef:L,onPointerGraceIntentChange:m.useCallback(K=>{j.current=K},[])},m.createElement(B,Z,m.createElement(e_,{asChild:!0,trapped:o,onMountAutoFocus:Me(i,K=>{var T;K.preventDefault(),(T=A.current)===null||T===void 0||T.focus()}),onUnmountAutoFocus:s},m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:g},m.createElement(Dw,he({asChild:!0},S,{dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:P,onEntryFocus:Me(l,K=>{x.isUsingKeyboardRef.current||K.preventDefault()})}),m.createElement(Hf,he({role:"menu","aria-orientation":"vertical","data-state":hL(w.open),"data-radix-menu-content":"",dir:x.dir},_,b,{ref:k,style:{outline:"none",...b.style},onKeyDown:Me(b.onKeyDown,K=>{const V=K.target.closest("[data-radix-menu-content]")===K.currentTarget,X=K.ctrlKey||K.altKey||K.metaKey,N=K.key.length===1;V&&(K.key==="Tab"&&K.preventDefault(),!X&&N&&G(K.key));const ie=A.current;if(K.target!==ie||!Pge.includes(K.key))return;K.preventDefault();const ue=C().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);rL.includes(K.key)&&ue.reverse(),ome(ue)}),onBlur:Me(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(I.current),$.current="")}),onPointerMove:Me(e.onPointerMove,hf(K=>{const T=K.target,V=ee.current!==K.clientX;if(K.currentTarget.contains(T)&&V){const X=K.clientX>ee.current?"right":"left";Q.current=X,ee.current=K.clientX}}))})))))))}),Vge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({role:"group"},r,{ref:t}))}),Hge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({},r,{ref:t}))}),fw="MenuItem",O2="menu.itemSelect",uS=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=eh(fw,e.__scopeMenu),a=lS(fw,e.__scopeMenu),l=_t(t,i),c=m.useRef(!1),u=()=>{const f=i.current;if(!n&&f){const h=new CustomEvent(O2,{bubbles:!0,cancelable:!0});f.addEventListener(O2,g=>r==null?void 0:r(g),{once:!0}),PD(f,h),h.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(cL,he({},o,{ref:l,disabled:n,onClick:Me(e.onClick,u),onPointerDown:f=>{var h;(h=e.onPointerDown)===null||h===void 0||h.call(e,f),c.current=!0},onPointerUp:Me(e.onPointerUp,f=>{var h;c.current||(h=f.currentTarget)===null||h===void 0||h.click()}),onKeyDown:Me(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||dw.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),cL=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=lS(fw,n),a=iL(n),l=m.useRef(null),c=_t(t,l),[u,f]=m.useState(!1),[h,g]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;g(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),m.createElement(ff.ItemSlot,{scope:n,disabled:r,textValue:o??h},m.createElement(Aw,he({asChild:!0},a,{focusable:!r}),m.createElement(Qe.div,he({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:Me(e.onPointerMove,hf(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Me(e.onPointerLeave,hf(v=>s.onItemLeave(v))),onFocus:Me(e.onFocus,()=>f(!0)),onBlur:Me(e.onBlur,()=>f(!1))}))))}),Wge=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(dL,{scope:e.__scopeMenu,checked:n},m.createElement(uS,he({role:"menuitemcheckbox","aria-checked":Jg(n)?"mixed":n},o,{ref:t,"data-state":dS(n),onSelect:Me(o.onSelect,()=>r==null?void 0:r(Jg(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),Uge="MenuRadioGroup",[qge,Gge]=$l(Uge,{value:void 0,onValueChange:()=>{}}),Yge=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Ln(r);return m.createElement(qge,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(Vge,he({},o,{ref:t})))}),Kge="MenuRadioItem",Xge=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Gge(Kge,e.__scopeMenu),i=n===o.value;return m.createElement(dL,{scope:e.__scopeMenu,checked:i},m.createElement(uS,he({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":dS(i),onSelect:Me(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),uL="MenuItemIndicator",[dL,Qge]=$l(uL,{checked:!1}),Jge=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Qge(uL,n);return m.createElement(er,{present:r||Jg(i.checked)||i.checked===!0},m.createElement(Qe.span,he({},o,{ref:t,"data-state":dS(i.checked)})))}),Zge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),eme="MenuSub",[Rye,fL]=$l(eme),Hp="MenuSubTrigger",tme=m.forwardRef((e,t)=>{const n=kl(Hp,e.__scopeMenu),r=eh(Hp,e.__scopeMenu),o=fL(Hp,e.__scopeMenu),i=lS(Hp,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(sL,he({asChild:!0},c),m.createElement(cL,he({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":hL(n.open)},e,{ref:cs(t,o.onTriggerChange),onClick:f=>{var h;(h=e.onClick)===null||h===void 0||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Me(e.onPointerMove,hf(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,hf(f=>{var h;u();const g=(h=n.content)===null||h===void 0?void 0:h.getBoundingClientRect();if(g){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,w=b==="right",x=w?-5:5,_=g[w?"left":"right"],S=g[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:_,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:_,y:g.bottom}],side:b}),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 h=i.searchRef.current!=="";if(!(e.disabled||h&&f.key===" ")&&Tge[r.dir].includes(f.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),f.preventDefault()}})})))}),nme="MenuSubContent",rme=m.forwardRef((e,t)=>{const n=lL(Qo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Qo,e.__scopeMenu),s=eh(Qo,e.__scopeMenu),a=fL(nme,e.__scopeMenu),l=m.useRef(null),c=_t(t,l);return m.createElement(ff.Provider,{scope:e.__scopeMenu},m.createElement(er,{present:r||i.open},m.createElement(ff.Slot,{scope:e.__scopeMenu},m.createElement(cS,he({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),h=Dge[s.dir].includes(u.key);if(f&&h){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),u.preventDefault()}})})))))});function hL(e){return e?"open":"closed"}function Jg(e){return e==="indeterminate"}function dS(e){return Jg(e)?"indeterminate":e?"checked":"unchecked"}function ome(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ime(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function sme(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=ime(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 ame(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 lme(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ame(n,t)}function hf(e){return t=>t.pointerType==="mouse"?e(t):void 0}const cme=Ige,ume=sL,dme=Lge,fme=jge,hme=Hge,pme=uS,gme=Wge,mme=Yge,vme=Xge,bme=Jge,yme=Zge,xme=tme,wme=rme,pL="DropdownMenu",[_me,Oye]=Zn(pL,[oL]),po=oL(),[Sme,gL]=_me(pL),Cme=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=po(t),c=m.useRef(null),[u=!1,f]=wr({prop:o,defaultProp:i,onChange:s});return m.createElement(Sme,{scope:t,triggerId:Jo(),triggerRef:c,contentId:Jo(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:a},m.createElement(cme,he({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},Eme="DropdownMenuTrigger",Rme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=gL(Eme,n),s=po(n);return m.createElement(ume,he({asChild:!0},s),m.createElement(Qe.button,he({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:cs(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())})})))}),Ome=e=>{const{__scopeDropdownMenu:t,...n}=e,r=po(t);return m.createElement(dme,he({},r,n))},Pme="DropdownMenuContent",Tme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=gL(Pme,n),i=po(n),s=m.useRef(!1);return m.createElement(fme,he({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)"}}))}),Dme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(hme,he({},o,r,{ref:t}))}),Ame=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(pme,he({},o,r,{ref:t}))}),$me=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(gme,he({},o,r,{ref:t}))}),kme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(mme,he({},o,r,{ref:t}))}),Mme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(vme,he({},o,r,{ref:t}))}),Ime=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(bme,he({},o,r,{ref:t}))}),Nme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(yme,he({},o,r,{ref:t}))}),Lme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(xme,he({},o,r,{ref:t}))}),Fme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(wme,he({},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)"}}))}),jme=Cme,zme=Rme,Bme=Ome,mL=Tme,vL=Dme,bL=Ame,yL=$me,Vme=kme,xL=Mme,wL=Ime,_L=Nme,SL=Lme,CL=Fme,Hme=jme,Wme=zme,Ume=Vme,qme=H.forwardRef(({className:e,inset:t,children:n,...r},o)=>O.jsxs(SL,{ref:o,className:Ce("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,O.jsx(E1,{className:"ml-auto h-4 w-4"})]}));qme.displayName=SL.displayName;const Gme=H.forwardRef(({className:e,...t},n)=>O.jsx(CL,{ref:n,className:Ce("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}));Gme.displayName=CL.displayName;const EL=H.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(Bme,{children:O.jsx(au,{children:O.jsx(mL,{ref:r,sideOffset:t,className:Ce("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})})}));EL.displayName=mL.displayName;const Yme=H.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(bL,{ref:r,className:Ce("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}));Yme.displayName=bL.displayName;const Kme=H.forwardRef(({className:e,children:t,checked:n,...r},o)=>O.jsxs(yL,{ref:o,className:Ce("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(wL,{children:O.jsx(Ff,{className:"h-4 w-4"})})}),t]}));Kme.displayName=yL.displayName;const RL=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(xL,{ref:r,className:Ce("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(wL,{children:O.jsx(L$,{className:"h-2 w-2 fill-current"})})}),t]}));RL.displayName=xL.displayName;const OL=H.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(vL,{ref:r,className:Ce("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));OL.displayName=vL.displayName;const PL=H.forwardRef(({className:e,...t},n)=>O.jsx(_L,{ref:n,className:Ce("-mx-1 my-1 h-px bg-muted",e),...t}));PL.displayName=_L.displayName;function Xme(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=>TL(s))}})}})}}function TL(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:Qme(e.customCfg),data:[]}}function Qme(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 DL(e){return`semaphor:bookmark:${e}`}const Jme=C5,Zme=E5,eve=R5,AL=H.forwardRef(({className:e,...t},n)=>O.jsx(nS,{ref:n,className:Ce("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}));AL.displayName=nS.displayName;const $L=H.forwardRef(({className:e,children:t,...n},r)=>O.jsx(eve,{children:O.jsxs(au,{children:[O.jsx(AL,{}),O.jsxs(rS,{ref:r,className:Ce("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,O.jsxs(sS,{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:[O.jsx($m,{className:"h-4 w-4"}),O.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));$L.displayName=rS.displayName;const kL=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});kL.displayName="DialogHeader";const ML=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ML.displayName="DialogFooter";const IL=H.forwardRef(({className:e,...t},n)=>O.jsx(oS,{ref:n,className:Ce("text-lg font-semibold leading-none tracking-tight",e),...t}));IL.displayName=oS.displayName;const NL=H.forwardRef(({className:e,...t},n)=>O.jsx(iS,{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));NL.displayName=iS.displayName;const LL="Checkbox",[tve,Pye]=Zn(LL),[nve,rve]=tve(LL),ove=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,h]=m.useState(null),g=_t(t,S=>h(S)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[w=!1,x]=wr({prop:o,defaultProp:i,onChange:c}),_=m.useRef(w);return m.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const C=()=>x(_.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[f,x]),m.createElement(nve,{scope:n,state:w,disabled:a},m.createElement(Qe.button,he({type:"button",role:"checkbox","aria-checked":dl(w)?"mixed":w,"aria-required":s,"data-state":FL(w),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onKeyDown:Me(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Me(e.onClick,S=>{x(C=>dl(C)?!0:!C),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(ave,{control:f,bubbles:!v.current,name:r,value:l,checked:w,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),ive="CheckboxIndicator",sve=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=rve(ive,n);return m.createElement(er,{present:r||dl(i.state)||i.state===!0},m.createElement(Qe.span,he({"data-state":FL(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),ave=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=jm(n),a=Im(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});l.indeterminate=dl(n),f.call(l,dl(n)?!1:n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",he({type:"checkbox","aria-hidden":!0,defaultChecked:dl(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function dl(e){return e==="indeterminate"}function FL(e){return dl(e)?"indeterminate":e?"checked":"unchecked"}const jL=ove,lve=sve,zL=H.forwardRef(({className:e,...t},n)=>O.jsx(jL,{ref:n,className:Ce("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:O.jsx(lve,{className:Ce("flex items-center justify-center text-current"),children:O.jsx(Ff,{className:"h-4 w-4"})})}));zL.displayName=jL.displayName;const BL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{role:"editor-panel",ref:n,className:Ce("flex grow h-full",e),...t}));BL.displayName="EditorPanel";const VL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce(" flex flex-col space-y-2 w-[270px]",e),...t}));VL.displayName="EditorAside";const HL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce(" grow",e),...t}));HL.displayName="EditorMain";function cve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P2(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 T2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P2(Object(n),!0).forEach(function(r){cve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uve(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 dve(e,t){if(e==null)return{};var n=uve(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 fve(e,t){return hve(e)||pve(e,t)||gve(e,t)||mve()}function hve(e){if(Array.isArray(e))return e}function pve(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 gve(e,t){if(e){if(typeof e=="string")return D2(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 D2(e,t)}}function D2(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 mve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
426
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A2(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 $2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A2(Object(n),!0).forEach(function(r){vve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bve(){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 cd(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 Zg(e){return{}.toString.call(e).includes("Object")}function yve(e){return!Object.keys(e).length}function pf(e){return typeof e=="function"}function xve(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wve(e,t){return Zg(t)||ia("changeType"),Object.keys(t).some(function(n){return!xve(e,n)})&&ia("changeField"),t}function _ve(e){pf(e)||ia("selectorType")}function Sve(e){pf(e)||Zg(e)||ia("handlerType"),Zg(e)&&Object.values(e).some(function(t){return!pf(t)})&&ia("handlersType")}function Cve(e){e||ia("initialIsRequired"),Zg(e)||ia("initialType"),yve(e)&&ia("initialContent")}function Eve(e,t){throw new Error(e[t]||e.default)}var Rve={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"},ia=cd(Eve)(Rve),Wp={changes:wve,selector:_ve,handler:Sve,initial:Cve};function Ove(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Wp.initial(e),Wp.handler(t);var n={current:e},r=cd(Dve)(n,t),o=cd(Tve)(n),i=cd(Wp.changes)(e),s=cd(Pve)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Wp.selector(c),c(n.current)}function l(c){bve(r,o,i,s)(c)}return[a,l]}function Pve(e,t){return pf(t)?t(e.current):t}function Tve(e,t){return e.current=$2($2({},e.current),t),t}function Dve(e,t,n){return pf(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 Ave={create:Ove},$ve={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function kve(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 Mve(e){return{}.toString.call(e).includes("Object")}function Ive(e){return e||k2("configIsRequired"),Mve(e)||k2("configType"),e.urls?(Nve(),{paths:{vs:e.urls.monacoBase}}):e}function Nve(){console.warn(WL.deprecation)}function Lve(e,t){throw new Error(e[t]||e.default)}var WL={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!
427
- You are using deprecated way of configuration.
428
-
429
- Instead of using
430
- monaco.config({ urls: { monacoBase: '...' } })
431
- use
432
- monaco.config({ paths: { vs: '...' } })
433
-
434
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
435
- `},k2=kve(Lve)(WL),Fve={config:Ive},jve=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 UL(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],UL(e[n],t[n]))}),T2(T2({},e),t)}var zve={type:"cancelation",msg:"operation is manually canceled"};function a0(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(zve):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Bve=Ave.create({config:$ve,isInitialized:!1,resolve:null,reject:null,monaco:null}),qL=fve(Bve,2),th=qL[0],fv=qL[1];function Vve(e){var t=Fve.config(e),n=t.monaco,r=dve(t,["monaco"]);fv(function(o){return{config:UL(o.config,r),monaco:n}})}function Hve(){var e=th(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(fv({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),a0(l0);if(window.monaco&&window.monaco.editor)return GL(window.monaco),e.resolve(window.monaco),a0(l0);jve(Wve,qve)(Gve)}return a0(l0)}function Wve(e){return document.body.appendChild(e)}function Uve(e){var t=document.createElement("script");return e&&(t.src=e),t}function qve(e){var t=th(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=Uve("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Gve(){var e=th(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){GL(n),e.resolve(n)},function(n){e.reject(n)})}function GL(e){th().monaco||fv({monaco:e})}function Yve(){return th(function(e){var t=e.monaco;return t})}var l0=new Promise(function(e,t){return fv({resolve:e,reject:t})}),YL={config:Vve,init:Hve,__getMonacoInstance:Yve},Kve={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},c0=Kve,Xve={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Qve=Xve;function Jve({children:e}){return m.createElement("div",{style:Qve.container},e)}var Zve=Jve,ebe=Zve;function tbe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...c0.wrapper,width:e,height:t},...s},!n&&m.createElement(ebe,null,r),m.createElement("div",{ref:o,style:{...c0.fullWidth,...!n&&c0.hide},className:i}))}var nbe=tbe,KL=m.memo(nbe);function rbe(e){m.useEffect(e,[])}var XL=rbe;function obe(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var to=obe;function Cd(){}function mc(e,t,n,r){return ibe(e,r)||sbe(e,t,n,r)}function ibe(e,t){return e.editor.getModel(QL(e,t))}function sbe(e,t,n,r){return e.editor.createModel(t,n,r?QL(e,r):void 0)}function QL(e,t){return e.Uri.parse(t)}function abe({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:h="100%",width:g="100%",className:v,wrapperProps:b={},beforeMount:w=Cd,onMount:x=Cd}){let[_,S]=m.useState(!1),[C,E]=m.useState(!0),P=m.useRef(null),A=m.useRef(null),k=m.useRef(null),I=m.useRef(x),$=m.useRef(w),L=m.useRef(!1);XL(()=>{let B=YL.init();return B.then(Z=>(A.current=Z)&&E(!1)).catch(Z=>(Z==null?void 0:Z.type)!=="cancelation"&&console.error("Monaco initialization: error:",Z)),()=>P.current?ee():B.cancel()}),to(()=>{if(P.current&&A.current){let B=P.current.getOriginalEditor(),Z=mc(A.current,e||"",r||n||"text",i||"");Z!==B.getModel()&&B.setModel(Z)}},[i],_),to(()=>{if(P.current&&A.current){let B=P.current.getModifiedEditor(),Z=mc(A.current,t||"",o||n||"text",s||"");Z!==B.getModel()&&B.setModel(Z)}},[s],_),to(()=>{let B=P.current.getModifiedEditor();B.getOption(A.current.editor.EditorOption.readOnly)?B.setValue(t||""):t!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[t],_),to(()=>{var B,Z;(Z=(B=P.current)==null?void 0:B.getModel())==null||Z.original.setValue(e||"")},[e],_),to(()=>{let{original:B,modified:Z}=P.current.getModel();A.current.editor.setModelLanguage(B,r||n||"text"),A.current.editor.setModelLanguage(Z,o||n||"text")},[n,r,o],_),to(()=>{var B;(B=A.current)==null||B.editor.setTheme(c)},[c],_),to(()=>{var B;(B=P.current)==null||B.updateOptions(f)},[f],_);let j=m.useCallback(()=>{var G;if(!A.current)return;$.current(A.current);let B=mc(A.current,e||"",r||n||"text",i||""),Z=mc(A.current,t||"",o||n||"text",s||"");(G=P.current)==null||G.setModel({original:B,modified:Z})},[n,t,o,e,r,i,s]),Q=m.useCallback(()=>{var B;!L.current&&k.current&&(P.current=A.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...f}),j(),(B=A.current)==null||B.editor.setTheme(c),S(!0),L.current=!0)},[f,c,j]);m.useEffect(()=>{_&&I.current(P.current,A.current)},[_]),m.useEffect(()=>{!C&&!_&&Q()},[C,_,Q]);function ee(){var Z,G,q,K;let B=(Z=P.current)==null?void 0:Z.getModel();a||((G=B==null?void 0:B.original)==null||G.dispose()),l||((q=B==null?void 0:B.modified)==null||q.dispose()),(K=P.current)==null||K.dispose()}return m.createElement(KL,{width:g,height:h,isEditorReady:_,loading:u,_ref:k,className:v,wrapperProps:b})}var lbe=abe;m.memo(lbe);function cbe(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var ube=cbe,Up=new Map;function dbe({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:h=!1,width:g="100%",height:v="100%",className:b,wrapperProps:w={},beforeMount:x=Cd,onMount:_=Cd,onChange:S,onValidate:C=Cd}){let[E,P]=m.useState(!1),[A,k]=m.useState(!0),I=m.useRef(null),$=m.useRef(null),L=m.useRef(null),j=m.useRef(_),Q=m.useRef(x),ee=m.useRef(),B=m.useRef(r),Z=ube(i),G=m.useRef(!1),q=m.useRef(!1);XL(()=>{let V=YL.init();return V.then(X=>(I.current=X)&&k(!1)).catch(X=>(X==null?void 0:X.type)!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>$.current?T():V.cancel()}),to(()=>{var X,N,ie,fe;let V=mc(I.current,e||r||"",t||o||"",i||n||"");V!==((X=$.current)==null?void 0:X.getModel())&&(f&&Up.set(Z,(N=$.current)==null?void 0:N.saveViewState()),(ie=$.current)==null||ie.setModel(V),f&&((fe=$.current)==null||fe.restoreViewState(Up.get(i))))},[i],E),to(()=>{var V;(V=$.current)==null||V.updateOptions(c)},[c],E),to(()=>{!$.current||r===void 0||($.current.getOption(I.current.editor.EditorOption.readOnly)?$.current.setValue(r):r!==$.current.getValue()&&(q.current=!0,$.current.executeEdits("",[{range:$.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),$.current.pushUndoStop(),q.current=!1))},[r],E),to(()=>{var X,N;let V=(X=$.current)==null?void 0:X.getModel();V&&o&&((N=I.current)==null||N.editor.setModelLanguage(V,o))},[o],E),to(()=>{var V;a!==void 0&&((V=$.current)==null||V.revealLine(a))},[a],E),to(()=>{var V;(V=I.current)==null||V.editor.setTheme(s)},[s],E);let K=m.useCallback(()=>{var V;if(!(!L.current||!I.current)&&!G.current){Q.current(I.current);let X=i||n,N=mc(I.current,r||e||"",t||o||"",X||"");$.current=(V=I.current)==null?void 0:V.editor.create(L.current,{model:N,automaticLayout:!0,...c},u),f&&$.current.restoreViewState(Up.get(X)),I.current.editor.setTheme(s),a!==void 0&&$.current.revealLine(a),P(!0),G.current=!0}},[e,t,n,r,o,i,c,u,f,s,a]);m.useEffect(()=>{E&&j.current($.current,I.current)},[E]),m.useEffect(()=>{!A&&!E&&K()},[A,E,K]),B.current=r,m.useEffect(()=>{var V,X;E&&S&&((V=ee.current)==null||V.dispose(),ee.current=(X=$.current)==null?void 0:X.onDidChangeModelContent(N=>{q.current||S($.current.getValue(),N)}))},[E,S]),m.useEffect(()=>{if(E){let V=I.current.editor.onDidChangeMarkers(X=>{var ie;let N=(ie=$.current.getModel())==null?void 0:ie.uri;if(N&&X.find(fe=>fe.path===N.path)){let fe=I.current.editor.getModelMarkers({resource:N});C==null||C(fe)}});return()=>{V==null||V.dispose()}}return()=>{}},[E,C]);function T(){var V,X;(V=ee.current)==null||V.dispose(),h?f&&Up.set(i,$.current.saveViewState()):(X=$.current.getModel())==null||X.dispose(),$.current.dispose()}return m.createElement(KL,{width:g,height:v,isEditorReady:E,loading:l,_ref:L,className:b,wrapperProps:w})}var fbe=dbe,JL=m.memo(fbe),hbe=JL;const ZL="Collapsible",[pbe,eF]=Zn(ZL),[gbe,fS]=pbe(ZL),mbe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=wr({prop:r,defaultProp:o,onChange:s});return m.createElement(gbe,{scope:n,disabled:i,contentId:Jo(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(Qe.div,he({"data-state":hS(l),"data-disabled":i?"":void 0},a,{ref:t})))}),vbe="CollapsibleTrigger",bbe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=fS(vbe,n);return m.createElement(Qe.button,he({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":hS(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:Me(e.onClick,o.onOpenToggle)}))}),tF="CollapsibleContent",ybe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=fS(tF,e.__scopeCollapsible);return m.createElement(er,{present:n||o.open},({present:i})=>m.createElement(xbe,he({},r,{ref:t,present:i})))}),xbe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=fS(tF,n),[a,l]=m.useState(r),c=m.useRef(null),u=_t(t,c),f=m.useRef(0),h=f.current,g=m.useRef(0),v=g.current,b=s.open||a,w=m.useRef(b),x=m.useRef();return m.useEffect(()=>{const _=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(_)},[]),ur(()=>{const _=c.current;if(_){x.current=x.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const S=_.getBoundingClientRect();f.current=S.height,g.current=S.width,w.current||(_.style.transitionDuration=x.current.transitionDuration,_.style.animationName=x.current.animationName),l(r)}},[s.open,r]),m.createElement(Qe.div,he({"data-state":hS(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b},i,{ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),b&&o)});function hS(e){return e?"open":"closed"}const wbe=mbe,_be=bbe,Sbe=ybe,ba="Accordion",Cbe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[pS,Ebe,Rbe]=um(ba),[hv,Tye]=Zn(ba,[Rbe,eF]),gS=eF(),nF=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(pS.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Dbe,he({},i,{ref:t})):m.createElement(Tbe,he({},o,{ref:t})))});nF.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[rF,Obe]=hv(ba),[oF,Pbe]=hv(ba,{collapsible:!1}),Tbe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=wr({prop:n,defaultProp:r,onChange:o});return m.createElement(rF,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(oF,{scope:e.__scopeAccordion,collapsible:i},m.createElement(iF,he({},s,{ref:t}))))}),Dbe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=wr({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(u=>a((f=[])=>[...f,u]),[a]),c=m.useCallback(u=>a((f=[])=>f.filter(h=>h!==u)),[a]);return m.createElement(rF,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(oF,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(iF,he({},i,{ref:t}))))}),[Abe,pv]=hv(ba),iF=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=Ebe(n),f=_l(o)==="ltr",h=Me(e.onKeyDown,g=>{var v;if(!Cbe.includes(g.key))return;const b=g.target,w=c().filter(I=>{var $;return!(($=I.ref.current)!==null&&$!==void 0&&$.disabled)}),x=w.findIndex(I=>I.ref.current===b),_=w.length;if(x===-1)return;g.preventDefault();let S=x;const C=0,E=_-1,P=()=>{S=x+1,S>E&&(S=C)},A=()=>{S=x-1,S<C&&(S=E)};switch(g.key){case"Home":S=C;break;case"End":S=E;break;case"ArrowRight":i==="horizontal"&&(f?P():A());break;case"ArrowDown":i==="vertical"&&P();break;case"ArrowLeft":i==="horizontal"&&(f?A():P());break;case"ArrowUp":i==="vertical"&&A();break}const k=S%_;(v=w[k].ref.current)===null||v===void 0||v.focus()});return m.createElement(Abe,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(pS.Slot,{scope:n},m.createElement(Qe.div,he({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:h}))))}),hw="AccordionItem",[$be,mS]=hv(hw),kbe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=pv(hw,n),s=Obe(hw,n),a=gS(n),l=Jo(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return m.createElement($be,{scope:n,open:c,disabled:u,triggerId:l},m.createElement(wbe,he({"data-orientation":i.orientation,"data-state":sF(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),Mbe="AccordionHeader",Ibe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=pv(ba,n),i=mS(Mbe,n);return m.createElement(Qe.h3,he({"data-orientation":o.orientation,"data-state":sF(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),M2="AccordionTrigger",Nbe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=pv(ba,n),i=mS(M2,n),s=Pbe(M2,n),a=gS(n);return m.createElement(pS.ItemSlot,{scope:n},m.createElement(_be,he({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),Lbe="AccordionContent",Fbe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=pv(ba,n),i=mS(Lbe,n),s=gS(n);return m.createElement(Sbe,he({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 sF(e){return e?"open":"closed"}const jbe=nF,zbe=kbe,Bbe=Ibe,aF=Nbe,lF=Fbe,Vbe=jbe,cF=H.forwardRef(({className:e,...t},n)=>O.jsx(zbe,{ref:n,className:Ce("border-b",e),...t}));cF.displayName="AccordionItem";const uF=H.forwardRef(({className:e,children:t,...n},r)=>O.jsx(Bbe,{className:"flex",children:O.jsxs(aF,{ref:r,className:Ce("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,O.jsx(Am,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));uF.displayName=aF.displayName;const dF=H.forwardRef(({className:e,children:t,...n},r)=>O.jsx(lF,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:O.jsx("div",{className:Ce("pb-4 pt-0",e),children:t})}));dF.displayName=lF.displayName;var Hbe=Object.defineProperty,Wbe=(e,t,n)=>t in e?Hbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qp=(e,t,n)=>(Wbe(e,typeof t!="symbol"?t+"":t,n),n);const Ube={stringify:e=>e,parse:e=>e},qbe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},Gbe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},Ybe={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}},Kbe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},u0={string:Ube,number:qbe,boolean:Gbe,function:Ybe,json:Kbe},d0=Symbol.for("r2wc.render"),Gp=Symbol.for("r2wc.connected"),Na=Symbol.for("r2wc.context"),Ns=Symbol.for("r2wc.props");function Xbe(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 h=Qbe(f);l[f]=h,c[h]=f}class u extends HTMLElement{constructor(){super(),qp(this,r,!0),qp(this,o),qp(this,i,{}),qp(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Ns].container=this.container;for(const h of s){const g=l[h],v=this.getAttribute(g),b=a[h],w=u0[b];v&&w!=null&&w.parse&&(this[Ns][h]=w.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Gp]=!0,this[d0]()}disconnectedCallback(){this[Gp]=!1,this[Na]&&n.unmount(this[Na]),delete this[Na]}attributeChangedCallback(h,g,v){const b=c[h],w=a[b],x=u0[w];b in a&&x!=null&&x.parse&&(this[Ns][b]=x.parse(v,this),this[d0]())}[(r=Gp,o=Na,i=Ns,d0)](){this[Gp]&&(this[Na]?n.update(this[Na],this[Ns]):this[Na]=n.mount(this.container,e,this[Ns]))}}for(const f of s){const h=l[f],g=a[f];Object.defineProperty(u.prototype,f,{enumerable:!0,configurable:!0,get(){return this[Ns][f]},set(v){this[Ns][f]=v;const b=u0[g];if(b!=null&&b.stringify){const w=b.stringify(v);this.getAttribute(h)!==w&&this.setAttribute(h,w)}}})}return u}function Qbe(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Jbe(e,t,n){const r=_0(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function Zbe({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function eye({root:e}){e.unmount()}function tye(e,t={}){return Xbe(e,t,{mount:Jbe,update:Zbe,unmount:eye})}const nye={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean"},rye=tye(tL,{props:nye});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=TI;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=nk;exports.Accordion=Vbe;exports.AccordionContent=dF;exports.AccordionItem=cF;exports.AccordionTrigger=uF;exports.BOOLEAN_DATA_TYPES=_w;exports.Bot=vx;exports.Button=xr;exports.Calendar=I$;exports.Card=Rw;exports.CardContent=cm;exports.CardDescription=Ow;exports.CardFooter=Pw;exports.CardHeader=lm;exports.CardTitle=Af;exports.ChartJsVisual=_1;exports.Check=Ff;exports.CheckIcon=A$;exports.Checkbox=zL;exports.ChevronDown=Am;exports.ClipboardCopyIcon=xX;exports.ColorFormat=mM;exports.Cross2Icon=$$;exports.DATAMODEL_NAMESPCACE=dD;exports.DATE_DATA_TYPES=Pf;exports.Dashboard=tL;exports.DashboardPanel=RD;exports.DashboardTabs=Z5;exports.DashboardWC=rye;exports.Dialog=Jme;exports.DialogContent=$L;exports.DialogDescription=NL;exports.DialogFooter=ML;exports.DialogHeader=kL;exports.DialogTitle=IL;exports.DialogTrigger=Zme;exports.DropdownMenu=Hme;exports.DropdownMenuContent=EL;exports.DropdownMenuLabel=OL;exports.DropdownMenuRadioGroup=Ume;exports.DropdownMenuRadioItem=RL;exports.DropdownMenuSeparator=PL;exports.DropdownMenuTrigger=Wme;exports.Editable=is;exports.EditorAside=VL;exports.EditorMain=HL;exports.EditorPanel=BL;exports.Ft=hbe;exports.HoverCard=W1;exports.HoverCardContent=Fm;exports.HoverCardTrigger=U1;exports.InfoCircledIcon=TX;exports.Input=xc;exports.Jt=pk;exports.KPICard=lk;exports.LOCALE_CURRENCY_PAIRS=S0;exports.Label=Wn;exports.Markdown=PN;exports.NUMBER_DATA_TYPES=Vc;exports.PYTHON_DEFAULT_CODE=uD;exports.PaperPlaneIcon=k$;exports.PlayIcon=$X;exports.Plus=R1;exports.Popover=qm;exports.PopoverContent=Wf;exports.PopoverTrigger=Gm;exports.RadioGroup=u_;exports.RadioGroupItem=Fg;exports.ResizableHandle=rpe;exports.ResizablePanel=aw;exports.ResizablePanelGroup=YN;exports.ScrollArea=I_;exports.ScrollBar=nv;exports.Select=zs;exports.SelectContent=Ji;exports.SelectGroup=dc;exports.SelectItem=Hn;exports.SelectLabel=Va;exports.SelectSeparator=Lg;exports.SelectTrigger=Qi;exports.SelectValue=Bs;exports.SemaphorContextProvider=dk;exports.SemaphorQueryClient=ck;exports.Separator=Ym;exports.Settings=O1;exports.SliderIcon=MX;exports.Switch=VI;exports.TEXT_DATA_TYPES=im;exports.Table=F$;exports.Table$1=q1;exports.TableBody=Y1;exports.TableCell=Ig;exports.TableHead=K1;exports.TableHeader=G1;exports.TableRow=yd;exports.TableVisual=bM;exports.Tabs=kw;exports.TabsContent=Mw;exports.TabsList=dm;exports.TabsTrigger=fm;exports.Te=EZ;exports.TextCard=CM;exports.Textarea=c_;exports.Toggle=l_;exports.Tooltip=ik;exports.TooltipContent=F1;exports.TooltipTrigger=sk;exports.TriangleDownIcon=S1;exports.TriangleUpIcon=C1;exports.UXProvider=eL;exports.X=$m;exports._=ol;exports.cleanCard=TL;exports.cn=Ce;exports.copyToClipboard=nz;exports.createChartConfig=z1;exports.createLucideIcon=Dn;exports.createSqlGenConfig=kz;exports.de=JL;exports.flexRender=Dx;exports.fmt=Sw;exports.getBookmarkKey=DL;exports.getCanvasBackgroundColor=Pd;exports.getColumnDataType=Mz;exports.getContrastColor=Bc;exports.getCoreRowModel=Ok;exports.getDashbaordStateWithoutData=Xme;exports.getDefaultFilterSql=zae;exports.getFilterValueType=hg;exports.getKeys=ar;exports.getNumberAxis=j1;exports.getPaginationRowModel=Tk;exports.getQualifiedTableName=fD;exports.getRequest=tz;exports.getSortedRowModel=Pk;exports.getSql=$z;exports.isColumnInSqlGen=Iz;exports.jsxRuntimeExports=O;exports.pivotData=Tg;exports.postRequest=Of;exports.resolveBaseQuery=Q2;exports.resolveDataType=Td;exports.titleCase=oz;exports.useCard=tZ;exports.useDashboardActions=co;exports.useDashboardCard=B1;exports.useDashboardStore=ke;exports.useEditorActions=Dm;exports.useEditorStore=br;exports.useQuery=Df;exports.useReactTable=Dk;exports.useSemaphorContext=ma;exports.useTheme=CD;exports.v4=la;