react-semaphor 0.0.309 → 0.0.310

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.
@@ -0,0 +1,406 @@
1
+ "use strict";var hY=Object.defineProperty;var pY=(e,t,n)=>t in e?hY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>(pY(e,typeof t!="symbol"?t+"":t,n),n),px=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ae=(e,t,n)=>(px(e,t,"read from private field"),n?n.call(e):t.get(e)),Ke=(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)},Ue=(e,t,n,r)=>(px(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Bg=(e,t,n,r)=>({set _(o){Ue(e,t,o,n)},get _(){return ae(e,t,r)}}),Ft=(e,t,n)=>(px(e,t,"access private method"),n);const P=require("react"),wr=require("react-dom");function ZI(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 R=ZI(P),dc=ZI(wr);var xa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function j_(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 pw={exports:{}},Jd={};/**
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 WO;function gY(){return WO||(WO=1,process.env.NODE_ENV!=="production"&&function(){var e=P,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"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator";function y(I){if(I===null||typeof I!="object")return null;var se=m&&I[m]||I[v];return typeof se=="function"?se:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(I){{for(var se=arguments.length,fe=new Array(se>1?se-1:0),Oe=1;Oe<se;Oe++)fe[Oe-1]=arguments[Oe];_("error",I,fe)}}function _(I,se,fe){{var Oe=b.ReactDebugCurrentFrame,He=Oe.getStackAddendum();He!==""&&(se+="%s",fe=fe.concat([He]));var Ge=fe.map(function($e){return String($e)});Ge.unshift("Warning: "+se),Function.prototype.apply.call(console[I],console,Ge)}}var C=!1,E=!1,T=!1,A=!1,D=!1,k;k=Symbol.for("react.module.reference");function j(I){return!!(typeof I=="string"||typeof I=="function"||I===r||I===i||D||I===o||I===c||I===u||A||I===p||C||E||T||typeof I=="object"&&I!==null&&(I.$$typeof===h||I.$$typeof===d||I.$$typeof===s||I.$$typeof===a||I.$$typeof===l||I.$$typeof===k||I.getModuleId!==void 0))}function $(I,se,fe){var Oe=I.displayName;if(Oe)return Oe;var He=se.displayName||se.name||"";return He!==""?fe+"("+He+")":fe}function z(I){return I.displayName||"Context"}function K(I){if(I==null)return null;if(typeof I.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof I=="function")return I.displayName||I.name||null;if(typeof I=="string")return I;switch(I){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 I=="object")switch(I.$$typeof){case a:var se=I;return z(se)+".Consumer";case s:var fe=I;return z(fe._context)+".Provider";case l:return $(I,I.render,"ForwardRef");case d:var Oe=I.displayName||null;return Oe!==null?Oe:K(I.type)||"Memo";case h:{var He=I,Ge=He._payload,$e=He._init;try{return K($e(Ge))}catch{return null}}}return null}var V=Object.assign,N=0,W,H,G,te,F,Y,q;function M(){}M.__reactDisabledLog=!0;function ne(){{if(N===0){W=console.log,H=console.info,G=console.warn,te=console.error,F=console.group,Y=console.groupCollapsed,q=console.groupEnd;var I={configurable:!0,enumerable:!0,value:M,writable:!0};Object.defineProperties(console,{info:I,log:I,warn:I,error:I,group:I,groupCollapsed:I,groupEnd:I})}N++}}function X(){{if(N--,N===0){var I={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},I,{value:W}),info:V({},I,{value:H}),warn:V({},I,{value:G}),error:V({},I,{value:te}),group:V({},I,{value:F}),groupCollapsed:V({},I,{value:Y}),groupEnd:V({},I,{value:q})})}N<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=b.ReactCurrentDispatcher,ee;function J(I,se,fe){{if(ee===void 0)try{throw Error()}catch(He){var Oe=He.stack.trim().match(/\n( *(at )?)/);ee=Oe&&Oe[1]||""}return`
10
+ `+ee+I}}var le=!1,ce;{var ye=typeof WeakMap=="function"?WeakMap:Map;ce=new ye}function oe(I,se){if(!I||le)return"";{var fe=ce.get(I);if(fe!==void 0)return fe}var Oe;le=!0;var He=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ge;Ge=re.current,re.current=null,ne();try{if(se){var $e=function(){throw Error()};if(Object.defineProperty($e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($e,[])}catch(pt){Oe=pt}Reflect.construct(I,[],$e)}else{try{$e.call()}catch(pt){Oe=pt}I.call($e.prototype)}}else{try{throw Error()}catch(pt){Oe=pt}I()}}catch(pt){if(pt&&Oe&&typeof pt.stack=="string"){for(var Fe=pt.stack.split(`
11
+ `),Ae=Oe.stack.split(`
12
+ `),Z=Fe.length-1,me=Ae.length-1;Z>=1&&me>=0&&Fe[Z]!==Ae[me];)me--;for(;Z>=1&&me>=0;Z--,me--)if(Fe[Z]!==Ae[me]){if(Z!==1||me!==1)do if(Z--,me--,me<0||Fe[Z]!==Ae[me]){var De=`
13
+ `+Fe[Z].replace(" at new "," at ");return I.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",I.displayName)),typeof I=="function"&&ce.set(I,De),De}while(Z>=1&&me>=0);break}}}finally{le=!1,re.current=Ge,X(),Error.prepareStackTrace=He}var lt=I?I.displayName||I.name:"",En=lt?J(lt):"";return typeof I=="function"&&ce.set(I,En),En}function ve(I,se,fe){return oe(I,!1)}function he(I){var se=I.prototype;return!!(se&&se.isReactComponent)}function Ee(I,se,fe){if(I==null)return"";if(typeof I=="function")return oe(I,he(I));if(typeof I=="string")return J(I);switch(I){case c:return J("Suspense");case u:return J("SuspenseList")}if(typeof I=="object")switch(I.$$typeof){case l:return ve(I.render);case d:return Ee(I.type,se,fe);case h:{var Oe=I,He=Oe._payload,Ge=Oe._init;try{return Ee(Ge(He),se,fe)}catch{}}}return""}var ke=Object.prototype.hasOwnProperty,We={},Ie=b.ReactDebugCurrentFrame;function Le(I){if(I){var se=I._owner,fe=Ee(I.type,I._source,se?se.type:null);Ie.setExtraStackFrame(fe)}else Ie.setExtraStackFrame(null)}function dt(I,se,fe,Oe,He){{var Ge=Function.call.bind(ke);for(var $e in I)if(Ge(I,$e)){var Fe=void 0;try{if(typeof I[$e]!="function"){var Ae=Error((Oe||"React class")+": "+fe+" type `"+$e+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof I[$e]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ae.name="Invariant Violation",Ae}Fe=I[$e](se,$e,Oe,fe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Z){Fe=Z}Fe&&!(Fe instanceof Error)&&(Le(He),S("%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",fe,$e,typeof Fe),Le(null)),Fe instanceof Error&&!(Fe.message in We)&&(We[Fe.message]=!0,Le(He),S("Failed %s type: %s",fe,Fe.message),Le(null))}}}var $t=Array.isArray;function rn(I){return $t(I)}function Nt(I){{var se=typeof Symbol=="function"&&Symbol.toStringTag,fe=se&&I[Symbol.toStringTag]||I.constructor.name||"Object";return fe}}function on(I){try{return pe(I),!1}catch{return!0}}function pe(I){return""+I}function Pe(I){if(on(I))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Nt(I)),pe(I)}var ze=b.ReactCurrentOwner,Ye={key:!0,ref:!0,__self:!0,__source:!0},nt,sn,Cn;Cn={};function mn(I){if(ke.call(I,"ref")){var se=Object.getOwnPropertyDescriptor(I,"ref").get;if(se&&se.isReactWarning)return!1}return I.ref!==void 0}function jn(I){if(ke.call(I,"key")){var se=Object.getOwnPropertyDescriptor(I,"key").get;if(se&&se.isReactWarning)return!1}return I.key!==void 0}function vn(I,se){if(typeof I.ref=="string"&&ze.current&&se&&ze.current.stateNode!==se){var fe=K(ze.current.type);Cn[fe]||(S('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',K(ze.current.type),I.ref),Cn[fe]=!0)}}function Ht(I,se){{var fe=function(){nt||(nt=!0,S("%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)",se))};fe.isReactWarning=!0,Object.defineProperty(I,"key",{get:fe,configurable:!0})}}function cn(I,se){{var fe=function(){sn||(sn=!0,S("%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)",se))};fe.isReactWarning=!0,Object.defineProperty(I,"ref",{get:fe,configurable:!0})}}var Pn=function(I,se,fe,Oe,He,Ge,$e){var Fe={$$typeof:t,type:I,key:se,ref:fe,props:$e,_owner:Ge};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 tt(I,se,fe,Oe,He){{var Ge,$e={},Fe=null,Ae=null;fe!==void 0&&(Pe(fe),Fe=""+fe),jn(se)&&(Pe(se.key),Fe=""+se.key),mn(se)&&(Ae=se.ref,vn(se,He));for(Ge in se)ke.call(se,Ge)&&!Ye.hasOwnProperty(Ge)&&($e[Ge]=se[Ge]);if(I&&I.defaultProps){var Z=I.defaultProps;for(Ge in Z)$e[Ge]===void 0&&($e[Ge]=Z[Ge])}if(Fe||Ae){var me=typeof I=="function"?I.displayName||I.name||"Unknown":I;Fe&&Ht($e,me),Ae&&cn($e,me)}return Pn(I,Fe,Ae,He,Oe,ze.current,$e)}}var mt=b.ReactCurrentOwner,kt=b.ReactDebugCurrentFrame;function Zt(I){if(I){var se=I._owner,fe=Ee(I.type,I._source,se?se.type:null);kt.setExtraStackFrame(fe)}else kt.setExtraStackFrame(null)}var wt;wt=!1;function $n(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function oi(){{if(mt.current){var I=K(mt.current.type);if(I)return`
14
+
15
+ Check the render method of \``+I+"`."}return""}}function Qs(I){{if(I!==void 0){var se=I.fileName.replace(/^.*[\\\/]/,""),fe=I.lineNumber;return`
16
+
17
+ Check your code at `+se+":"+fe+"."}return""}}var ii={};function ds(I){{var se=oi();if(!se){var fe=typeof I=="string"?I:I.displayName||I.name;fe&&(se=`
18
+
19
+ Check the top-level render call using <`+fe+">.")}return se}}function Oi(I,se){{if(!I._store||I._store.validated||I.key!=null)return;I._store.validated=!0;var fe=ds(se);if(ii[fe])return;ii[fe]=!0;var Oe="";I&&I._owner&&I._owner!==mt.current&&(Oe=" It was passed a child from "+K(I._owner.type)+"."),Zt(I),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',fe,Oe),Zt(null)}}function fs(I,se){{if(typeof I!="object")return;if(rn(I))for(var fe=0;fe<I.length;fe++){var Oe=I[fe];$n(Oe)&&Oi(Oe,se)}else if($n(I))I._store&&(I._store.validated=!0);else if(I){var He=y(I);if(typeof He=="function"&&He!==I.entries)for(var Ge=He.call(I),$e;!($e=Ge.next()).done;)$n($e.value)&&Oi($e.value,se)}}}function Js(I){{var se=I.type;if(se==null||typeof se=="string")return;var fe;if(typeof se=="function")fe=se.propTypes;else if(typeof se=="object"&&(se.$$typeof===l||se.$$typeof===d))fe=se.propTypes;else return;if(fe){var Oe=K(se);dt(fe,I.props,"prop",Oe,I)}else if(se.PropTypes!==void 0&&!wt){wt=!0;var He=K(se);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof se.getDefaultProps=="function"&&!se.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ti(I){{for(var se=Object.keys(I.props),fe=0;fe<se.length;fe++){var Oe=se[fe];if(Oe!=="children"&&Oe!=="key"){Zt(I),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Zt(null);break}}I.ref!==null&&(Zt(I),S("Invalid attribute `ref` supplied to `React.Fragment`."),Zt(null))}}function hs(I,se,fe,Oe,He,Ge){{var $e=j(I);if(!$e){var Fe="";(I===void 0||typeof I=="object"&&I!==null&&Object.keys(I).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=Qs(He);Ae?Fe+=Ae:Fe+=oi();var Z;I===null?Z="null":rn(I)?Z="array":I!==void 0&&I.$$typeof===t?(Z="<"+(K(I.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):Z=typeof I,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Z,Fe)}var me=tt(I,se,fe,He,Ge);if(me==null)return me;if($e){var De=se.children;if(De!==void 0)if(Oe)if(rn(De)){for(var lt=0;lt<De.length;lt++)fs(De[lt],I);Object.freeze&&Object.freeze(De)}else S("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 fs(De,I)}return I===r?Ti(me):Js(me),me}}function Zn(I,se,fe){return hs(I,se,fe,!0)}function Mi(I,se,fe){return hs(I,se,fe,!1)}var Zs=Mi,ea=Zn;Jd.Fragment=r,Jd.jsx=Zs,Jd.jsxs=ea}()),Jd}var Zd={};/**
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 UO;function mY(){if(UO)return Zd;UO=1;var e=P,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,d={},h=null,p=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:p,props:d,_owner:o.current}}return Zd.Fragment=n,Zd.jsx=s,Zd.jsxs=s,Zd}process.env.NODE_ENV==="production"?pw.exports=mY():pw.exports=gY();var x=pw.exports;function eN(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=eN(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function g0(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=eN(e))&&(r&&(r+=" "),r+=t);return r}const vY=Object.freeze(Object.defineProperty({__proto__:null,clsx:g0,default:g0},Symbol.toStringTag,{value:"Module"})),$_="-";function bY(e){const t=xY(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split($_);return a[0]===""&&a.length!==1&&a.shift(),tN(a,t)||yY(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function tN(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?tN(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join($_);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const GO=/^\[(.+)\]$/;function yY(e){if(GO.test(e)){const t=GO.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function xY(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return SY(Object.entries(e.classGroups),n).forEach(([i,s])=>{gw(s,r,i,t)}),r}function gw(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:qO(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(wY(o)){gw(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{gw(s,qO(t,i),n,r)})})}function qO(e,t){let n=e;return t.split($_).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function wY(e){return e.isThemeGetter}function SY(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 _Y(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 nN="!";function CY(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let v=0;v<s.length;v++){let y=s[v];if(l===0){if(y===r&&(n||s.slice(v,v+o)===t)){a.push(s.slice(c,v)),c=v+o;continue}if(y==="/"){u=v;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),h=d.startsWith(nN),p=h?d.substring(1):d,m=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}}}function EY(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 RY(e){return{cache:_Y(e.cacheSize),splitModifiers:CY(e),...bY(e)}}const PY=/\s+/;function OY(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(PY).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),h=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};h=!1}const p=EY(a).join(":");return{isTailwindClass:!0,modifierId:l?p+nN:p,classGroupId:d,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(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function TY(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=rN(t))&&(r&&(r+=" "),r+=n);return r}function rN(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=rN(e[r]))&&(n&&(n+=" "),n+=t);return n}function MY(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=RY(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=OY(l,n);return o(l,u),u}return function(){return i(TY.apply(null,arguments))}}function yn(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const oN=/^\[(?:([a-z-]+):)?(.+)\]$/i,AY=/^\d+\/\d+$/,DY=new Set(["px","full","screen"]),kY=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IY=/\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$/,NY=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,LY=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ui(e){return Nl(e)||DY.has(e)||AY.test(e)}function ua(e){return vd(e,"length",WY)}function Nl(e){return!!e&&!Number.isNaN(Number(e))}function Hg(e){return vd(e,"number",Nl)}function ef(e){return!!e&&Number.isInteger(Number(e))}function FY(e){return e.endsWith("%")&&Nl(e.slice(0,-1))}function _t(e){return oN.test(e)}function da(e){return kY.test(e)}const jY=new Set(["length","size","percentage"]);function $Y(e){return vd(e,jY,iN)}function zY(e){return vd(e,"position",iN)}const BY=new Set(["image","url"]);function HY(e){return vd(e,BY,GY)}function VY(e){return vd(e,"",UY)}function tf(){return!0}function vd(e,t,n){const r=oN.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function WY(e){return IY.test(e)}function iN(){return!1}function UY(e){return NY.test(e)}function GY(e){return LY.test(e)}function qY(){const e=yn("colors"),t=yn("spacing"),n=yn("blur"),r=yn("brightness"),o=yn("borderColor"),i=yn("borderRadius"),s=yn("borderSpacing"),a=yn("borderWidth"),l=yn("contrast"),c=yn("grayscale"),u=yn("hueRotate"),d=yn("invert"),h=yn("gap"),p=yn("gradientColorStops"),m=yn("gradientColorStopPositions"),v=yn("inset"),y=yn("margin"),b=yn("opacity"),S=yn("padding"),_=yn("saturate"),C=yn("scale"),E=yn("sepia"),T=yn("skew"),A=yn("space"),D=yn("translate"),k=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",_t,t],z=()=>[_t,t],K=()=>["",ui,ua],V=()=>["auto",Nl,_t],N=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],G=()=>["start","end","center","between","around","evenly","stretch"],te=()=>["","0",_t],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[Nl,Hg],q=()=>[Nl,_t];return{cacheSize:500,separator:":",theme:{colors:[tf],spacing:[ui,ua],blur:["none","",da,_t],brightness:Y(),borderColor:[e],borderRadius:["none","","full",da,_t],borderSpacing:z(),borderWidth:K(),contrast:Y(),grayscale:te(),hueRotate:q(),invert:te(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[FY,ua],inset:$(),margin:$(),opacity:Y(),padding:z(),saturate:Y(),scale:Y(),sepia:te(),skew:q(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",_t]}],container:["container"],columns:[{columns:[da]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...N(),_t]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ef,_t]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",_t]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:["first","last","none",ef,_t]}],"grid-cols":[{"grid-cols":[tf]}],"col-start-end":[{col:["auto",{span:["full",ef,_t]},_t]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[tf]}],"row-start-end":[{row:["auto",{span:[ef,_t]},_t]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",_t]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",_t]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"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",_t,t]}],"min-w":[{"min-w":["min","max","fit",_t,ui]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[da]},da,_t]}],h:[{h:[_t,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",ui,_t]}],"max-h":[{"max-h":[_t,t,"min","max","fit"]}],"font-size":[{text:["base",da,ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hg]}],"font-family":[{font:[tf]}],"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",_t]}],"line-clamp":[{"line-clamp":["none",Nl,Hg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ui,_t]}],"list-image":[{"list-image":["none",_t]}],"list-style-type":[{list:["none","disc","decimal",_t]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ui,ua]}],"underline-offset":[{"underline-offset":["auto",ui,_t]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_t]}],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",_t]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...N(),zY]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$Y]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},HY]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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":[b]}],"border-style":[{border:[...W(),"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":[b]}],"divide-style":[{divide:W()}],"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:["",...W()]}],"outline-offset":[{"outline-offset":[ui,_t]}],"outline-w":[{outline:[ui,ua]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ui,ua]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",da,VY]}],"shadow-color":[{shadow:[tf]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":H()}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",da,_t]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],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":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"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",_t]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",_t]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",_t]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[ef,_t]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",_t]}],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",_t]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_t]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ui,ua,Hg]}],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 YY=MY(qY);class Pf extends Error{}Pf.prototype.name="InvalidTokenError";function KY(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function XY(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return KY(t)}catch{return atob(t)}}function z_(e,t){if(typeof e!="string")throw new Pf("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Pf(`Invalid token specified: missing part #${n+1}`);let o;try{o=XY(r)}catch(i){throw new Pf(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new Pf(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}async function QY(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 JY(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),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const h=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(h)}}catch(h){throw new Error(`Decryption failed: ${h}`)}}function xe(...e){return YY(g0(e))}async function ZY(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 Ev(e,t,n={}){try{const r=JSON.stringify(n),o=await QY(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 JY(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}function eK(e){if(!e)return{tenantId:"",endUserId:""};const t=z_(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function tK(e){if(!e)return;const t=z_(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function sN(e){return e?z_(e).params:void 0}function nK(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 rK(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>oK(i,t))}function oK(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 iK(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Yf="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function sK(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),o=new URLSearchParams(r).toString();return o&&(n+=`?${o}`),await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json()}async function aK(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}var lK={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const YO=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const d=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(h=>h(t,d))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(lK?"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},cK=e=>e?YO(e):YO;var mw={exports:{}},gx={},Vg={exports:{}},mx={};/**
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 KO;function uK(){return KO||(KO=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=P,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(_){{for(var C=arguments.length,E=new Array(C>1?C-1:0),T=1;T<C;T++)E[T-1]=arguments[T];r("error",_,E)}}function r(_,C,E){{var T=t.ReactDebugCurrentFrame,A=T.getStackAddendum();A!==""&&(C+="%s",E=E.concat([A]));var D=E.map(function(k){return String(k)});D.unshift("Warning: "+C),Function.prototype.apply.call(console[_],console,D)}}function o(_,C){return _===C&&(_!==0||1/_===1/C)||_!==_&&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,d=!1;function h(_,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 T=C();if(!d){var A=C();i(T,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var D=s({inst:{value:T,getSnapshot:C}}),k=D[0].inst,j=D[1];return l(function(){k.value=T,k.getSnapshot=C,p(k)&&j({inst:k})},[_,T,C]),a(function(){p(k)&&j({inst:k});var $=function(){p(k)&&j({inst:k})};return _($)},[_]),c(T),T}function p(_){var C=_.getSnapshot,E=_.value;try{var T=C();return!i(E,T)}catch{return!0}}function m(_,C,E){return C()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!v,b=y?m:h,S=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b;mx.useSyncExternalStore=S,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),mx}var vx={};/**
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 XO;function dK(){if(XO)return vx;XO=1;var e=P;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&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(d,h){var p=h(),m=r({inst:{value:p,getSnapshot:h}}),v=m[0].inst,y=m[1];return i(function(){v.value=p,v.getSnapshot=h,l(v)&&y({inst:v})},[d,p,h]),o(function(){return l(v)&&y({inst:v}),d(function(){l(v)&&y({inst:v})})},[d]),s(p),p}function l(d){var h=d.getSnapshot;d=d.value;try{var p=h();return!n(d,p)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return vx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,vx}var QO;function B_(){return QO||(QO=1,process.env.NODE_ENV==="production"?Vg.exports=dK():Vg.exports=uK()),Vg.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 JO;function fK(){return JO||(JO=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=P,t=B_();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,d,h,p,m){var v=i(null),y;v.current===null?(y={hasValue:!1,value:null},v.current=y):y=v.current;var b=a(function(){var E=!1,T,A,D=function(z){if(!E){E=!0,T=z;var K=p(z);if(m!==void 0&&y.hasValue){var V=y.value;if(m(V,K))return A=V,V}return A=K,K}var N=T,W=A;if(r(N,z))return W;var H=p(z);return m!==void 0&&m(W,H)?W:(T=z,A=H,H)},k=h===void 0?null:h,j=function(){return D(d())},$=k===null?void 0:function(){return D(k())};return[j,$]},[d,h,p,m]),S=b[0],_=b[1],C=o(u,S,_);return s(function(){y.hasValue=!0,y.value=C},[C]),l(C),C}gx.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),gx}var bx={};/**
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 ZO;function hK(){if(ZO)return bx;ZO=1;var e=P,t=B_();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 bx.useSyncExternalStoreWithSelector=function(c,u,d,h,p){var m=i(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function b(T){if(!S){if(S=!0,_=T,T=h(T),p!==void 0&&v.hasValue){var A=v.value;if(p(A,T))return C=A}return C=T}if(A=C,r(_,T))return A;var D=h(T);return p!==void 0&&p(A,D)?A:(_=T,C=D)}var S=!1,_,C,E=d===void 0?null:d;return[function(){return b(u())},E===null?void 0:function(){return b(E())}]},[u,d,h,p]);var y=o(c,m[0],m[1]);return s(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},bx}process.env.NODE_ENV==="production"?mw.exports=hK():mw.exports=fK();var pK=mw.exports;const gK=Oc(pK);var aN={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:mK}=P,{useSyncExternalStoreWithSelector:vK}=gK;let eT=!1;function bK(e,t=e.getState,n){(aN?"production":void 0)!=="production"&&n&&!eT&&(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"),eT=!0);const r=vK(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return mK(r),r}const tT=e=>{(aN?"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"?cK(e):e,n=(r,o)=>bK(t,r,o);return Object.assign(n,t),n},lN=e=>e?tT(e):tT;var cN=Symbol.for("immer-nothing"),nT=Symbol.for("immer-draftable"),Po=Symbol.for("immer-state"),yK=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 to(e,...t){if(process.env.NODE_ENV!=="production"){const n=yK[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 Yu=Object.getPrototypeOf;function Ku(e){return!!e&&!!e[Po]}function fc(e){var t;return e?uN(e)||Array.isArray(e)||!!e[nT]||!!((t=e.constructor)!=null&&t[nT])||Pv(e)||Ov(e):!1}var xK=Object.prototype.constructor.toString();function uN(e){if(!e||typeof e!="object")return!1;const t=Yu(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)===xK}function ph(e,t){Rv(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Rv(e){const t=e[Po];return t?t.type_:Array.isArray(e)?1:Pv(e)?2:Ov(e)?3:0}function vw(e,t){return Rv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function dN(e,t,n){const r=Rv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function wK(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Pv(e){return e instanceof Map}function Ov(e){return e instanceof Set}function El(e){return e.copy_||e.base_}function bw(e,t){if(Pv(e))return new Map(e);if(Ov(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&uN(e))return Yu(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[Po];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(Yu(e),n)}function H_(e,t=!1){return Tv(e)||Ku(e)||!fc(e)||(Rv(e)>1&&(e.set=e.add=e.clear=e.delete=SK),Object.freeze(e),t&&ph(e,(n,r)=>H_(r,!0))),e}function SK(){to(2)}function Tv(e){return Object.isFrozen(e)}var _K={};function hc(e){const t=_K[e];return t||to(0,e),t}var gh;function fN(){return gh}function CK(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function rT(e,t){t&&(hc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function yw(e){xw(e),e.drafts_.forEach(EK),e.drafts_=null}function xw(e){e===gh&&(gh=e.parent_)}function oT(e){return gh=CK(gh,e)}function EK(e){const t=e[Po];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function iT(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Po].modified_&&(yw(t),to(4)),fc(e)&&(e=m0(t,e),t.parent_||v0(t,e)),t.patches_&&hc("Patches").generateReplacementPatches_(n[Po].base_,e,t.patches_,t.inversePatches_)):e=m0(t,n,[]),yw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==cN?e:void 0}function m0(e,t,n){if(Tv(t))return t;const r=t[Po];if(!r)return ph(t,(o,i)=>sT(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return v0(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),ph(i,(a,l)=>sT(e,r,o,a,l,n,s)),v0(e,o,!1),n&&e.patches_&&hc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function sT(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&to(5),Ku(o)){const a=i&&t&&t.type_!==3&&!vw(t.assigned_,r)?i.concat(r):void 0,l=m0(e,o,a);if(dN(n,r,l),Ku(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(fc(o)&&!Tv(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;m0(e,o),(!t||!t.scope_.parent_)&&v0(e,o)}}function v0(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&H_(t,n)}function RK(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:fN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=V_;n&&(o=[r],i=mh);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var V_={get(e,t){if(t===Po)return e;const n=El(e);if(!vw(n,t))return PK(e,n,t);const r=n[t];return e.finalized_||!fc(r)?r:r===yx(e.base_,t)?(xx(e),e.copy_[t]=Sw(r,e)):r},has(e,t){return t in El(e)},ownKeys(e){return Reflect.ownKeys(El(e))},set(e,t,n){const r=hN(El(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=yx(El(e),t),i=o==null?void 0:o[Po];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(wK(n,o)&&(n!==void 0||vw(e.base_,t)))return!0;xx(e),ww(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 yx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,xx(e),ww(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=El(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){to(11)},getPrototypeOf(e){return Yu(e.base_)},setPrototypeOf(){to(12)}},mh={};ph(V_,(e,t)=>{mh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});mh.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&to(13),mh.set.call(this,e,t,void 0)};mh.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&to(14),V_.set.call(this,e[0],t,n,e[0])};function yx(e,t){const n=e[Po];return(n?El(n):e)[t]}function PK(e,t,n){var o;const r=hN(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function hN(e,t){if(!(t in e))return;let n=Yu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Yu(n)}}function ww(e){e.modified_||(e.modified_=!0,e.parent_&&ww(e.parent_))}function xx(e){e.copy_||(e.copy_=bw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var OK=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"&&to(6),r!==void 0&&typeof r!="function"&&to(7);let o;if(fc(t)){const i=oT(this),s=Sw(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?yw(i):xw(i)}return rT(i,r),iT(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===cN&&(o=void 0),this.autoFreeze_&&H_(o,!0),r){const i=[],s=[];hc("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else to(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){fc(e)||to(8),Ku(e)&&(e=TK(e));const t=oT(this),n=Sw(e,void 0);return n[Po].isManual_=!0,xw(t),n}finishDraft(e,t){const n=e&&e[Po];(!n||!n.isManual_)&&to(9);const{scope_:r}=n;return rT(r,t),iT(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=hc("Patches").applyPatches_;return Ku(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Sw(e,t){const n=Pv(e)?hc("MapSet").proxyMap_(e,t):Ov(e)?hc("MapSet").proxySet_(e,t):RK(e,t);return(t?t.scope_:fN()).drafts_.push(n),n}function TK(e){return Ku(e)||to(10,e),pN(e)}function pN(e){if(!fc(e)||Tv(e))return e;const t=e[Po];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=bw(e,t.scope_.immer_.useStrictShallowCopy_)}else n=bw(e,!0);return ph(n,(r,o)=>{dN(n,r,pN(o))}),t&&(t.finalized_=!1),n}var Oo=new OK,MK=Oo.produce;Oo.produceWithPatches.bind(Oo);Oo.setAutoFreeze.bind(Oo);Oo.setUseStrictShallowCopy.bind(Oo);Oo.applyPatches.bind(Oo);Oo.createDraft.bind(Oo);Oo.finishDraft.bind(Oo);const AK=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?MK(o):o;return t(a,i,...s)},e(r.setState,n,r)),gN=AK;var _w,Wg=wr;if(process.env.NODE_ENV==="production")_w=Wg.createRoot,Wg.hydrateRoot;else{var aT=Wg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;_w=function(e,t){aT.usingClientEntryPoint=!0;try{return Wg.createRoot(e,t)}finally{aT.usingClientEntryPoint=!1}}}var mN={},vN={},W_={exports:{}},bt=String,bN=function(){return{isColorSupported:!1,reset:bt,bold:bt,dim:bt,italic:bt,underline:bt,inverse:bt,hidden:bt,strikethrough:bt,black:bt,red:bt,green:bt,yellow:bt,blue:bt,magenta:bt,cyan:bt,white:bt,gray:bt,bgBlack:bt,bgRed:bt,bgGreen:bt,bgYellow:bt,bgBlue:bt,bgMagenta:bt,bgCyan:bt,bgWhite:bt,blackBright:bt,redBright:bt,greenBright:bt,yellowBright:bt,blueBright:bt,magentaBright:bt,cyanBright:bt,whiteBright:bt,bgBlackBright:bt,bgRedBright:bt,bgGreenBright:bt,bgYellowBright:bt,bgBlueBright:bt,bgMagentaBright:bt,bgCyanBright:bt,bgWhiteBright:bt}};W_.exports=bN();W_.exports.createColors=bN;var DK=W_.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(DK);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(d=>console.warn(l,"-",d)))}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])}}})(vN);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(vN);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}}})(mN);let wx=mN;var kK=(wx.__esModule?wx:{default:wx}).default;const Gt=Oc(kK),yN=`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
+ `,xN="dm",Cw=[{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"}],IK=[{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)"}]}],U_=["lg","md","sm","xs","xxs"],b0={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Gt.blue[500],Gt.teal[500],Gt.amber[500],Gt.red[500],Gt.indigo[500],Gt.green[500]],borderColor:[Gt.blue[500],Gt.teal[500],Gt.amber[500],Gt.red[500],Gt.indigo[500],Gt.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:Ew},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:[Gt.blue[500],Gt.teal[500],Gt.amber[500],Gt.red[500],Gt.indigo[500],Gt.green[500]],borderColor:[Gt.blue[500],Gt.teal[500],Gt.amber[500],Gt.red[500],Gt.indigo[500],Gt.green[500]],datalables:{color:Ew}},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:Gt.slate[800]}},y:{grid:{display:!0,color:Gt.slate[800]}}}}}}};function Ew(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=vh()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=vh()),Xu(n)}function vh(){return we.getState().theme==="dark"?"#000000":"#FFFFFF"}function Xu(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Gt.gray[500];const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),p=parseInt(d.substring(2,4),16),m=parseInt(d.substring(4,6),16);t+=h,n+=p,r+=m,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 Mv=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],bp=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],bd=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],G_=["boolean"];function q_(e){return e.match(/[A-Z]/)?`"${e}"`:e}function NK(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?`${xN}.${r}`:wN(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 LK(e,t,n="AVG"){var i,s,a,l;let r={};const o=q_(e.column_name);return Mv.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]}),bp.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 wu(e){return Mv.includes(e.dataType)?"string":bp.includes(e.dataType)?"number":bd.includes(e.dataType)?"date":G_.includes(e.dataType)?"boolean":"string"}function FK(e){let t;const n=e.data_type.toLowerCase();return Mv.includes(n)?t="T":bp.includes(n)?t="#":bd.includes(n)?t="D":G_.includes(n)?t="B":t="?",t}function jK(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 wN(e,t){return t==="api"||e===q_("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const $K=e=>{const t=new Date(e);return!isNaN(t.getTime())},zK=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Av=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?$K(e)?t="date":zK(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function BK({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,d={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:Av(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),i(p);return}else s(d)}o(n),r(d)}var y0={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
+ */y0.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__",d=1,h=2,p=4,m=1,v=2,y=1,b=2,S=4,_=8,C=16,E=32,T=64,A=128,D=256,k=512,j=30,$="...",z=800,K=16,V=1,N=2,W=3,H=1/0,G=9007199254740991,te=17976931348623157e292,F=NaN,Y=4294967295,q=Y-1,M=Y>>>1,ne=[["ary",A],["bind",y],["bindKey",b],["curry",_],["curryRight",C],["flip",k],["partial",E],["partialRight",T],["rearg",D]],X="[object Arguments]",re="[object Array]",ee="[object AsyncFunction]",J="[object Boolean]",le="[object Date]",ce="[object DOMException]",ye="[object Error]",oe="[object Function]",ve="[object GeneratorFunction]",he="[object Map]",Ee="[object Number]",ke="[object Null]",We="[object Object]",Ie="[object Promise]",Le="[object Proxy]",dt="[object RegExp]",$t="[object Set]",rn="[object String]",Nt="[object Symbol]",on="[object Undefined]",pe="[object WeakMap]",Pe="[object WeakSet]",ze="[object ArrayBuffer]",Ye="[object DataView]",nt="[object Float32Array]",sn="[object Float64Array]",Cn="[object Int8Array]",mn="[object Int16Array]",jn="[object Int32Array]",vn="[object Uint8Array]",Ht="[object Uint8ClampedArray]",cn="[object Uint16Array]",Pn="[object Uint32Array]",tt=/\b__p \+= '';/g,mt=/\b(__p \+=) '' \+/g,kt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Zt=/&(?:amp|lt|gt|quot|#39);/g,wt=/[&<>"']/g,$n=RegExp(Zt.source),oi=RegExp(wt.source),Qs=/<%-([\s\S]+?)%>/g,ii=/<%([\s\S]+?)%>/g,ds=/<%=([\s\S]+?)%>/g,Oi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fs=/^\w*$/,Js=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ti=/[\\^$.*+?()[\]{}|]/g,hs=RegExp(Ti.source),Zn=/^\s+/,Mi=/\s/,Zs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ea=/\{\n\/\* \[wrapped with (.+)\] \*/,I=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,Oe=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ge=/\w*$/,$e=/^[-+]0x[0-9a-f]+$/i,Fe=/^0b[01]+$/i,Ae=/^\[object .+?Constructor\]$/,Z=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,De=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lt=/($^)/,En=/['\n\r\u2028\u2029\\]/g,pt="\\ud800-\\udfff",pr="\\u0300-\\u036f",No="\\ufe20-\\ufe2f",sl="\\u20d0-\\u20ff",er=pr+No+sl,Nd="\\u2700-\\u27bf",Ld="a-z\\xdf-\\xf6\\xf8-\\xff",cB="\\xac\\xb1\\xd7\\xf7",uB="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",dB="\\u2000-\\u206f",fB=" \\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",S2="A-Z\\xc0-\\xd6\\xd8-\\xde",_2="\\ufe0e\\ufe0f",C2=cB+uB+dB+fB,oy="['’]",hB="["+pt+"]",E2="["+C2+"]",tg="["+er+"]",R2="\\d+",pB="["+Nd+"]",P2="["+Ld+"]",O2="[^"+pt+C2+R2+Nd+Ld+S2+"]",iy="\\ud83c[\\udffb-\\udfff]",gB="(?:"+tg+"|"+iy+")",T2="[^"+pt+"]",sy="(?:\\ud83c[\\udde6-\\uddff]){2}",ay="[\\ud800-\\udbff][\\udc00-\\udfff]",jc="["+S2+"]",M2="\\u200d",A2="(?:"+P2+"|"+O2+")",mB="(?:"+jc+"|"+O2+")",D2="(?:"+oy+"(?:d|ll|m|re|s|t|ve))?",k2="(?:"+oy+"(?:D|LL|M|RE|S|T|VE))?",I2=gB+"?",N2="["+_2+"]?",vB="(?:"+M2+"(?:"+[T2,sy,ay].join("|")+")"+N2+I2+")*",bB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",L2=N2+I2+vB,xB="(?:"+[pB,sy,ay].join("|")+")"+L2,wB="(?:"+[T2+tg+"?",tg,sy,ay,hB].join("|")+")",SB=RegExp(oy,"g"),_B=RegExp(tg,"g"),ly=RegExp(iy+"(?="+iy+")|"+wB+L2,"g"),CB=RegExp([jc+"?"+P2+"+"+D2+"(?="+[E2,jc,"$"].join("|")+")",mB+"+"+k2+"(?="+[E2,jc+A2,"$"].join("|")+")",jc+"?"+A2+"+"+D2,jc+"+"+k2,yB,bB,R2,xB].join("|"),"g"),EB=RegExp("["+M2+pt+er+_2+"]"),RB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,PB=["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"],OB=-1,bn={};bn[nt]=bn[sn]=bn[Cn]=bn[mn]=bn[jn]=bn[vn]=bn[Ht]=bn[cn]=bn[Pn]=!0,bn[X]=bn[re]=bn[ze]=bn[J]=bn[Ye]=bn[le]=bn[ye]=bn[oe]=bn[he]=bn[Ee]=bn[We]=bn[dt]=bn[$t]=bn[rn]=bn[pe]=!1;var fn={};fn[X]=fn[re]=fn[ze]=fn[Ye]=fn[J]=fn[le]=fn[nt]=fn[sn]=fn[Cn]=fn[mn]=fn[jn]=fn[he]=fn[Ee]=fn[We]=fn[dt]=fn[$t]=fn[rn]=fn[Nt]=fn[vn]=fn[Ht]=fn[cn]=fn[Pn]=!0,fn[ye]=fn[oe]=fn[pe]=!1;var TB={À:"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"},MB={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},AB={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},DB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kB=parseFloat,IB=parseInt,F2=typeof xa=="object"&&xa&&xa.Object===Object&&xa,NB=typeof self=="object"&&self&&self.Object===Object&&self,sr=F2||NB||Function("return this")(),cy=t&&!t.nodeType&&t,al=cy&&!0&&e&&!e.nodeType&&e,j2=al&&al.exports===cy,uy=j2&&F2.process,Lo=function(){try{var ue=al&&al.require&&al.require("util").types;return ue||uy&&uy.binding&&uy.binding("util")}catch{}}(),$2=Lo&&Lo.isArrayBuffer,z2=Lo&&Lo.isDate,B2=Lo&&Lo.isMap,H2=Lo&&Lo.isRegExp,V2=Lo&&Lo.isSet,W2=Lo&&Lo.isTypedArray;function co(ue,be,ge){switch(ge.length){case 0:return ue.call(be);case 1:return ue.call(be,ge[0]);case 2:return ue.call(be,ge[0],ge[1]);case 3:return ue.call(be,ge[0],ge[1],ge[2])}return ue.apply(be,ge)}function LB(ue,be,ge,Ve){for(var ft=-1,Wt=ue==null?0:ue.length;++ft<Wt;){var Kn=ue[ft];be(Ve,Kn,ge(Kn),ue)}return Ve}function Fo(ue,be){for(var ge=-1,Ve=ue==null?0:ue.length;++ge<Ve&&be(ue[ge],ge,ue)!==!1;);return ue}function FB(ue,be){for(var ge=ue==null?0:ue.length;ge--&&be(ue[ge],ge,ue)!==!1;);return ue}function U2(ue,be){for(var ge=-1,Ve=ue==null?0:ue.length;++ge<Ve;)if(!be(ue[ge],ge,ue))return!1;return!0}function ta(ue,be){for(var ge=-1,Ve=ue==null?0:ue.length,ft=0,Wt=[];++ge<Ve;){var Kn=ue[ge];be(Kn,ge,ue)&&(Wt[ft++]=Kn)}return Wt}function ng(ue,be){var ge=ue==null?0:ue.length;return!!ge&&$c(ue,be,0)>-1}function dy(ue,be,ge){for(var Ve=-1,ft=ue==null?0:ue.length;++Ve<ft;)if(ge(be,ue[Ve]))return!0;return!1}function Rn(ue,be){for(var ge=-1,Ve=ue==null?0:ue.length,ft=Array(Ve);++ge<Ve;)ft[ge]=be(ue[ge],ge,ue);return ft}function na(ue,be){for(var ge=-1,Ve=be.length,ft=ue.length;++ge<Ve;)ue[ft+ge]=be[ge];return ue}function fy(ue,be,ge,Ve){var ft=-1,Wt=ue==null?0:ue.length;for(Ve&&Wt&&(ge=ue[++ft]);++ft<Wt;)ge=be(ge,ue[ft],ft,ue);return ge}function jB(ue,be,ge,Ve){var ft=ue==null?0:ue.length;for(Ve&&ft&&(ge=ue[--ft]);ft--;)ge=be(ge,ue[ft],ft,ue);return ge}function hy(ue,be){for(var ge=-1,Ve=ue==null?0:ue.length;++ge<Ve;)if(be(ue[ge],ge,ue))return!0;return!1}var $B=py("length");function zB(ue){return ue.split("")}function BB(ue){return ue.match(se)||[]}function G2(ue,be,ge){var Ve;return ge(ue,function(ft,Wt,Kn){if(be(ft,Wt,Kn))return Ve=Wt,!1}),Ve}function rg(ue,be,ge,Ve){for(var ft=ue.length,Wt=ge+(Ve?1:-1);Ve?Wt--:++Wt<ft;)if(be(ue[Wt],Wt,ue))return Wt;return-1}function $c(ue,be,ge){return be===be?ZB(ue,be,ge):rg(ue,q2,ge)}function HB(ue,be,ge,Ve){for(var ft=ge-1,Wt=ue.length;++ft<Wt;)if(Ve(ue[ft],be))return ft;return-1}function q2(ue){return ue!==ue}function Y2(ue,be){var ge=ue==null?0:ue.length;return ge?my(ue,be)/ge:F}function py(ue){return function(be){return be==null?n:be[ue]}}function gy(ue){return function(be){return ue==null?n:ue[be]}}function K2(ue,be,ge,Ve,ft){return ft(ue,function(Wt,Kn,un){ge=Ve?(Ve=!1,Wt):be(ge,Wt,Kn,un)}),ge}function VB(ue,be){var ge=ue.length;for(ue.sort(be);ge--;)ue[ge]=ue[ge].value;return ue}function my(ue,be){for(var ge,Ve=-1,ft=ue.length;++Ve<ft;){var Wt=be(ue[Ve]);Wt!==n&&(ge=ge===n?Wt:ge+Wt)}return ge}function vy(ue,be){for(var ge=-1,Ve=Array(ue);++ge<ue;)Ve[ge]=be(ge);return Ve}function WB(ue,be){return Rn(be,function(ge){return[ge,ue[ge]]})}function X2(ue){return ue&&ue.slice(0,eP(ue)+1).replace(Zn,"")}function uo(ue){return function(be){return ue(be)}}function by(ue,be){return Rn(be,function(ge){return ue[ge]})}function Fd(ue,be){return ue.has(be)}function Q2(ue,be){for(var ge=-1,Ve=ue.length;++ge<Ve&&$c(be,ue[ge],0)>-1;);return ge}function J2(ue,be){for(var ge=ue.length;ge--&&$c(be,ue[ge],0)>-1;);return ge}function UB(ue,be){for(var ge=ue.length,Ve=0;ge--;)ue[ge]===be&&++Ve;return Ve}var GB=gy(TB),qB=gy(MB);function YB(ue){return"\\"+DB[ue]}function KB(ue,be){return ue==null?n:ue[be]}function zc(ue){return EB.test(ue)}function XB(ue){return RB.test(ue)}function QB(ue){for(var be,ge=[];!(be=ue.next()).done;)ge.push(be.value);return ge}function yy(ue){var be=-1,ge=Array(ue.size);return ue.forEach(function(Ve,ft){ge[++be]=[ft,Ve]}),ge}function Z2(ue,be){return function(ge){return ue(be(ge))}}function ra(ue,be){for(var ge=-1,Ve=ue.length,ft=0,Wt=[];++ge<Ve;){var Kn=ue[ge];(Kn===be||Kn===u)&&(ue[ge]=u,Wt[ft++]=ge)}return Wt}function og(ue){var be=-1,ge=Array(ue.size);return ue.forEach(function(Ve){ge[++be]=Ve}),ge}function JB(ue){var be=-1,ge=Array(ue.size);return ue.forEach(function(Ve){ge[++be]=[Ve,Ve]}),ge}function ZB(ue,be,ge){for(var Ve=ge-1,ft=ue.length;++Ve<ft;)if(ue[Ve]===be)return Ve;return-1}function eH(ue,be,ge){for(var Ve=ge+1;Ve--;)if(ue[Ve]===be)return Ve;return Ve}function Bc(ue){return zc(ue)?nH(ue):$B(ue)}function si(ue){return zc(ue)?rH(ue):zB(ue)}function eP(ue){for(var be=ue.length;be--&&Mi.test(ue.charAt(be)););return be}var tH=gy(AB);function nH(ue){for(var be=ly.lastIndex=0;ly.test(ue);)++be;return be}function rH(ue){return ue.match(ly)||[]}function oH(ue){return ue.match(CB)||[]}var iH=function ue(be){be=be==null?sr:Hc.defaults(sr.Object(),be,Hc.pick(sr,PB));var ge=be.Array,Ve=be.Date,ft=be.Error,Wt=be.Function,Kn=be.Math,un=be.Object,xy=be.RegExp,sH=be.String,jo=be.TypeError,ig=ge.prototype,aH=Wt.prototype,Vc=un.prototype,sg=be["__core-js_shared__"],ag=aH.toString,en=Vc.hasOwnProperty,lH=0,tP=function(){var f=/[^.]+$/.exec(sg&&sg.keys&&sg.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),lg=Vc.toString,cH=ag.call(un),uH=sr._,dH=xy("^"+ag.call(en).replace(Ti,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),cg=j2?be.Buffer:n,oa=be.Symbol,ug=be.Uint8Array,nP=cg?cg.allocUnsafe:n,dg=Z2(un.getPrototypeOf,un),rP=un.create,oP=Vc.propertyIsEnumerable,fg=ig.splice,iP=oa?oa.isConcatSpreadable:n,jd=oa?oa.iterator:n,ll=oa?oa.toStringTag:n,hg=function(){try{var f=hl(un,"defineProperty");return f({},"",{}),f}catch{}}(),fH=be.clearTimeout!==sr.clearTimeout&&be.clearTimeout,hH=Ve&&Ve.now!==sr.Date.now&&Ve.now,pH=be.setTimeout!==sr.setTimeout&&be.setTimeout,pg=Kn.ceil,gg=Kn.floor,wy=un.getOwnPropertySymbols,gH=cg?cg.isBuffer:n,sP=be.isFinite,mH=ig.join,vH=Z2(un.keys,un),Xn=Kn.max,gr=Kn.min,bH=Ve.now,yH=be.parseInt,aP=Kn.random,xH=ig.reverse,Sy=hl(be,"DataView"),$d=hl(be,"Map"),_y=hl(be,"Promise"),Wc=hl(be,"Set"),zd=hl(be,"WeakMap"),Bd=hl(un,"create"),mg=zd&&new zd,Uc={},wH=pl(Sy),SH=pl($d),_H=pl(_y),CH=pl(Wc),EH=pl(zd),vg=oa?oa.prototype:n,Hd=vg?vg.valueOf:n,lP=vg?vg.toString:n;function B(f){if(Dn(f)&&!ht(f)&&!(f instanceof It)){if(f instanceof $o)return f;if(en.call(f,"__wrapped__"))return cO(f)}return new $o(f)}var Gc=function(){function f(){}return function(g){if(!On(g))return{};if(rP)return rP(g);f.prototype=g;var w=new f;return f.prototype=n,w}}();function bg(){}function $o(f,g){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}B.templateSettings={escape:Qs,evaluate:ii,interpolate:ds,variable:"",imports:{_:B}},B.prototype=bg.prototype,B.prototype.constructor=B,$o.prototype=Gc(bg.prototype),$o.prototype.constructor=$o;function It(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Y,this.__views__=[]}function RH(){var f=new It(this.__wrapped__);return f.__actions__=Hr(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=Hr(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=Hr(this.__views__),f}function PH(){if(this.__filtered__){var f=new It(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function OH(){var f=this.__wrapped__.value(),g=this.__dir__,w=ht(f),O=g<0,L=w?f.length:0,U=zV(0,L,this.__views__),Q=U.start,ie=U.end,de=ie-Q,Se=O?ie:Q-1,_e=this.__iteratees__,Re=_e.length,je=0,qe=gr(de,this.__takeCount__);if(!w||!O&&L==de&&qe==de)return DP(f,this.__actions__);var Qe=[];e:for(;de--&&je<qe;){Se+=g;for(var St=-1,Je=f[Se];++St<Re;){var Mt=_e[St],Lt=Mt.iteratee,po=Mt.type,Or=Lt(Je);if(po==N)Je=Or;else if(!Or){if(po==V)continue e;break e}}Qe[je++]=Je}return Qe}It.prototype=Gc(bg.prototype),It.prototype.constructor=It;function cl(f){var g=-1,w=f==null?0:f.length;for(this.clear();++g<w;){var O=f[g];this.set(O[0],O[1])}}function TH(){this.__data__=Bd?Bd(null):{},this.size=0}function MH(f){var g=this.has(f)&&delete this.__data__[f];return this.size-=g?1:0,g}function AH(f){var g=this.__data__;if(Bd){var w=g[f];return w===l?n:w}return en.call(g,f)?g[f]:n}function DH(f){var g=this.__data__;return Bd?g[f]!==n:en.call(g,f)}function kH(f,g){var w=this.__data__;return this.size+=this.has(f)?0:1,w[f]=Bd&&g===n?l:g,this}cl.prototype.clear=TH,cl.prototype.delete=MH,cl.prototype.get=AH,cl.prototype.has=DH,cl.prototype.set=kH;function ps(f){var g=-1,w=f==null?0:f.length;for(this.clear();++g<w;){var O=f[g];this.set(O[0],O[1])}}function IH(){this.__data__=[],this.size=0}function NH(f){var g=this.__data__,w=yg(g,f);if(w<0)return!1;var O=g.length-1;return w==O?g.pop():fg.call(g,w,1),--this.size,!0}function LH(f){var g=this.__data__,w=yg(g,f);return w<0?n:g[w][1]}function FH(f){return yg(this.__data__,f)>-1}function jH(f,g){var w=this.__data__,O=yg(w,f);return O<0?(++this.size,w.push([f,g])):w[O][1]=g,this}ps.prototype.clear=IH,ps.prototype.delete=NH,ps.prototype.get=LH,ps.prototype.has=FH,ps.prototype.set=jH;function gs(f){var g=-1,w=f==null?0:f.length;for(this.clear();++g<w;){var O=f[g];this.set(O[0],O[1])}}function $H(){this.size=0,this.__data__={hash:new cl,map:new($d||ps),string:new cl}}function zH(f){var g=Ag(this,f).delete(f);return this.size-=g?1:0,g}function BH(f){return Ag(this,f).get(f)}function HH(f){return Ag(this,f).has(f)}function VH(f,g){var w=Ag(this,f),O=w.size;return w.set(f,g),this.size+=w.size==O?0:1,this}gs.prototype.clear=$H,gs.prototype.delete=zH,gs.prototype.get=BH,gs.prototype.has=HH,gs.prototype.set=VH;function ul(f){var g=-1,w=f==null?0:f.length;for(this.__data__=new gs;++g<w;)this.add(f[g])}function WH(f){return this.__data__.set(f,l),this}function UH(f){return this.__data__.has(f)}ul.prototype.add=ul.prototype.push=WH,ul.prototype.has=UH;function ai(f){var g=this.__data__=new ps(f);this.size=g.size}function GH(){this.__data__=new ps,this.size=0}function qH(f){var g=this.__data__,w=g.delete(f);return this.size=g.size,w}function YH(f){return this.__data__.get(f)}function KH(f){return this.__data__.has(f)}function XH(f,g){var w=this.__data__;if(w instanceof ps){var O=w.__data__;if(!$d||O.length<o-1)return O.push([f,g]),this.size=++w.size,this;w=this.__data__=new gs(O)}return w.set(f,g),this.size=w.size,this}ai.prototype.clear=GH,ai.prototype.delete=qH,ai.prototype.get=YH,ai.prototype.has=KH,ai.prototype.set=XH;function cP(f,g){var w=ht(f),O=!w&&gl(f),L=!w&&!O&&ca(f),U=!w&&!O&&!L&&Xc(f),Q=w||O||L||U,ie=Q?vy(f.length,sH):[],de=ie.length;for(var Se in f)(g||en.call(f,Se))&&!(Q&&(Se=="length"||L&&(Se=="offset"||Se=="parent")||U&&(Se=="buffer"||Se=="byteLength"||Se=="byteOffset")||ys(Se,de)))&&ie.push(Se);return ie}function uP(f){var g=f.length;return g?f[Iy(0,g-1)]:n}function QH(f,g){return Dg(Hr(f),dl(g,0,f.length))}function JH(f){return Dg(Hr(f))}function Cy(f,g,w){(w!==n&&!li(f[g],w)||w===n&&!(g in f))&&ms(f,g,w)}function Vd(f,g,w){var O=f[g];(!(en.call(f,g)&&li(O,w))||w===n&&!(g in f))&&ms(f,g,w)}function yg(f,g){for(var w=f.length;w--;)if(li(f[w][0],g))return w;return-1}function ZH(f,g,w,O){return ia(f,function(L,U,Q){g(O,L,w(L),Q)}),O}function dP(f,g){return f&&Di(g,tr(g),f)}function eV(f,g){return f&&Di(g,Wr(g),f)}function ms(f,g,w){g=="__proto__"&&hg?hg(f,g,{configurable:!0,enumerable:!0,value:w,writable:!0}):f[g]=w}function Ey(f,g){for(var w=-1,O=g.length,L=ge(O),U=f==null;++w<O;)L[w]=U?n:ix(f,g[w]);return L}function dl(f,g,w){return f===f&&(w!==n&&(f=f<=w?f:w),g!==n&&(f=f>=g?f:g)),f}function zo(f,g,w,O,L,U){var Q,ie=g&d,de=g&h,Se=g&p;if(w&&(Q=L?w(f,O,L,U):w(f)),Q!==n)return Q;if(!On(f))return f;var _e=ht(f);if(_e){if(Q=HV(f),!ie)return Hr(f,Q)}else{var Re=mr(f),je=Re==oe||Re==ve;if(ca(f))return NP(f,ie);if(Re==We||Re==X||je&&!L){if(Q=de||je?{}:eO(f),!ie)return de?AV(f,eV(Q,f)):MV(f,dP(Q,f))}else{if(!fn[Re])return L?f:{};Q=VV(f,Re,ie)}}U||(U=new ai);var qe=U.get(f);if(qe)return qe;U.set(f,Q),TO(f)?f.forEach(function(Je){Q.add(zo(Je,g,w,Je,f,U))}):PO(f)&&f.forEach(function(Je,Mt){Q.set(Mt,zo(Je,g,w,Mt,f,U))});var Qe=Se?de?Uy:Wy:de?Wr:tr,St=_e?n:Qe(f);return Fo(St||f,function(Je,Mt){St&&(Mt=Je,Je=f[Mt]),Vd(Q,Mt,zo(Je,g,w,Mt,f,U))}),Q}function tV(f){var g=tr(f);return function(w){return fP(w,f,g)}}function fP(f,g,w){var O=w.length;if(f==null)return!O;for(f=un(f);O--;){var L=w[O],U=g[L],Q=f[L];if(Q===n&&!(L in f)||!U(Q))return!1}return!0}function hP(f,g,w){if(typeof f!="function")throw new jo(s);return Xd(function(){f.apply(n,w)},g)}function Wd(f,g,w,O){var L=-1,U=ng,Q=!0,ie=f.length,de=[],Se=g.length;if(!ie)return de;w&&(g=Rn(g,uo(w))),O?(U=dy,Q=!1):g.length>=o&&(U=Fd,Q=!1,g=new ul(g));e:for(;++L<ie;){var _e=f[L],Re=w==null?_e:w(_e);if(_e=O||_e!==0?_e:0,Q&&Re===Re){for(var je=Se;je--;)if(g[je]===Re)continue e;de.push(_e)}else U(g,Re,O)||de.push(_e)}return de}var ia=zP(Ai),pP=zP(Py,!0);function nV(f,g){var w=!0;return ia(f,function(O,L,U){return w=!!g(O,L,U),w}),w}function xg(f,g,w){for(var O=-1,L=f.length;++O<L;){var U=f[O],Q=g(U);if(Q!=null&&(ie===n?Q===Q&&!ho(Q):w(Q,ie)))var ie=Q,de=U}return de}function rV(f,g,w,O){var L=f.length;for(w=vt(w),w<0&&(w=-w>L?0:L+w),O=O===n||O>L?L:vt(O),O<0&&(O+=L),O=w>O?0:AO(O);w<O;)f[w++]=g;return f}function gP(f,g){var w=[];return ia(f,function(O,L,U){g(O,L,U)&&w.push(O)}),w}function ar(f,g,w,O,L){var U=-1,Q=f.length;for(w||(w=UV),L||(L=[]);++U<Q;){var ie=f[U];g>0&&w(ie)?g>1?ar(ie,g-1,w,O,L):na(L,ie):O||(L[L.length]=ie)}return L}var Ry=BP(),mP=BP(!0);function Ai(f,g){return f&&Ry(f,g,tr)}function Py(f,g){return f&&mP(f,g,tr)}function wg(f,g){return ta(g,function(w){return xs(f[w])})}function fl(f,g){g=aa(g,f);for(var w=0,O=g.length;f!=null&&w<O;)f=f[ki(g[w++])];return w&&w==O?f:n}function vP(f,g,w){var O=g(f);return ht(f)?O:na(O,w(f))}function Rr(f){return f==null?f===n?on:ke:ll&&ll in un(f)?$V(f):JV(f)}function Oy(f,g){return f>g}function oV(f,g){return f!=null&&en.call(f,g)}function iV(f,g){return f!=null&&g in un(f)}function sV(f,g,w){return f>=gr(g,w)&&f<Xn(g,w)}function Ty(f,g,w){for(var O=w?dy:ng,L=f[0].length,U=f.length,Q=U,ie=ge(U),de=1/0,Se=[];Q--;){var _e=f[Q];Q&&g&&(_e=Rn(_e,uo(g))),de=gr(_e.length,de),ie[Q]=!w&&(g||L>=120&&_e.length>=120)?new ul(Q&&_e):n}_e=f[0];var Re=-1,je=ie[0];e:for(;++Re<L&&Se.length<de;){var qe=_e[Re],Qe=g?g(qe):qe;if(qe=w||qe!==0?qe:0,!(je?Fd(je,Qe):O(Se,Qe,w))){for(Q=U;--Q;){var St=ie[Q];if(!(St?Fd(St,Qe):O(f[Q],Qe,w)))continue e}je&&je.push(Qe),Se.push(qe)}}return Se}function aV(f,g,w,O){return Ai(f,function(L,U,Q){g(O,w(L),U,Q)}),O}function Ud(f,g,w){g=aa(g,f),f=oO(f,g);var O=f==null?f:f[ki(Ho(g))];return O==null?n:co(O,f,w)}function bP(f){return Dn(f)&&Rr(f)==X}function lV(f){return Dn(f)&&Rr(f)==ze}function cV(f){return Dn(f)&&Rr(f)==le}function Gd(f,g,w,O,L){return f===g?!0:f==null||g==null||!Dn(f)&&!Dn(g)?f!==f&&g!==g:uV(f,g,w,O,Gd,L)}function uV(f,g,w,O,L,U){var Q=ht(f),ie=ht(g),de=Q?re:mr(f),Se=ie?re:mr(g);de=de==X?We:de,Se=Se==X?We:Se;var _e=de==We,Re=Se==We,je=de==Se;if(je&&ca(f)){if(!ca(g))return!1;Q=!0,_e=!1}if(je&&!_e)return U||(U=new ai),Q||Xc(f)?QP(f,g,w,O,L,U):FV(f,g,de,w,O,L,U);if(!(w&m)){var qe=_e&&en.call(f,"__wrapped__"),Qe=Re&&en.call(g,"__wrapped__");if(qe||Qe){var St=qe?f.value():f,Je=Qe?g.value():g;return U||(U=new ai),L(St,Je,w,O,U)}}return je?(U||(U=new ai),jV(f,g,w,O,L,U)):!1}function dV(f){return Dn(f)&&mr(f)==he}function My(f,g,w,O){var L=w.length,U=L,Q=!O;if(f==null)return!U;for(f=un(f);L--;){var ie=w[L];if(Q&&ie[2]?ie[1]!==f[ie[0]]:!(ie[0]in f))return!1}for(;++L<U;){ie=w[L];var de=ie[0],Se=f[de],_e=ie[1];if(Q&&ie[2]){if(Se===n&&!(de in f))return!1}else{var Re=new ai;if(O)var je=O(Se,_e,de,f,g,Re);if(!(je===n?Gd(_e,Se,m|v,O,Re):je))return!1}}return!0}function yP(f){if(!On(f)||qV(f))return!1;var g=xs(f)?dH:Ae;return g.test(pl(f))}function fV(f){return Dn(f)&&Rr(f)==dt}function hV(f){return Dn(f)&&mr(f)==$t}function pV(f){return Dn(f)&&jg(f.length)&&!!bn[Rr(f)]}function xP(f){return typeof f=="function"?f:f==null?Ur:typeof f=="object"?ht(f)?_P(f[0],f[1]):SP(f):HO(f)}function Ay(f){if(!Kd(f))return vH(f);var g=[];for(var w in un(f))en.call(f,w)&&w!="constructor"&&g.push(w);return g}function gV(f){if(!On(f))return QV(f);var g=Kd(f),w=[];for(var O in f)O=="constructor"&&(g||!en.call(f,O))||w.push(O);return w}function Dy(f,g){return f<g}function wP(f,g){var w=-1,O=Vr(f)?ge(f.length):[];return ia(f,function(L,U,Q){O[++w]=g(L,U,Q)}),O}function SP(f){var g=qy(f);return g.length==1&&g[0][2]?nO(g[0][0],g[0][1]):function(w){return w===f||My(w,f,g)}}function _P(f,g){return Ky(f)&&tO(g)?nO(ki(f),g):function(w){var O=ix(w,f);return O===n&&O===g?sx(w,f):Gd(g,O,m|v)}}function Sg(f,g,w,O,L){f!==g&&Ry(g,function(U,Q){if(L||(L=new ai),On(U))mV(f,g,Q,w,Sg,O,L);else{var ie=O?O(Qy(f,Q),U,Q+"",f,g,L):n;ie===n&&(ie=U),Cy(f,Q,ie)}},Wr)}function mV(f,g,w,O,L,U,Q){var ie=Qy(f,w),de=Qy(g,w),Se=Q.get(de);if(Se){Cy(f,w,Se);return}var _e=U?U(ie,de,w+"",f,g,Q):n,Re=_e===n;if(Re){var je=ht(de),qe=!je&&ca(de),Qe=!je&&!qe&&Xc(de);_e=de,je||qe||Qe?ht(ie)?_e=ie:zn(ie)?_e=Hr(ie):qe?(Re=!1,_e=NP(de,!0)):Qe?(Re=!1,_e=LP(de,!0)):_e=[]:Qd(de)||gl(de)?(_e=ie,gl(ie)?_e=DO(ie):(!On(ie)||xs(ie))&&(_e=eO(de))):Re=!1}Re&&(Q.set(de,_e),L(_e,de,O,U,Q),Q.delete(de)),Cy(f,w,_e)}function CP(f,g){var w=f.length;if(w)return g+=g<0?w:0,ys(g,w)?f[g]:n}function EP(f,g,w){g.length?g=Rn(g,function(U){return ht(U)?function(Q){return fl(Q,U.length===1?U[0]:U)}:U}):g=[Ur];var O=-1;g=Rn(g,uo(Xe()));var L=wP(f,function(U,Q,ie){var de=Rn(g,function(Se){return Se(U)});return{criteria:de,index:++O,value:U}});return VB(L,function(U,Q){return TV(U,Q,w)})}function vV(f,g){return RP(f,g,function(w,O){return sx(f,O)})}function RP(f,g,w){for(var O=-1,L=g.length,U={};++O<L;){var Q=g[O],ie=fl(f,Q);w(ie,Q)&&qd(U,aa(Q,f),ie)}return U}function bV(f){return function(g){return fl(g,f)}}function ky(f,g,w,O){var L=O?HB:$c,U=-1,Q=g.length,ie=f;for(f===g&&(g=Hr(g)),w&&(ie=Rn(f,uo(w)));++U<Q;)for(var de=0,Se=g[U],_e=w?w(Se):Se;(de=L(ie,_e,de,O))>-1;)ie!==f&&fg.call(ie,de,1),fg.call(f,de,1);return f}function PP(f,g){for(var w=f?g.length:0,O=w-1;w--;){var L=g[w];if(w==O||L!==U){var U=L;ys(L)?fg.call(f,L,1):Fy(f,L)}}return f}function Iy(f,g){return f+gg(aP()*(g-f+1))}function yV(f,g,w,O){for(var L=-1,U=Xn(pg((g-f)/(w||1)),0),Q=ge(U);U--;)Q[O?U:++L]=f,f+=w;return Q}function Ny(f,g){var w="";if(!f||g<1||g>G)return w;do g%2&&(w+=f),g=gg(g/2),g&&(f+=f);while(g);return w}function Rt(f,g){return Jy(rO(f,g,Ur),f+"")}function xV(f){return uP(Qc(f))}function wV(f,g){var w=Qc(f);return Dg(w,dl(g,0,w.length))}function qd(f,g,w,O){if(!On(f))return f;g=aa(g,f);for(var L=-1,U=g.length,Q=U-1,ie=f;ie!=null&&++L<U;){var de=ki(g[L]),Se=w;if(de==="__proto__"||de==="constructor"||de==="prototype")return f;if(L!=Q){var _e=ie[de];Se=O?O(_e,de,ie):n,Se===n&&(Se=On(_e)?_e:ys(g[L+1])?[]:{})}Vd(ie,de,Se),ie=ie[de]}return f}var OP=mg?function(f,g){return mg.set(f,g),f}:Ur,SV=hg?function(f,g){return hg(f,"toString",{configurable:!0,enumerable:!1,value:lx(g),writable:!0})}:Ur;function _V(f){return Dg(Qc(f))}function Bo(f,g,w){var O=-1,L=f.length;g<0&&(g=-g>L?0:L+g),w=w>L?L:w,w<0&&(w+=L),L=g>w?0:w-g>>>0,g>>>=0;for(var U=ge(L);++O<L;)U[O]=f[O+g];return U}function CV(f,g){var w;return ia(f,function(O,L,U){return w=g(O,L,U),!w}),!!w}function _g(f,g,w){var O=0,L=f==null?O:f.length;if(typeof g=="number"&&g===g&&L<=M){for(;O<L;){var U=O+L>>>1,Q=f[U];Q!==null&&!ho(Q)&&(w?Q<=g:Q<g)?O=U+1:L=U}return L}return Ly(f,g,Ur,w)}function Ly(f,g,w,O){var L=0,U=f==null?0:f.length;if(U===0)return 0;g=w(g);for(var Q=g!==g,ie=g===null,de=ho(g),Se=g===n;L<U;){var _e=gg((L+U)/2),Re=w(f[_e]),je=Re!==n,qe=Re===null,Qe=Re===Re,St=ho(Re);if(Q)var Je=O||Qe;else Se?Je=Qe&&(O||je):ie?Je=Qe&&je&&(O||!qe):de?Je=Qe&&je&&!qe&&(O||!St):qe||St?Je=!1:Je=O?Re<=g:Re<g;Je?L=_e+1:U=_e}return gr(U,q)}function TP(f,g){for(var w=-1,O=f.length,L=0,U=[];++w<O;){var Q=f[w],ie=g?g(Q):Q;if(!w||!li(ie,de)){var de=ie;U[L++]=Q===0?0:Q}}return U}function MP(f){return typeof f=="number"?f:ho(f)?F:+f}function fo(f){if(typeof f=="string")return f;if(ht(f))return Rn(f,fo)+"";if(ho(f))return lP?lP.call(f):"";var g=f+"";return g=="0"&&1/f==-H?"-0":g}function sa(f,g,w){var O=-1,L=ng,U=f.length,Q=!0,ie=[],de=ie;if(w)Q=!1,L=dy;else if(U>=o){var Se=g?null:NV(f);if(Se)return og(Se);Q=!1,L=Fd,de=new ul}else de=g?[]:ie;e:for(;++O<U;){var _e=f[O],Re=g?g(_e):_e;if(_e=w||_e!==0?_e:0,Q&&Re===Re){for(var je=de.length;je--;)if(de[je]===Re)continue e;g&&de.push(Re),ie.push(_e)}else L(de,Re,w)||(de!==ie&&de.push(Re),ie.push(_e))}return ie}function Fy(f,g){return g=aa(g,f),f=oO(f,g),f==null||delete f[ki(Ho(g))]}function AP(f,g,w,O){return qd(f,g,w(fl(f,g)),O)}function Cg(f,g,w,O){for(var L=f.length,U=O?L:-1;(O?U--:++U<L)&&g(f[U],U,f););return w?Bo(f,O?0:U,O?U+1:L):Bo(f,O?U+1:0,O?L:U)}function DP(f,g){var w=f;return w instanceof It&&(w=w.value()),fy(g,function(O,L){return L.func.apply(L.thisArg,na([O],L.args))},w)}function jy(f,g,w){var O=f.length;if(O<2)return O?sa(f[0]):[];for(var L=-1,U=ge(O);++L<O;)for(var Q=f[L],ie=-1;++ie<O;)ie!=L&&(U[L]=Wd(U[L]||Q,f[ie],g,w));return sa(ar(U,1),g,w)}function kP(f,g,w){for(var O=-1,L=f.length,U=g.length,Q={};++O<L;){var ie=O<U?g[O]:n;w(Q,f[O],ie)}return Q}function $y(f){return zn(f)?f:[]}function zy(f){return typeof f=="function"?f:Ur}function aa(f,g){return ht(f)?f:Ky(f,g)?[f]:lO(Kt(f))}var EV=Rt;function la(f,g,w){var O=f.length;return w=w===n?O:w,!g&&w>=O?f:Bo(f,g,w)}var IP=fH||function(f){return sr.clearTimeout(f)};function NP(f,g){if(g)return f.slice();var w=f.length,O=nP?nP(w):new f.constructor(w);return f.copy(O),O}function By(f){var g=new f.constructor(f.byteLength);return new ug(g).set(new ug(f)),g}function RV(f,g){var w=g?By(f.buffer):f.buffer;return new f.constructor(w,f.byteOffset,f.byteLength)}function PV(f){var g=new f.constructor(f.source,Ge.exec(f));return g.lastIndex=f.lastIndex,g}function OV(f){return Hd?un(Hd.call(f)):{}}function LP(f,g){var w=g?By(f.buffer):f.buffer;return new f.constructor(w,f.byteOffset,f.length)}function FP(f,g){if(f!==g){var w=f!==n,O=f===null,L=f===f,U=ho(f),Q=g!==n,ie=g===null,de=g===g,Se=ho(g);if(!ie&&!Se&&!U&&f>g||U&&Q&&de&&!ie&&!Se||O&&Q&&de||!w&&de||!L)return 1;if(!O&&!U&&!Se&&f<g||Se&&w&&L&&!O&&!U||ie&&w&&L||!Q&&L||!de)return-1}return 0}function TV(f,g,w){for(var O=-1,L=f.criteria,U=g.criteria,Q=L.length,ie=w.length;++O<Q;){var de=FP(L[O],U[O]);if(de){if(O>=ie)return de;var Se=w[O];return de*(Se=="desc"?-1:1)}}return f.index-g.index}function jP(f,g,w,O){for(var L=-1,U=f.length,Q=w.length,ie=-1,de=g.length,Se=Xn(U-Q,0),_e=ge(de+Se),Re=!O;++ie<de;)_e[ie]=g[ie];for(;++L<Q;)(Re||L<U)&&(_e[w[L]]=f[L]);for(;Se--;)_e[ie++]=f[L++];return _e}function $P(f,g,w,O){for(var L=-1,U=f.length,Q=-1,ie=w.length,de=-1,Se=g.length,_e=Xn(U-ie,0),Re=ge(_e+Se),je=!O;++L<_e;)Re[L]=f[L];for(var qe=L;++de<Se;)Re[qe+de]=g[de];for(;++Q<ie;)(je||L<U)&&(Re[qe+w[Q]]=f[L++]);return Re}function Hr(f,g){var w=-1,O=f.length;for(g||(g=ge(O));++w<O;)g[w]=f[w];return g}function Di(f,g,w,O){var L=!w;w||(w={});for(var U=-1,Q=g.length;++U<Q;){var ie=g[U],de=O?O(w[ie],f[ie],ie,w,f):n;de===n&&(de=f[ie]),L?ms(w,ie,de):Vd(w,ie,de)}return w}function MV(f,g){return Di(f,Yy(f),g)}function AV(f,g){return Di(f,JP(f),g)}function Eg(f,g){return function(w,O){var L=ht(w)?LB:ZH,U=g?g():{};return L(w,f,Xe(O,2),U)}}function qc(f){return Rt(function(g,w){var O=-1,L=w.length,U=L>1?w[L-1]:n,Q=L>2?w[2]:n;for(U=f.length>3&&typeof U=="function"?(L--,U):n,Q&&Pr(w[0],w[1],Q)&&(U=L<3?n:U,L=1),g=un(g);++O<L;){var ie=w[O];ie&&f(g,ie,O,U)}return g})}function zP(f,g){return function(w,O){if(w==null)return w;if(!Vr(w))return f(w,O);for(var L=w.length,U=g?L:-1,Q=un(w);(g?U--:++U<L)&&O(Q[U],U,Q)!==!1;);return w}}function BP(f){return function(g,w,O){for(var L=-1,U=un(g),Q=O(g),ie=Q.length;ie--;){var de=Q[f?ie:++L];if(w(U[de],de,U)===!1)break}return g}}function DV(f,g,w){var O=g&y,L=Yd(f);function U(){var Q=this&&this!==sr&&this instanceof U?L:f;return Q.apply(O?w:this,arguments)}return U}function HP(f){return function(g){g=Kt(g);var w=zc(g)?si(g):n,O=w?w[0]:g.charAt(0),L=w?la(w,1).join(""):g.slice(1);return O[f]()+L}}function Yc(f){return function(g){return fy(zO($O(g).replace(SB,"")),f,"")}}function Yd(f){return function(){var g=arguments;switch(g.length){case 0:return new f;case 1:return new f(g[0]);case 2:return new f(g[0],g[1]);case 3:return new f(g[0],g[1],g[2]);case 4:return new f(g[0],g[1],g[2],g[3]);case 5:return new f(g[0],g[1],g[2],g[3],g[4]);case 6:return new f(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new f(g[0],g[1],g[2],g[3],g[4],g[5],g[6])}var w=Gc(f.prototype),O=f.apply(w,g);return On(O)?O:w}}function kV(f,g,w){var O=Yd(f);function L(){for(var U=arguments.length,Q=ge(U),ie=U,de=Kc(L);ie--;)Q[ie]=arguments[ie];var Se=U<3&&Q[0]!==de&&Q[U-1]!==de?[]:ra(Q,de);if(U-=Se.length,U<w)return qP(f,g,Rg,L.placeholder,n,Q,Se,n,n,w-U);var _e=this&&this!==sr&&this instanceof L?O:f;return co(_e,this,Q)}return L}function VP(f){return function(g,w,O){var L=un(g);if(!Vr(g)){var U=Xe(w,3);g=tr(g),w=function(ie){return U(L[ie],ie,L)}}var Q=f(g,w,O);return Q>-1?L[U?g[Q]:Q]:n}}function WP(f){return bs(function(g){var w=g.length,O=w,L=$o.prototype.thru;for(f&&g.reverse();O--;){var U=g[O];if(typeof U!="function")throw new jo(s);if(L&&!Q&&Mg(U)=="wrapper")var Q=new $o([],!0)}for(O=Q?O:w;++O<w;){U=g[O];var ie=Mg(U),de=ie=="wrapper"?Gy(U):n;de&&Xy(de[0])&&de[1]==(A|_|E|D)&&!de[4].length&&de[9]==1?Q=Q[Mg(de[0])].apply(Q,de[3]):Q=U.length==1&&Xy(U)?Q[ie]():Q.thru(U)}return function(){var Se=arguments,_e=Se[0];if(Q&&Se.length==1&&ht(_e))return Q.plant(_e).value();for(var Re=0,je=w?g[Re].apply(this,Se):_e;++Re<w;)je=g[Re].call(this,je);return je}})}function Rg(f,g,w,O,L,U,Q,ie,de,Se){var _e=g&A,Re=g&y,je=g&b,qe=g&(_|C),Qe=g&k,St=je?n:Yd(f);function Je(){for(var Mt=arguments.length,Lt=ge(Mt),po=Mt;po--;)Lt[po]=arguments[po];if(qe)var Or=Kc(Je),go=UB(Lt,Or);if(O&&(Lt=jP(Lt,O,L,qe)),U&&(Lt=$P(Lt,U,Q,qe)),Mt-=go,qe&&Mt<Se){var Bn=ra(Lt,Or);return qP(f,g,Rg,Je.placeholder,w,Lt,Bn,ie,de,Se-Mt)}var ci=Re?w:this,Ss=je?ci[f]:f;return Mt=Lt.length,ie?Lt=ZV(Lt,ie):Qe&&Mt>1&&Lt.reverse(),_e&&de<Mt&&(Lt.length=de),this&&this!==sr&&this instanceof Je&&(Ss=St||Yd(Ss)),Ss.apply(ci,Lt)}return Je}function UP(f,g){return function(w,O){return aV(w,f,g(O),{})}}function Pg(f,g){return function(w,O){var L;if(w===n&&O===n)return g;if(w!==n&&(L=w),O!==n){if(L===n)return O;typeof w=="string"||typeof O=="string"?(w=fo(w),O=fo(O)):(w=MP(w),O=MP(O)),L=f(w,O)}return L}}function Hy(f){return bs(function(g){return g=Rn(g,uo(Xe())),Rt(function(w){var O=this;return f(g,function(L){return co(L,O,w)})})})}function Og(f,g){g=g===n?" ":fo(g);var w=g.length;if(w<2)return w?Ny(g,f):g;var O=Ny(g,pg(f/Bc(g)));return zc(g)?la(si(O),0,f).join(""):O.slice(0,f)}function IV(f,g,w,O){var L=g&y,U=Yd(f);function Q(){for(var ie=-1,de=arguments.length,Se=-1,_e=O.length,Re=ge(_e+de),je=this&&this!==sr&&this instanceof Q?U:f;++Se<_e;)Re[Se]=O[Se];for(;de--;)Re[Se++]=arguments[++ie];return co(je,L?w:this,Re)}return Q}function GP(f){return function(g,w,O){return O&&typeof O!="number"&&Pr(g,w,O)&&(w=O=n),g=ws(g),w===n?(w=g,g=0):w=ws(w),O=O===n?g<w?1:-1:ws(O),yV(g,w,O,f)}}function Tg(f){return function(g,w){return typeof g=="string"&&typeof w=="string"||(g=Vo(g),w=Vo(w)),f(g,w)}}function qP(f,g,w,O,L,U,Q,ie,de,Se){var _e=g&_,Re=_e?Q:n,je=_e?n:Q,qe=_e?U:n,Qe=_e?n:U;g|=_e?E:T,g&=~(_e?T:E),g&S||(g&=~(y|b));var St=[f,g,L,qe,Re,Qe,je,ie,de,Se],Je=w.apply(n,St);return Xy(f)&&iO(Je,St),Je.placeholder=O,sO(Je,f,g)}function Vy(f){var g=Kn[f];return function(w,O){if(w=Vo(w),O=O==null?0:gr(vt(O),292),O&&sP(w)){var L=(Kt(w)+"e").split("e"),U=g(L[0]+"e"+(+L[1]+O));return L=(Kt(U)+"e").split("e"),+(L[0]+"e"+(+L[1]-O))}return g(w)}}var NV=Wc&&1/og(new Wc([,-0]))[1]==H?function(f){return new Wc(f)}:dx;function YP(f){return function(g){var w=mr(g);return w==he?yy(g):w==$t?JB(g):WB(g,f(g))}}function vs(f,g,w,O,L,U,Q,ie){var de=g&b;if(!de&&typeof f!="function")throw new jo(s);var Se=O?O.length:0;if(Se||(g&=~(E|T),O=L=n),Q=Q===n?Q:Xn(vt(Q),0),ie=ie===n?ie:vt(ie),Se-=L?L.length:0,g&T){var _e=O,Re=L;O=L=n}var je=de?n:Gy(f),qe=[f,g,w,O,L,_e,Re,U,Q,ie];if(je&&XV(qe,je),f=qe[0],g=qe[1],w=qe[2],O=qe[3],L=qe[4],ie=qe[9]=qe[9]===n?de?0:f.length:Xn(qe[9]-Se,0),!ie&&g&(_|C)&&(g&=~(_|C)),!g||g==y)var Qe=DV(f,g,w);else g==_||g==C?Qe=kV(f,g,ie):(g==E||g==(y|E))&&!L.length?Qe=IV(f,g,w,O):Qe=Rg.apply(n,qe);var St=je?OP:iO;return sO(St(Qe,qe),f,g)}function KP(f,g,w,O){return f===n||li(f,Vc[w])&&!en.call(O,w)?g:f}function XP(f,g,w,O,L,U){return On(f)&&On(g)&&(U.set(g,f),Sg(f,g,n,XP,U),U.delete(g)),f}function LV(f){return Qd(f)?n:f}function QP(f,g,w,O,L,U){var Q=w&m,ie=f.length,de=g.length;if(ie!=de&&!(Q&&de>ie))return!1;var Se=U.get(f),_e=U.get(g);if(Se&&_e)return Se==g&&_e==f;var Re=-1,je=!0,qe=w&v?new ul:n;for(U.set(f,g),U.set(g,f);++Re<ie;){var Qe=f[Re],St=g[Re];if(O)var Je=Q?O(St,Qe,Re,g,f,U):O(Qe,St,Re,f,g,U);if(Je!==n){if(Je)continue;je=!1;break}if(qe){if(!hy(g,function(Mt,Lt){if(!Fd(qe,Lt)&&(Qe===Mt||L(Qe,Mt,w,O,U)))return qe.push(Lt)})){je=!1;break}}else if(!(Qe===St||L(Qe,St,w,O,U))){je=!1;break}}return U.delete(f),U.delete(g),je}function FV(f,g,w,O,L,U,Q){switch(w){case Ye:if(f.byteLength!=g.byteLength||f.byteOffset!=g.byteOffset)return!1;f=f.buffer,g=g.buffer;case ze:return!(f.byteLength!=g.byteLength||!U(new ug(f),new ug(g)));case J:case le:case Ee:return li(+f,+g);case ye:return f.name==g.name&&f.message==g.message;case dt:case rn:return f==g+"";case he:var ie=yy;case $t:var de=O&m;if(ie||(ie=og),f.size!=g.size&&!de)return!1;var Se=Q.get(f);if(Se)return Se==g;O|=v,Q.set(f,g);var _e=QP(ie(f),ie(g),O,L,U,Q);return Q.delete(f),_e;case Nt:if(Hd)return Hd.call(f)==Hd.call(g)}return!1}function jV(f,g,w,O,L,U){var Q=w&m,ie=Wy(f),de=ie.length,Se=Wy(g),_e=Se.length;if(de!=_e&&!Q)return!1;for(var Re=de;Re--;){var je=ie[Re];if(!(Q?je in g:en.call(g,je)))return!1}var qe=U.get(f),Qe=U.get(g);if(qe&&Qe)return qe==g&&Qe==f;var St=!0;U.set(f,g),U.set(g,f);for(var Je=Q;++Re<de;){je=ie[Re];var Mt=f[je],Lt=g[je];if(O)var po=Q?O(Lt,Mt,je,g,f,U):O(Mt,Lt,je,f,g,U);if(!(po===n?Mt===Lt||L(Mt,Lt,w,O,U):po)){St=!1;break}Je||(Je=je=="constructor")}if(St&&!Je){var Or=f.constructor,go=g.constructor;Or!=go&&"constructor"in f&&"constructor"in g&&!(typeof Or=="function"&&Or instanceof Or&&typeof go=="function"&&go instanceof go)&&(St=!1)}return U.delete(f),U.delete(g),St}function bs(f){return Jy(rO(f,n,fO),f+"")}function Wy(f){return vP(f,tr,Yy)}function Uy(f){return vP(f,Wr,JP)}var Gy=mg?function(f){return mg.get(f)}:dx;function Mg(f){for(var g=f.name+"",w=Uc[g],O=en.call(Uc,g)?w.length:0;O--;){var L=w[O],U=L.func;if(U==null||U==f)return L.name}return g}function Kc(f){var g=en.call(B,"placeholder")?B:f;return g.placeholder}function Xe(){var f=B.iteratee||cx;return f=f===cx?xP:f,arguments.length?f(arguments[0],arguments[1]):f}function Ag(f,g){var w=f.__data__;return GV(g)?w[typeof g=="string"?"string":"hash"]:w.map}function qy(f){for(var g=tr(f),w=g.length;w--;){var O=g[w],L=f[O];g[w]=[O,L,tO(L)]}return g}function hl(f,g){var w=KB(f,g);return yP(w)?w:n}function $V(f){var g=en.call(f,ll),w=f[ll];try{f[ll]=n;var O=!0}catch{}var L=lg.call(f);return O&&(g?f[ll]=w:delete f[ll]),L}var Yy=wy?function(f){return f==null?[]:(f=un(f),ta(wy(f),function(g){return oP.call(f,g)}))}:fx,JP=wy?function(f){for(var g=[];f;)na(g,Yy(f)),f=dg(f);return g}:fx,mr=Rr;(Sy&&mr(new Sy(new ArrayBuffer(1)))!=Ye||$d&&mr(new $d)!=he||_y&&mr(_y.resolve())!=Ie||Wc&&mr(new Wc)!=$t||zd&&mr(new zd)!=pe)&&(mr=function(f){var g=Rr(f),w=g==We?f.constructor:n,O=w?pl(w):"";if(O)switch(O){case wH:return Ye;case SH:return he;case _H:return Ie;case CH:return $t;case EH:return pe}return g});function zV(f,g,w){for(var O=-1,L=w.length;++O<L;){var U=w[O],Q=U.size;switch(U.type){case"drop":f+=Q;break;case"dropRight":g-=Q;break;case"take":g=gr(g,f+Q);break;case"takeRight":f=Xn(f,g-Q);break}}return{start:f,end:g}}function BV(f){var g=f.match(ea);return g?g[1].split(I):[]}function ZP(f,g,w){g=aa(g,f);for(var O=-1,L=g.length,U=!1;++O<L;){var Q=ki(g[O]);if(!(U=f!=null&&w(f,Q)))break;f=f[Q]}return U||++O!=L?U:(L=f==null?0:f.length,!!L&&jg(L)&&ys(Q,L)&&(ht(f)||gl(f)))}function HV(f){var g=f.length,w=new f.constructor(g);return g&&typeof f[0]=="string"&&en.call(f,"index")&&(w.index=f.index,w.input=f.input),w}function eO(f){return typeof f.constructor=="function"&&!Kd(f)?Gc(dg(f)):{}}function VV(f,g,w){var O=f.constructor;switch(g){case ze:return By(f);case J:case le:return new O(+f);case Ye:return RV(f,w);case nt:case sn:case Cn:case mn:case jn:case vn:case Ht:case cn:case Pn:return LP(f,w);case he:return new O;case Ee:case rn:return new O(f);case dt:return PV(f);case $t:return new O;case Nt:return OV(f)}}function WV(f,g){var w=g.length;if(!w)return f;var O=w-1;return g[O]=(w>1?"& ":"")+g[O],g=g.join(w>2?", ":" "),f.replace(Zs,`{
70
+ /* [wrapped with `+g+`] */
71
+ `)}function UV(f){return ht(f)||gl(f)||!!(iP&&f&&f[iP])}function ys(f,g){var w=typeof f;return g=g??G,!!g&&(w=="number"||w!="symbol"&&me.test(f))&&f>-1&&f%1==0&&f<g}function Pr(f,g,w){if(!On(w))return!1;var O=typeof g;return(O=="number"?Vr(w)&&ys(g,w.length):O=="string"&&g in w)?li(w[g],f):!1}function Ky(f,g){if(ht(f))return!1;var w=typeof f;return w=="number"||w=="symbol"||w=="boolean"||f==null||ho(f)?!0:fs.test(f)||!Oi.test(f)||g!=null&&f in un(g)}function GV(f){var g=typeof f;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?f!=="__proto__":f===null}function Xy(f){var g=Mg(f),w=B[g];if(typeof w!="function"||!(g in It.prototype))return!1;if(f===w)return!0;var O=Gy(w);return!!O&&f===O[0]}function qV(f){return!!tP&&tP in f}var YV=sg?xs:hx;function Kd(f){var g=f&&f.constructor,w=typeof g=="function"&&g.prototype||Vc;return f===w}function tO(f){return f===f&&!On(f)}function nO(f,g){return function(w){return w==null?!1:w[f]===g&&(g!==n||f in un(w))}}function KV(f){var g=Lg(f,function(O){return w.size===c&&w.clear(),O}),w=g.cache;return g}function XV(f,g){var w=f[1],O=g[1],L=w|O,U=L<(y|b|A),Q=O==A&&w==_||O==A&&w==D&&f[7].length<=g[8]||O==(A|D)&&g[7].length<=g[8]&&w==_;if(!(U||Q))return f;O&y&&(f[2]=g[2],L|=w&y?0:S);var ie=g[3];if(ie){var de=f[3];f[3]=de?jP(de,ie,g[4]):ie,f[4]=de?ra(f[3],u):g[4]}return ie=g[5],ie&&(de=f[5],f[5]=de?$P(de,ie,g[6]):ie,f[6]=de?ra(f[5],u):g[6]),ie=g[7],ie&&(f[7]=ie),O&A&&(f[8]=f[8]==null?g[8]:gr(f[8],g[8])),f[9]==null&&(f[9]=g[9]),f[0]=g[0],f[1]=L,f}function QV(f){var g=[];if(f!=null)for(var w in un(f))g.push(w);return g}function JV(f){return lg.call(f)}function rO(f,g,w){return g=Xn(g===n?f.length-1:g,0),function(){for(var O=arguments,L=-1,U=Xn(O.length-g,0),Q=ge(U);++L<U;)Q[L]=O[g+L];L=-1;for(var ie=ge(g+1);++L<g;)ie[L]=O[L];return ie[g]=w(Q),co(f,this,ie)}}function oO(f,g){return g.length<2?f:fl(f,Bo(g,0,-1))}function ZV(f,g){for(var w=f.length,O=gr(g.length,w),L=Hr(f);O--;){var U=g[O];f[O]=ys(U,w)?L[U]:n}return f}function Qy(f,g){if(!(g==="constructor"&&typeof f[g]=="function")&&g!="__proto__")return f[g]}var iO=aO(OP),Xd=pH||function(f,g){return sr.setTimeout(f,g)},Jy=aO(SV);function sO(f,g,w){var O=g+"";return Jy(f,WV(O,eW(BV(O),w)))}function aO(f){var g=0,w=0;return function(){var O=bH(),L=K-(O-w);if(w=O,L>0){if(++g>=z)return arguments[0]}else g=0;return f.apply(n,arguments)}}function Dg(f,g){var w=-1,O=f.length,L=O-1;for(g=g===n?O:g;++w<g;){var U=Iy(w,L),Q=f[U];f[U]=f[w],f[w]=Q}return f.length=g,f}var lO=KV(function(f){var g=[];return f.charCodeAt(0)===46&&g.push(""),f.replace(Js,function(w,O,L,U){g.push(L?U.replace(Oe,"$1"):O||w)}),g});function ki(f){if(typeof f=="string"||ho(f))return f;var g=f+"";return g=="0"&&1/f==-H?"-0":g}function pl(f){if(f!=null){try{return ag.call(f)}catch{}try{return f+""}catch{}}return""}function eW(f,g){return Fo(ne,function(w){var O="_."+w[0];g&w[1]&&!ng(f,O)&&f.push(O)}),f.sort()}function cO(f){if(f instanceof It)return f.clone();var g=new $o(f.__wrapped__,f.__chain__);return g.__actions__=Hr(f.__actions__),g.__index__=f.__index__,g.__values__=f.__values__,g}function tW(f,g,w){(w?Pr(f,g,w):g===n)?g=1:g=Xn(vt(g),0);var O=f==null?0:f.length;if(!O||g<1)return[];for(var L=0,U=0,Q=ge(pg(O/g));L<O;)Q[U++]=Bo(f,L,L+=g);return Q}function nW(f){for(var g=-1,w=f==null?0:f.length,O=0,L=[];++g<w;){var U=f[g];U&&(L[O++]=U)}return L}function rW(){var f=arguments.length;if(!f)return[];for(var g=ge(f-1),w=arguments[0],O=f;O--;)g[O-1]=arguments[O];return na(ht(w)?Hr(w):[w],ar(g,1))}var oW=Rt(function(f,g){return zn(f)?Wd(f,ar(g,1,zn,!0)):[]}),iW=Rt(function(f,g){var w=Ho(g);return zn(w)&&(w=n),zn(f)?Wd(f,ar(g,1,zn,!0),Xe(w,2)):[]}),sW=Rt(function(f,g){var w=Ho(g);return zn(w)&&(w=n),zn(f)?Wd(f,ar(g,1,zn,!0),n,w):[]});function aW(f,g,w){var O=f==null?0:f.length;return O?(g=w||g===n?1:vt(g),Bo(f,g<0?0:g,O)):[]}function lW(f,g,w){var O=f==null?0:f.length;return O?(g=w||g===n?1:vt(g),g=O-g,Bo(f,0,g<0?0:g)):[]}function cW(f,g){return f&&f.length?Cg(f,Xe(g,3),!0,!0):[]}function uW(f,g){return f&&f.length?Cg(f,Xe(g,3),!0):[]}function dW(f,g,w,O){var L=f==null?0:f.length;return L?(w&&typeof w!="number"&&Pr(f,g,w)&&(w=0,O=L),rV(f,g,w,O)):[]}function uO(f,g,w){var O=f==null?0:f.length;if(!O)return-1;var L=w==null?0:vt(w);return L<0&&(L=Xn(O+L,0)),rg(f,Xe(g,3),L)}function dO(f,g,w){var O=f==null?0:f.length;if(!O)return-1;var L=O-1;return w!==n&&(L=vt(w),L=w<0?Xn(O+L,0):gr(L,O-1)),rg(f,Xe(g,3),L,!0)}function fO(f){var g=f==null?0:f.length;return g?ar(f,1):[]}function fW(f){var g=f==null?0:f.length;return g?ar(f,H):[]}function hW(f,g){var w=f==null?0:f.length;return w?(g=g===n?1:vt(g),ar(f,g)):[]}function pW(f){for(var g=-1,w=f==null?0:f.length,O={};++g<w;){var L=f[g];O[L[0]]=L[1]}return O}function hO(f){return f&&f.length?f[0]:n}function gW(f,g,w){var O=f==null?0:f.length;if(!O)return-1;var L=w==null?0:vt(w);return L<0&&(L=Xn(O+L,0)),$c(f,g,L)}function mW(f){var g=f==null?0:f.length;return g?Bo(f,0,-1):[]}var vW=Rt(function(f){var g=Rn(f,$y);return g.length&&g[0]===f[0]?Ty(g):[]}),bW=Rt(function(f){var g=Ho(f),w=Rn(f,$y);return g===Ho(w)?g=n:w.pop(),w.length&&w[0]===f[0]?Ty(w,Xe(g,2)):[]}),yW=Rt(function(f){var g=Ho(f),w=Rn(f,$y);return g=typeof g=="function"?g:n,g&&w.pop(),w.length&&w[0]===f[0]?Ty(w,n,g):[]});function xW(f,g){return f==null?"":mH.call(f,g)}function Ho(f){var g=f==null?0:f.length;return g?f[g-1]:n}function wW(f,g,w){var O=f==null?0:f.length;if(!O)return-1;var L=O;return w!==n&&(L=vt(w),L=L<0?Xn(O+L,0):gr(L,O-1)),g===g?eH(f,g,L):rg(f,q2,L,!0)}function SW(f,g){return f&&f.length?CP(f,vt(g)):n}var _W=Rt(pO);function pO(f,g){return f&&f.length&&g&&g.length?ky(f,g):f}function CW(f,g,w){return f&&f.length&&g&&g.length?ky(f,g,Xe(w,2)):f}function EW(f,g,w){return f&&f.length&&g&&g.length?ky(f,g,n,w):f}var RW=bs(function(f,g){var w=f==null?0:f.length,O=Ey(f,g);return PP(f,Rn(g,function(L){return ys(L,w)?+L:L}).sort(FP)),O});function PW(f,g){var w=[];if(!(f&&f.length))return w;var O=-1,L=[],U=f.length;for(g=Xe(g,3);++O<U;){var Q=f[O];g(Q,O,f)&&(w.push(Q),L.push(O))}return PP(f,L),w}function Zy(f){return f==null?f:xH.call(f)}function OW(f,g,w){var O=f==null?0:f.length;return O?(w&&typeof w!="number"&&Pr(f,g,w)?(g=0,w=O):(g=g==null?0:vt(g),w=w===n?O:vt(w)),Bo(f,g,w)):[]}function TW(f,g){return _g(f,g)}function MW(f,g,w){return Ly(f,g,Xe(w,2))}function AW(f,g){var w=f==null?0:f.length;if(w){var O=_g(f,g);if(O<w&&li(f[O],g))return O}return-1}function DW(f,g){return _g(f,g,!0)}function kW(f,g,w){return Ly(f,g,Xe(w,2),!0)}function IW(f,g){var w=f==null?0:f.length;if(w){var O=_g(f,g,!0)-1;if(li(f[O],g))return O}return-1}function NW(f){return f&&f.length?TP(f):[]}function LW(f,g){return f&&f.length?TP(f,Xe(g,2)):[]}function FW(f){var g=f==null?0:f.length;return g?Bo(f,1,g):[]}function jW(f,g,w){return f&&f.length?(g=w||g===n?1:vt(g),Bo(f,0,g<0?0:g)):[]}function $W(f,g,w){var O=f==null?0:f.length;return O?(g=w||g===n?1:vt(g),g=O-g,Bo(f,g<0?0:g,O)):[]}function zW(f,g){return f&&f.length?Cg(f,Xe(g,3),!1,!0):[]}function BW(f,g){return f&&f.length?Cg(f,Xe(g,3)):[]}var HW=Rt(function(f){return sa(ar(f,1,zn,!0))}),VW=Rt(function(f){var g=Ho(f);return zn(g)&&(g=n),sa(ar(f,1,zn,!0),Xe(g,2))}),WW=Rt(function(f){var g=Ho(f);return g=typeof g=="function"?g:n,sa(ar(f,1,zn,!0),n,g)});function UW(f){return f&&f.length?sa(f):[]}function GW(f,g){return f&&f.length?sa(f,Xe(g,2)):[]}function qW(f,g){return g=typeof g=="function"?g:n,f&&f.length?sa(f,n,g):[]}function ex(f){if(!(f&&f.length))return[];var g=0;return f=ta(f,function(w){if(zn(w))return g=Xn(w.length,g),!0}),vy(g,function(w){return Rn(f,py(w))})}function gO(f,g){if(!(f&&f.length))return[];var w=ex(f);return g==null?w:Rn(w,function(O){return co(g,n,O)})}var YW=Rt(function(f,g){return zn(f)?Wd(f,g):[]}),KW=Rt(function(f){return jy(ta(f,zn))}),XW=Rt(function(f){var g=Ho(f);return zn(g)&&(g=n),jy(ta(f,zn),Xe(g,2))}),QW=Rt(function(f){var g=Ho(f);return g=typeof g=="function"?g:n,jy(ta(f,zn),n,g)}),JW=Rt(ex);function ZW(f,g){return kP(f||[],g||[],Vd)}function eU(f,g){return kP(f||[],g||[],qd)}var tU=Rt(function(f){var g=f.length,w=g>1?f[g-1]:n;return w=typeof w=="function"?(f.pop(),w):n,gO(f,w)});function mO(f){var g=B(f);return g.__chain__=!0,g}function nU(f,g){return g(f),f}function kg(f,g){return g(f)}var rU=bs(function(f){var g=f.length,w=g?f[0]:0,O=this.__wrapped__,L=function(U){return Ey(U,f)};return g>1||this.__actions__.length||!(O instanceof It)||!ys(w)?this.thru(L):(O=O.slice(w,+w+(g?1:0)),O.__actions__.push({func:kg,args:[L],thisArg:n}),new $o(O,this.__chain__).thru(function(U){return g&&!U.length&&U.push(n),U}))});function oU(){return mO(this)}function iU(){return new $o(this.value(),this.__chain__)}function sU(){this.__values__===n&&(this.__values__=MO(this.value()));var f=this.__index__>=this.__values__.length,g=f?n:this.__values__[this.__index__++];return{done:f,value:g}}function aU(){return this}function lU(f){for(var g,w=this;w instanceof bg;){var O=cO(w);O.__index__=0,O.__values__=n,g?L.__wrapped__=O:g=O;var L=O;w=w.__wrapped__}return L.__wrapped__=f,g}function cU(){var f=this.__wrapped__;if(f instanceof It){var g=f;return this.__actions__.length&&(g=new It(this)),g=g.reverse(),g.__actions__.push({func:kg,args:[Zy],thisArg:n}),new $o(g,this.__chain__)}return this.thru(Zy)}function uU(){return DP(this.__wrapped__,this.__actions__)}var dU=Eg(function(f,g,w){en.call(f,w)?++f[w]:ms(f,w,1)});function fU(f,g,w){var O=ht(f)?U2:nV;return w&&Pr(f,g,w)&&(g=n),O(f,Xe(g,3))}function hU(f,g){var w=ht(f)?ta:gP;return w(f,Xe(g,3))}var pU=VP(uO),gU=VP(dO);function mU(f,g){return ar(Ig(f,g),1)}function vU(f,g){return ar(Ig(f,g),H)}function bU(f,g,w){return w=w===n?1:vt(w),ar(Ig(f,g),w)}function vO(f,g){var w=ht(f)?Fo:ia;return w(f,Xe(g,3))}function bO(f,g){var w=ht(f)?FB:pP;return w(f,Xe(g,3))}var yU=Eg(function(f,g,w){en.call(f,w)?f[w].push(g):ms(f,w,[g])});function xU(f,g,w,O){f=Vr(f)?f:Qc(f),w=w&&!O?vt(w):0;var L=f.length;return w<0&&(w=Xn(L+w,0)),$g(f)?w<=L&&f.indexOf(g,w)>-1:!!L&&$c(f,g,w)>-1}var wU=Rt(function(f,g,w){var O=-1,L=typeof g=="function",U=Vr(f)?ge(f.length):[];return ia(f,function(Q){U[++O]=L?co(g,Q,w):Ud(Q,g,w)}),U}),SU=Eg(function(f,g,w){ms(f,w,g)});function Ig(f,g){var w=ht(f)?Rn:wP;return w(f,Xe(g,3))}function _U(f,g,w,O){return f==null?[]:(ht(g)||(g=g==null?[]:[g]),w=O?n:w,ht(w)||(w=w==null?[]:[w]),EP(f,g,w))}var CU=Eg(function(f,g,w){f[w?0:1].push(g)},function(){return[[],[]]});function EU(f,g,w){var O=ht(f)?fy:K2,L=arguments.length<3;return O(f,Xe(g,4),w,L,ia)}function RU(f,g,w){var O=ht(f)?jB:K2,L=arguments.length<3;return O(f,Xe(g,4),w,L,pP)}function PU(f,g){var w=ht(f)?ta:gP;return w(f,Fg(Xe(g,3)))}function OU(f){var g=ht(f)?uP:xV;return g(f)}function TU(f,g,w){(w?Pr(f,g,w):g===n)?g=1:g=vt(g);var O=ht(f)?QH:wV;return O(f,g)}function MU(f){var g=ht(f)?JH:_V;return g(f)}function AU(f){if(f==null)return 0;if(Vr(f))return $g(f)?Bc(f):f.length;var g=mr(f);return g==he||g==$t?f.size:Ay(f).length}function DU(f,g,w){var O=ht(f)?hy:CV;return w&&Pr(f,g,w)&&(g=n),O(f,Xe(g,3))}var kU=Rt(function(f,g){if(f==null)return[];var w=g.length;return w>1&&Pr(f,g[0],g[1])?g=[]:w>2&&Pr(g[0],g[1],g[2])&&(g=[g[0]]),EP(f,ar(g,1),[])}),Ng=hH||function(){return sr.Date.now()};function IU(f,g){if(typeof g!="function")throw new jo(s);return f=vt(f),function(){if(--f<1)return g.apply(this,arguments)}}function yO(f,g,w){return g=w?n:g,g=f&&g==null?f.length:g,vs(f,A,n,n,n,n,g)}function xO(f,g){var w;if(typeof g!="function")throw new jo(s);return f=vt(f),function(){return--f>0&&(w=g.apply(this,arguments)),f<=1&&(g=n),w}}var tx=Rt(function(f,g,w){var O=y;if(w.length){var L=ra(w,Kc(tx));O|=E}return vs(f,O,g,w,L)}),wO=Rt(function(f,g,w){var O=y|b;if(w.length){var L=ra(w,Kc(wO));O|=E}return vs(g,O,f,w,L)});function SO(f,g,w){g=w?n:g;var O=vs(f,_,n,n,n,n,n,g);return O.placeholder=SO.placeholder,O}function _O(f,g,w){g=w?n:g;var O=vs(f,C,n,n,n,n,n,g);return O.placeholder=_O.placeholder,O}function CO(f,g,w){var O,L,U,Q,ie,de,Se=0,_e=!1,Re=!1,je=!0;if(typeof f!="function")throw new jo(s);g=Vo(g)||0,On(w)&&(_e=!!w.leading,Re="maxWait"in w,U=Re?Xn(Vo(w.maxWait)||0,g):U,je="trailing"in w?!!w.trailing:je);function qe(Bn){var ci=O,Ss=L;return O=L=n,Se=Bn,Q=f.apply(Ss,ci),Q}function Qe(Bn){return Se=Bn,ie=Xd(Mt,g),_e?qe(Bn):Q}function St(Bn){var ci=Bn-de,Ss=Bn-Se,VO=g-ci;return Re?gr(VO,U-Ss):VO}function Je(Bn){var ci=Bn-de,Ss=Bn-Se;return de===n||ci>=g||ci<0||Re&&Ss>=U}function Mt(){var Bn=Ng();if(Je(Bn))return Lt(Bn);ie=Xd(Mt,St(Bn))}function Lt(Bn){return ie=n,je&&O?qe(Bn):(O=L=n,Q)}function po(){ie!==n&&IP(ie),Se=0,O=de=L=ie=n}function Or(){return ie===n?Q:Lt(Ng())}function go(){var Bn=Ng(),ci=Je(Bn);if(O=arguments,L=this,de=Bn,ci){if(ie===n)return Qe(de);if(Re)return IP(ie),ie=Xd(Mt,g),qe(de)}return ie===n&&(ie=Xd(Mt,g)),Q}return go.cancel=po,go.flush=Or,go}var NU=Rt(function(f,g){return hP(f,1,g)}),LU=Rt(function(f,g,w){return hP(f,Vo(g)||0,w)});function FU(f){return vs(f,k)}function Lg(f,g){if(typeof f!="function"||g!=null&&typeof g!="function")throw new jo(s);var w=function(){var O=arguments,L=g?g.apply(this,O):O[0],U=w.cache;if(U.has(L))return U.get(L);var Q=f.apply(this,O);return w.cache=U.set(L,Q)||U,Q};return w.cache=new(Lg.Cache||gs),w}Lg.Cache=gs;function Fg(f){if(typeof f!="function")throw new jo(s);return function(){var g=arguments;switch(g.length){case 0:return!f.call(this);case 1:return!f.call(this,g[0]);case 2:return!f.call(this,g[0],g[1]);case 3:return!f.call(this,g[0],g[1],g[2])}return!f.apply(this,g)}}function jU(f){return xO(2,f)}var $U=EV(function(f,g){g=g.length==1&&ht(g[0])?Rn(g[0],uo(Xe())):Rn(ar(g,1),uo(Xe()));var w=g.length;return Rt(function(O){for(var L=-1,U=gr(O.length,w);++L<U;)O[L]=g[L].call(this,O[L]);return co(f,this,O)})}),nx=Rt(function(f,g){var w=ra(g,Kc(nx));return vs(f,E,n,g,w)}),EO=Rt(function(f,g){var w=ra(g,Kc(EO));return vs(f,T,n,g,w)}),zU=bs(function(f,g){return vs(f,D,n,n,n,g)});function BU(f,g){if(typeof f!="function")throw new jo(s);return g=g===n?g:vt(g),Rt(f,g)}function HU(f,g){if(typeof f!="function")throw new jo(s);return g=g==null?0:Xn(vt(g),0),Rt(function(w){var O=w[g],L=la(w,0,g);return O&&na(L,O),co(f,this,L)})}function VU(f,g,w){var O=!0,L=!0;if(typeof f!="function")throw new jo(s);return On(w)&&(O="leading"in w?!!w.leading:O,L="trailing"in w?!!w.trailing:L),CO(f,g,{leading:O,maxWait:g,trailing:L})}function WU(f){return yO(f,1)}function UU(f,g){return nx(zy(g),f)}function GU(){if(!arguments.length)return[];var f=arguments[0];return ht(f)?f:[f]}function qU(f){return zo(f,p)}function YU(f,g){return g=typeof g=="function"?g:n,zo(f,p,g)}function KU(f){return zo(f,d|p)}function XU(f,g){return g=typeof g=="function"?g:n,zo(f,d|p,g)}function QU(f,g){return g==null||fP(f,g,tr(g))}function li(f,g){return f===g||f!==f&&g!==g}var JU=Tg(Oy),ZU=Tg(function(f,g){return f>=g}),gl=bP(function(){return arguments}())?bP:function(f){return Dn(f)&&en.call(f,"callee")&&!oP.call(f,"callee")},ht=ge.isArray,eG=$2?uo($2):lV;function Vr(f){return f!=null&&jg(f.length)&&!xs(f)}function zn(f){return Dn(f)&&Vr(f)}function tG(f){return f===!0||f===!1||Dn(f)&&Rr(f)==J}var ca=gH||hx,nG=z2?uo(z2):cV;function rG(f){return Dn(f)&&f.nodeType===1&&!Qd(f)}function oG(f){if(f==null)return!0;if(Vr(f)&&(ht(f)||typeof f=="string"||typeof f.splice=="function"||ca(f)||Xc(f)||gl(f)))return!f.length;var g=mr(f);if(g==he||g==$t)return!f.size;if(Kd(f))return!Ay(f).length;for(var w in f)if(en.call(f,w))return!1;return!0}function iG(f,g){return Gd(f,g)}function sG(f,g,w){w=typeof w=="function"?w:n;var O=w?w(f,g):n;return O===n?Gd(f,g,n,w):!!O}function rx(f){if(!Dn(f))return!1;var g=Rr(f);return g==ye||g==ce||typeof f.message=="string"&&typeof f.name=="string"&&!Qd(f)}function aG(f){return typeof f=="number"&&sP(f)}function xs(f){if(!On(f))return!1;var g=Rr(f);return g==oe||g==ve||g==ee||g==Le}function RO(f){return typeof f=="number"&&f==vt(f)}function jg(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=G}function On(f){var g=typeof f;return f!=null&&(g=="object"||g=="function")}function Dn(f){return f!=null&&typeof f=="object"}var PO=B2?uo(B2):dV;function lG(f,g){return f===g||My(f,g,qy(g))}function cG(f,g,w){return w=typeof w=="function"?w:n,My(f,g,qy(g),w)}function uG(f){return OO(f)&&f!=+f}function dG(f){if(YV(f))throw new ft(i);return yP(f)}function fG(f){return f===null}function hG(f){return f==null}function OO(f){return typeof f=="number"||Dn(f)&&Rr(f)==Ee}function Qd(f){if(!Dn(f)||Rr(f)!=We)return!1;var g=dg(f);if(g===null)return!0;var w=en.call(g,"constructor")&&g.constructor;return typeof w=="function"&&w instanceof w&&ag.call(w)==cH}var ox=H2?uo(H2):fV;function pG(f){return RO(f)&&f>=-G&&f<=G}var TO=V2?uo(V2):hV;function $g(f){return typeof f=="string"||!ht(f)&&Dn(f)&&Rr(f)==rn}function ho(f){return typeof f=="symbol"||Dn(f)&&Rr(f)==Nt}var Xc=W2?uo(W2):pV;function gG(f){return f===n}function mG(f){return Dn(f)&&mr(f)==pe}function vG(f){return Dn(f)&&Rr(f)==Pe}var bG=Tg(Dy),yG=Tg(function(f,g){return f<=g});function MO(f){if(!f)return[];if(Vr(f))return $g(f)?si(f):Hr(f);if(jd&&f[jd])return QB(f[jd]());var g=mr(f),w=g==he?yy:g==$t?og:Qc;return w(f)}function ws(f){if(!f)return f===0?f:0;if(f=Vo(f),f===H||f===-H){var g=f<0?-1:1;return g*te}return f===f?f:0}function vt(f){var g=ws(f),w=g%1;return g===g?w?g-w:g:0}function AO(f){return f?dl(vt(f),0,Y):0}function Vo(f){if(typeof f=="number")return f;if(ho(f))return F;if(On(f)){var g=typeof f.valueOf=="function"?f.valueOf():f;f=On(g)?g+"":g}if(typeof f!="string")return f===0?f:+f;f=X2(f);var w=Fe.test(f);return w||Z.test(f)?IB(f.slice(2),w?2:8):$e.test(f)?F:+f}function DO(f){return Di(f,Wr(f))}function xG(f){return f?dl(vt(f),-G,G):f===0?f:0}function Kt(f){return f==null?"":fo(f)}var wG=qc(function(f,g){if(Kd(g)||Vr(g)){Di(g,tr(g),f);return}for(var w in g)en.call(g,w)&&Vd(f,w,g[w])}),kO=qc(function(f,g){Di(g,Wr(g),f)}),zg=qc(function(f,g,w,O){Di(g,Wr(g),f,O)}),SG=qc(function(f,g,w,O){Di(g,tr(g),f,O)}),_G=bs(Ey);function CG(f,g){var w=Gc(f);return g==null?w:dP(w,g)}var EG=Rt(function(f,g){f=un(f);var w=-1,O=g.length,L=O>2?g[2]:n;for(L&&Pr(g[0],g[1],L)&&(O=1);++w<O;)for(var U=g[w],Q=Wr(U),ie=-1,de=Q.length;++ie<de;){var Se=Q[ie],_e=f[Se];(_e===n||li(_e,Vc[Se])&&!en.call(f,Se))&&(f[Se]=U[Se])}return f}),RG=Rt(function(f){return f.push(n,XP),co(IO,n,f)});function PG(f,g){return G2(f,Xe(g,3),Ai)}function OG(f,g){return G2(f,Xe(g,3),Py)}function TG(f,g){return f==null?f:Ry(f,Xe(g,3),Wr)}function MG(f,g){return f==null?f:mP(f,Xe(g,3),Wr)}function AG(f,g){return f&&Ai(f,Xe(g,3))}function DG(f,g){return f&&Py(f,Xe(g,3))}function kG(f){return f==null?[]:wg(f,tr(f))}function IG(f){return f==null?[]:wg(f,Wr(f))}function ix(f,g,w){var O=f==null?n:fl(f,g);return O===n?w:O}function NG(f,g){return f!=null&&ZP(f,g,oV)}function sx(f,g){return f!=null&&ZP(f,g,iV)}var LG=UP(function(f,g,w){g!=null&&typeof g.toString!="function"&&(g=lg.call(g)),f[g]=w},lx(Ur)),FG=UP(function(f,g,w){g!=null&&typeof g.toString!="function"&&(g=lg.call(g)),en.call(f,g)?f[g].push(w):f[g]=[w]},Xe),jG=Rt(Ud);function tr(f){return Vr(f)?cP(f):Ay(f)}function Wr(f){return Vr(f)?cP(f,!0):gV(f)}function $G(f,g){var w={};return g=Xe(g,3),Ai(f,function(O,L,U){ms(w,g(O,L,U),O)}),w}function zG(f,g){var w={};return g=Xe(g,3),Ai(f,function(O,L,U){ms(w,L,g(O,L,U))}),w}var BG=qc(function(f,g,w){Sg(f,g,w)}),IO=qc(function(f,g,w,O){Sg(f,g,w,O)}),HG=bs(function(f,g){var w={};if(f==null)return w;var O=!1;g=Rn(g,function(U){return U=aa(U,f),O||(O=U.length>1),U}),Di(f,Uy(f),w),O&&(w=zo(w,d|h|p,LV));for(var L=g.length;L--;)Fy(w,g[L]);return w});function VG(f,g){return NO(f,Fg(Xe(g)))}var WG=bs(function(f,g){return f==null?{}:vV(f,g)});function NO(f,g){if(f==null)return{};var w=Rn(Uy(f),function(O){return[O]});return g=Xe(g),RP(f,w,function(O,L){return g(O,L[0])})}function UG(f,g,w){g=aa(g,f);var O=-1,L=g.length;for(L||(L=1,f=n);++O<L;){var U=f==null?n:f[ki(g[O])];U===n&&(O=L,U=w),f=xs(U)?U.call(f):U}return f}function GG(f,g,w){return f==null?f:qd(f,g,w)}function qG(f,g,w,O){return O=typeof O=="function"?O:n,f==null?f:qd(f,g,w,O)}var LO=YP(tr),FO=YP(Wr);function YG(f,g,w){var O=ht(f),L=O||ca(f)||Xc(f);if(g=Xe(g,4),w==null){var U=f&&f.constructor;L?w=O?new U:[]:On(f)?w=xs(U)?Gc(dg(f)):{}:w={}}return(L?Fo:Ai)(f,function(Q,ie,de){return g(w,Q,ie,de)}),w}function KG(f,g){return f==null?!0:Fy(f,g)}function XG(f,g,w){return f==null?f:AP(f,g,zy(w))}function QG(f,g,w,O){return O=typeof O=="function"?O:n,f==null?f:AP(f,g,zy(w),O)}function Qc(f){return f==null?[]:by(f,tr(f))}function JG(f){return f==null?[]:by(f,Wr(f))}function ZG(f,g,w){return w===n&&(w=g,g=n),w!==n&&(w=Vo(w),w=w===w?w:0),g!==n&&(g=Vo(g),g=g===g?g:0),dl(Vo(f),g,w)}function eq(f,g,w){return g=ws(g),w===n?(w=g,g=0):w=ws(w),f=Vo(f),sV(f,g,w)}function tq(f,g,w){if(w&&typeof w!="boolean"&&Pr(f,g,w)&&(g=w=n),w===n&&(typeof g=="boolean"?(w=g,g=n):typeof f=="boolean"&&(w=f,f=n)),f===n&&g===n?(f=0,g=1):(f=ws(f),g===n?(g=f,f=0):g=ws(g)),f>g){var O=f;f=g,g=O}if(w||f%1||g%1){var L=aP();return gr(f+L*(g-f+kB("1e-"+((L+"").length-1))),g)}return Iy(f,g)}var nq=Yc(function(f,g,w){return g=g.toLowerCase(),f+(w?jO(g):g)});function jO(f){return ax(Kt(f).toLowerCase())}function $O(f){return f=Kt(f),f&&f.replace(De,GB).replace(_B,"")}function rq(f,g,w){f=Kt(f),g=fo(g);var O=f.length;w=w===n?O:dl(vt(w),0,O);var L=w;return w-=g.length,w>=0&&f.slice(w,L)==g}function oq(f){return f=Kt(f),f&&oi.test(f)?f.replace(wt,qB):f}function iq(f){return f=Kt(f),f&&hs.test(f)?f.replace(Ti,"\\$&"):f}var sq=Yc(function(f,g,w){return f+(w?"-":"")+g.toLowerCase()}),aq=Yc(function(f,g,w){return f+(w?" ":"")+g.toLowerCase()}),lq=HP("toLowerCase");function cq(f,g,w){f=Kt(f),g=vt(g);var O=g?Bc(f):0;if(!g||O>=g)return f;var L=(g-O)/2;return Og(gg(L),w)+f+Og(pg(L),w)}function uq(f,g,w){f=Kt(f),g=vt(g);var O=g?Bc(f):0;return g&&O<g?f+Og(g-O,w):f}function dq(f,g,w){f=Kt(f),g=vt(g);var O=g?Bc(f):0;return g&&O<g?Og(g-O,w)+f:f}function fq(f,g,w){return w||g==null?g=0:g&&(g=+g),yH(Kt(f).replace(Zn,""),g||0)}function hq(f,g,w){return(w?Pr(f,g,w):g===n)?g=1:g=vt(g),Ny(Kt(f),g)}function pq(){var f=arguments,g=Kt(f[0]);return f.length<3?g:g.replace(f[1],f[2])}var gq=Yc(function(f,g,w){return f+(w?"_":"")+g.toLowerCase()});function mq(f,g,w){return w&&typeof w!="number"&&Pr(f,g,w)&&(g=w=n),w=w===n?Y:w>>>0,w?(f=Kt(f),f&&(typeof g=="string"||g!=null&&!ox(g))&&(g=fo(g),!g&&zc(f))?la(si(f),0,w):f.split(g,w)):[]}var vq=Yc(function(f,g,w){return f+(w?" ":"")+ax(g)});function bq(f,g,w){return f=Kt(f),w=w==null?0:dl(vt(w),0,f.length),g=fo(g),f.slice(w,w+g.length)==g}function yq(f,g,w){var O=B.templateSettings;w&&Pr(f,g,w)&&(g=n),f=Kt(f),g=zg({},g,O,KP);var L=zg({},g.imports,O.imports,KP),U=tr(L),Q=by(L,U),ie,de,Se=0,_e=g.interpolate||lt,Re="__p += '",je=xy((g.escape||lt).source+"|"+_e.source+"|"+(_e===ds?He:lt).source+"|"+(g.evaluate||lt).source+"|$","g"),qe="//# sourceURL="+(en.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++OB+"]")+`
72
+ `;f.replace(je,function(Je,Mt,Lt,po,Or,go){return Lt||(Lt=po),Re+=f.slice(Se,go).replace(En,YB),Mt&&(ie=!0,Re+=`' +
73
+ __e(`+Mt+`) +
74
+ '`),Or&&(de=!0,Re+=`';
75
+ `+Or+`;
76
+ __p += '`),Lt&&(Re+=`' +
77
+ ((__t = (`+Lt+`)) == null ? '' : __t) +
78
+ '`),Se=go+Je.length,Je}),Re+=`';
79
+ `;var Qe=en.call(g,"variable")&&g.variable;if(!Qe)Re=`with (obj) {
80
+ `+Re+`
81
+ }
82
+ `;else if(fe.test(Qe))throw new ft(a);Re=(de?Re.replace(tt,""):Re).replace(mt,"$1").replace(kt,"$1;"),Re="function("+(Qe||"obj")+`) {
83
+ `+(Qe?"":`obj || (obj = {});
84
+ `)+"var __t, __p = ''"+(ie?", __e = _.escape":"")+(de?`, __j = Array.prototype.join;
85
+ function print() { __p += __j.call(arguments, '') }
86
+ `:`;
87
+ `)+Re+`return __p
88
+ }`;var St=BO(function(){return Wt(U,qe+"return "+Re).apply(n,Q)});if(St.source=Re,rx(St))throw St;return St}function xq(f){return Kt(f).toLowerCase()}function wq(f){return Kt(f).toUpperCase()}function Sq(f,g,w){if(f=Kt(f),f&&(w||g===n))return X2(f);if(!f||!(g=fo(g)))return f;var O=si(f),L=si(g),U=Q2(O,L),Q=J2(O,L)+1;return la(O,U,Q).join("")}function _q(f,g,w){if(f=Kt(f),f&&(w||g===n))return f.slice(0,eP(f)+1);if(!f||!(g=fo(g)))return f;var O=si(f),L=J2(O,si(g))+1;return la(O,0,L).join("")}function Cq(f,g,w){if(f=Kt(f),f&&(w||g===n))return f.replace(Zn,"");if(!f||!(g=fo(g)))return f;var O=si(f),L=Q2(O,si(g));return la(O,L).join("")}function Eq(f,g){var w=j,O=$;if(On(g)){var L="separator"in g?g.separator:L;w="length"in g?vt(g.length):w,O="omission"in g?fo(g.omission):O}f=Kt(f);var U=f.length;if(zc(f)){var Q=si(f);U=Q.length}if(w>=U)return f;var ie=w-Bc(O);if(ie<1)return O;var de=Q?la(Q,0,ie).join(""):f.slice(0,ie);if(L===n)return de+O;if(Q&&(ie+=de.length-ie),ox(L)){if(f.slice(ie).search(L)){var Se,_e=de;for(L.global||(L=xy(L.source,Kt(Ge.exec(L))+"g")),L.lastIndex=0;Se=L.exec(_e);)var Re=Se.index;de=de.slice(0,Re===n?ie:Re)}}else if(f.indexOf(fo(L),ie)!=ie){var je=de.lastIndexOf(L);je>-1&&(de=de.slice(0,je))}return de+O}function Rq(f){return f=Kt(f),f&&$n.test(f)?f.replace(Zt,tH):f}var Pq=Yc(function(f,g,w){return f+(w?" ":"")+g.toUpperCase()}),ax=HP("toUpperCase");function zO(f,g,w){return f=Kt(f),g=w?n:g,g===n?XB(f)?oH(f):BB(f):f.match(g)||[]}var BO=Rt(function(f,g){try{return co(f,n,g)}catch(w){return rx(w)?w:new ft(w)}}),Oq=bs(function(f,g){return Fo(g,function(w){w=ki(w),ms(f,w,tx(f[w],f))}),f});function Tq(f){var g=f==null?0:f.length,w=Xe();return f=g?Rn(f,function(O){if(typeof O[1]!="function")throw new jo(s);return[w(O[0]),O[1]]}):[],Rt(function(O){for(var L=-1;++L<g;){var U=f[L];if(co(U[0],this,O))return co(U[1],this,O)}})}function Mq(f){return tV(zo(f,d))}function lx(f){return function(){return f}}function Aq(f,g){return f==null||f!==f?g:f}var Dq=WP(),kq=WP(!0);function Ur(f){return f}function cx(f){return xP(typeof f=="function"?f:zo(f,d))}function Iq(f){return SP(zo(f,d))}function Nq(f,g){return _P(f,zo(g,d))}var Lq=Rt(function(f,g){return function(w){return Ud(w,f,g)}}),Fq=Rt(function(f,g){return function(w){return Ud(f,w,g)}});function ux(f,g,w){var O=tr(g),L=wg(g,O);w==null&&!(On(g)&&(L.length||!O.length))&&(w=g,g=f,f=this,L=wg(g,tr(g)));var U=!(On(w)&&"chain"in w)||!!w.chain,Q=xs(f);return Fo(L,function(ie){var de=g[ie];f[ie]=de,Q&&(f.prototype[ie]=function(){var Se=this.__chain__;if(U||Se){var _e=f(this.__wrapped__),Re=_e.__actions__=Hr(this.__actions__);return Re.push({func:de,args:arguments,thisArg:f}),_e.__chain__=Se,_e}return de.apply(f,na([this.value()],arguments))})}),f}function jq(){return sr._===this&&(sr._=uH),this}function dx(){}function $q(f){return f=vt(f),Rt(function(g){return CP(g,f)})}var zq=Hy(Rn),Bq=Hy(U2),Hq=Hy(hy);function HO(f){return Ky(f)?py(ki(f)):bV(f)}function Vq(f){return function(g){return f==null?n:fl(f,g)}}var Wq=GP(),Uq=GP(!0);function fx(){return[]}function hx(){return!1}function Gq(){return{}}function qq(){return""}function Yq(){return!0}function Kq(f,g){if(f=vt(f),f<1||f>G)return[];var w=Y,O=gr(f,Y);g=Xe(g),f-=Y;for(var L=vy(O,g);++w<f;)g(w);return L}function Xq(f){return ht(f)?Rn(f,ki):ho(f)?[f]:Hr(lO(Kt(f)))}function Qq(f){var g=++lH;return Kt(f)+g}var Jq=Pg(function(f,g){return f+g},0),Zq=Vy("ceil"),eY=Pg(function(f,g){return f/g},1),tY=Vy("floor");function nY(f){return f&&f.length?xg(f,Ur,Oy):n}function rY(f,g){return f&&f.length?xg(f,Xe(g,2),Oy):n}function oY(f){return Y2(f,Ur)}function iY(f,g){return Y2(f,Xe(g,2))}function sY(f){return f&&f.length?xg(f,Ur,Dy):n}function aY(f,g){return f&&f.length?xg(f,Xe(g,2),Dy):n}var lY=Pg(function(f,g){return f*g},1),cY=Vy("round"),uY=Pg(function(f,g){return f-g},0);function dY(f){return f&&f.length?my(f,Ur):0}function fY(f,g){return f&&f.length?my(f,Xe(g,2)):0}return B.after=IU,B.ary=yO,B.assign=wG,B.assignIn=kO,B.assignInWith=zg,B.assignWith=SG,B.at=_G,B.before=xO,B.bind=tx,B.bindAll=Oq,B.bindKey=wO,B.castArray=GU,B.chain=mO,B.chunk=tW,B.compact=nW,B.concat=rW,B.cond=Tq,B.conforms=Mq,B.constant=lx,B.countBy=dU,B.create=CG,B.curry=SO,B.curryRight=_O,B.debounce=CO,B.defaults=EG,B.defaultsDeep=RG,B.defer=NU,B.delay=LU,B.difference=oW,B.differenceBy=iW,B.differenceWith=sW,B.drop=aW,B.dropRight=lW,B.dropRightWhile=cW,B.dropWhile=uW,B.fill=dW,B.filter=hU,B.flatMap=mU,B.flatMapDeep=vU,B.flatMapDepth=bU,B.flatten=fO,B.flattenDeep=fW,B.flattenDepth=hW,B.flip=FU,B.flow=Dq,B.flowRight=kq,B.fromPairs=pW,B.functions=kG,B.functionsIn=IG,B.groupBy=yU,B.initial=mW,B.intersection=vW,B.intersectionBy=bW,B.intersectionWith=yW,B.invert=LG,B.invertBy=FG,B.invokeMap=wU,B.iteratee=cx,B.keyBy=SU,B.keys=tr,B.keysIn=Wr,B.map=Ig,B.mapKeys=$G,B.mapValues=zG,B.matches=Iq,B.matchesProperty=Nq,B.memoize=Lg,B.merge=BG,B.mergeWith=IO,B.method=Lq,B.methodOf=Fq,B.mixin=ux,B.negate=Fg,B.nthArg=$q,B.omit=HG,B.omitBy=VG,B.once=jU,B.orderBy=_U,B.over=zq,B.overArgs=$U,B.overEvery=Bq,B.overSome=Hq,B.partial=nx,B.partialRight=EO,B.partition=CU,B.pick=WG,B.pickBy=NO,B.property=HO,B.propertyOf=Vq,B.pull=_W,B.pullAll=pO,B.pullAllBy=CW,B.pullAllWith=EW,B.pullAt=RW,B.range=Wq,B.rangeRight=Uq,B.rearg=zU,B.reject=PU,B.remove=PW,B.rest=BU,B.reverse=Zy,B.sampleSize=TU,B.set=GG,B.setWith=qG,B.shuffle=MU,B.slice=OW,B.sortBy=kU,B.sortedUniq=NW,B.sortedUniqBy=LW,B.split=mq,B.spread=HU,B.tail=FW,B.take=jW,B.takeRight=$W,B.takeRightWhile=zW,B.takeWhile=BW,B.tap=nU,B.throttle=VU,B.thru=kg,B.toArray=MO,B.toPairs=LO,B.toPairsIn=FO,B.toPath=Xq,B.toPlainObject=DO,B.transform=YG,B.unary=WU,B.union=HW,B.unionBy=VW,B.unionWith=WW,B.uniq=UW,B.uniqBy=GW,B.uniqWith=qW,B.unset=KG,B.unzip=ex,B.unzipWith=gO,B.update=XG,B.updateWith=QG,B.values=Qc,B.valuesIn=JG,B.without=YW,B.words=zO,B.wrap=UU,B.xor=KW,B.xorBy=XW,B.xorWith=QW,B.zip=JW,B.zipObject=ZW,B.zipObjectDeep=eU,B.zipWith=tU,B.entries=LO,B.entriesIn=FO,B.extend=kO,B.extendWith=zg,ux(B,B),B.add=Jq,B.attempt=BO,B.camelCase=nq,B.capitalize=jO,B.ceil=Zq,B.clamp=ZG,B.clone=qU,B.cloneDeep=KU,B.cloneDeepWith=XU,B.cloneWith=YU,B.conformsTo=QU,B.deburr=$O,B.defaultTo=Aq,B.divide=eY,B.endsWith=rq,B.eq=li,B.escape=oq,B.escapeRegExp=iq,B.every=fU,B.find=pU,B.findIndex=uO,B.findKey=PG,B.findLast=gU,B.findLastIndex=dO,B.findLastKey=OG,B.floor=tY,B.forEach=vO,B.forEachRight=bO,B.forIn=TG,B.forInRight=MG,B.forOwn=AG,B.forOwnRight=DG,B.get=ix,B.gt=JU,B.gte=ZU,B.has=NG,B.hasIn=sx,B.head=hO,B.identity=Ur,B.includes=xU,B.indexOf=gW,B.inRange=eq,B.invoke=jG,B.isArguments=gl,B.isArray=ht,B.isArrayBuffer=eG,B.isArrayLike=Vr,B.isArrayLikeObject=zn,B.isBoolean=tG,B.isBuffer=ca,B.isDate=nG,B.isElement=rG,B.isEmpty=oG,B.isEqual=iG,B.isEqualWith=sG,B.isError=rx,B.isFinite=aG,B.isFunction=xs,B.isInteger=RO,B.isLength=jg,B.isMap=PO,B.isMatch=lG,B.isMatchWith=cG,B.isNaN=uG,B.isNative=dG,B.isNil=hG,B.isNull=fG,B.isNumber=OO,B.isObject=On,B.isObjectLike=Dn,B.isPlainObject=Qd,B.isRegExp=ox,B.isSafeInteger=pG,B.isSet=TO,B.isString=$g,B.isSymbol=ho,B.isTypedArray=Xc,B.isUndefined=gG,B.isWeakMap=mG,B.isWeakSet=vG,B.join=xW,B.kebabCase=sq,B.last=Ho,B.lastIndexOf=wW,B.lowerCase=aq,B.lowerFirst=lq,B.lt=bG,B.lte=yG,B.max=nY,B.maxBy=rY,B.mean=oY,B.meanBy=iY,B.min=sY,B.minBy=aY,B.stubArray=fx,B.stubFalse=hx,B.stubObject=Gq,B.stubString=qq,B.stubTrue=Yq,B.multiply=lY,B.nth=SW,B.noConflict=jq,B.noop=dx,B.now=Ng,B.pad=cq,B.padEnd=uq,B.padStart=dq,B.parseInt=fq,B.random=tq,B.reduce=EU,B.reduceRight=RU,B.repeat=hq,B.replace=pq,B.result=UG,B.round=cY,B.runInContext=ue,B.sample=OU,B.size=AU,B.snakeCase=gq,B.some=DU,B.sortedIndex=TW,B.sortedIndexBy=MW,B.sortedIndexOf=AW,B.sortedLastIndex=DW,B.sortedLastIndexBy=kW,B.sortedLastIndexOf=IW,B.startCase=vq,B.startsWith=bq,B.subtract=uY,B.sum=dY,B.sumBy=fY,B.template=yq,B.times=Kq,B.toFinite=ws,B.toInteger=vt,B.toLength=AO,B.toLower=xq,B.toNumber=Vo,B.toSafeInteger=xG,B.toString=Kt,B.toUpper=wq,B.trim=Sq,B.trimEnd=_q,B.trimStart=Cq,B.truncate=Eq,B.unescape=Rq,B.uniqueId=Qq,B.upperCase=Pq,B.upperFirst=ax,B.each=vO,B.eachRight=bO,B.first=hO,ux(B,function(){var f={};return Ai(B,function(g,w){en.call(B.prototype,w)||(f[w]=g)}),f}(),{chain:!1}),B.VERSION=r,Fo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){B[f].placeholder=B}),Fo(["drop","take"],function(f,g){It.prototype[f]=function(w){w=w===n?1:Xn(vt(w),0);var O=this.__filtered__&&!g?new It(this):this.clone();return O.__filtered__?O.__takeCount__=gr(w,O.__takeCount__):O.__views__.push({size:gr(w,Y),type:f+(O.__dir__<0?"Right":"")}),O},It.prototype[f+"Right"]=function(w){return this.reverse()[f](w).reverse()}}),Fo(["filter","map","takeWhile"],function(f,g){var w=g+1,O=w==V||w==W;It.prototype[f]=function(L){var U=this.clone();return U.__iteratees__.push({iteratee:Xe(L,3),type:w}),U.__filtered__=U.__filtered__||O,U}}),Fo(["head","last"],function(f,g){var w="take"+(g?"Right":"");It.prototype[f]=function(){return this[w](1).value()[0]}}),Fo(["initial","tail"],function(f,g){var w="drop"+(g?"":"Right");It.prototype[f]=function(){return this.__filtered__?new It(this):this[w](1)}}),It.prototype.compact=function(){return this.filter(Ur)},It.prototype.find=function(f){return this.filter(f).head()},It.prototype.findLast=function(f){return this.reverse().find(f)},It.prototype.invokeMap=Rt(function(f,g){return typeof f=="function"?new It(this):this.map(function(w){return Ud(w,f,g)})}),It.prototype.reject=function(f){return this.filter(Fg(Xe(f)))},It.prototype.slice=function(f,g){f=vt(f);var w=this;return w.__filtered__&&(f>0||g<0)?new It(w):(f<0?w=w.takeRight(-f):f&&(w=w.drop(f)),g!==n&&(g=vt(g),w=g<0?w.dropRight(-g):w.take(g-f)),w)},It.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},It.prototype.toArray=function(){return this.take(Y)},Ai(It.prototype,function(f,g){var w=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),L=B[O?"take"+(g=="last"?"Right":""):g],U=O||/^find/.test(g);L&&(B.prototype[g]=function(){var Q=this.__wrapped__,ie=O?[1]:arguments,de=Q instanceof It,Se=ie[0],_e=de||ht(Q),Re=function(Mt){var Lt=L.apply(B,na([Mt],ie));return O&&je?Lt[0]:Lt};_e&&w&&typeof Se=="function"&&Se.length!=1&&(de=_e=!1);var je=this.__chain__,qe=!!this.__actions__.length,Qe=U&&!je,St=de&&!qe;if(!U&&_e){Q=St?Q:new It(this);var Je=f.apply(Q,ie);return Je.__actions__.push({func:kg,args:[Re],thisArg:n}),new $o(Je,je)}return Qe&&St?f.apply(this,ie):(Je=this.thru(Re),Qe?O?Je.value()[0]:Je.value():Je)})}),Fo(["pop","push","shift","sort","splice","unshift"],function(f){var g=ig[f],w=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",O=/^(?:pop|shift)$/.test(f);B.prototype[f]=function(){var L=arguments;if(O&&!this.__chain__){var U=this.value();return g.apply(ht(U)?U:[],L)}return this[w](function(Q){return g.apply(ht(Q)?Q:[],L)})}}),Ai(It.prototype,function(f,g){var w=B[g];if(w){var O=w.name+"";en.call(Uc,O)||(Uc[O]=[]),Uc[O].push({name:g,func:w})}}),Uc[Rg(n,b).name]=[{name:"wrapper",func:n}],It.prototype.clone=RH,It.prototype.reverse=PH,It.prototype.value=OH,B.prototype.at=rU,B.prototype.chain=oU,B.prototype.commit=iU,B.prototype.next=sU,B.prototype.plant=lU,B.prototype.reverse=cU,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=uU,B.prototype.first=B.prototype.head,jd&&(B.prototype[jd]=aU),B},Hc=iH();al?((al.exports=Hc)._=Hc,cy._=Hc):sr._=Hc}).call(xa)})(y0,y0.exports);var Of=y0.exports;const Ql=Oc(Of);function lT({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},l=t?{...t}:{};return U_.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,h)=>Math.max(d,h.y+h.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function cT(e,t){if(!t)return;const n={...t};return U_.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function Y_(e){return we.getState().dashboard.globalCacheConfig}const we=lN()(gN((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:b0},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:b0},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l,c,u,d,h;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(p=>p.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const p=(a=r.dashboard.filters)==null?void 0:a.filter(v=>v.sheetId===n),m=(l=r.filterValues)==null?void 0:l.filter(v=>p==null?void 0:p.some(y=>y.id===v.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(v=>!(m!=null&&m.some(y=>y.filterId===v.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(v=>v.sheetId!==n),r.selectedSheetId=(h=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:h.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{U_.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&&Of.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},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&&Of.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.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&&Of.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.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&&Of.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.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(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(h=>h.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},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],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{lT({id:n.id,layouts:a.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),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=cT(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(d=a.cards)==null?void 0:d.findIndex(m=>m.id===o.id);p>-1&&((h=a.cards)==null||h.splice(p,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(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const h=0;o==="start"&&(d=0);const p=lT({id:r.id,layouts:s.layouts,minH:10,x:h,y:d});s.layouts=p,(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(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),cT(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;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.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;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),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.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}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges: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)=>{BK({card:n,dataPoint:r,set:e,get:t})}}}))),dr=()=>we(e=>e.actions),HK={theme:"system",setTheme:()=>null},SN=P.createContext(HK);function VK({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=P.useState(()=>localStorage.getItem(n)||t);P.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 x.jsx(SN.Provider,{...r,value:s,children:e})}const _N=()=>{const e=P.useContext(SN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var yp=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(){}},pc=typeof window>"u"||"Deno"in globalThis;function Go(){}function WK(e,t){return typeof e=="function"?e(t):e}function Rw(e){return typeof e=="number"&&e>=0&&e!==1/0}function CN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Su(e,t){return typeof e=="function"?e(t):e}function mi(e,t){return typeof e=="function"?e(t):e}function uT(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==K_(s,t.options))return!1}else if(!yh(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||o&&o!==t.state.fetchStatus||i&&!i(t))}function dT(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(bh(t.options.mutationKey)!==bh(i))return!1}else if(!yh(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function K_(e,t){return((t==null?void 0:t.queryKeyHashFn)||bh)(e)}function bh(e){return JSON.stringify(e,(t,n)=>Tw(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function yh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!yh(e[n],t[n])):!1}function Pw(e,t){if(e===t)return e;const n=fT(e)&&fT(t);if(n||Tw(e)&&Tw(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&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=Pw(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function Ow(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function fT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Tw(e){if(!hT(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!hT(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function hT(e){return Object.prototype.toString.call(e)==="[object Object]"}function UK(e){return new Promise(t=>{setTimeout(t,e)})}function Mw(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Pw(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return Pw(e,t)}return t}function GK(e){return e}function qK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function YK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var x0=Symbol();function EN(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===x0&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===x0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Vl,_a,Nu,WI,KK=(WI=class extends yp{constructor(){super();Ke(this,Vl,void 0);Ke(this,_a,void 0);Ke(this,Nu,void 0);Ue(this,Nu,t=>{if(!pc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ae(this,_a)||this.setEventListener(ae(this,Nu))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,_a))==null||t.call(this),Ue(this,_a,void 0))}setEventListener(t){var n;Ue(this,Nu,t),(n=ae(this,_a))==null||n.call(this),Ue(this,_a,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ae(this,Vl)!==t&&(Ue(this,Vl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ae(this,Vl)=="boolean"?ae(this,Vl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Vl=new WeakMap,_a=new WeakMap,Nu=new WeakMap,WI),X_=new KK,Lu,Ca,Fu,UI,XK=(UI=class extends yp{constructor(){super();Ke(this,Lu,!0);Ke(this,Ca,void 0);Ke(this,Fu,void 0);Ue(this,Fu,t=>{if(!pc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ae(this,Ca)||this.setEventListener(ae(this,Fu))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,Ca))==null||t.call(this),Ue(this,Ca,void 0))}setEventListener(t){var n;Ue(this,Fu,t),(n=ae(this,Ca))==null||n.call(this),Ue(this,Ca,t(this.setOnline.bind(this)))}setOnline(t){ae(this,Lu)!==t&&(Ue(this,Lu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ae(this,Lu)}},Lu=new WeakMap,Ca=new WeakMap,Fu=new WeakMap,UI),w0=new XK;function Aw(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function QK(e){return Math.min(1e3*2**e,3e4)}function RN(e){return(e??"online")==="online"?w0.isOnline():!0}var PN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Sx(e){return e instanceof PN}function ON(e){let t=!1,n=0,r=!1,o;const i=Aw(),s=v=>{var y;r||(h(new PN(v)),(y=e.abort)==null||y.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>X_.isFocused()&&(e.networkMode==="always"||w0.isOnline())&&e.canRun(),u=()=>RN(e.networkMode)&&e.canRun(),d=v=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,v),o==null||o(),i.resolve(v))},h=v=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,v),o==null||o(),i.reject(v))},p=()=>new Promise(v=>{var y;o=b=>{(r||c())&&v(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var v;o=void 0,r||(v=e.onContinue)==null||v.call(e)}),m=()=>{if(r)return;let v;const y=n===0?e.initialPromise:void 0;try{v=y??e.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(d).catch(b=>{var T;if(r)return;const S=e.retry??(pc?0:3),_=e.retryDelay??QK,C=typeof _=="function"?_(n,b):_,E=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,b);if(t||!E){h(b);return}n++,(T=e.onFail)==null||T.call(e,n,b),UK(C).then(()=>c()?void 0:p()).then(()=>{t?h(b):m()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():p().then(m),i)}}function JK(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var ur=JK(),Wl,GI,TN=(GI=class{constructor(){Ke(this,Wl,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rw(this.gcTime)&&Ue(this,Wl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pc?1/0:5*60*1e3))}clearGcTimeout(){ae(this,Wl)&&(clearTimeout(ae(this,Wl)),Ue(this,Wl,void 0))}},Wl=new WeakMap,GI),ju,$u,Uo,yr,ap,Ul,pi,Rs,qI,ZK=(qI=class extends TN{constructor(t){super();Ke(this,pi);Ke(this,ju,void 0);Ke(this,$u,void 0);Ke(this,Uo,void 0);Ke(this,yr,void 0);Ke(this,ap,void 0);Ke(this,Ul,void 0);Ue(this,Ul,!1),Ue(this,ap,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ue(this,Uo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ue(this,ju,eX(this.options)),this.state=t.state??ae(this,ju),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ae(this,yr))==null?void 0:t.promise}setOptions(t){this.options={...ae(this,ap),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ae(this,Uo).remove(this)}setData(t,n){const r=Mw(this.state.data,t,this.options);return Ft(this,pi,Rs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ft(this,pi,Rs).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=ae(this,yr))==null?void 0:r.promise;return(o=ae(this,yr))==null||o.cancel(t),n?n.then(Go).catch(Go):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ae(this,ju))}isActive(){return this.observers.some(t=>mi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===x0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!CN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,yr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,yr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ae(this,Uo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ae(this,yr)&&(ae(this,Ul)?ae(this,yr).cancel({revert:!0}):ae(this,yr).cancelRetry()),this.scheduleGc()),ae(this,Uo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ft(this,pi,Rs).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ae(this,yr))return ae(this,yr).continueRetry(),ae(this,yr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.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=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(Ue(this,Ul,!0),r.signal)})},i=()=>{const d=EN(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return o(h),Ue(this,Ul,!1),this.options.persister?this.options.persister(d,h,this):d(h)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),Ue(this,$u,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Ft(this,pi,Rs).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var h,p,m,v;Sx(d)&&d.silent||Ft(this,pi,Rs).call(this,{type:"error",error:d}),Sx(d)||((p=(h=ae(this,Uo).config).onError)==null||p.call(h,d,this),(v=(m=ae(this,Uo).config).onSettled)==null||v.call(m,this.state.data,d,this)),this.scheduleGc()};return Ue(this,yr,ON({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,p,m,v;if(d===void 0){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}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(y){a(y);return}(p=(h=ae(this,Uo).config).onSuccess)==null||p.call(h,d,this),(v=(m=ae(this,Uo).config).onSettled)==null||v.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,h)=>{Ft(this,pi,Rs).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{Ft(this,pi,Rs).call(this,{type:"pause"})},onContinue:()=>{Ft(this,pi,Rs).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),ae(this,yr).start()}},ju=new WeakMap,$u=new WeakMap,Uo=new WeakMap,yr=new WeakMap,ap=new WeakMap,Ul=new WeakMap,pi=new WeakSet,Rs=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,...MN(r.data,this.options),fetchMeta:t.meta??null};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 Sx(o)&&o.revert&&ae(this,$u)?{...ae(this,$u),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),ur.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ae(this,Uo).notify({query:this,type:"updated",action:t})})},qI);function MN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:RN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function eX(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,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 $i,YI,AN=(YI=class extends yp{constructor(t={}){super();Ke(this,$i,void 0);this.config=t,Ue(this,$i,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??K_(o,n);let s=this.get(i);return s||(s=new ZK({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ae(this,$i).has(t.queryHash)||(ae(this,$i).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ae(this,$i).get(t.queryHash);n&&(t.destroy(),n===t&&ae(this,$i).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ur.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ae(this,$i).get(t)}getAll(){return[...ae(this,$i).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>uT(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>uT(t,r)):n}notify(t){ur.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ur.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ur.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},$i=new WeakMap,YI),zi,Ar,Gl,Bi,va,KI,tX=(KI=class extends TN{constructor(t){super();Ke(this,Bi);Ke(this,zi,void 0);Ke(this,Ar,void 0);Ke(this,Gl,void 0);this.mutationId=t.mutationId,Ue(this,Ar,t.mutationCache),Ue(this,zi,[]),this.state=t.state||nX(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ae(this,zi).includes(t)||(ae(this,zi).push(t),this.clearGcTimeout(),ae(this,Ar).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ue(this,zi,ae(this,zi).filter(n=>n!==t)),this.scheduleGc(),ae(this,Ar).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ae(this,zi).length||(this.state.status==="pending"?this.scheduleGc():ae(this,Ar).remove(this))}continue(){var t;return((t=ae(this,Gl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,h,p,m,v,y,b,S,_,C,E,T,A;Ue(this,Gl,ON({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(D,k)=>{Ft(this,Bi,va).call(this,{type:"failed",failureCount:D,error:k})},onPause:()=>{Ft(this,Bi,va).call(this,{type:"pause"})},onContinue:()=>{Ft(this,Bi,va).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ae(this,Ar).canRun(this)}));const n=this.state.status==="pending",r=!ae(this,Gl).canStart();try{if(!n){Ft(this,Bi,va).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=ae(this,Ar).config).onMutate)==null?void 0:i.call(o,t,this));const k=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));k!==this.state.context&&Ft(this,Bi,va).call(this,{type:"pending",context:k,variables:t,isPaused:r})}const D=await ae(this,Gl).start();return await((c=(l=ae(this,Ar).config).onSuccess)==null?void 0:c.call(l,D,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,D,t,this.state.context)),await((p=(h=ae(this,Ar).config).onSettled)==null?void 0:p.call(h,D,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,D,null,t,this.state.context)),Ft(this,Bi,va).call(this,{type:"success",data:D}),D}catch(D){try{throw await((b=(y=ae(this,Ar).config).onError)==null?void 0:b.call(y,D,t,this.state.context,this)),await((_=(S=this.options).onError)==null?void 0:_.call(S,D,t,this.state.context)),await((E=(C=ae(this,Ar).config).onSettled)==null?void 0:E.call(C,void 0,D,this.state.variables,this.state.context,this)),await((A=(T=this.options).onSettled)==null?void 0:A.call(T,void 0,D,t,this.state.context)),D}finally{Ft(this,Bi,va).call(this,{type:"error",error:D})}}finally{ae(this,Ar).runNext(this)}}},zi=new WeakMap,Ar=new WeakMap,Gl=new WeakMap,Bi=new WeakSet,va=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:t.isPaused,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),ur.batch(()=>{ae(this,zi).forEach(r=>{r.onMutationUpdate(t)}),ae(this,Ar).notify({mutation:this,type:"updated",action:t})})},KI);function nX(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ds,gi,lp,XI,rX=(XI=class extends yp{constructor(t={}){super();Ke(this,Ds,void 0);Ke(this,gi,void 0);Ke(this,lp,void 0);this.config=t,Ue(this,Ds,new Set),Ue(this,gi,new Map),Ue(this,lp,0)}build(t,n,r){const o=new tX({mutationCache:this,mutationId:++Bg(this,lp)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ae(this,Ds).add(t);const n=Ug(t);if(typeof n=="string"){const r=ae(this,gi).get(n);r?r.push(t):ae(this,gi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ae(this,Ds).delete(t)){const n=Ug(t);if(typeof n=="string"){const r=ae(this,gi).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&ae(this,gi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ug(t);if(typeof n=="string"){const r=ae(this,gi).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Ug(t);if(typeof n=="string"){const o=(r=ae(this,gi).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ur.batch(()=>{ae(this,Ds).forEach(t=>{this.notify({type:"removed",mutation:t})}),ae(this,Ds).clear(),ae(this,gi).clear()})}getAll(){return Array.from(ae(this,Ds))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>dT(n,r))}findAll(t={}){return this.getAll().filter(n=>dT(t,n))}notify(t){ur.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ur.batch(()=>Promise.all(t.map(n=>n.continue().catch(Go))))}},Ds=new WeakMap,gi=new WeakMap,lp=new WeakMap,XI);function Ug(e){var t;return(t=e.options.scope)==null?void 0:t.id}function pT(e){return{onFetch:(t,n)=>{var u,d,h,p,m;const r=t.options,o=(h=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const y=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},b=EN(t.options,t.fetchOptions),S=async(_,C,E)=>{if(v)return Promise.reject();if(C==null&&_.pages.length)return Promise.resolve(_);const T={queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};y(T);const A=await b(T),{maxPages:D}=t.options,k=E?YK:qK;return{pages:k(_.pages,A,D),pageParams:k(_.pageParams,C,D)}};if(o&&i.length){const _=o==="backward",C=_?oX:gT,E={pages:i,pageParams:s},T=C(r,E);a=await S(E,T,_)}else{const _=e??i.length;do{const C=l===0?s[0]??r.initialPageParam:gT(r,a);if(l>0&&C==null)break;a=await S(a,C),l++}while(l<_)}return a};t.options.persister?t.fetchFn=()=>{var v,y;return(y=(v=t.options).persister)==null?void 0:y.call(v,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function gT(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function oX(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var kn,Ea,Ra,zu,Bu,Pa,Hu,Vu,QI,iX=(QI=class{constructor(e={}){Ke(this,kn,void 0);Ke(this,Ea,void 0);Ke(this,Ra,void 0);Ke(this,zu,void 0);Ke(this,Bu,void 0);Ke(this,Pa,void 0);Ke(this,Hu,void 0);Ke(this,Vu,void 0);Ue(this,kn,e.queryCache||new AN),Ue(this,Ea,e.mutationCache||new rX),Ue(this,Ra,e.defaultOptions||{}),Ue(this,zu,new Map),Ue(this,Bu,new Map),Ue(this,Pa,0)}mount(){Bg(this,Pa)._++,ae(this,Pa)===1&&(Ue(this,Hu,X_.subscribe(async e=>{e&&(await this.resumePausedMutations(),ae(this,kn).onFocus())})),Ue(this,Vu,w0.subscribe(async e=>{e&&(await this.resumePausedMutations(),ae(this,kn).onOnline())})))}unmount(){var e,t;Bg(this,Pa)._--,ae(this,Pa)===0&&((e=ae(this,Hu))==null||e.call(this),Ue(this,Hu,void 0),(t=ae(this,Vu))==null||t.call(this),Ue(this,Vu,void 0))}isFetching(e){return ae(this,kn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ae(this,Ea).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ae(this,kn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ae(this,kn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Su(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return ae(this,kn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=ae(this,kn).get(r.queryHash),i=o==null?void 0:o.state.data,s=WK(t,i);if(s!==void 0)return ae(this,kn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return ur.batch(()=>ae(this,kn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ae(this,kn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ae(this,kn);ur.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ae(this,kn),r={type:"active",...e};return ur.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ur.batch(()=>ae(this,kn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Go).catch(Go)}invalidateQueries(e,t={}){return ur.batch(()=>{if(ae(this,kn).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ur.batch(()=>ae(this,kn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Go)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Go)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ae(this,kn).build(this,t);return n.isStaleByTime(Su(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Go).catch(Go)}fetchInfiniteQuery(e){return e.behavior=pT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Go).catch(Go)}ensureInfiniteQueryData(e){return e.behavior=pT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return w0.isOnline()?ae(this,Ea).resumePausedMutations():Promise.resolve()}getQueryCache(){return ae(this,kn)}getMutationCache(){return ae(this,Ea)}getDefaultOptions(){return ae(this,Ra)}setDefaultOptions(e){Ue(this,Ra,e)}setQueryDefaults(e,t){ae(this,zu).set(bh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ae(this,zu).values()],n={};return t.forEach(r=>{yh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){ae(this,Bu).set(bh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ae(this,Bu).values()];let n={};return t.forEach(r=>{yh(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ae(this,Ra).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=K_(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===x0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ae(this,Ra).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ae(this,kn).clear(),ae(this,Ea).clear()}},kn=new WeakMap,Ea=new WeakMap,Ra=new WeakMap,zu=new WeakMap,Bu=new WeakMap,Pa=new WeakMap,Hu=new WeakMap,Vu=new WeakMap,QI),Jr,jt,cp,Dr,ql,Wu,Oa,Hi,up,Uu,Gu,Yl,Kl,Ta,qu,Xl,Tf,dp,Dw,fp,kw,hp,Iw,pp,Nw,gp,Lw,mp,Fw,vp,jw,Cv,DN,JI,sX=(JI=class extends yp{constructor(t,n){super();Ke(this,Xl);Ke(this,dp);Ke(this,fp);Ke(this,hp);Ke(this,pp);Ke(this,gp);Ke(this,mp);Ke(this,vp);Ke(this,Cv);Ke(this,Jr,void 0);Ke(this,jt,void 0);Ke(this,cp,void 0);Ke(this,Dr,void 0);Ke(this,ql,void 0);Ke(this,Wu,void 0);Ke(this,Oa,void 0);Ke(this,Hi,void 0);Ke(this,up,void 0);Ke(this,Uu,void 0);Ke(this,Gu,void 0);Ke(this,Yl,void 0);Ke(this,Kl,void 0);Ke(this,Ta,void 0);Ke(this,qu,new Set);this.options=n,Ue(this,Jr,t),Ue(this,Hi,null),Ue(this,Oa,Aw()),this.options.experimental_prefetchInRender||ae(this,Oa).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ae(this,jt).addObserver(this),mT(ae(this,jt),this.options)?Ft(this,Xl,Tf).call(this):this.updateResult(),Ft(this,pp,Nw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $w(ae(this,jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $w(ae(this,jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ft(this,gp,Lw).call(this),Ft(this,mp,Fw).call(this),ae(this,jt).removeObserver(this)}setOptions(t,n){const r=this.options,o=ae(this,jt);if(this.options=ae(this,Jr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof mi(this.options.enabled,ae(this,jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ft(this,vp,jw).call(this),ae(this,jt).setOptions(this.options),r._defaulted&&!Ow(this.options,r)&&ae(this,Jr).getQueryCache().notify({type:"observerOptionsUpdated",query:ae(this,jt),observer:this});const i=this.hasListeners();i&&vT(ae(this,jt),o,this.options,r)&&Ft(this,Xl,Tf).call(this),this.updateResult(n),i&&(ae(this,jt)!==o||mi(this.options.enabled,ae(this,jt))!==mi(r.enabled,ae(this,jt))||Su(this.options.staleTime,ae(this,jt))!==Su(r.staleTime,ae(this,jt)))&&Ft(this,dp,Dw).call(this);const s=Ft(this,fp,kw).call(this);i&&(ae(this,jt)!==o||mi(this.options.enabled,ae(this,jt))!==mi(r.enabled,ae(this,jt))||s!==ae(this,Ta))&&Ft(this,hp,Iw).call(this,s)}getOptimisticResult(t){const n=ae(this,Jr).getQueryCache().build(ae(this,Jr),t),r=this.createResult(n,t);return lX(this,r)&&(Ue(this,Dr,r),Ue(this,Wu,this.options),Ue(this,ql,ae(this,jt).state)),r}getCurrentResult(){return ae(this,Dr)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){ae(this,qu).add(t)}getCurrentQuery(){return ae(this,jt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ae(this,Jr).defaultQueryOptions(t),r=ae(this,Jr).getQueryCache().build(ae(this,Jr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ft(this,Xl,Tf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ae(this,Dr)))}createResult(t,n){var D;const r=ae(this,jt),o=this.options,i=ae(this,Dr),s=ae(this,ql),a=ae(this,Wu),c=t!==r?t.state:ae(this,cp),{state:u}=t;let d={...u},h=!1,p;if(n._optimisticResults){const k=this.hasListeners(),j=!k&&mT(t,n),$=k&&vT(t,r,n,o);(j||$)&&(d={...d,...MN(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:v,status:y}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===ae(this,up))p=ae(this,Uu);else try{Ue(this,up,n.select),p=n.select(d.data),p=Mw(i==null?void 0:i.data,p,n),Ue(this,Uu,p),Ue(this,Hi,null)}catch(k){Ue(this,Hi,k)}else p=d.data;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let k;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))k=i.data;else if(k=typeof n.placeholderData=="function"?n.placeholderData((D=ae(this,Gu))==null?void 0:D.state.data,ae(this,Gu)):n.placeholderData,n.select&&k!==void 0)try{k=n.select(k),Ue(this,Hi,null)}catch(j){Ue(this,Hi,j)}k!==void 0&&(y="success",p=Mw(i==null?void 0:i.data,k,n),h=!0)}ae(this,Hi)&&(m=ae(this,Hi),p=ae(this,Uu),v=Date.now(),y="error");const b=d.fetchStatus==="fetching",S=y==="pending",_=y==="error",C=S&&b,E=p!==void 0,A={status:y,fetchStatus:d.fetchStatus,isPending:S,isSuccess:y==="success",isError:_,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:_&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:_&&E,isStale:Q_(t,n),refetch:this.refetch,promise:ae(this,Oa)};if(this.options.experimental_prefetchInRender){const k=z=>{A.status==="error"?z.reject(A.error):A.data!==void 0&&z.resolve(A.data)},j=()=>{const z=Ue(this,Oa,A.promise=Aw());k(z)},$=ae(this,Oa);switch($.status){case"pending":t.queryHash===r.queryHash&&k($);break;case"fulfilled":(A.status==="error"||A.data!==$.value)&&j();break;case"rejected":(A.status!=="error"||A.error!==$.reason)&&j();break}}return A}updateResult(t){const n=ae(this,Dr),r=this.createResult(ae(this,jt),this.options);if(Ue(this,ql,ae(this,jt).state),Ue(this,Wu,this.options),ae(this,ql).data!==void 0&&Ue(this,Gu,ae(this,jt)),Ow(r,n))return;Ue(this,Dr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ae(this,qu).size)return!0;const l=new Set(a??ae(this,qu));return this.options.throwOnError&&l.add("error"),Object.keys(ae(this,Dr)).some(c=>{const u=c;return ae(this,Dr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ft(this,Cv,DN).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ft(this,pp,Nw).call(this)}},Jr=new WeakMap,jt=new WeakMap,cp=new WeakMap,Dr=new WeakMap,ql=new WeakMap,Wu=new WeakMap,Oa=new WeakMap,Hi=new WeakMap,up=new WeakMap,Uu=new WeakMap,Gu=new WeakMap,Yl=new WeakMap,Kl=new WeakMap,Ta=new WeakMap,qu=new WeakMap,Xl=new WeakSet,Tf=function(t){Ft(this,vp,jw).call(this);let n=ae(this,jt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Go)),n},dp=new WeakSet,Dw=function(){Ft(this,gp,Lw).call(this);const t=Su(this.options.staleTime,ae(this,jt));if(pc||ae(this,Dr).isStale||!Rw(t))return;const r=CN(ae(this,Dr).dataUpdatedAt,t)+1;Ue(this,Yl,setTimeout(()=>{ae(this,Dr).isStale||this.updateResult()},r))},fp=new WeakSet,kw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ae(this,jt)):this.options.refetchInterval)??!1},hp=new WeakSet,Iw=function(t){Ft(this,mp,Fw).call(this),Ue(this,Ta,t),!(pc||mi(this.options.enabled,ae(this,jt))===!1||!Rw(ae(this,Ta))||ae(this,Ta)===0)&&Ue(this,Kl,setInterval(()=>{(this.options.refetchIntervalInBackground||X_.isFocused())&&Ft(this,Xl,Tf).call(this)},ae(this,Ta)))},pp=new WeakSet,Nw=function(){Ft(this,dp,Dw).call(this),Ft(this,hp,Iw).call(this,Ft(this,fp,kw).call(this))},gp=new WeakSet,Lw=function(){ae(this,Yl)&&(clearTimeout(ae(this,Yl)),Ue(this,Yl,void 0))},mp=new WeakSet,Fw=function(){ae(this,Kl)&&(clearInterval(ae(this,Kl)),Ue(this,Kl,void 0))},vp=new WeakSet,jw=function(){const t=ae(this,Jr).getQueryCache().build(ae(this,Jr),this.options);if(t===ae(this,jt))return;const n=ae(this,jt);Ue(this,jt,t),Ue(this,cp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Cv=new WeakSet,DN=function(t){ur.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ae(this,Dr))}),ae(this,Jr).getQueryCache().notify({query:ae(this,jt),type:"observerResultsUpdated"})})},JI);function aX(e,t){return mi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function mT(e,t){return aX(e,t)||e.state.data!==void 0&&$w(e,t,t.refetchOnMount)}function $w(e,t,n){if(mi(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Q_(e,t)}return!1}function vT(e,t,n,r){return(e!==t||mi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Q_(e,n)}function Q_(e,t){return mi(t.enabled,e)!==!1&&e.isStaleByTime(Su(t.staleTime,e))}function lX(e,t){return!Ow(e.getCurrentResult(),t)}var kN=R.createContext(void 0),J_=e=>{const t=R.useContext(kN);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},cX=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),x.jsx(kN.Provider,{value:e,children:t})),IN=R.createContext(!1),uX=()=>R.useContext(IN);IN.Provider;function dX(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var fX=R.createContext(dX()),hX=()=>R.useContext(fX);function pX(e,t){return typeof e=="function"?e(...t):!!e}function bT(){}var gX=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},mX=e=>{R.useEffect(()=>{e.clearReset()},[e])},vX=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&pX(n,[e.error,r]),bX=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},yX=(e,t)=>e.isLoading&&e.isFetching&&!t,xX=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,yT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wX(e,t,n){var u,d,h,p,m;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=J_(n),o=uX(),i=hX(),s=r.defaultQueryOptions(e);(d=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||d.call(u,s),s._optimisticResults=o?"isRestoring":"optimistic",bX(s),gX(s,i),mX(i);const a=!r.getQueryCache().get(s.queryHash),[l]=R.useState(()=>new t(r,s)),c=l.getOptimisticResult(s);if(R.useSyncExternalStore(R.useCallback(v=>{const y=o?bT:l.subscribe(ur.batchCalls(v));return l.updateResult(),y},[l,o]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),xX(s,c))throw yT(s,l,i);if(vX({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw c.error;if((p=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||p.call(h,s,c),s.experimental_prefetchInRender&&!pc&&yX(c,o)){const v=a?yT(s,l,i):(m=r.getQueryCache().get(s.queryHash))==null?void 0:m.promise;v==null||v.catch(bT).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function xp(e,t){return wX(e,sX,t)}function NN({children:e}){const{setIsSessionExpired:t}=dr(),n=new iX({queryCache:new AN({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{gcTime:1e3*60*10,staleTime:1e3*60*5,refetchOnWindowFocus:!1,retry:1}}});return x.jsx(cX,{client:n,children:e})}const Tc=P.forwardRef(({children:e,className:t,...n},r)=>x.jsx("div",{className:xe("semaphor-scope",t),ref:r,...n,children:e})),SX={id:"",authToken:void 0},LN=P.createContext(SX),FN=({children:e,dashboardProps:t})=>x.jsx(NN,{children:x.jsx(LN.Provider,{value:t,children:x.jsx(Tc,{style:{height:"100%"},children:e})})});function ko(){const e=P.useContext(LN);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function _X(){const{authToken:e,version:t}=ko(),n=we(a=>a.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:s}=xp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>sK(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:o,isFetching:i,isError:s}}function jN(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function xT(e,t){const n=jN(e);return n==="dark"?Ql.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function CX({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,onFilterValuesChange:i}){const{authToken:s}=ko(),a=we(N=>N.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:d}=_X(),[h,p]=P.useState(o||[]),{theme:m,setTheme:v}=_N(),y=we(N=>N.dashboard.globalStyle),{setDashboard:b,setDashboardWithFilterValues:S,setSelectedSheetId:_,setStyle:C,setOnSaveFunction:E,setLenses:T,setSelectedLensId:A,setInitStore:D}=we(N=>N.actions);we(N=>N.actions.setCustomCards);const k=we(N=>N.actions.setFilterValues),j=we(N=>N.filterValues),$=we(N=>N.actions.setThemeStyle),z=we(N=>N.actions.setDashboardTheme),K=we(N=>N.actions.setOnEvent);P.useEffect(()=>{s&&D()},[s,D]),P.useEffect(()=>{if(m){const N=jN(m);z(N)}},[m,z]),P.useEffect(()=>{t&&v(t)},[t,v]);const V=P.useCallback(()=>{const N=Ql.cloneDeep(b0),W=Ql.merge(N,y);if(e){const H=Ql.merge(W,e),G=xT(m,H);$(G),C(H)}else{const H=xT(m,W);$(H),C(b0)}},[m,e,y,$,C]);return P.useEffect(()=>{l&&l.dashboard&&V()},[m,e,y,V,l]),P.useEffect(()=>{var Y,q;function N(M,ne){const X=M.filters||[],re=[];for(const ee of ne){const J=X.find(le=>le.id===ee.filterId);J&&re.push({filterId:ee.filterId,connectionType:J.database==="NA"?"api":"database",name:J.column,operation:J.operation,valueType:wu(J),values:ee.values})}return re}if(!l||!l.dashboard)return;const{dashboard:W,filterValues:H,defaultLensId:G,lenses:te}=l,F=N(W,h||[]);S(W,H||F||[]),G&&A(G),te&&T(te),_(((q=(Y=W==null?void 0:W.sheets)==null?void 0:Y[0])==null?void 0:q.id)||null)},[l,b,_,k,a,T,S,A,h]),P.useEffect(()=>{i&&j&&i(j)},[j,i]),P.useEffect(()=>{n&&E(n),r&&K(r)},[n,E,r,K]),{isFetching:u,isLoading:c,isError:d}}function _u({className:e,...t}){return x.jsx("div",{className:xe("animate-pulse rounded-md bg-muted",e),...t})}const $N=R.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:xe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));$N.displayName="Card";const Dv=R.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:xe("flex flex-col space-y-1.5 p-6",e),...t}));Dv.displayName="CardHeader";const yd=R.forwardRef(({className:e,...t},n)=>x.jsx("h3",{ref:n,className:xe("text-2xl font-semibold leading-none tracking-tight",e),...t}));yd.displayName="CardTitle";const Z_=R.forwardRef(({className:e,...t},n)=>x.jsx("p",{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));Z_.displayName="CardDescription";const kv=R.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:xe("px-6 pt-0",e),...t}));kv.displayName="CardContent";const zN=R.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:xe("flex items-center p-6 pt-0",e),...t}));zN.displayName="CardFooter";function BN({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:h,defaultFilterValues:p,onFilterValuesChange:m,...v}){we(E=>E.selectedSheetId);const y=we(E=>E.themeStyle),b=we(E=>E.isSessionExpired),{isLoading:S,isError:_,isFetching:C}=CX({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:p,onFilterValuesChange:m});return S||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?x.jsx(o,{message:"loading"}):x.jsx("div",{className:"flex items-center gap-3",children:x.jsx(_u,{className:"h-1 w-full dark:h-[2px]"})})):_?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),x.jsx(i,{})):x.jsx("div",{children:"Error"})):b?(r==null||r({type:"error",message:"Session Expired"}),x.jsx("div",{className:"flex h-full items-center justify-center",children:x.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[x.jsx(yd,{children:"Session Expired"}),x.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):x.jsx("div",{className:xe("flex h-full flex-col justify-between",y==null?void 0:y.dashboardPanel,e),style:{},role:"dashboard-panel",...v})}function Te(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 EX(e,t){const n=R.createContext(t),r=i=>{const{children:s,...a}=i,l=R.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=R.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Jn(e,t=[]){let n=[];function r(i,s){const a=R.createContext(s),l=n.length;n=[...n,s];const c=d=>{var b;const{scope:h,children:p,...m}=d,v=((b=h==null?void 0:h[e])==null?void 0:b[l])||a,y=R.useMemo(()=>m,Object.values(m));return x.jsx(v.Provider,{value:y,children:p})};c.displayName=i+"Provider";function u(d,h){var v;const p=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,m=R.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>R.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return R.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,RX(o,...t)]}function RX(...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 d=l(i)[`__scope${c}`];return{...a,...d}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function wT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Iv(...e){return t=>{let n=!1;const r=e.map(o=>{const i=wT(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():wT(e[o],null)}}}}function at(...e){return R.useCallback(Iv(...e),e)}var Hs=R.forwardRef((e,t)=>{const{children:n,...r}=e,o=R.Children.toArray(n),i=o.find(PX);if(i){const s=i.props.children,a=o.map(l=>l===i?R.Children.count(s)>1?R.Children.only(null):R.isValidElement(s)?s.props.children:null:l);return x.jsx(zw,{...r,ref:t,children:R.isValidElement(s)?R.cloneElement(s,void 0,a):null})}return x.jsx(zw,{...r,ref:t,children:n})});Hs.displayName="Slot";var zw=R.forwardRef((e,t)=>{const{children:n,...r}=e;if(R.isValidElement(n)){const o=TX(n);return R.cloneElement(n,{...OX(r,n.props),ref:t?Iv(t,o):o})}return R.Children.count(n)>1?R.Children.only(null):null});zw.displayName="SlotClone";var eC=({children:e})=>x.jsx(x.Fragment,{children:e});function PX(e){return R.isValidElement(e)&&e.type===eC}function OX(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 TX(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)}function Nv(e){const t=e+"CollectionProvider",[n,r]=Jn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:m,children:v}=p,y=P.useRef(null),b=P.useRef(new Map).current;return x.jsx(o,{scope:m,itemMap:b,collectionRef:y,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=P.forwardRef((p,m)=>{const{scope:v,children:y}=p,b=i(a,v),S=at(m,b.collectionRef);return x.jsx(Hs,{ref:S,children:y})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=P.forwardRef((p,m)=>{const{scope:v,children:y,...b}=p,S=P.useRef(null),_=at(m,S),C=i(c,v);return P.useEffect(()=>(C.itemMap.set(S,{ref:S,...b}),()=>void C.itemMap.delete(S))),x.jsx(Hs,{[u]:"",ref:_,children:y})});d.displayName=c;function h(p){const m=i(e+"CollectionConsumer",p);return P.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((C,E)=>b.indexOf(C.ref.current)-b.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},h,r]}var fr=globalThis!=null&&globalThis.document?R.useLayoutEffect:()=>{},MX=R.useId||(()=>{}),AX=0;function qn(e){const[t,n]=R.useState(MX());return fr(()=>{e||n(r=>r??String(AX++))},[e]),e||(t?`radix-${t}`:"")}var DX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Be=DX.reduce((e,t)=>{const n=R.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Hs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function HN(e,t){e&&dc.flushSync(()=>e.dispatchEvent(t))}function Qn(e){const t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Cr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=kX({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Qn(n),l=R.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function kX({defaultProp:e,onChange:t}){const n=R.useState(e),[r]=n,o=R.useRef(r),i=Qn(t);return R.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var IX=R.createContext(void 0);function Mc(e){const t=R.useContext(IX);return e||t||"ltr"}var _x="rovingFocusGroup.onEntryFocus",NX={bubbles:!1,cancelable:!0},Lv="RovingFocusGroup",[Bw,VN,LX]=Nv(Lv),[FX,xd]=Jn(Lv,[LX]),[jX,$X]=FX(Lv),WN=R.forwardRef((e,t)=>x.jsx(Bw.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(Bw.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(zX,{...e,ref:t})})}));WN.displayName=Lv;var zX=R.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,h=R.useRef(null),p=at(t,h),m=Mc(i),[v=null,y]=Cr({prop:s,defaultProp:a,onChange:l}),[b,S]=R.useState(!1),_=Qn(c),C=VN(n),E=R.useRef(!1),[T,A]=R.useState(0);return R.useEffect(()=>{const D=h.current;if(D)return D.addEventListener(_x,_),()=>D.removeEventListener(_x,_)},[_]),x.jsx(jX,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:v,onItemFocus:R.useCallback(D=>y(D),[y]),onItemShiftTab:R.useCallback(()=>S(!0),[]),onFocusableItemAdd:R.useCallback(()=>A(D=>D+1),[]),onFocusableItemRemove:R.useCallback(()=>A(D=>D-1),[]),children:x.jsx(Be.div,{tabIndex:b||T===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{E.current=!0}),onFocus:Te(e.onFocus,D=>{const k=!E.current;if(D.target===D.currentTarget&&k&&!b){const j=new CustomEvent(_x,NX);if(D.currentTarget.dispatchEvent(j),!j.defaultPrevented){const $=C().filter(W=>W.focusable),z=$.find(W=>W.active),K=$.find(W=>W.id===v),N=[z,K,...$].filter(Boolean).map(W=>W.ref.current);qN(N,u)}}E.current=!1}),onBlur:Te(e.onBlur,()=>S(!1))})})}),UN="RovingFocusGroupItem",GN=R.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=qn(),l=i||a,c=$X(UN,n),u=c.currentTabStopId===l,d=VN(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return R.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),x.jsx(Bw.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:x.jsx(Be.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Te(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Te(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Te(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=VX(m,c.orientation,c.dir);if(v!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let b=d().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const S=b.indexOf(m.currentTarget);b=c.loop?WX(b,S+1):b.slice(S+1)}setTimeout(()=>qN(b))}})})})});GN.displayName=UN;var BX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function HX(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function VX(e,t,n){const r=HX(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return BX[r]}function qN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function WX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tC=WN,nC=GN;function UX(e,t){return R.useReducer((n,r)=>t[n][r]??n,e)}var Yn=e=>{const{present:t,children:n}=e,r=GX(t),o=typeof n=="function"?n({present:r.isPresent}):R.Children.only(n),i=at(r.ref,qX(o));return typeof n=="function"||r.isPresent?R.cloneElement(o,{ref:i}):null};Yn.displayName="Presence";function GX(e){const[t,n]=R.useState(),r=R.useRef({}),o=R.useRef(e),i=R.useRef("none"),s=e?"mounted":"unmounted",[a,l]=UX(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const c=Gg(r.current);i.current=a==="mounted"?c:"none"},[a]),fr(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=Gg(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),fr(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=p=>{const v=Gg(r.current).includes(p.animationName);if(p.target===t&&v&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(i.current=Gg(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:R.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Gg(e){return(e==null?void 0:e.animationName)||"none"}function qX(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 rC="Tabs",[YX,MOe]=Jn(rC,[xd]),YN=xd(),[KX,oC]=YX(rC),KN=R.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Mc(a),[d,h]=Cr({prop:r,onChange:o,defaultProp:i});return x.jsx(KX,{scope:n,baseId:qn(),value:d,onValueChange:h,orientation:s,dir:u,activationMode:l,children:x.jsx(Be.div,{dir:u,"data-orientation":s,...c,ref:t})})});KN.displayName=rC;var XN="TabsList",QN=R.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=oC(XN,n),s=YN(n);return x.jsx(tC,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:x.jsx(Be.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});QN.displayName=XN;var JN="TabsTrigger",ZN=R.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=oC(JN,n),a=YN(n),l=n5(s.baseId,r),c=r5(s.baseId,r),u=r===s.value;return x.jsx(nC,{asChild:!0,...a,focusable:!o,active:u,children:x.jsx(Be.button,{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:Te(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Te(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});ZN.displayName=JN;var e5="TabsContent",t5=R.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=oC(e5,n),l=n5(a.baseId,r),c=r5(a.baseId,r),u=r===a.value,d=R.useRef(u);return R.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),x.jsx(Yn,{present:o||u,children:({present:h})=>x.jsx(Be.div,{"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:d.current?"0s":void 0},children:h&&i})})});t5.displayName=e5;function n5(e,t){return`${e}-trigger-${t}`}function r5(e,t){return`${e}-content-${t}`}var XX=KN,o5=QN,i5=ZN,s5=t5;const iC=XX,Fv=R.forwardRef(({className:e,...t},n)=>x.jsx(o5,{ref:n,className:xe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Fv.displayName=o5.displayName;const jv=R.forwardRef(({className:e,...t},n)=>x.jsx(i5,{ref:n,className:xe("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}));jv.displayName=i5.displayName;const sC=R.forwardRef(({className:e,...t},n)=>x.jsx(s5,{ref:n,className:xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));sC.displayName=s5.displayName;var a5={exports:{}},wp={},Hw={exports:{}};(function(e,t){(function(n,r){r(t)})(xa,function(n){function r(J){return function(ce,ye,oe,ve,he,Ee,ke){return J(ce,ye,ke)}}function o(J){return function(ce,ye,oe,ve){if(!ce||!ye||typeof ce!="object"||typeof ye!="object")return J(ce,ye,oe,ve);var he=ve.get(ce),Ee=ve.get(ye);if(he&&Ee)return he===ye&&Ee===ce;ve.set(ce,ye),ve.set(ye,ce);var ke=J(ce,ye,oe,ve);return ve.delete(ce),ve.delete(ye),ke}}function i(J,le){var ce={};for(var ye in J)ce[ye]=J[ye];for(var ye in le)ce[ye]=le[ye];return ce}function s(J){return J.constructor===Object||J.constructor==null}function a(J){return typeof J.then=="function"}function l(J,le){return J===le||J!==J&&le!==le}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",p="[object Map]",m="[object Number]",v="[object Object]",y="[object Set]",b="[object String]",S=Object.prototype.toString;function _(J){var le=J.areArraysEqual,ce=J.areDatesEqual,ye=J.areMapsEqual,oe=J.areObjectsEqual,ve=J.areRegExpsEqual,he=J.areSetsEqual,Ee=J.createIsNestedEqual,ke=Ee(We);function We(Ie,Le,dt){if(Ie===Le)return!0;if(!Ie||!Le||typeof Ie!="object"||typeof Le!="object")return Ie!==Ie&&Le!==Le;if(s(Ie)&&s(Le))return oe(Ie,Le,ke,dt);var $t=Array.isArray(Ie),rn=Array.isArray(Le);if($t||rn)return $t===rn&&le(Ie,Le,ke,dt);var Nt=S.call(Ie);return Nt!==S.call(Le)?!1:Nt===d?ce(Ie,Le,ke,dt):Nt===h?ve(Ie,Le,ke,dt):Nt===p?ye(Ie,Le,ke,dt):Nt===y?he(Ie,Le,ke,dt):Nt===v||Nt===c?a(Ie)||a(Le)?!1:oe(Ie,Le,ke,dt):Nt===u||Nt===m||Nt===b?l(Ie.valueOf(),Le.valueOf()):!1}return We}function C(J,le,ce,ye){var oe=J.length;if(le.length!==oe)return!1;for(;oe-- >0;)if(!ce(J[oe],le[oe],oe,oe,J,le,ye))return!1;return!0}var E=o(C);function T(J,le){return l(J.valueOf(),le.valueOf())}function A(J,le,ce,ye){var oe=J.size===le.size;if(!oe)return!1;if(!J.size)return!0;var ve={},he=0;return J.forEach(function(Ee,ke){if(oe){var We=!1,Ie=0;le.forEach(function(Le,dt){!We&&!ve[Ie]&&(We=ce(ke,dt,he,Ie,J,le,ye)&&ce(Ee,Le,ke,dt,J,le,ye))&&(ve[Ie]=!0),Ie++}),he++,oe=We}}),oe}var D=o(A),k="_owner",j=Object.prototype.hasOwnProperty;function $(J,le,ce,ye){var oe=Object.keys(J),ve=oe.length;if(Object.keys(le).length!==ve)return!1;for(var he;ve-- >0;){if(he=oe[ve],he===k){var Ee=!!J.$$typeof,ke=!!le.$$typeof;if((Ee||ke)&&Ee!==ke)return!1}if(!j.call(le,he)||!ce(J[he],le[he],he,he,J,le,ye))return!1}return!0}var z=o($);function K(J,le){return J.source===le.source&&J.flags===le.flags}function V(J,le,ce,ye){var oe=J.size===le.size;if(!oe)return!1;if(!J.size)return!0;var ve={};return J.forEach(function(he,Ee){if(oe){var ke=!1,We=0;le.forEach(function(Ie,Le){!ke&&!ve[We]&&(ke=ce(he,Ie,Ee,Le,J,le,ye))&&(ve[We]=!0),We++}),oe=ke}}),oe}var N=o(V),W=Object.freeze({areArraysEqual:C,areDatesEqual:T,areMapsEqual:A,areObjectsEqual:$,areRegExpsEqual:K,areSetsEqual:V,createIsNestedEqual:r}),H=Object.freeze({areArraysEqual:E,areDatesEqual:T,areMapsEqual:D,areObjectsEqual:z,areRegExpsEqual:K,areSetsEqual:N,createIsNestedEqual:r}),G=_(W);function te(J,le){return G(J,le,void 0)}var F=_(i(W,{createIsNestedEqual:function(){return l}}));function Y(J,le){return F(J,le,void 0)}var q=_(H);function M(J,le){return q(J,le,new WeakMap)}var ne=_(i(H,{createIsNestedEqual:function(){return l}}));function X(J,le){return ne(J,le,new WeakMap)}function re(J){return _(i(W,J(W)))}function ee(J){var le=_(i(H,J(H)));return function(ce,ye,oe){return oe===void 0&&(oe=new WeakMap),le(ce,ye,oe)}}n.circularDeepEqual=M,n.circularShallowEqual=X,n.createCustomCircularEqual=ee,n.createCustomEqual=re,n.deepEqual=te,n.sameValueZeroEqual=l,n.shallowEqual=Y,Object.defineProperty(n,"__esModule",{value:!0})})})(Hw,Hw.exports);var aC=Hw.exports;const lC=j_(vY);var Tt={},QX=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(Tt,"__esModule",{value:!0});Tt.bottom=cC;Tt.childrenEqual=tQ;Tt.cloneLayout=l5;Tt.cloneLayoutItem=Jl;Tt.collides=$v;Tt.compact=u5;Tt.compactItem=d5;Tt.compactType=gQ;Tt.correctBounds=f5;Tt.fastPositionEqual=rQ;Tt.fastRGLPropsEqual=void 0;Tt.getAllCollisions=h5;Tt.getFirstCollision=Ll;Tt.getLayoutItem=uC;Tt.getStatics=dC;Tt.modifyLayout=c5;Tt.moveElement=Af;Tt.moveElementAwayFromCollision=Ww;Tt.noop=void 0;Tt.perc=iQ;Tt.resizeItemInDirection=dQ;Tt.setTopLeft=hQ;Tt.setTransform=fQ;Tt.sortLayoutItems=vC;Tt.sortLayoutItemsByColRow=b5;Tt.sortLayoutItemsByRowCol=v5;Tt.synchronizeLayoutWithChildren=pQ;Tt.validateLayout=y5;Tt.withLayoutItem=eQ;var ST=aC,Mf=JX(P);function JX(e){return e&&e.__esModule?e:{default:e}}const ZX=process.env.NODE_ENV==="production";function cC(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 l5(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Jl(e[n]);return t}function c5(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 eQ(e,t,n){let r=uC(e,t);return r?(r=n(Jl(r)),e=c5(e,r),[e,r]):[e,null]}function Jl(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 tQ(e,t){return(0,ST.deepEqual)(Mf.default.Children.map(e,n=>n==null?void 0:n.key),Mf.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,ST.deepEqual)(Mf.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Mf.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const nQ=QX;Tt.fastRGLPropsEqual=nQ;function rQ(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function $v(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 u5(e,t,n,r){const o=dC(e),i=vC(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=Jl(i[a]);c.static||(c=d5(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const oQ={x:"w",y:"h"};function Vw(e,t,n,r){const o=oQ[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;$v(t,a)&&Vw(e,a,n+t[o],r)}}t[r]=n}function d5(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(cC(e),t.y);t.y>0&&!Ll(e,t);)t.y--;else if(a)for(;t.x>0&&!Ll(e,t);)t.x--;let l;for(;(l=Ll(e,t))&&!(n===null&&i);)if(a?Vw(o,t,l.x+l.w,"x"):Vw(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ll(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function f5(e,t){const n=dC(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(;Ll(n,i);)i.y++}return e}function uC(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ll(e,t){for(let n=0,r=e.length;n<r;n++)if($v(e[n],t))return e[n]}function h5(e,t){return e.filter(n=>$v(n,t))}function dC(e){return e.filter(t=>t.static)}function Af(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 d=vC(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const p=h5(d,t),m=p.length>0;if(m&&l)return l5(e);if(m&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let v=0,y=p.length;v<y;v++){const b=p[v];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(b.i," at [").concat(b.x,",").concat(b.y,"]"),!b.moved&&(b.static?e=Ww(e,b,t,o,s):e=Ww(e,t,b,o,s))}return e}function Ww(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const d={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=Ll(e,d),p=h&&h.y+h.h>t.y,m=h&&t.x+t.w>h.x;if(h){if(p&&a)return Af(e,n,void 0,t.y+1,r,l,o);if(p&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(m&&s)return Af(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(d.x,",").concat(d.y,"]."),Af(e,n,s?d.x:void 0,a?d.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:Af(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function iQ(e){return e*100+"%"}const p5=(e,t,n,r)=>e+n>r?t:n,g5=(e,t,n)=>e<0?t:n,m5=e=>Math.max(0,e),fC=e=>Math.max(0,e),hC=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:g5(s,e.height,o),top:fC(s)}},pC=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:p5(e.left,e.width,s,n),left:m5(o)}},gC=(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:p5(e.left,e.width,i,n),top:fC(r),left:m5(s)}},mC=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:g5(r,e.height,i),top:fC(r)}},sQ=function(){return hC(arguments.length<=0?void 0:arguments[0],pC(...arguments))},aQ=function(){return hC(arguments.length<=0?void 0:arguments[0],gC(...arguments))},lQ=function(){return mC(arguments.length<=0?void 0:arguments[0],pC(...arguments))},cQ=function(){return mC(arguments.length<=0?void 0:arguments[0],gC(...arguments))},uQ={n:hC,ne:sQ,e:pC,se:lQ,s:mC,sw:cQ,w:gC,nw:aQ};function dQ(e,t,n,r){const o=uQ[e];return o?o(t,{...t,...n},r):n}function fQ(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 hQ(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 vC(e,t){return t==="horizontal"?b5(e):t==="vertical"?v5(e):e}function v5(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 b5(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 pQ(e,t,n,r,o){e=e||[];const i=[];Mf.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=uC(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(Jl(l)):c?(ZX||y5([c],"ReactGridLayout.children"),i.push(Jl({...c,i:a.key}))):i.push(Jl({w:1,h:1,x:0,y:cC(i),i:String(a.key)}))});const s=f5(i,{cols:n});return o?s:u5(s,r,n)}function y5(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 gQ(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const mQ=()=>{};Tt.noop=mQ;var is={};Object.defineProperty(is,"__esModule",{value:!0});is.calcGridColWidth=zv;is.calcGridItemPosition=vQ;is.calcGridItemWHPx=Uw;is.calcWH=yQ;is.calcXY=bQ;is.clamp=Fl;function zv(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Uw(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function vQ(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=zv(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Uw(r,c,s[0]),u.height=Uw(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 bQ(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=zv(e);let u=Math.round((n-i[0])/(c+i[0])),d=Math.round((t-i[1])/(a+i[1]));return u=Fl(u,0,s-r),d=Fl(d,0,l-o),{x:u,y:d}}function yQ(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=zv(e);let d=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),p=Fl(d,0,l-r),m=Fl(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Fl(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(m=Fl(h,0,a)),{w:p,h:m}}function Fl(e,t,n){return Math.max(Math.min(e,n),t)}var Bv={},Gw={exports:{}},Cx,_T;function bC(){if(_T)return Cx;_T=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Cx=e,Cx}var Ex,CT;function xQ(){if(CT)return Ex;CT=1;var e=bC();function t(){}function n(){}return n.resetWarningCache=t,Ex=function(){function r(s,a,l,c,u,d){if(d!==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},Ex}var qg={exports:{}},Xt={};/** @license React v16.13.1
89
+ * react-is.development.js
90
+ *
91
+ * Copyright (c) Facebook, Inc. and its affiliates.
92
+ *
93
+ * This source code is licensed under the MIT license found in the
94
+ * LICENSE file in the root directory of this source tree.
95
+ */var ET;function wQ(){return ET||(ET=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,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function _(oe){return typeof oe=="string"||typeof oe=="function"||oe===r||oe===c||oe===i||oe===o||oe===d||oe===h||typeof oe=="object"&&oe!==null&&(oe.$$typeof===m||oe.$$typeof===p||oe.$$typeof===s||oe.$$typeof===a||oe.$$typeof===u||oe.$$typeof===y||oe.$$typeof===b||oe.$$typeof===S||oe.$$typeof===v)}function C(oe){if(typeof oe=="object"&&oe!==null){var ve=oe.$$typeof;switch(ve){case t:var he=oe.type;switch(he){case l:case c:case r:case i:case o:case d:return he;default:var Ee=he&&he.$$typeof;switch(Ee){case a:case u:case m:case p:case s:return Ee;default:return ve}}case n:return ve}}}var E=l,T=c,A=a,D=s,k=t,j=u,$=r,z=m,K=p,V=n,N=i,W=o,H=d,G=!1;function te(oe){return G||(G=!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.")),F(oe)||C(oe)===l}function F(oe){return C(oe)===c}function Y(oe){return C(oe)===a}function q(oe){return C(oe)===s}function M(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===t}function ne(oe){return C(oe)===u}function X(oe){return C(oe)===r}function re(oe){return C(oe)===m}function ee(oe){return C(oe)===p}function J(oe){return C(oe)===n}function le(oe){return C(oe)===i}function ce(oe){return C(oe)===o}function ye(oe){return C(oe)===d}Xt.AsyncMode=E,Xt.ConcurrentMode=T,Xt.ContextConsumer=A,Xt.ContextProvider=D,Xt.Element=k,Xt.ForwardRef=j,Xt.Fragment=$,Xt.Lazy=z,Xt.Memo=K,Xt.Portal=V,Xt.Profiler=N,Xt.StrictMode=W,Xt.Suspense=H,Xt.isAsyncMode=te,Xt.isConcurrentMode=F,Xt.isContextConsumer=Y,Xt.isContextProvider=q,Xt.isElement=M,Xt.isForwardRef=ne,Xt.isFragment=X,Xt.isLazy=re,Xt.isMemo=ee,Xt.isPortal=J,Xt.isProfiler=le,Xt.isStrictMode=ce,Xt.isSuspense=ye,Xt.isValidElementType=_,Xt.typeOf=C}()),Xt}var Qt={};/** @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 RT;function SQ(){if(RT)return Qt;RT=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,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function _(E){if(typeof E=="object"&&E!==null){var T=E.$$typeof;switch(T){case t:switch(E=E.type,E){case l:case c:case r:case i:case o:case d:return E;default:switch(E=E&&E.$$typeof,E){case a:case u:case m:case p:case s:return E;default:return T}}case n:return T}}}function C(E){return _(E)===c}return Qt.AsyncMode=l,Qt.ConcurrentMode=c,Qt.ContextConsumer=a,Qt.ContextProvider=s,Qt.Element=t,Qt.ForwardRef=u,Qt.Fragment=r,Qt.Lazy=m,Qt.Memo=p,Qt.Portal=n,Qt.Profiler=i,Qt.StrictMode=o,Qt.Suspense=d,Qt.isAsyncMode=function(E){return C(E)||_(E)===l},Qt.isConcurrentMode=C,Qt.isContextConsumer=function(E){return _(E)===a},Qt.isContextProvider=function(E){return _(E)===s},Qt.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},Qt.isForwardRef=function(E){return _(E)===u},Qt.isFragment=function(E){return _(E)===r},Qt.isLazy=function(E){return _(E)===m},Qt.isMemo=function(E){return _(E)===p},Qt.isPortal=function(E){return _(E)===n},Qt.isProfiler=function(E){return _(E)===i},Qt.isStrictMode=function(E){return _(E)===o},Qt.isSuspense=function(E){return _(E)===d},Qt.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===c||E===i||E===o||E===d||E===h||typeof E=="object"&&E!==null&&(E.$$typeof===m||E.$$typeof===p||E.$$typeof===s||E.$$typeof===a||E.$$typeof===u||E.$$typeof===y||E.$$typeof===b||E.$$typeof===S||E.$$typeof===v)},Qt.typeOf=_,Qt}var PT;function x5(){return PT||(PT=1,process.env.NODE_ENV==="production"?qg.exports=SQ():qg.exports=wQ()),qg.exports}/*
103
+ object-assign
104
+ (c) Sindre Sorhus
105
+ @license MIT
106
+ */var Rx,OT;function _Q(){if(OT)return Rx;OT=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 Rx=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 d in a)t.call(a,d)&&(l[d]=a[d]);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},Rx}var Px,TT;function w5(){return TT||(TT=1,Px=Function.call.bind(Object.prototype.hasOwnProperty)),Px}var Ox,MT;function CQ(){if(MT)return Ox;MT=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=bC(),n={},r=w5();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 d;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}d=i[u](s,u,l,a,null,t)}catch(m){d=m}if(d&&!(d 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 d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var p=c?c():"";e("Failed "+a+" type: "+d.message+(p??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ox=o,Ox}var Tx,AT;function EQ(){if(AT)return Tx;AT=1;var e=x5(),t=_Q(),n=bC(),r=w5(),o=CQ(),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 Tx=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(F){var Y=F&&(c&&F[c]||F[u]);if(typeof Y=="function")return Y}var h="<<anonymous>>",p={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:S(),arrayOf:_,element:C(),elementType:E(),instanceOf:T,node:j(),objectOf:D,oneOf:A,oneOfType:k,shape:z,exact:K};function m(F,Y){return F===Y?F!==0||1/F===1/Y:F!==F&&Y!==Y}function v(F,Y){this.message=F,this.data=Y&&typeof Y=="object"?Y:{},this.stack=""}v.prototype=Error.prototype;function y(F){if(process.env.NODE_ENV!=="production")var Y={},q=0;function M(X,re,ee,J,le,ce,ye){if(J=J||h,ce=ce||ee,ye!==n){if(l){var oe=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 oe.name="Invariant Violation",oe}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ve=J+":"+ee;!Y[ve]&&q<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ce+"` prop on `"+J+"`. 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."),Y[ve]=!0,q++)}}return re[ee]==null?X?re[ee]===null?new v("The "+le+" `"+ce+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new v("The "+le+" `"+ce+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:F(re,ee,J,le,ce)}var ne=M.bind(null,!1);return ne.isRequired=M.bind(null,!0),ne}function b(F){function Y(q,M,ne,X,re,ee){var J=q[M],le=W(J);if(le!==F){var ce=H(J);return new v("Invalid "+X+" `"+re+"` of type "+("`"+ce+"` supplied to `"+ne+"`, expected ")+("`"+F+"`."),{expectedType:F})}return null}return y(Y)}function S(){return y(s)}function _(F){function Y(q,M,ne,X,re){if(typeof F!="function")return new v("Property `"+re+"` of component `"+ne+"` has invalid PropType notation inside arrayOf.");var ee=q[M];if(!Array.isArray(ee)){var J=W(ee);return new v("Invalid "+X+" `"+re+"` of type "+("`"+J+"` supplied to `"+ne+"`, expected an array."))}for(var le=0;le<ee.length;le++){var ce=F(ee,le,ne,X,re+"["+le+"]",n);if(ce instanceof Error)return ce}return null}return y(Y)}function C(){function F(Y,q,M,ne,X){var re=Y[q];if(!a(re)){var ee=W(re);return new v("Invalid "+ne+" `"+X+"` of type "+("`"+ee+"` supplied to `"+M+"`, expected a single ReactElement."))}return null}return y(F)}function E(){function F(Y,q,M,ne,X){var re=Y[q];if(!e.isValidElementType(re)){var ee=W(re);return new v("Invalid "+ne+" `"+X+"` of type "+("`"+ee+"` supplied to `"+M+"`, expected a single ReactElement type."))}return null}return y(F)}function T(F){function Y(q,M,ne,X,re){if(!(q[M]instanceof F)){var ee=F.name||h,J=te(q[M]);return new v("Invalid "+X+" `"+re+"` of type "+("`"+J+"` supplied to `"+ne+"`, expected ")+("instance of `"+ee+"`."))}return null}return y(Y)}function A(F){if(!Array.isArray(F))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 Y(q,M,ne,X,re){for(var ee=q[M],J=0;J<F.length;J++)if(m(ee,F[J]))return null;var le=JSON.stringify(F,function(ye,oe){var ve=H(oe);return ve==="symbol"?String(oe):oe});return new v("Invalid "+X+" `"+re+"` of value `"+String(ee)+"` "+("supplied to `"+ne+"`, expected one of "+le+"."))}return y(Y)}function D(F){function Y(q,M,ne,X,re){if(typeof F!="function")return new v("Property `"+re+"` of component `"+ne+"` has invalid PropType notation inside objectOf.");var ee=q[M],J=W(ee);if(J!=="object")return new v("Invalid "+X+" `"+re+"` of type "+("`"+J+"` supplied to `"+ne+"`, expected an object."));for(var le in ee)if(r(ee,le)){var ce=F(ee,le,ne,X,re+"."+le,n);if(ce instanceof Error)return ce}return null}return y(Y)}function k(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var Y=0;Y<F.length;Y++){var q=F[Y];if(typeof q!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+G(q)+" at index "+Y+"."),s}function M(ne,X,re,ee,J){for(var le=[],ce=0;ce<F.length;ce++){var ye=F[ce],oe=ye(ne,X,re,ee,J,n);if(oe==null)return null;oe.data&&r(oe.data,"expectedType")&&le.push(oe.data.expectedType)}var ve=le.length>0?", expected one of type ["+le.join(", ")+"]":"";return new v("Invalid "+ee+" `"+J+"` supplied to "+("`"+re+"`"+ve+"."))}return y(M)}function j(){function F(Y,q,M,ne,X){return V(Y[q])?null:new v("Invalid "+ne+" `"+X+"` supplied to "+("`"+M+"`, expected a ReactNode."))}return y(F)}function $(F,Y,q,M,ne){return new v((F||"React class")+": "+Y+" type `"+q+"."+M+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ne+"`.")}function z(F){function Y(q,M,ne,X,re){var ee=q[M],J=W(ee);if(J!=="object")return new v("Invalid "+X+" `"+re+"` of type `"+J+"` "+("supplied to `"+ne+"`, expected `object`."));for(var le in F){var ce=F[le];if(typeof ce!="function")return $(ne,X,re,le,H(ce));var ye=ce(ee,le,ne,X,re+"."+le,n);if(ye)return ye}return null}return y(Y)}function K(F){function Y(q,M,ne,X,re){var ee=q[M],J=W(ee);if(J!=="object")return new v("Invalid "+X+" `"+re+"` of type `"+J+"` "+("supplied to `"+ne+"`, expected `object`."));var le=t({},q[M],F);for(var ce in le){var ye=F[ce];if(r(F,ce)&&typeof ye!="function")return $(ne,X,re,ce,H(ye));if(!ye)return new v("Invalid "+X+" `"+re+"` key `"+ce+"` supplied to `"+ne+"`.\nBad object: "+JSON.stringify(q[M],null," ")+`
107
+ Valid keys: `+JSON.stringify(Object.keys(F),null," "));var oe=ye(ee,ce,ne,X,re+"."+ce,n);if(oe)return oe}return null}return y(Y)}function V(F){switch(typeof F){case"number":case"string":case"undefined":return!0;case"boolean":return!F;case"object":if(Array.isArray(F))return F.every(V);if(F===null||a(F))return!0;var Y=d(F);if(Y){var q=Y.call(F),M;if(Y!==F.entries){for(;!(M=q.next()).done;)if(!V(M.value))return!1}else for(;!(M=q.next()).done;){var ne=M.value;if(ne&&!V(ne[1]))return!1}}else return!1;return!0;default:return!1}}function N(F,Y){return F==="symbol"?!0:Y?Y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Y instanceof Symbol:!1}function W(F){var Y=typeof F;return Array.isArray(F)?"array":F instanceof RegExp?"object":N(Y,F)?"symbol":Y}function H(F){if(typeof F>"u"||F===null)return""+F;var Y=W(F);if(Y==="object"){if(F instanceof Date)return"date";if(F instanceof RegExp)return"regexp"}return Y}function G(F){var Y=H(F);switch(Y){case"array":case"object":return"an "+Y;case"boolean":case"date":case"regexp":return"a "+Y;default:return Y}}function te(F){return!F.constructor||!F.constructor.name?h:F.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},Tx}if(process.env.NODE_ENV!=="production"){var RQ=x5(),PQ=!0;Gw.exports=EQ()(RQ.isElement,PQ)}else Gw.exports=xQ()();var Ja=Gw.exports,Hv={exports:{}},S5={};function _5(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=_5(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function DT(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=_5(e))&&(r&&(r+=" "),r+=t);return r}const OQ=Object.freeze(Object.defineProperty({__proto__:null,clsx:DT,default:DT},Symbol.toStringTag,{value:"Module"})),TQ=j_(OQ);var Ln={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.dontSetMe=IQ;ss.findInArray=MQ;ss.int=kQ;ss.isFunction=AQ;ss.isNum=DQ;function MQ(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function AQ(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function DQ(e){return typeof e=="number"&&!isNaN(e)}function kQ(e){return parseInt(e,10)}function IQ(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 Ac={};Object.defineProperty(Ac,"__esModule",{value:!0});Ac.browserPrefixToKey=E5;Ac.browserPrefixToStyle=NQ;Ac.default=void 0;Ac.getPrefix=C5;const Mx=["Moz","Webkit","O","ms"];function C5(){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<Mx.length;r++)if(E5(t,Mx[r])in n)return Mx[r];return""}function E5(e,t){return t?"".concat(t).concat(LQ(e)):e}function NQ(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function LQ(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}Ac.default=C5();Object.defineProperty(Ln,"__esModule",{value:!0});Ln.addClassName=O5;Ln.addEvent=$Q;Ln.addUserSelectStyles=XQ;Ln.createCSSTransform=GQ;Ln.createSVGTransform=qQ;Ln.getTouch=YQ;Ln.getTouchIdentifier=KQ;Ln.getTranslation=yC;Ln.innerHeight=VQ;Ln.innerWidth=WQ;Ln.matchesSelector=P5;Ln.matchesSelectorAndParentsTo=jQ;Ln.offsetXYFromParent=UQ;Ln.outerHeight=BQ;Ln.outerWidth=HQ;Ln.removeClassName=T5;Ln.removeEvent=zQ;Ln.removeUserSelectStyles=QQ;var Eo=ss,kT=FQ(Ac);function R5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(R5=function(r){return r?n:t})(e)}function FQ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=R5(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 Yg="";function P5(e,t){return Yg||(Yg=(0,Eo.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Eo.isFunction)(e[n])})),(0,Eo.isFunction)(e[Yg])?e[Yg](t):!1}function jQ(e,t,n){let r=e;do{if(P5(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function $Q(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 zQ(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 BQ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Eo.int)(n.borderTopWidth),t+=(0,Eo.int)(n.borderBottomWidth),t}function HQ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Eo.int)(n.borderLeftWidth),t+=(0,Eo.int)(n.borderRightWidth),t}function VQ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Eo.int)(n.paddingTop),t-=(0,Eo.int)(n.paddingBottom),t}function WQ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Eo.int)(n.paddingLeft),t-=(0,Eo.int)(n.paddingRight),t}function UQ(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 GQ(e,t){const n=yC(e,t,"px");return{[(0,kT.browserPrefixToKey)("transform",kT.default)]:n}}function qQ(e,t){return yC(e,t,"")}function yC(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 YQ(e,t){return e.targetTouches&&(0,Eo.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Eo.findInArray)(e.changedTouches,n=>t===n.identifier)}function KQ(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function XQ(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&&O5(e.body,"react-draggable-transparent-selection")}function QQ(e){if(e)try{if(e.body&&T5(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 O5(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function T5(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var as={};Object.defineProperty(as,"__esModule",{value:!0});as.canDragX=eJ;as.canDragY=tJ;as.createCoreData=rJ;as.createDraggableData=oJ;as.getBoundPosition=JQ;as.getControlPosition=nJ;as.snapToGrid=ZQ;var mo=ss,pu=Ln;function JQ(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:iJ(r);const o=xC(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,mo.int)(u.paddingLeft)+(0,mo.int)(c.marginLeft),top:-o.offsetTop+(0,mo.int)(u.paddingTop)+(0,mo.int)(c.marginTop),right:(0,pu.innerWidth)(l)-(0,pu.outerWidth)(o)-o.offsetLeft+(0,mo.int)(u.paddingRight)-(0,mo.int)(c.marginRight),bottom:(0,pu.innerHeight)(l)-(0,pu.outerHeight)(o)-o.offsetTop+(0,mo.int)(u.paddingBottom)-(0,mo.int)(c.marginBottom)}}return(0,mo.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,mo.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,mo.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,mo.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function ZQ(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function eJ(e){return e.props.axis==="both"||e.props.axis==="x"}function tJ(e){return e.props.axis==="both"||e.props.axis==="y"}function nJ(e,t,n){const r=typeof t=="number"?(0,pu.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=xC(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,pu.offsetXYFromParent)(r||e,i,n.props.scale)}function rJ(e,t,n){const r=!(0,mo.isNum)(e.lastX),o=xC(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 oJ(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 iJ(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function xC(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Vv={},Wv={};Object.defineProperty(Wv,"__esModule",{value:!0});Wv.default=sJ;function sJ(){}Object.defineProperty(Vv,"__esModule",{value:!0});Vv.default=void 0;var Ax=lJ(P),Gr=wC(Ja),aJ=wC(wr),vr=Ln,fa=as,Dx=ss,nf=wC(Wv);function wC(e){return e&&e.__esModule?e:{default:e}}function M5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(M5=function(r){return r?n:t})(e)}function lJ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=M5(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=cJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cJ(e){var t=uJ(e,"string");return typeof t=="symbol"?t:String(t)}function uJ(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 di={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ha=di.mouse,Uv=class extends Ax.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,vr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,vr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,vr.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,fa.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,fa.createCoreData)(this,s,a);(0,nf.default)("DraggableCore: handleDragStart: %j",l),(0,nf.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,vr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,vr.addEvent)(r,ha.move,this.handleDrag),(0,vr.addEvent)(r,ha.stop,this.handleDragStop))}),Mr(this,"handleDrag",t=>{const n=(0,fa.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,fa.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,fa.createCoreData)(this,r,o);if((0,nf.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,fa.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,fa.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,fa.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,vr.removeUserSelectStyles)(a.ownerDocument),(0,nf.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,nf.default)("DraggableCore: Removing handlers"),(0,vr.removeEvent)(a.ownerDocument,ha.move,this.handleDrag),(0,vr.removeEvent)(a.ownerDocument,ha.stop,this.handleDragStop))}),Mr(this,"onMouseDown",t=>(ha=di.mouse,this.handleDragStart(t))),Mr(this,"onMouseUp",t=>(ha=di.mouse,this.handleDragStop(t))),Mr(this,"onTouchStart",t=>(ha=di.touch,this.handleDragStart(t))),Mr(this,"onTouchEnd",t=>(ha=di.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,vr.addEvent)(t,di.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,vr.removeEvent)(n,di.mouse.move,this.handleDrag),(0,vr.removeEvent)(n,di.touch.move,this.handleDrag),(0,vr.removeEvent)(n,di.mouse.stop,this.handleDragStop),(0,vr.removeEvent)(n,di.touch.stop,this.handleDragStop),(0,vr.removeEvent)(t,di.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,vr.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:aJ.default.findDOMNode(this)}render(){return Ax.cloneElement(Ax.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Vv.default=Uv;Mr(Uv,"displayName","DraggableCore");Mr(Uv,"propTypes",{allowAnyClick:Gr.default.bool,children:Gr.default.node.isRequired,disabled:Gr.default.bool,enableUserSelectHack:Gr.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:Gr.default.arrayOf(Gr.default.number),handle:Gr.default.string,cancel:Gr.default.string,nodeRef:Gr.default.object,onStart:Gr.default.func,onDrag:Gr.default.func,onStop:Gr.default.func,onMouseDown:Gr.default.func,scale:Gr.default.number,className:Dx.dontSetMe,style:Dx.dontSetMe,transform:Dx.dontSetMe});Mr(Uv,"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(P),n=u(Ja),r=u(wr),o=u(TQ),i=Ln,s=as,a=ss,l=u(Vv),c=u(Wv);function u(S){return S&&S.__esModule?S:{default:S}}function d(S){if(typeof WeakMap!="function")return null;var _=new WeakMap,C=new WeakMap;return(d=function(E){return E?C:_})(S)}function h(S,_){if(!_&&S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var C=d(_);if(C&&C.has(S))return C.get(S);var E={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in S)if(A!=="default"&&Object.prototype.hasOwnProperty.call(S,A)){var D=T?Object.getOwnPropertyDescriptor(S,A):null;D&&(D.get||D.set)?Object.defineProperty(E,A,D):E[A]=S[A]}return E.default=S,C&&C.set(S,E),E}function p(){return p=Object.assign?Object.assign.bind():function(S){for(var _=1;_<arguments.length;_++){var C=arguments[_];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(S[E]=C[E])}return S},p.apply(this,arguments)}function m(S,_,C){return _=v(_),_ in S?Object.defineProperty(S,_,{value:C,enumerable:!0,configurable:!0,writable:!0}):S[_]=C,S}function v(S){var _=y(S,"string");return typeof _=="symbol"?_:String(_)}function y(S,_){if(typeof S!="object"||S===null)return S;var C=S[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(_==="string"?String:Number)(S)}class b extends t.Component{static getDerivedStateFromProps(_,C){let{position:E}=_,{prevPropsPosition:T}=C;return E&&(!T||E.x!==T.x||E.y!==T.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:T}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(_){super(_),m(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})}),m(this,"onDrag",(C,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const T=(0,s.createDraggableData)(this,E),A={x:T.x,y:T.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:j}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[$,z]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=$,A.y=z,A.slackX=this.state.slackX+(k-A.x),A.slackY=this.state.slackY+(j-A.y),T.x=A.x,T.y=A.y,T.deltaX=A.x-this.state.x,T.deltaY=A.y-this.state.y}if(this.props.onDrag(C,T)===!1)return!1;this.setState(A)}),m(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:k,y:j}=this.props.position;A.x=k,A.y=j}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:_.position?_.position.x:_.defaultPosition.x,y:_.position?_.position.y:_.defaultPosition.y,prevPropsPosition:{..._.position},slackX:0,slackY:0,isElementSVG:!1},_.position&&!(_.onDrag||_.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var _,C;return(_=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&_!==void 0?_:r.default.findDOMNode(this)}render(){const{axis:_,bounds:C,children:E,defaultPosition:T,defaultClassName:A,defaultClassNameDragging:D,defaultClassNameDragged:k,position:j,positionOffset:$,scale:z,...K}=this.props;let V={},N=null;const H=!!!j||this.state.dragging,G=j||T,te={x:(0,s.canDragX)(this)&&H?this.state.x:G.x,y:(0,s.canDragY)(this)&&H?this.state.y:G.y};this.state.isElementSVG?N=(0,i.createSVGTransform)(te,$):V=(0,i.createCSSTransform)(te,$);const F=(0,o.default)(E.props.className||"",A,{[D]:this.state.dragging,[k]:this.state.dragged});return t.createElement(l.default,p({},K,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:F,style:{...E.props.style,...V},transform:N}))}}e.default=b,m(b,"displayName","Draggable"),m(b,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(b,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(S5);const{default:A5,DraggableCore:dJ}=S5;Hv.exports=A5;Hv.exports.default=A5;Hv.exports.DraggableCore=dJ;var D5=Hv.exports,Gv={exports:{}},Sp={},SC={};SC.__esModule=!0;SC.cloneElement=vJ;var fJ=hJ(P);function hJ(e){return e&&e.__esModule?e:{default:e}}function IT(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 NT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IT(Object(n),!0).forEach(function(r){pJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pJ(e,t,n){return t=gJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gJ(e){var t=mJ(e,"string");return typeof t=="symbol"?t:String(t)}function mJ(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 vJ(e,t){return t.style&&e.props.style&&(t.style=NT(NT({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),fJ.default.cloneElement(e,t)}var _p={};_p.__esModule=!0;_p.resizableProps=void 0;var yt=bJ(Ja);function bJ(e){return e&&e.__esModule?e:{default:e}}var yJ={axis:yt.default.oneOf(["both","x","y","none"]),className:yt.default.string,children:yt.default.element.isRequired,draggableOpts:yt.default.shape({allowAnyClick:yt.default.bool,cancel:yt.default.string,children:yt.default.node,disabled:yt.default.bool,enableUserSelectHack:yt.default.bool,offsetParent:yt.default.node,grid:yt.default.arrayOf(yt.default.number),handle:yt.default.string,nodeRef:yt.default.object,onStart:yt.default.func,onDrag:yt.default.func,onStop:yt.default.func,onMouseDown:yt.default.func,scale:yt.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=yt.default.number).isRequired.apply(i,n)}return yt.default.number.apply(yt.default,n)},handle:yt.default.oneOfType([yt.default.node,yt.default.func]),handleSize:yt.default.arrayOf(yt.default.number),lockAspectRatio:yt.default.bool,maxConstraints:yt.default.arrayOf(yt.default.number),minConstraints:yt.default.arrayOf(yt.default.number),onResizeStop:yt.default.func,onResizeStart:yt.default.func,onResize:yt.default.func,resizeHandles:yt.default.arrayOf(yt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:yt.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=yt.default.number).isRequired.apply(i,n)}return yt.default.number.apply(yt.default,n)}};_p.resizableProps=yJ;Sp.__esModule=!0;Sp.default=void 0;var rf=CJ(P),xJ=D5,wJ=SC,SJ=_p,_J=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function k5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(k5=function(o){return o?n:t})(e)}function CJ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=k5(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 qw(){return qw=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},qw.apply(this,arguments)}function EJ(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 LT(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 kx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LT(Object(n),!0).forEach(function(r){RJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RJ(e,t,n){return t=PJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PJ(e){var t=OJ(e,"string");return typeof t=="symbol"?t:String(t)}function OJ(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 TJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Yw(e,t)}function Yw(e,t){return Yw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Yw(e,t)}var _C=function(e){TJ(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,d=o-this.props.width,h=i-this.props.height;Math.abs(d)>Math.abs(h*u)?i=o/u:o=i*u}var p=o,m=i,v=this.slack||[0,0],y=v[0],b=v[1];return o+=y,i+=b,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=[y+(p-o),b+(m-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&s.resetData();var h=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!h&&!p)){var m=i[0],v=i[i.length-1],y=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(v==="w"){var b=y.left-s.lastHandleRect.left;u+=b}if(m==="n"){var S=y.top-s.lastHandleRect.top;d+=S}}s.lastHandleRect=y,v==="w"&&(u=-u),m==="n"&&(d=-d);var _=s.props.width+(h?u/s.props.transformScale:0),C=s.props.height+(p?d/s.props.transformScale:0),E=s.runConstraints(_,C);_=E[0],C=E[1];var T=_!==s.props.width||C!==s.props.height,A=typeof s.props[o]=="function"?s.props[o]:null,D=o==="onResize"&&!T;A&&!D&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:_,height:C},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return rf.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=kx({ref:i},a?{}:{handleAxis:o});return rf.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=EJ(i,_J);return(0,wJ.cloneElement)(s,kx(kx({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var h,p=(h=o.handleRefs[d])!=null?h:o.handleRefs[d]=rf.createRef();return rf.createElement(xJ.DraggableCore,qw({},l,{nodeRef:p,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,p))}))}))},t}(rf.Component);Sp.default=_C;_C.propTypes=SJ.resizableProps;_C.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var qv={};qv.__esModule=!0;qv.default=void 0;var Ix=IJ(P),MJ=I5(Ja),AJ=I5(Sp),DJ=_p,kJ=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function I5(e){return e&&e.__esModule?e:{default:e}}function N5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(N5=function(o){return o?n:t})(e)}function IJ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=N5(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 Kw(){return Kw=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},Kw.apply(this,arguments)}function FT(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 S0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FT(Object(n),!0).forEach(function(r){NJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NJ(e,t,n){return t=LJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LJ(e){var t=FJ(e,"string");return typeof t=="symbol"?t:String(t)}function FJ(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 jJ(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 $J(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Xw(e,t)}function Xw(e,t){return Xw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Xw(e,t)}var L5=function(e){$J(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,d=o.maxConstraints,h=o.lockAspectRatio,p=o.axis;o.width,o.height;var m=o.resizeHandles,v=o.style,y=o.transformScale,b=jJ(o,kJ);return Ix.createElement(AJ.default,{axis:p,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:h,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:m,transformScale:y,width:this.state.width},Ix.createElement("div",Kw({},b,{style:S0(S0({},v),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ix.Component);qv.default=L5;L5.propTypes=S0(S0({},DJ.resizableProps),{},{children:MJ.default.element});Gv.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Gv.exports.Resizable=Sp.default;Gv.exports.ResizableBox=qv.default;var zJ=Gv.exports,zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.resizeHandleType=zs.resizeHandleAxesType=zs.default=void 0;var Ct=F5(Ja),BJ=F5(P);function F5(e){return e&&e.__esModule?e:{default:e}}const j5=Ct.default.arrayOf(Ct.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));zs.resizeHandleAxesType=j5;const $5=Ct.default.oneOfType([Ct.default.node,Ct.default.func]);zs.resizeHandleType=$5;var HJ={className:Ct.default.string,style:Ct.default.object,width:Ct.default.number,autoSize:Ct.default.bool,cols:Ct.default.number,draggableCancel:Ct.default.string,draggableHandle:Ct.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:Ct.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Tt.validateLayout(t,"layout")},margin:Ct.default.arrayOf(Ct.default.number),containerPadding:Ct.default.arrayOf(Ct.default.number),rowHeight:Ct.default.number,maxRows:Ct.default.number,isBounded:Ct.default.bool,isDraggable:Ct.default.bool,isResizable:Ct.default.bool,allowOverlap:Ct.default.bool,preventCollision:Ct.default.bool,useCSSTransforms:Ct.default.bool,transformScale:Ct.default.number,isDroppable:Ct.default.bool,resizeHandles:j5,resizeHandle:$5,onLayoutChange:Ct.default.func,onDragStart:Ct.default.func,onDrag:Ct.default.func,onDragStop:Ct.default.func,onResizeStart:Ct.default.func,onResize:Ct.default.func,onResizeStop:Ct.default.func,onDrop:Ct.default.func,droppingItem:Ct.default.shape({i:Ct.default.string.isRequired,w:Ct.default.number.isRequired,h:Ct.default.number.isRequired}),children:function(e,t){const n=e[t],r={};BJ.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:Ct.default.any};zs.default=HJ;Object.defineProperty(Bv,"__esModule",{value:!0});Bv.default=void 0;var Jc=CC(P),Ut=CC(Ja),VJ=D5,WJ=zJ,Zc=Tt,lr=is,jT=zs,UJ=CC(lC);function CC(e){return e&&e.__esModule?e:{default:e}}function Ni(e,t,n){return t=GJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GJ(e){var t=qJ(e,"string");return typeof t=="symbol"?t:String(t)}function qJ(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 EC extends Jc.default.Component{constructor(){super(...arguments),Ni(this,"state",{resizing:null,dragging:null,className:""}),Ni(this,"elementRef",Jc.default.createRef()),Ni(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,d=l.left/i,h=c.top/i,p=l.top/i;s.left=u-d+a.scrollLeft,s.top=h-p+a.scrollTop,this.setState({dragging:s});const{x:m,y:v}=(0,lr.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,m,v,{e:t,node:r,newPosition:s})}),Ni(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:d,h,containerWidth:p}=this.props,m=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:_,rowHeight:C}=this.props,E=S.clientHeight-(0,lr.calcGridItemWHPx)(h,C,_[1]);a=(0,lr.clamp)(a,0,E);const T=(0,lr.calcGridColWidth)(m),A=p-(0,lr.calcGridItemWHPx)(d,T,_[0]);l=(0,lr.clamp)(l,0,A)}}const v={top:a,left:l};this.setState({dragging:v});const{x:y,y:b}=(0,lr.calcXY)(m,a,l,d,h);return s.call(this,u,y,b,{e:t,node:r,newPosition:v})}),Ni(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:d,y:h}=(0,lr.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,d,h,{e:t,node:r,newPosition:u})}),Ni(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Ni(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Ni(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,lr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,lr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Zc.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,Zc.setTransform)(t):(i=(0,Zc.setTopLeft)(t),n&&(i.left=(0,Zc.perc)(t.left/r),i.width=(0,Zc.perc)(t.width/r))),i}mixinDraggable(t,n){return Jc.default.createElement(VJ.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:d}=this.props,h=this.getPositionParams(),p=(0,lr.calcGridItemPosition)(h,0,0,o,0).width,m=(0,lr.calcGridItemPosition)(h,0,0,i,s),v=(0,lr.calcGridItemPosition)(h,0,0,a,l),y=[m.width,m.height],b=[Math.min(v.width,p),Math.min(v.height,1/0)];return Jc.default.createElement(WJ.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:y,maxConstraints:b,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},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:d,maxH:h,minH:p,containerWidth:m}=this.props,{minW:v,maxW:y}=this.props;let b=s;i&&(b=(0,Zc.resizeItemInDirection)(a,r,s,m),this.setState({resizing:o==="onResizeStop"?null:b}));let{w:S,h:_}=(0,lr.calcWH)(this.getPositionParams(),b.width,b.height,c,u,a);S=(0,lr.clamp)(S,Math.max(v,1),y),_=(0,lr.clamp)(_,p,h),l.call(this,d,S,_,{e:t,node:i,size:b,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,lr.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Jc.default.Children.only(this.props.children);let d=Jc.default.cloneElement(u,{ref:this.elementRef,className:(0,UJ.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 d=this.mixinResizable(d,c,s),d=this.mixinDraggable(d,i),d}}Bv.default=EC;Ni(EC,"propTypes",{children:Ut.default.element,cols:Ut.default.number.isRequired,containerWidth:Ut.default.number.isRequired,rowHeight:Ut.default.number.isRequired,margin:Ut.default.array.isRequired,maxRows:Ut.default.number.isRequired,containerPadding:Ut.default.array.isRequired,x:Ut.default.number.isRequired,y:Ut.default.number.isRequired,w:Ut.default.number.isRequired,h:Ut.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:Ut.default.string.isRequired,resizeHandles:jT.resizeHandleAxesType,resizeHandle:jT.resizeHandleType,onDragStop:Ut.default.func,onDragStart:Ut.default.func,onDrag:Ut.default.func,onResizeStop:Ut.default.func,onResizeStart:Ut.default.func,onResize:Ut.default.func,isDraggable:Ut.default.bool.isRequired,isResizable:Ut.default.bool.isRequired,isBounded:Ut.default.bool.isRequired,static:Ut.default.bool,useCSSTransforms:Ut.default.bool.isRequired,transformScale:Ut.default.number,className:Ut.default.string,handle:Ut.default.string,cancel:Ut.default.string,droppingPosition:Ut.default.shape({e:Ut.default.object.isRequired,left:Ut.default.number.isRequired,top:Ut.default.number.isRequired})});Ni(EC,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(wp,"__esModule",{value:!0});wp.default=void 0;var ml=QJ(P),Nx=aC,YJ=RC(lC),it=Tt,KJ=is,$T=RC(Bv),XJ=RC(zs);function RC(e){return e&&e.__esModule?e:{default:e}}function z5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(z5=function(r){return r?n:t})(e)}function QJ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=z5(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 br(e,t,n){return t=JJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JJ(e){var t=ZJ(e,"string");return typeof t=="symbol"?t:String(t)}function ZJ(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 zT="react-grid-layout";let B5=!1;try{B5=/firefox/i.test(navigator.userAgent)}catch{}class Yv extends ml.Component{constructor(){super(...arguments),br(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:[]}),br(this,"dragEnterCounter",0),br(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)}),br(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:d}=this.props,h=(0,it.getLayoutItem)(l,t);if(!h)return;const p={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t},m=!0;l=(0,it.moveElement)(l,h,n,r,m,d,(0,it.compactType)(this.props),c,u),this.props.onDrag(l,a,h,p,i,s),this.setState({layout:u?l:(0,it.compact)(l,(0,it.compactType)(this.props),c),activeDrag:p})}),br(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:d}=this.props,h=(0,it.getLayoutItem)(l,t);if(!h)return;const p=!0;l=(0,it.moveElement)(l,h,n,r,p,u,(0,it.compactType)(this.props),c,d);const m=d?l:(0,it.compact)(l,(0,it.compactType)(this.props),c);this.props.onDragStop(m,a,h,null,i,s);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:m,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(m,v)}),br(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))}),br(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:d,preventCollision:h,allowOverlap:p}=this.props;let m=!1,v,y,b;const[S,_]=(0,it.withLayoutItem)(u,t,E=>{let T;return y=E.x,b=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(y=E.x+(E.w-n),n=E.x!==y&&y<0?E.w:n,y=y<0?0:y),["ne","n","nw"].indexOf(l)!==-1&&(b=E.y+(E.h-r),r=E.y!==b&&b<0?E.h:r,b=b<0?0:b),m=!0),h&&!p&&(T=(0,it.getAllCollisions)(u,{...E,w:n,h:r,x:y,y:b}).filter(D=>D.i!==E.i).length>0,T&&(b=E.y,r=E.h,y=E.x,n=E.w,m=!1)),E.w=n,E.h=r,E});if(!_)return;v=S,m&&(v=(0,it.moveElement)(S,_,y,b,!0,this.props.preventCollision,(0,it.compactType)(this.props),d,p));const C={w:_.w,h:_.h,x:_.x,y:_.y,static:!0,i:t};this.props.onResize(v,c,_,C,i,s),this.setState({layout:p?v:(0,it.compact)(v,(0,it.compactType)(this.props),d),activeDrag:C})}),br(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,d=(0,it.getLayoutItem)(a,t),h=u?a:(0,it.compact)(a,(0,it.compactType)(this.props),c);this.props.onResizeStop(h,l,d,null,i,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,p)}),br(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),B5&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(zT)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:d}=this.props,h=o==null?void 0:o(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...h},{layout:m}=this.state,{layerX:v,layerY:y}=t.nativeEvent,b={left:v/d,top:y/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:S,top:_}=this.state.droppingPosition;(S!=v||_!=y)&&this.setState({droppingPosition:b})}}else{const S={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},_=(0,KJ.calcXY)(S,y,v,p.w,p.h);this.setState({droppingDOMNode:ml.createElement("div",{key:p.i}),droppingPosition:b,layout:[...m,{...p,x:_.x,y:_.y,static:!1,isDraggable:!0}]})}}),br(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})}),br(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),br(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),br(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,Nx.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,Nx.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,Nx.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 ml.createElement($T.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},ml.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:d,isBounded:h,useCSSTransforms:p,transformScale:m,draggableCancel:v,draggableHandle:y,resizeHandles:b,resizeHandle:S}=this.props,{mounted:_,droppingPosition:C}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,T=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,A=r.resizeHandles||b,D=E&&h&&r.isBounded!==!1;return ml.createElement($T.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:v,handle:y,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:T,isBounded:D,useCSSTransforms:p&&_,usePercentages:!_,transformScale:m,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:S},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,YJ.default)(zT,t),s={height:this.containerHeight(),...n};return ml.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},ml.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}wp.default=Yv;br(Yv,"displayName","ReactGridLayout");br(Yv,"propTypes",XJ.default);br(Yv,"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 Kv={},Dc={};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.findOrGenerateResponsiveLayout=nZ;Dc.getBreakpointFromWidth=eZ;Dc.getColsFromBreakpoint=tZ;Dc.sortBreakpoints=PC;var Kg=Tt;function eZ(e,t){const n=PC(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 tZ(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function nZ(e,t,n,r,o,i){if(e[n])return(0,Kg.cloneLayout)(e[n]);let s=e[r];const a=PC(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){s=e[d];break}}return s=(0,Kg.cloneLayout)(s||[]),(0,Kg.compact)((0,Kg.correctBounds)(s,{cols:o}),i,o)}function PC(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Kv,"__esModule",{value:!0});Kv.default=void 0;var BT=oZ(P),qr=H5(Ja),Lx=aC,Cu=Tt,vl=Dc,rZ=H5(wp);function H5(e){return e&&e.__esModule?e:{default:e}}function V5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(V5=function(r){return r?n:t})(e)}function oZ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=V5(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 Qw(){return Qw=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},Qw.apply(this,arguments)}function _0(e,t,n){return t=iZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iZ(e){var t=sZ(e,"string");return typeof t=="symbol"?t:String(t)}function sZ(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 HT=e=>Object.prototype.toString.call(e);function Xg(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class OC extends BT.Component{constructor(){super(...arguments),_0(this,"state",this.generateInitialState()),_0(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,vl.getBreakpointFromWidth)(n,t),s=(0,vl.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,vl.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Lx.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,vl.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,Lx.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Lx.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,vl.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,vl.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Cu.cloneLayout)(this.state.layout));let h=(0,vl.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);h=(0,Cu.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=Xg(this.props.margin,s),d=Xg(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return BT.createElement(rZ.default,Qw({},u,{margin:Xg(i,this.state.breakpoint),containerPadding:Xg(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Kv.default=OC;_0(OC,"propTypes",{breakpoint:qr.default.string,breakpoints:qr.default.object,allowOverlap:qr.default.bool,cols:qr.default.object,margin:qr.default.oneOfType([qr.default.array,qr.default.object]),containerPadding:qr.default.oneOfType([qr.default.array,qr.default.object]),layouts(e,t){if(HT(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+HT(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,Cu.validateLayout)(e.layouts[n],"layouts."+n)})},width:qr.default.number.isRequired,onBreakpointChange:qr.default.func,onLayoutChange:qr.default.func,onWidthChange:qr.default.func});_0(OC,"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:Cu.noop,onLayoutChange:Cu.noop,onWidthChange:Cu.noop});var TC={},W5=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}()}(),Jw=typeof window<"u"&&typeof document<"u"&&window.document===document,C0=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")()}(),aZ=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(C0):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),lZ=2;function cZ(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){aZ(i)}function a(){var l=Date.now();if(n){if(l-o<lZ)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var uZ=20,dZ=["top","right","bottom","left","width","height","size","weight"],fZ=typeof MutationObserver<"u",hZ=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=cZ(this.refresh.bind(this),uZ)}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(){!Jw||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),fZ?(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(){!Jw||!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=dZ.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}(),U5=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},Qu=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||C0},G5=Xv(0,0,0,0);function E0(e){return parseFloat(e)||0}function VT(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+E0(i)},0)}function pZ(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]=E0(s)}return n}function gZ(e){var t=e.getBBox();return Xv(0,0,t.width,t.height)}function mZ(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return G5;var r=Qu(e).getComputedStyle(e),o=pZ(r),i=o.left+o.right,s=o.top+o.bottom,a=E0(r.width),l=E0(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=VT(r,"left","right")+i),Math.round(l+s)!==n&&(l-=VT(r,"top","bottom")+s)),!bZ(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 Xv(o.left,o.top,a,l)}var vZ=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Qu(e).SVGGraphicsElement}:function(e){return e instanceof Qu(e).SVGElement&&typeof e.getBBox=="function"}}();function bZ(e){return e===Qu(e).document.documentElement}function yZ(e){return Jw?vZ(e)?gZ(e):mZ(e):G5}function xZ(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 U5(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Xv(e,t,n,r){return{x:e,y:t,width:n,height:r}}var wZ=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Xv(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=yZ(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}(),SZ=function(){function e(t,n){var r=xZ(n);U5(this,{target:t,contentRect:r})}return e}(),_Z=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new W5,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 Qu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new wZ(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 Qu(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 SZ(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}(),q5=typeof WeakMap<"u"?new WeakMap:new W5,Y5=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=hZ.getInstance(),r=new _Z(t,n,this);q5.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Y5.prototype[e]=function(){var t;return(t=q5.get(this))[e].apply(t,arguments)}});var CZ=function(){return typeof C0.ResizeObserver<"u"?C0.ResizeObserver:Y5}();const EZ=Object.freeze(Object.defineProperty({__proto__:null,default:CZ},Symbol.toStringTag,{value:"Module"})),RZ=j_(EZ);Object.defineProperty(TC,"__esModule",{value:!0});TC.default=IZ;var Qg=MZ(P),PZ=MC(Ja),OZ=MC(RZ),TZ=MC(lC);function MC(e){return e&&e.__esModule?e:{default:e}}function K5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(K5=function(r){return r?n:t})(e)}function MZ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=K5(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 Zw(){return Zw=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},Zw.apply(this,arguments)}function eu(e,t,n){return t=AZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AZ(e){var t=DZ(e,"string");return typeof t=="symbol"?t:String(t)}function DZ(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 kZ="react-grid-layout";function IZ(e){var t;return t=class extends Qg.Component{constructor(){super(...arguments),eu(this,"state",{width:1280}),eu(this,"elementRef",Qg.createRef()),eu(this,"mounted",!1),eu(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new OZ.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?Qg.createElement("div",{className:(0,TZ.default)(this.props.className,kZ),style:this.props.style,ref:this.elementRef}):Qg.createElement(e,Zw({innerRef:this.elementRef},o,this.state))}},eu(t,"defaultProps",{measureBeforeMount:!1}),eu(t,"propTypes",{measureBeforeMount:PZ.default.bool}),t}(function(e){e.exports=wp.default,e.exports.utils=Tt,e.exports.calculateUtils=is,e.exports.Responsive=Kv.default,e.exports.Responsive.utils=Dc,e.exports.WidthProvider=TC.default})(a5);var WT=a5.exports;function zr(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 NZ=["color"],LZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,NZ);return P.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}),P.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),FZ=["color"],X5=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,FZ);return P.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}),P.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"}))}),jZ=["color"],$Z=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,jZ);return P.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}),P.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"}))}),zZ=["color"],BZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,zZ);return P.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}),P.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"}))}),HZ=["color"],Q5=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,HZ);return P.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}),P.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"}))}),VZ=["color"],WZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,VZ);return P.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}),P.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}))}),UZ=["color"],GZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,UZ);return P.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}),P.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"}))}),qZ=["color"],YZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,qZ);return P.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}),P.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"}))}),KZ=["color"],XZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,KZ);return P.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}),P.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"}))}),QZ=["color"],J5=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,QZ);return P.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}),P.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"}))}),JZ=["color"],ZZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,JZ);return P.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}),P.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"}))}),eee=["color"],tee=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,eee);return P.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}),P.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"}))}),nee=["color"],ree=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,nee);return P.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}),P.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"}))}),oee=["color"],Z5=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,oee);return P.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}),P.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),iee=["color"],e4=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=zr(e,iee);return P.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}),P.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Jg;const see=new Uint8Array(16);function aee(){if(!Jg&&(Jg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Jg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jg(see)}const cr=[];for(let e=0;e<256;++e)cr.push((e+256).toString(16).slice(1));function lee(e,t=0){return cr[e[t+0]]+cr[e[t+1]]+cr[e[t+2]]+cr[e[t+3]]+"-"+cr[e[t+4]]+cr[e[t+5]]+"-"+cr[e[t+6]]+cr[e[t+7]]+"-"+cr[e[t+8]]+cr[e[t+9]]+"-"+cr[e[t+10]]+cr[e[t+11]]+cr[e[t+12]]+cr[e[t+13]]+cr[e[t+14]]+cr[e[t+15]]}const cee=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),UT={randomUUID:cee};function Ba(e,t,n){if(UT.randomUUID&&!t&&!e)return UT.randomUUID();e=e||{};const r=e.random||(e.rng||aee)();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 lee(r)}const Nr=lN()(gN((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:Ba(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Ba(),cards:[],activeCardId:""},actions:{setCustomCardPreferences:n=>{e(r=>{r.card.customCardPreferences=n})},setChartOrientation:n=>{e(r=>{var s,a,l,c,u,d;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:{...(d=o==null?void 0:o.chartOptions)==null?void 0:d.scales,...i},indexAxis:n}}})},setSortChart:n=>{e(r=>{r.card.preferences={...r.card.preferences,sortChart: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]})},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})}}}))),Qv=()=>Nr(e=>e.actions);function uee(e,t,n){var l,c,u,d;const r=n==null?void 0:n.datasetOptions,o=we.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,s=(d=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:d.borderColor;return e.map((h,p)=>{var _;const m=r==null?void 0:r.find(C=>C.idx===p),v=i==null?void 0:i[p%i.length],y=s==null?void 0:s[p%s.length],b=s==null?void 0:s[p%s.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(C=>C[h]),...m,datalabels:{...m==null?void 0:m.datalabels,color:dee((_=m==null?void 0:m.datalabels)==null?void 0:_.align,v)},backgroundColor:v,pointBackgroundColor:y,borderColor:b}})}function dee(e,t){return Xu(e==="end"||e==="start"?vh():t)}function fee(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=nr(e);let r=[];const o=we.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 d=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:d}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(h=>h[n==null?void 0:n[1]]))].map((h,p)=>{const m=e.filter(v=>v[n==null?void 0:n[1]]===h);return{label:h,data:m.map(v=>({x:v[t[0]],y:v[t[1]],r:v[t[2]],label:v[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[p%i.length],borderColor:s==null?void 0:s[p%s.length]}})),r}function hee(e){var c,u,d,h;const{dimensionKeys:t,metricKeys:n}=nr(e),r=we.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(h=(d=r==null?void 0:r.chart)==null?void 0:d.dataset)==null?void 0:h.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(p=>p==null?void 0:p[s]))].map((p,m)=>({label:p,data:e.filter(v=>(v==null?void 0:v[s])===p).map(v=>[v==null?void 0:v[n[0]],v==null?void 0:v[n[1]],v==null?void 0:v[n[2]]]),backgroundColor:o==null?void 0:o[m%o.length],borderColor:i==null?void 0:i[m%i.length],borderSkipped:!1}))}function pee(e,t){var s,a,l,c;const n=we.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(d=>d[u]),backgroundColor:t.map((d,h)=>(d==null?void 0:d._color)||(r==null?void 0:r[h%r.length])),borderColor:t.map((d,h)=>(d==null?void 0:d._color)||(o==null?void 0:o[h%o.length]))}))}function gee(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function nr(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=gee(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,d,h,p;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((d=e==null?void 0:e[1])==null?void 0:d[i])=="string"||typeof((h=e==null?void 0:e[2])==null?void 0:h[i])&&typeof((p=e==null?void 0:e[2])==null?void 0:p[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 Df(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 mee(e,t="asc"){function n(r){return Object.entries(r).slice(1).reduce((s,[a,l])=>{const c=typeof l=="number"?l:parseFloat(l);return s+(isNaN(c)?0:c)},0)}return e.sort((r,o)=>{const i=n(r),s=n(o);return t==="asc"?i-s:s-i})}function R0({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:o}){const i=e.reduce((a,l)=>{const c=l[t],u=l[n],d=l[r];return a[c]||(a[c]={[t]:c}),a[c][u]=d,a},{});let s=Object.values(i);return o!=="none"&&o!==void 0&&(s=mee(s,o)),s}function qo(e,t){var s;const n=we.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=Ql.cloneDeep(r);return Ql.merge(o,e,t)}function eS(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
110
+ * @license lucide-react v0.453.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const vee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),t4=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
115
+ * @license lucide-react v0.453.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */var bee={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"};/**
120
+ * @license lucide-react v0.453.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const n4=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>P.createElement("svg",{ref:l,...bee,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:t4("lucide",o),...a},[...s.map(([c,u])=>P.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
125
+ * @license lucide-react v0.453.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const Fn=(e,t)=>{const n=P.forwardRef(({className:r,...o},i)=>P.createElement(n4,{ref:i,iconNode:t,className:t4(`lucide-${vee(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
130
+ * @license lucide-react v0.453.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const tS=Fn("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"}]]);/**
135
+ * @license lucide-react v0.453.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const r4=Fn("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"}]]);/**
140
+ * @license lucide-react v0.453.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const Cp=Fn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
145
+ * @license lucide-react v0.453.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const Jv=Fn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
150
+ * @license lucide-react v0.453.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const AC=Fn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
155
+ * @license lucide-react v0.453.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const Zv=Fn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
160
+ * @license lucide-react v0.453.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const o4=Fn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
165
+ * @license lucide-react v0.453.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const DC=Fn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
170
+ * @license lucide-react v0.453.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const i4=Fn("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"}]]);/**
175
+ * @license lucide-react v0.453.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const kC=Fn("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"}]]);/**
180
+ * @license lucide-react v0.453.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const s4=Fn("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
185
+ * @license lucide-react v0.453.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const a4=Fn("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"}]]);/**
190
+ * @license lucide-react v0.453.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const l4=Fn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
195
+ * @license lucide-react v0.453.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const c4=Fn("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"}]]);/**
200
+ * @license lucide-react v0.453.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const IC=Fn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
205
+ * @license lucide-react v0.453.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const u4=Fn("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"}]]);/**
210
+ * @license lucide-react v0.453.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const d4=Fn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
215
+ * @license lucide-react v0.453.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const NC=Fn("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"}]]);/**
220
+ * @license lucide-react v0.453.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const f4=Fn("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"}]]);/**
225
+ * @license lucide-react v0.453.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const h4=Fn("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
230
+ * @license lucide-react v0.453.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const wd=Fn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),yee=({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(d=>`"${(""+c[d]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
235
+ `),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 x.jsx(i4,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function p4({frame:e}){var _;const t=we(C=>C.isDashboardEditing),n=we(C=>C.filterValues),r=we(C=>C.isVisualEditing),o=we(C=>C.selectedSheetId);we(C=>C.currentBreakpoint);const{removeFrame:i}=we(C=>C.actions),s=we(C=>C.actions.setIsVisualEditing),a=Nr(C=>C.actions.setFilterValues),l=Nr(C=>C.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d}=Nr(C=>C.actions),h=Nr(C=>C.actions.setSelectedConnectionId),p=Nr(C=>C.actions.setSelectedDatamodelId),m=Nr(C=>C.actions.setSelectedDatabaseName),v=Nr(C=>C.actions.setSelectedSchemaName),y=Nr(C=>C.actions.setSelectedTableName),b=e.cards.find(C=>C.id===e.activeCardId);function S(){s(!r),c(b);const{dimensionKeys:C}=nr((b==null?void 0:b.data)||[]);d(C),u(e),b!=null&&b.connectionId&&h(b==null?void 0:b.connectionId),b!=null&&b.datamodelId&&b.datamodelId!=="none"&&(p(b==null?void 0:b.datamodelId),m("")),b!=null&&b.lastSelectedDatabase&&b.lastSelectedDatabase!=="none"&&(m(b==null?void 0:b.lastSelectedDatabase),p("")),b!=null&&b.lastSelectedSchema&&v(b==null?void 0:b.lastSelectedSchema),b!=null&&b.lastSelectedTable&&y(b==null?void 0:b.lastSelectedTable),n&&(a(n),l(!0))}return x.jsx("section",{className:"absolute right-2 top-2 z-10",children:x.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?x.jsx(GZ,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):x.jsx(YZ,{role:"edit-visual",onClick:S,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&x.jsx(Q5,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((_=b.preferences)==null?void 0:_.allowDownload)===!0&&x.jsx(yee,{data:(b==null?void 0:b.data)||[],filename:b.title})]})})}function xee(e,t){we(s=>s.selectedSheetId);const n=we(s=>s.selectedFrameId),r=we(s=>s.isDashboardEditing),o=we(s=>s.isVisualEditing);we(s=>s.actions),P.useEffect(()=>{n===e.id&&r&&!o&&i()},[n,e.id,r,o]);function i(){const s=t==null?void 0:t.current;s==null||s.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}const wee=P.createContext(null),Fx={didCatch:!1,error:null};class eb extends P.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Fx}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(Fx)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&See(t.resetKeys,o)){var i,s;(i=(s=this.props).onReset)===null||i===void 0||i.call(s,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Fx)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=P.createElement(r,l);else if(o!==void 0)a=o;else throw s}return P.createElement(wee.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function See(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function LC({error:e}){return x.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%"},children:x.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[x.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),x.jsx("p",{className:"text-sm",children:"Something went wrong:"}),x.jsx("pre",{className:"text-xs",children:e.message})]})})}function _ee({error:e,frame:t}){return x.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[x.jsx(p4,{frame:t}),x.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),x.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[x.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),x.jsx("p",{className:"text-sm",children:"Something went wrong:"}),x.jsx("pre",{className:"text-xs",children:e.message})]})]})}function Cee({error:e}){return x.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[x.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),x.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[x.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),x.jsx("p",{className:"text-sm",children:"Something went wrong:"}),x.jsx("pre",{className:"text-xs",children:e.message})]})]})}var Ju=1e3,Zu=Ju*60,ed=Zu*60,gc=ed*24,Eee=gc*7,Ree=gc*365.25,Pee=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Oee(e);if(n==="number"&&isFinite(e))return t.long?Mee(e):Tee(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Oee(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*Ree;case"weeks":case"week":case"w":return n*Eee;case"days":case"day":case"d":return n*gc;case"hours":case"hour":case"hrs":case"hr":case"h":return n*ed;case"minutes":case"minute":case"mins":case"min":case"m":return n*Zu;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ju;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Tee(e){var t=Math.abs(e);return t>=gc?Math.round(e/gc)+"d":t>=ed?Math.round(e/ed)+"h":t>=Zu?Math.round(e/Zu)+"m":t>=Ju?Math.round(e/Ju)+"s":e+"ms"}function Mee(e){var t=Math.abs(e);return t>=gc?Zg(e,t,gc,"day"):t>=ed?Zg(e,t,ed,"hour"):t>=Zu?Zg(e,t,Zu,"minute"):t>=Ju?Zg(e,t,Ju,"second"):e+" ms"}function Zg(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const Aee=Oc(Pee);function Dee(e){const t=we(u=>u.selectedSheetId),n=we(u=>u.selectedLensId),r=we(u=>u.dashboard.baseQueries),o=we(u=>u.dashboard.filters),i=we(u=>u.filterValues),s=o==null?void 0:o.filter(u=>u.sheetId===t||!u.sheetId),a=i==null?void 0:i.filter(u=>(s==null?void 0:s.some(d=>d.id===u.filterId))||u.filterId.endsWith(t)),l=rK(e.sql,r);return{queryKey:["query",e.id,l,n||"",JSON.stringify(a)],sql:l,sheetFilterValues:a}}function tb(e,t){const{authToken:n}=ko(),r=we(d=>d.isVisualEditing),o=we(d=>d.authToken),i=Aee((e==null?void 0:e.refreshInterval)||"0"),{queryKey:s,sql:a,sheetFilterValues:l}=Dee(e);return{...xp({queryKey:s,queryFn:()=>Ev("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(o==null?void 0:o.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===yN?"":e.python,active_filters:l,cache_config:Y_()}),refetchInterval:i,placeholderData:GK,enabled:!!e.connectionId&&!!e.sql&&!t&&!r}),queryKey:s}}function Bs({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,d={maximumFractionDigits:c,minimumFractionDigits:c};if(o){d.style="currency",d.currency=o;try{new Intl.NumberFormat(i,d).format(0)}catch{}}try{new Intl.NumberFormat(i,d).format(0)}catch{l="en-US"}let p=new Intl.NumberFormat(l,d).format(u);return n&&(p+=a),p}function FC(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function g4(e){try{const n=new Function("getDatalabelColor",e)(Ew);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}catch(t){return console.error("Error processing custom visual code",t),{options:{},plugins:[]}}}function m4(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return kee(t)}function kee(e){const[t,n,r]=e.split(" "),o=parseFloat(t),i=parseFloat(n),s=parseFloat(r),a=i/100,l=s/100,c=(1-Math.abs(2*l-1))*a,u=c*(1-Math.abs(o/60%2-1)),d=l-c/2;let h=0,p=0,m=0;0<=o&&o<60?(h=c,p=u,m=0):60<=o&&o<120?(h=u,p=c,m=0):120<=o&&o<180?(h=0,p=c,m=u):180<=o&&o<240?(h=0,p=u,m=c):240<=o&&o<300?(h=u,p=0,m=c):300<=o&&o<360&&(h=c,p=0,m=u),h=Math.round((h+d)*255),p=Math.round((p+d)*255),m=Math.round((m+d)*255);const v=y=>{const b=y.toString(16);return b.length==1?"0"+b:b};return`#${v(h)}${v(p)}${v(m)}`}function bl({data:e,cfg:t,customCfg:n,preferences:r}){we.getState().themeStyle;const{dimensionKeys:o,metricKeys:i}=nr(e),s=uee(i,e,r),a=Df(s,n),l=o[0],c=eS(e,l);jC(r,t),v4(r);const{options:u,plugins:d}=y4({cfg:t,preferences:r,customCfg:n});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:a},options:u,plugins:d}}function jC(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 v4(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 b4(e,t){var i,s,a,l,c,u,d,h,p,m,v,y;const n=jC(t,e),r=v4(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:b=>{var S,_,C,E;return Bs({number:Number(b),decimalPlaces:((S=t==null?void 0:t.numberAxisFormat)==null?void 0:S.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.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]:{...(p=(h=(d=e==null?void 0:e.options)==null?void 0:d.scales)==null?void 0:h[r])==null?void 0:p.ticks,callback:null}},plugins:{...(m=e==null?void 0:e.options)==null?void 0:m.plugins,datalabels:{...(y=(v=e==null?void 0:e.options)==null?void 0:v.plugins)==null?void 0:y.datalabels,formatter:function(b){var S,_,C,E;return Bs({number:Number(b),decimalPlaces:((S=t==null?void 0:t.numberAxisFormat)==null?void 0:S.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.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 y4({cfg:e,preferences:t,customCfg:n}){var h,p,m,v,y,b,S,_,C,E,T,A,D,k,j,$,z,K,V,N,W,H,G,te,F,Y,q,M,ne;const r=we.getState().themeStyle,o=b4(e,t),i=qo((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),s=qo(o,i),a=qo(s,(n==null?void 0:n.options)||{}),l={...a,scales:{...a==null?void 0:a.scales,x:{...(h=a==null?void 0:a.scales)==null?void 0:h.x,grid:{...(m=(p=a==null?void 0:a.scales)==null?void 0:p.x)==null?void 0:m.grid,color:(_=(S=(b=(y=(v=r==null?void 0:r.chart)==null?void 0:v.options)==null?void 0:y.scales)==null?void 0:b.x)==null?void 0:S.grid)==null?void 0:_.color}},y:{...(C=a==null?void 0:a.scales)==null?void 0:C.y,grid:{...(T=(E=a==null?void 0:a.scales)==null?void 0:E.y)==null?void 0:T.grid,color:($=(j=(k=(D=(A=r==null?void 0:r.chart)==null?void 0:A.options)==null?void 0:D.scales)==null?void 0:k.y)==null?void 0:j.grid)==null?void 0:$.color}}},plugins:{...a==null?void 0:a.plugins,tooltip:{...(z=a==null?void 0:a.plugins)==null?void 0:z.tooltip,backgroundColor:(W=(N=(V=(K=r==null?void 0:r.chart)==null?void 0:K.options)==null?void 0:V.plugins)==null?void 0:N.tooltip)==null?void 0:W.backgroundColor,bodyColor:(F=(te=(G=(H=r==null?void 0:r.chart)==null?void 0:H.options)==null?void 0:G.plugins)==null?void 0:te.tooltip)==null?void 0:F.bodyColor,titleColor:(ne=(M=(q=(Y=r==null?void 0:r.chart)==null?void 0:Y.options)==null?void 0:q.plugins)==null?void 0:M.tooltip)==null?void 0:ne.titleColor}}},{plugins:c,options:u}=g4((t==null?void 0:t.customVisualCode)||"");return{options:qo(l,u),plugins:c}}/*!
236
+ * @kurkle/color v0.3.2
237
+ * https://github.com/kurkle/color#readme
238
+ * (c) 2023 Jukka Kurkela
239
+ * Released under the MIT License
240
+ */function Ep(e){return e+.5|0}const Ma=(e,t,n)=>Math.max(Math.min(e,n),t);function kf(e){return Ma(Ep(e*2.55),0,255)}function Fa(e){return Ma(Ep(e*255),0,255)}function As(e){return Ma(Ep(e/2.55)/100,0,1)}function GT(e){return Ma(Ep(e*100),0,100)}const Wo={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},nS=[..."0123456789ABCDEF"],Iee=e=>nS[e&15],Nee=e=>nS[(e&240)>>4]+nS[e&15],em=e=>(e&240)>>4===(e&15),Lee=e=>em(e.r)&&em(e.g)&&em(e.b)&&em(e.a);function Fee(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Wo[e[1]]*17,g:255&Wo[e[2]]*17,b:255&Wo[e[3]]*17,a:t===5?Wo[e[4]]*17:255}:(t===7||t===9)&&(n={r:Wo[e[1]]<<4|Wo[e[2]],g:Wo[e[3]]<<4|Wo[e[4]],b:Wo[e[5]]<<4|Wo[e[6]],a:t===9?Wo[e[7]]<<4|Wo[e[8]]:255})),n}const jee=(e,t)=>e<255?t(e):"";function $ee(e){var t=Lee(e)?Iee:Nee;return e?"#"+t(e.r)+t(e.g)+t(e.b)+jee(e.a,t):void 0}const zee=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function x4(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 Bee(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 Hee(e,t,n){const r=x4(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 Vee(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 $C(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=Vee(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function zC(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Fa)}function BC(e,t,n){return zC(x4,e,t,n)}function Wee(e,t,n){return zC(Hee,e,t,n)}function Uee(e,t,n){return zC(Bee,e,t,n)}function w4(e){return(e%360+360)%360}function Gee(e){const t=zee.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?kf(+t[5]):Fa(+t[5]));const o=w4(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=Wee(o,i,s):t[1]==="hsv"?r=Uee(o,i,s):r=BC(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function qee(e,t){var n=$C(e);n[0]=w4(n[0]+t),n=BC(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Yee(e){if(!e)return;const t=$C(e),n=t[0],r=GT(t[1]),o=GT(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${As(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const qT={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"},YT={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 Kee(){const e={},t=Object.keys(YT),n=Object.keys(qT);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,qT[i]);i=parseInt(YT[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let tm;function Xee(e){tm||(tm=Kee(),tm.transparent=[0,0,0,0]);const t=tm[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Qee=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Jee(e){const t=Qee.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?kf(s):Ma(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?kf(r):Ma(r,0,255)),o=255&(t[4]?kf(o):Ma(o,0,255)),i=255&(t[6]?kf(i):Ma(i,0,255)),{r,g:o,b:i,a:n}}}function Zee(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${As(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const jx=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,tu=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function ete(e,t,n){const r=tu(As(e.r)),o=tu(As(e.g)),i=tu(As(e.b));return{r:Fa(jx(r+n*(tu(As(t.r))-r))),g:Fa(jx(o+n*(tu(As(t.g))-o))),b:Fa(jx(i+n*(tu(As(t.b))-i))),a:e.a+n*(t.a-e.a)}}function nm(e,t,n){if(e){let r=$C(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=BC(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function S4(e,t){return e&&Object.assign(t||{},e)}function KT(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=Fa(e[3]))):(t=S4(e,{r:0,g:0,b:0,a:1}),t.a=Fa(t.a)),t}function tte(e){return e.charAt(0)==="r"?Jee(e):Gee(e)}let _4=class rS{constructor(t){if(t instanceof rS)return t;const n=typeof t;let r;n==="object"?r=KT(t):n==="string"&&(r=Fee(t)||Xee(t)||tte(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=S4(this._rgb);return t&&(t.a=As(t.a)),t}set rgb(t){this._rgb=KT(t)}rgbString(){return this._valid?Zee(this._rgb):void 0}hexString(){return this._valid?$ee(this._rgb):void 0}hslString(){return this._valid?Yee(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=ete(this._rgb,t._rgb,n)),this}clone(){return new rS(this.rgb)}alpha(t){return this._rgb.a=Fa(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Ep(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 nm(this._rgb,2,t),this}darken(t){return nm(this._rgb,2,-t),this}saturate(t){return nm(this._rgb,1,t),this}desaturate(t){return nm(this._rgb,1,-t),this}rotate(t){return qee(this._rgb,t),this}};/*!
241
+ * Chart.js v4.4.1
242
+ * https://www.chartjs.org
243
+ * (c) 2023 Chart.js Contributors
244
+ * Released under the MIT License
245
+ */function _s(){}const nte=(()=>{let e=0;return()=>e++})();function Ot(e){return e===null||typeof e>"u"}function wn(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 Nn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function bo(e,t){return Nn(e)?e:t}function st(e,t){return typeof e>"u"?t:e}const rte=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,C4=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function an(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Jt(e,t,n,r){let o,i,s;if(wn(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 P0(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 O0(e){if(wn(e))return e.map(O0);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]]=O0(e[n[o]]);return t}return e}function E4(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function ote(e,t,n,r){if(!E4(e))return;const o=t[e],i=n[e];Dt(o)&&Dt(i)?ir(o,i,r):t[e]=O0(i)}function ir(e,t,n){const r=wn(t)?t:[t],o=r.length;if(!Dt(e))return e;n=n||{};const i=n.merger||ote;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 Kf(e,t){return ir(e,t,{merger:ite})}function ite(e,t,n){if(!E4(e))return;const r=t[e],o=n[e];Dt(r)&&Dt(o)?Kf(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=O0(o))}const XT={"":e=>e,x:e=>e.x,y:e=>e.y};function ste(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 ate(e){const t=ste(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Ha(e,t){return(XT[t]||(XT[t]=ate(t)))(e)}function HC(e){return e.charAt(0).toUpperCase()+e.slice(1)}const xh=e=>typeof e<"u",Va=e=>typeof e=="function",QT=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function lte(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const _n=Math.PI,Sn=2*_n,cte=Sn+_n,T0=Number.POSITIVE_INFINITY,ute=_n/180,Vn=_n/2,yl=_n/4,JT=_n*2/3,Aa=Math.log10,Ki=Math.sign;function Xf(e,t,n){return Math.abs(e-t)<n}function ZT(e){const t=Math.round(e);e=Xf(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Aa(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function dte(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 td(e){return!isNaN(parseFloat(e))&&isFinite(e)}function fte(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function R4(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 yi(e){return e*(_n/180)}function VC(e){return e*(180/_n)}function eM(e){if(!Nn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function P4(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*_n&&(i+=Sn),{angle:i,distance:o}}function oS(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function hte(e,t){return(e-t+cte)%Sn-_n}function wo(e){return(e%Sn+Sn)%Sn}function wh(e,t,n,r){const o=wo(e),i=wo(t),s=wo(n),a=wo(i-o),l=wo(s-o),c=wo(o-i),u=wo(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function or(e,t,n){return Math.max(t,Math.min(n,e))}function pte(e){return or(e,-32768,32767)}function Ls(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function WC(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 Fs=(e,t,n,r)=>WC(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),gte=(e,t,n)=>WC(e,n,r=>e[r][t]>=n);function mte(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 O4=["push","pop","shift","splice","unshift"];function vte(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),O4.forEach(n=>{const r="_onData"+HC(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 tM(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)&&(O4.forEach(i=>{delete e[i]}),delete e._chartjs)}function T4(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const M4=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function A4(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,M4.call(window,()=>{r=!1,e.apply(t,n)}))}}function bte(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const UC=e=>e==="start"?"left":e==="end"?"right":"center",xr=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,yte=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function D4(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:d,maxDefined:h}=s.getUserBounds();d&&(o=or(Math.min(Fs(a,l,c).lo,n?r:Fs(t,l,s.getPixelForValue(c)).lo),0,r-1)),h?i=or(Math.max(Fs(a,s.axis,u,!0).hi+1,n?0:Fs(t,l,s.getPixelForValue(u),!0).hi+1),o,r)-o:i=r-o}return{start:o,count:i}}function k4(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 rm=e=>e===0||e===1,nM=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Sn/n)),rM=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Sn/n)+1,Qf={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*Vn)+1,easeOutSine:e=>Math.sin(e*Vn),easeInOutSine:e=>-.5*(Math.cos(_n*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=>rm(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=>rm(e)?e:nM(e,.075,.3),easeOutElastic:e=>rm(e)?e:rM(e,.075,.3),easeInOutElastic(e){return rm(e)?e:e<.5?.5*nM(e*2,.1125,.45):.5+.5*rM(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-Qf.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?Qf.easeInBounce(e*2)*.5:Qf.easeOutBounce(e*2-1)*.5+.5};function GC(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function oM(e){return GC(e)?e:new _4(e)}function $x(e){return GC(e)?e:new _4(e).saturate(.5).darken(.1).hexString()}const xte=["x","y","borderWidth","radius","tension"],wte=["color","borderColor","backgroundColor"];function Ste(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:wte},numbers:{type:"number",properties:xte}}),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 _te(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const iM=new Map;function Cte(e,t){t=t||{};const n=e+JSON.stringify(t);let r=iM.get(n);return r||(r=new Intl.NumberFormat(e,t),iM.set(n,r)),r}function Rp(e,t,n){return Cte(t,n).format(e)}const I4={values(e){return wn(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=Ete(e,n)}const s=Aa(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),Rp(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Aa(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?I4.numeric.call(this,e,t,n):""}};function Ete(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 nb={formatters:I4};function Rte(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:nb.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 mc=Object.create(null),iS=Object.create(null);function Jf(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 zx(e,t,n){return typeof t=="string"?ir(Jf(e,t),n):ir(Jf(e,""),t)}class Pte{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)=>$x(o.backgroundColor),this.hoverBorderColor=(r,o)=>$x(o.borderColor),this.hoverColor=(r,o)=>$x(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 zx(this,t,n)}get(t){return Jf(this,t)}describe(t,n){return zx(iS,t,n)}override(t,n){return zx(mc,t,n)}route(t,n,r,o){const i=Jf(this,t),s=Jf(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):st(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var An=new Pte({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ste,_te,Rte]);function Ote(e){return!e||Ot(e.size)||Ot(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function M0(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 Tte(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,d,h;for(l=0;l<a;l++)if(d=n[l],d!=null&&!wn(d))s=M0(e,o,i,s,d);else if(wn(d))for(c=0,u=d.length;c<u;c++)h=d[c],h!=null&&!wn(h)&&(s=M0(e,o,i,s,h));e.restore();const p=i.length/2;if(p>n.length){for(l=0;l<p;l++)delete o[i[l]];i.splice(0,p)}return s}function xl(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 sM(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function A0(e,t,n,r){N4(e,t,n,r,null)}function N4(e,t,n,r,o){let i,s,a,l,c,u,d,h;const p=t.pointStyle,m=t.rotation,v=t.radius;let y=(m||0)*ute;if(p&&typeof p=="object"&&(i=p.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(y),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(v)||v<=0)){switch(e.beginPath(),p){default:o?e.ellipse(n,r,o/2,v,0,0,Sn):e.arc(n,r,v,0,Sn),e.closePath();break;case"triangle":u=o?o/2:v,e.moveTo(n+Math.sin(y)*u,r-Math.cos(y)*v),y+=JT,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*v),y+=JT,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*v),e.closePath();break;case"rectRounded":c=v*.516,l=v-c,s=Math.cos(y+yl)*l,d=Math.cos(y+yl)*(o?o/2-c:l),a=Math.sin(y+yl)*l,h=Math.sin(y+yl)*(o?o/2-c:l),e.arc(n-d,r-a,c,y-_n,y-Vn),e.arc(n+h,r-s,c,y-Vn,y),e.arc(n+d,r+a,c,y,y+Vn),e.arc(n-h,r+s,c,y+Vn,y+_n),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*v,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}y+=yl;case"rectRot":d=Math.cos(y)*(o?o/2:v),s=Math.cos(y)*v,a=Math.sin(y)*v,h=Math.sin(y)*(o?o/2:v),e.moveTo(n-d,r-a),e.lineTo(n+h,r-s),e.lineTo(n+d,r+a),e.lineTo(n-h,r+s),e.closePath();break;case"crossRot":y+=yl;case"cross":d=Math.cos(y)*(o?o/2:v),s=Math.cos(y)*v,a=Math.sin(y)*v,h=Math.sin(y)*(o?o/2:v),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s);break;case"star":d=Math.cos(y)*(o?o/2:v),s=Math.cos(y)*v,a=Math.sin(y)*v,h=Math.sin(y)*(o?o/2:v),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s),y+=yl,d=Math.cos(y)*(o?o/2:v),s=Math.cos(y)*v,a=Math.sin(y)*v,h=Math.sin(y)*(o?o/2:v),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s);break;case"line":s=o?o/2:Math.cos(y)*v,a=Math.sin(y)*v,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(y)*(o?o/2:v),r+Math.sin(y)*v);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function js(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 Zl(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function ec(e){e.restore()}function Mte(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 Ate(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 Dte(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Ot(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 kte(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 Ite(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function vc(e,t,n,r,o,i={}){const s=wn(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=o.string,Dte(e,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&Ite(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),Ot(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),kte(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function Sh(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*_n,_n,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,_n,Vn,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,Vn,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-Vn,!0),e.lineTo(n+s.topLeft,r)}const Nte=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Lte=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Fte(e,t){const n=(""+e).match(Nte);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 jte=e=>+e||0;function qC(e,t){const n={},r=Dt(t),o=r?Object.keys(t):t,i=Dt(e)?r?s=>st(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=jte(i(s));return n}function L4(e){return qC(e,{top:"y",right:"x",bottom:"y",left:"x"})}function tc(e){return qC(e,["topLeft","topRight","bottomLeft","bottomRight"])}function hr(e){const t=L4(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Gn(e,t){e=e||{},t=t||An.font;let n=st(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=st(e.style,t.style);r&&!(""+r).match(Lte)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:st(e.family,t.family),lineHeight:Fte(st(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:st(e.weight,t.weight),string:""};return o.string=Ote(o),o}function xn(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&&wn(a)&&(a=a[n%a.length],o=!1),a!==void 0))return r&&!o&&(r.cacheable=!1),a}function $te(e,t,n){const{min:r,max:o}=e,i=C4(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 Za(e,t){return Object.assign(Object.create(e),t)}function YC(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=z4("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>YC([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 j4(a,l,()=>qte(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return lM(a).includes(l)},ownKeys(a){return lM(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function nd(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:F4(e,r),setContext:i=>nd(e,i,n,r),override:i=>nd(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 j4(i,s,()=>Bte(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 F4(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:Va(n)?n:()=>n,isIndexable:Va(r)?r:()=>r}}const zte=(e,t)=>e?e+HC(t):t,KC=(e,t)=>Dt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function j4(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function Bte(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return Va(a)&&s.isScriptable(t)&&(a=Hte(t,a,e,n)),wn(a)&&a.length&&(a=Vte(t,a,e,s.isIndexable)),KC(t,a)&&(a=nd(a,o,i&&i[t],s)),a}function Hte(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),KC(e,l)&&(l=XC(o._scopes,o,e,l)),l}function Vte(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 d=XC(c,o,e,u);t.push(nd(d,i,s&&s[e],a))}}return t}function $4(e,t,n){return Va(e)?e(t,n):e}const Wte=(e,t)=>e===!0?t:typeof e=="string"?Ha(t,e):void 0;function Ute(e,t,n,r,o){for(const i of t){const s=Wte(n,i);if(s){e.add(s);const a=$4(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 XC(e,t,n,r){const o=t._rootScopes,i=$4(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=aM(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=aM(a,s,i,l,r),l===null)?!1:YC(Array.from(a),[""],o,i,()=>Gte(t,n,r))}function aM(e,t,n,r,o){for(;n;)n=Ute(e,t,n,r,o);return n}function Gte(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return wn(o)&&Dt(n)?n:o||{}}function qte(e,t,n,r){let o;for(const i of t)if(o=z4(zte(i,e),n),typeof o<"u")return KC(e,o)?XC(n,r,e,o):o}function z4(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function lM(e){let t=e._keys;return t||(t=e._keys=Yte(e._scopes)),t}function Yte(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 B4(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(Ha(u,i),c)};return s}const Kte=Number.EPSILON||1e-14,rd=(e,t)=>t<e.length&&!e[t].skip&&e[t],H4=e=>e==="x"?"y":"x";function Xte(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=oS(i,o),l=oS(s,i);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,h=r*u;return{previous:{x:i.x-d*(s.x-o.x),y:i.y-d*(s.y-o.y)},next:{x:i.x+h*(s.x-o.x),y:i.y+h*(s.y-o.y)}}}function Qte(e,t,n){const r=e.length;let o,i,s,a,l,c=rd(e,0);for(let u=0;u<r-1;++u)if(l=c,c=rd(e,u+1),!(!l||!c)){if(Xf(t[u],0,Kte)){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 Jte(e,t,n="x"){const r=H4(n),o=e.length;let i,s,a,l=rd(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=rd(e,c+1),!a)continue;const u=a[n],d=a[r];s&&(i=(u-s[n])/3,a[`cp1${n}`]=u-i,a[`cp1${r}`]=d-i*t[c]),l&&(i=(l[n]-u)/3,a[`cp2${n}`]=u+i,a[`cp2${r}`]=d+i*t[c])}}function Zte(e,t="x"){const n=H4(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,c=rd(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=rd(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?Ki(o[s-1])!==Ki(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}Qte(e,o,i),Jte(e,i,t)}function om(e,t,n){return Math.max(Math.min(e,n),t)}function ene(e,t){let n,r,o,i,s,a=js(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&js(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=om(o.cp1x,t.left,t.right),o.cp1y=om(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=om(o.cp2x,t.left,t.right),o.cp2y=om(o.cp2y,t.top,t.bottom)))}function tne(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Zte(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=Xte(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&&ene(e,n)}function QC(){return typeof window<"u"&&typeof document<"u"}function JC(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function D0(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 rb=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function nne(e,t){return rb(e).getPropertyValue(t)}const rne=["top","right","bottom","left"];function nc(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=rne[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const one=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function ine(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(one(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 Rl(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=rb(n),i=o.boxSizing==="border-box",s=nc(o,"padding"),a=nc(o,"border","width"),{x:l,y:c,box:u}=ine(e,n),d=s.left+(u&&a.left),h=s.top+(u&&a.top);let{width:p,height:m}=t;return i&&(p-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-d)/p*n.width/r),y:Math.round((c-h)/m*n.height/r)}}function sne(e,t,n){let r,o;if(t===void 0||n===void 0){const i=JC(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=rb(i),l=nc(a,"border","width"),c=nc(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=D0(a.maxWidth,i,"clientWidth"),o=D0(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||T0,maxHeight:o||T0}}const im=e=>Math.round(e*10)/10;function ane(e,t,n,r){const o=rb(e),i=nc(o,"margin"),s=D0(o.maxWidth,e,"clientWidth")||T0,a=D0(o.maxHeight,e,"clientHeight")||T0,l=sne(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const h=nc(o,"border","width"),p=nc(o,"padding");c-=p.width+h.width,u-=p.height+h.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=im(Math.min(c,s,l.maxWidth)),u=im(Math.min(u,a,l.maxHeight)),c&&!u&&(u=im(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=im(Math.floor(u*r))),{width:c,height:u}}function cM(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 lne=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};QC()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function uM(e,t){const n=nne(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Pl(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function cne(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 une(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=Pl(e,o,n),a=Pl(o,i,n),l=Pl(i,t,n),c=Pl(s,a,n),u=Pl(a,l,n);return Pl(c,u,n)}const dne=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}}},fne=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Eu(e,t,n){return e?dne(t,n):fne()}function V4(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 W4(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function U4(e){return e==="angle"?{between:wh,compare:hte,normalize:wo}:{between:Ls,compare:(t,n)=>t-n,normalize:t=>t}}function dM({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 hne(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=U4(r),l=t.length;let{start:c,end:u,loop:d}=e,h,p;if(d){for(c+=l,u+=l,h=0,p=l;h<p&&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:d,style:e.style}}function G4(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:c}=U4(r),{start:u,end:d,loop:h,style:p}=hne(e,t,n),m=[];let v=!1,y=null,b,S,_;const C=()=>l(o,_,b)&&a(o,_)!==0,E=()=>a(i,b)===0||l(i,_,b),T=()=>v||C(),A=()=>!v||E();for(let D=u,k=u;D<=d;++D)S=t[D%s],!S.skip&&(b=c(S[r]),b!==_&&(v=l(b,o,i),y===null&&T()&&(y=a(b,o)===0?D:k),y!==null&&A()&&(m.push(dM({start:y,end:D,loop:h,count:s,style:p})),y=null),k=D,_=b));return y!==null&&m.push(dM({start:y,end:d,loop:h,count:s,style:p})),m}function q4(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=G4(r[o],e.points,t);i.length&&n.push(...i)}return n}function pne(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 gne(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 mne(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=pne(n,o,i,r);if(r===!0)return fM(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 fM(e,gne(n,s,l,c),n,t)}function fM(e,t,n,r){return!r||!r.setContext||!n?t:vne(e,t,n,r)}function vne(e,t,n,r){const o=e._chart.getContext(),i=hM(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=i,d=t[0].start,h=d;function p(m,v,y,b){const S=a?-1:1;if(m!==v){for(m+=l;n[m%l].skip;)m-=S;for(;n[v%l].skip;)v+=S;m%l!==v%l&&(c.push({start:m%l,end:v%l,loop:y,style:b}),u=b,d=v%l)}}for(const m of t){d=a?d:m.start;let v=n[d%l],y;for(h=d+1;h<=m.end;h++){const b=n[h%l];y=hM(r.setContext(Za(o,{type:"segment",p0:v,p1:b,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:s}))),bne(y,u)&&p(d,h-1,m.loop,u),v=b,u=y}d<h-1&&p(d,h-1,m.loop,u)}return c}function hM(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function bne(e,t){if(!t)return!1;const n=[],r=function(o,i){return GC(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
246
+ * Chart.js v4.4.1
247
+ * https://www.chartjs.org
248
+ * (c) 2023 Chart.js Contributors
249
+ * Released under the MIT License
250
+ */class yne{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=M4.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 Ps=new yne;const pM="transparent",xne={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=oM(e||pM),o=r.valid&&oM(t||pM);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class wne{constructor(t,n,r,o){const i=n[r];o=xn([t.to,o,i,t.from]);const s=xn([t.from,i,o]);this._active=!0,this._fn=t.fn||xne[t.type||typeof s],this._easing=Qf[t.easing]||Qf.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=xn([t.to,n,o,t.from]),this._from=xn([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 Y4{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Dt(t))return;const n=Object.keys(An.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];(wn(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=_ne(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&Sne(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 d=i[c];const h=r.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}i[c]=d=new wne(h,t,c,u),o.push(d)}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 Ps.add(this._chart,r),!0}}function Sne(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 _ne(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 gM(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 Cne(e,t,n){if(n===!1)return!1;const r=gM(e,n),o=gM(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function Ene(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 K4(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 mM(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],Nn(c)&&(i||t===0||Ki(t)===Ki(c))&&(t+=c)}return t}}function Rne(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 vM(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Pne(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function One(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 Tne(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function bM(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 yM(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=Pne(i,s,r),d=t.length;let h;for(let p=0;p<d;++p){const m=t[p],{[l]:v,[c]:y}=m,b=m._stacks||(m._stacks={});h=b[c]=Tne(o,u,v),h[a]=y,h._top=bM(h,s,!0,r.type),h._bottom=bM(h,s,!1,r.type);const S=h._visualValues||(h._visualValues={});S[a]=y}}function Bx(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Mne(e,t){return Za(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ane(e,t,n){return Za(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function of(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 Hx=e=>e==="reset"||e==="none",xM=(e,t)=>t?e:Object.assign({},e),Dne=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:K4(n,!0),values:null};class Qo{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=vM(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&&of(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,h,p,m)=>d==="x"?h:d==="r"?m:p,i=n.xAxisID=st(r.xAxisID,Bx(t,"x")),s=n.yAxisID=st(r.yAxisID,Bx(t,"y")),a=n.rAxisID=st(r.rAxisID,Bx(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&&tM(this._data,this),t._stacked&&of(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Dt(n))this._data=Rne(n);else if(r!==n){if(r){tM(r,this);const o=this._cachedMeta;of(o),o._parsed=[]}n&&Object.isExtensible(n)&&vte(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=vM(n.vScale,n),n.stack!==r.stack&&(o=!0,of(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&yM(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,d,h;if(this._parsing===!1)r._parsed=o,r._sorted=!0,h=o;else{wn(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 p=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=h[u],l&&(p()&&(l=!1),c=d);r._sorted=l}s&&yM(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,d=new Array(o);let h,p,m;for(h=0,p=o;h<p;++h)m=h+r,d[h]={[a]:u||i.parse(c[m],m),[l]:s.parse(n[m],m)};return d}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,c,u,d;for(l=0,c=o;l<c;++l)u=l+r,d=n[u],a[l]={x:i.parse(d[0],u),y:s.parse(d[1],u)};return a}parseObjectData(t,n,r,o){const{xScale:i,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,d,h,p;for(u=0,d=o;u<d;++u)h=u+r,p=n[h],c[u]={x:i.parse(Ha(p,a),h),y:s.parse(Ha(p,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:K4(o,!0),values:n._stacks[t.axis]._visualValues};return mM(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=mM(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=Dne(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=One(a);let h,p;function m(){p=o[h];const v=p[a.axis];return!Nn(p[t.axis])||u>v||d<v}for(h=0;h<s&&!(!m()&&(this.updateRangeFromParsed(c,t,p,l),i));++h);if(i){for(h=s-1;h>=0;--h)if(!m()){this.updateRangeFromParsed(c,t,p,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],Nn(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=Ene(st(this.options.clip,Cne(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 d=o[u];d.hidden||(d.active&&c?s.push(d):d.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=Ane(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=Mne(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&&xh(r);if(a)return xM(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=o?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),p=Object.keys(An.elements[t]),m=()=>this.getContext(r,o,n),v=c.resolveNamedOptions(h,p,m,d);return v.$shared&&(v.$shared=l,i[s]=Object.freeze(xM(v,l))),v}_resolveAnimations(t,n,r){const o=this.chart,i=this._cachedDataOpts,s=`animation-${n}`,a=i[s];if(a)return a;let l;if(o.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,r,n))}const c=new Y4(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||Hx(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){Hx(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!Hx(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&&of(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(Qo,"defaults",{}),Ne(Qo,"datasetElementType",null),Ne(Qo,"dataElementType",null);function kne(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=T4(r.sort((o,i)=>o-i))}return e._cache.$bar}function Ine(e){const t=e.iScale,n=kne(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(xh(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 Nne(e,t,n,r){const o=n.barThickness;let i,s;return Ot(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 Lne(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 Fne(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 X4(e,t,n,r){return wn(e)?Fne(e,t,n,r):t[n.axis]=n.parse(e,r),t}function wM(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,d,h;for(c=n,u=n+r;c<u;++c)h=t[c],d={},d[o.axis]=a||o.parse(s[c],c),l.push(X4(h,d,i,c));return l}function Vx(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function jne(e,t,n){return e!==0?Ki(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function $ne(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 zne(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}=$ne(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[SM(u,s,a,l)]=!0,o=c)),i[SM(o,s,a,l)]=!0,e.borderSkipped=i}function SM(e,t,n,r){return r?(e=Bne(e,t,n),e=_M(e,n,t)):e=_M(e,t,n),e}function Bne(e,t,n){return e===t?n:e===n?t:e}function _M(e,t,n){return e==="start"?t:e==="end"?n:e}function Hne(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Jm extends Qo{parsePrimitiveData(t,n,r,o){return wM(t,n,r,o)}parseArrayData(t,n,r,o){return wM(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,d=[];let h,p,m,v;for(h=r,p=r+o;h<p;++h)v=n[h],m={},m[i.axis]=i.parse(Ha(v,c),h),d.push(X4(Ha(v,u),m,s,h));return d}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=Vx(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:d,includeOptions:h}=this._getSharedOptions(n,o);for(let p=n;p<n+r;p++){const m=this.getParsed(p),v=i||Ot(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),y=this._calculateBarIndexPixels(p,u),b=(m._stacks||{})[a.axis],S={horizontal:c,base:v.base,enableBorderRadius:!b||Vx(m._custom)||s===b._top||s===b._bottom,x:c?v.head:y.center,y:c?y.center:v.head,height:c?y.size:Math.abs(v.size),width:c?Math.abs(v.size):y.size};h&&(S.options=d||this.resolveDataElementOptions(p,t[p].active?"active":o));const _=S.options||t[p].options;zne(S,_,b,s),Hne(S,_,u.ratio),this.updateElement(t[p],p,S,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(Ot(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||Ine(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=Vx(c);let d=l[n.axis],h=0,p=r?this.applyStack(n,l,r):d,m,v;p!==d&&(h=p-d,p=d),u&&(d=c.barStart,p=c.barEnd-c.barStart,d!==0&&Ki(d)!==Ki(c.barEnd)&&(h=0),h+=d);const y=!Ot(i)&&!u?i:h;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(h+p):m=b,v=m-b,Math.abs(v)<s){v=jne(v,n,a)*s,d===a&&(b-=v/2);const S=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),C=Math.min(S,_),E=Math.max(S,_);b=Math.max(Math.min(b,E),C),m=b+v,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(m)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){const S=Ki(v)*n.getLineWidthForValue(a)/2;b+=S,v-=S}return{size:v,base:b,head:m,center:m+v/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=st(o.maxBarThickness,1/0);let a,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?Lne(t,n,o,c):Nne(t,n,o,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=u.start+u.chunk*d+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(Jm,"id","bar"),Ne(Jm,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ne(Jm,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Zm extends Qo{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=st(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=st(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,d=a.axis;for(let h=n;h<n+r;h++){const p=t[h],m=!i&&this.getParsed(h),v={},y=v[u]=i?s.getPixelForDecimal(.5):s.getPixelForValue(m[u]),b=v[d]=i?a.getBasePixel():a.getPixelForValue(m[d]);v.skip=isNaN(y)||isNaN(b),c&&(v.options=l||this.resolveDataElementOptions(h,p.active?"active":o),i&&(v.options.radius=0)),this.updateElement(p,h,v,o)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return n!=="active"&&(o.radius=0),o.radius+=st(r&&r._custom,i),o}}Ne(Zm,"id","bubble"),Ne(Zm,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Ne(Zm,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Vne(e,t,n){let r=1,o=1,i=0,s=0;if(t<Sn){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),h=Math.sin(l),p=(_,C,E)=>wh(_,a,l,!0)?1:Math.max(C,C*n,E,E*n),m=(_,C,E)=>wh(_,a,l,!0)?-1:Math.min(C,C*n,E,E*n),v=p(0,c,d),y=p(Vn,u,h),b=m(_n,c,d),S=m(_n+Vn,u,h);r=(v-b)/2,o=(y-S)/2,i=-(v+b)/2,s=-(y+S)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class jl extends Qo{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=>+Ha(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return yi(this.options.rotation-90)}_getCircumference(){return yi(this.options.circumference)}_getRotationExtents(){let t=Sn,n=-Sn;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(rte(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:p,offsetX:m,offsetY:v}=Vne(d,u,l),y=(r.width-s)/h,b=(r.height-s)/p,S=Math.max(Math.min(y,b)/2,0),_=C4(this.options.radius,S),C=Math.max(_*l,0),E=(_-C)/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=v*_,o.total=this.calculateTotal(),this.outerRadius=_-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/Sn)}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,d=(a.top+a.bottom)/2,h=i&&c.animateScale,p=h?0:this.innerRadius,m=h?0:this.outerRadius,{sharedOptions:v,includeOptions:y}=this._getSharedOptions(n,o);let b=this._getRotation(),S;for(S=0;S<n;++S)b+=this._circumference(S,i);for(S=n;S<n+r;++S){const _=this._circumference(S,i),C=t[S],E={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:m,innerRadius:p};y&&(E.options=v||this.resolveDataElementOptions(S,C.active?"active":o)),b+=_,this.updateElement(C,S,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)?Sn*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=Rp(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(st(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ne(jl,"id","doughnut"),Ne(jl,"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(jl,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ne(jl,"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 e0 extends Qo{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}=D4(n,o,s);this._drawStart=a,this._drawCount=l,k4(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:d}=this._getSharedOptions(n,o),h=s.axis,p=a.axis,{spanGaps:m,segment:v}=this.options,y=td(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||i||o==="none",S=n+r,_=t.length;let C=n>0&&this.getParsed(n-1);for(let E=0;E<_;++E){const T=t[E],A=b?T:{};if(E<n||E>=S){A.skip=!0;continue}const D=this.getParsed(E),k=Ot(D[p]),j=A[h]=s.getPixelForValue(D[h],E),$=A[p]=i||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,D,l):D[p],E);A.skip=isNaN(j)||isNaN($)||k,A.stop=E>0&&Math.abs(D[h]-C[h])>y,v&&(A.parsed=D,A.raw=c.data[E]),d&&(A.options=u||this.resolveDataElementOptions(E,T.active?"active":o)),b||this.updateElement(T,E,A,o),C=D}}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(e0,"id","line"),Ne(e0,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ne(e0,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Zf extends Qo{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=Rp(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return B4.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,d=c.yCenter,h=c.getIndexAngle(0)-.5*_n;let p=h,m;const v=360/this.countVisibleElements();for(m=0;m<n;++m)p+=this._computeAngle(m,o,v);for(m=n;m<n+r;m++){const y=t[m];let b=p,S=p+this._computeAngle(m,o,v),_=s.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=S,i&&(l.animateScale&&(_=0),l.animateRotate&&(b=S=h));const C={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:b,endAngle:S,options:this.resolveDataElementOptions(m,y.active?"active":o)};this.updateElement(y,m,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)?yi(this.resolveDataElementOptions(t,n).angle||r):0}}Ne(Zf,"id","polarArea"),Ne(Zf,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Ne(Zf,"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 sS extends jl{}Ne(sS,"id","pie"),Ne(sS,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class t0 extends Qo{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 B4.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),d=s?i.xCenter:u.x,h=s?i.yCenter:u.y,p={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,a,p,o)}}}Ne(t0,"id","radar"),Ne(t0,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Ne(t0,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class n0 extends Qo{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}=D4(n,r,o);if(this._drawStart=i,this._drawCount=s,k4(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),d=this.getSharedOptions(u),h=this.includeOptions(o,d),p=s.axis,m=a.axis,{spanGaps:v,segment:y}=this.options,b=td(v)?v:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||i||o==="none";let _=n>0&&this.getParsed(n-1);for(let C=n;C<n+r;++C){const E=t[C],T=this.getParsed(C),A=S?E:{},D=Ot(T[m]),k=A[p]=s.getPixelForValue(T[p],C),j=A[m]=i||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,T,l):T[m],C);A.skip=isNaN(k)||isNaN(j)||D,A.stop=C>0&&Math.abs(T[p]-_[p])>b,y&&(A.parsed=T,A.raw=c.data[C]),h&&(A.options=d||this.resolveDataElementOptions(C,E.active?"active":o)),S||this.updateElement(E,C,A,o),_=T}this.updateSharedOptions(d,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(n0,"id","scatter"),Ne(n0,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Ne(n0,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Wne=Object.freeze({__proto__:null,BarController:Jm,BubbleController:Zm,DoughnutController:jl,LineController:e0,PieController:sS,PolarAreaController:Zf,RadarController:t0,ScatterController:n0});function wl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ZC{constructor(t){Ne(this,"options");this.options=t||{}}static override(t){Object.assign(ZC.prototype,t)}init(){}formats(){return wl()}parse(){return wl()}format(){return wl()}add(){return wl()}diff(){return wl()}startOf(){return wl()}endOf(){return wl()}}var Une={_date:ZC};function Gne(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?gte:Fs;if(r){if(o._sharedOptions){const c=i[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(i,t,n-u),h=l(i,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function Pp(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:d,hi:h}=Gne(i[a],t,s,o);for(let p=d;p<=h;++p){const m=u[p];m.skip||r(m,c,p)}}}function qne(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 Wx(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||Pp(e,n,t,function(a,l,c){!o&&!js(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function Yne(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=P4(s,{x:t.x,y:t.y});wh(d,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return Pp(e,n,t,i),o}function Kne(e,t,n,r,o,i){let s=[];const a=qne(n);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const p=u.inRange(t.x,t.y,o);if(r&&!p)return;const m=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(m))&&!p)return;const y=a(t,m);y<l?(s=[{element:u,datasetIndex:d,index:h}],l=y):y===l&&s.push({element:u,datasetIndex:d,index:h})}return Pp(e,n,t,c),s}function Ux(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?Yne(e,t,n,o):Kne(e,t,n,r,o,i)}function CM(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Pp(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 Xne={evaluateInteractionItems:Pp,modes:{index(e,t,n,r){const o=Rl(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Wx(e,o,i,r,s):Ux(e,o,i,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const o=Rl(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Wx(e,o,i,r,s):Ux(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=Rl(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Wx(e,o,i,r,s)},nearest(e,t,n,r){const o=Rl(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Ux(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=Rl(t,e);return CM(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=Rl(t,e);return CM(e,o,"y",n.intersect,r)}}};const Q4=["left","top","right","bottom"];function sf(e,t){return e.filter(n=>n.pos===t)}function EM(e,t){return e.filter(n=>Q4.indexOf(n.pos)===-1&&n.box.axis===t)}function af(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 Qne(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 Jne(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!Q4.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 Zne(e,t){const n=Jne(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 ere(e){const t=Qne(e),n=af(t.filter(c=>c.box.fullSize),!0),r=af(sf(t,"left"),!0),o=af(sf(t,"right")),i=af(sf(t,"top"),!0),s=af(sf(t,"bottom")),a=EM(t,"x"),l=EM(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:sf(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function RM(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function J4(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 tre(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!Dt(o)){n.size&&(e[o]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?i.height:i.width),n.size=d.size/d.count,e[o]+=n.size}i.getPadding&&J4(s,i.getPadding());const a=Math.max(0,t.outerWidth-RM(s,e,"left","right")),l=Math.max(0,t.outerHeight-RM(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 nre(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 rre(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 If(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,rre(a.horizontal,t));const{same:d,other:h}=tre(t,n,a,r);c|=d&&o.length,u=u||h,l.fullSize||o.push(a)}return c&&If(o,t,n,r)||u}function sm(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 PM(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 d=t.w*u,h=c.size||l.height;xh(c.start)&&(s=c.start),l.fullSize?sm(l,o.left,s,n.outerWidth-o.right-o.left,h):sm(l,t.left+c.placed,s,d,h),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,h=c.size||l.width;xh(c.start)&&(i=c.start),l.fullSize?sm(l,i,o.top,h,n.outerHeight-o.bottom-o.top):sm(l,i,t.top+c.placed,h,d),c.start=i,c.placed+=d,i=l.right}}t.x=i,t.y=s}var Sr={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=hr(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=ere(e.boxes),l=a.vertical,c=a.horizontal;Jt(e.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const u=l.reduce((v,y)=>y.box.options&&y.box.options.display===!1?v:v+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},o);J4(h,hr(r));const p=Object.assign({maxPadding:h,w:i,h:s,x:o.left,y:o.top},o),m=Zne(l.concat(c),d);If(a.fullSize,p,d,m),If(l,p,d,m),If(c,p,d,m)&&If(l,p,d,m),nre(p),PM(a.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,PM(a.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Jt(a.chartArea,v=>{const y=v.box;Object.assign(y,e.chartArea),y.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Z4{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 ore extends Z4{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const r0="$chartjs",ire={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},OM=e=>e===null||e==="";function sre(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[r0]={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",OM(o)){const i=uM(e,"width");i!==void 0&&(e.width=i)}if(OM(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=uM(e,"height");i!==void 0&&(e.height=i)}return e}const eL=lne?{passive:!0}:!1;function are(e,t,n){e.addEventListener(t,n,eL)}function lre(e,t,n){e.canvas.removeEventListener(t,n,eL)}function cre(e,t){const n=ire[e.type]||e.type,{x:r,y:o}=Rl(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function k0(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function ure(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||k0(a.addedNodes,r),s=s&&!k0(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function dre(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||k0(a.removedNodes,r),s=s&&!k0(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const _h=new Map;let TM=0;function tL(){const e=window.devicePixelRatio;e!==TM&&(TM=e,_h.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function fre(e,t){_h.size||window.addEventListener("resize",tL),_h.set(e,t)}function hre(e){_h.delete(e),_h.size||window.removeEventListener("resize",tL)}function pre(e,t,n){const r=e.canvas,o=r&&JC(r);if(!o)return;const i=A4((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),fre(e,i),s}function Gx(e,t,n){n&&n.disconnect(),t==="resize"&&hre(e)}function gre(e,t,n){const r=e.canvas,o=A4(i=>{e.ctx!==null&&n(cre(i,e))},e);return are(r,t,o),o}class mre extends Z4{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(sre(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[r0])return!1;const r=n[r0].initial;["height","width"].forEach(i=>{const s=r[i];Ot(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[r0],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:ure,detach:dre,resize:pre}[n]||gre;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:Gx,detach:Gx,resize:Gx}[n]||lre)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return ane(t,n,r,o)}isAttached(t){const n=JC(t);return!!(n&&n.isConnected)}}function vre(e){return!QC()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?ore:mre}var Qm;let ls=(Qm=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 td(this.x)&&td(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(Qm,"defaults",{}),Ne(Qm,"defaultRoutes"),Qm);function bre(e,t){const n=e.options.ticks,r=yre(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?wre(t):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return Sre(t,c,i,s/o),c;const u=xre(i,t,o);if(s>0){let d,h;const p=s>1?Math.round((l-a)/(s-1)):null;for(am(t,c,u,Ot(p)?0:a-p,a),d=0,h=s-1;d<h;d++)am(t,c,u,i[d],i[d+1]);return am(t,c,u,l,Ot(p)?t.length:l+p),c}return am(t,c,u),c}function yre(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 xre(e,t,n){const r=_re(e),o=t.length/n;if(!r)return Math.max(o,1);const i=dte(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 wre(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Sre(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 am(e,t,n,r,o){const i=st(r,0),s=Math.min(st(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 _re(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 Cre=e=>e==="left"?"right":e==="right"?"left":e,MM=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,AM=(e,t)=>Math.min(t||e,e);function DM(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 Ere(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 Rre(e,t){Jt(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 lf(e){return e.drawTicks?e.tickLength:0}function kM(e,t){if(!e.display)return 0;const n=Gn(e.font,t),r=hr(e.padding);return(wn(e.text)?e.text.length:1)*n.lineHeight+r.height}function Pre(e,t){return Za(e,{scale:t,type:"scale"})}function Ore(e,t,n){return Za(e,{tick:n,index:t,type:"tick"})}function Tre(e,t,n){let r=UC(e);return(n&&t!=="right"||!n&&t==="right")&&(r=Cre(r)),r}function Mre(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,h,p,m;const v=s-o,y=a-i;if(e.isHorizontal()){if(p=xr(r,i,a),Dt(n)){const b=Object.keys(n)[0],S=n[b];m=u[b].getPixelForValue(S)+v-t}else n==="center"?m=(c.bottom+c.top)/2+v-t:m=MM(e,n,t);h=a-i}else{if(Dt(n)){const b=Object.keys(n)[0],S=n[b];p=u[b].getPixelForValue(S)-y+t}else n==="center"?p=(c.left+c.right)/2-y+t:p=MM(e,n,t);m=xr(r,s,o),d=n==="left"?-Vn:Vn}return{titleX:p,titleY:m,maxWidth:h,rotation:d}}class el extends ls{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=bo(t,Number.POSITIVE_INFINITY),n=bo(n,Number.NEGATIVE_INFINITY),r=bo(r,Number.POSITIVE_INFINITY),o=bo(o,Number.NEGATIVE_INFINITY),{min:bo(t,r),max:bo(n,o),minDefined:Nn(t),maxDefined:Nn(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:bo(n,bo(r,n)),max:bo(r,bo(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(){an(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=$te(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?DM(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=bre(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(){an(this.options.afterUpdate,[this])}beforeSetDimensions(){an(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(){an(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),an(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){an(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=an(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){an(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){an(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=AM(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(),d=u.widest.width,h=u.highest.height,p=or(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),d+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-lf(t.grid)-n.padding-kM(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),s=VC(Math.min(Math.asin(or((u.highest.height+6)/a,-1,1)),Math.asin(or(l/c,-1,1))-Math.asin(or(h/c,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){an(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){an(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=kM(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=lf(i)+l):(t.height=this.maxHeight,t.width=lf(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),p=r.padding*2,m=yi(this.labelRotation),v=Math.cos(m),y=Math.sin(m);if(a){const b=r.mirror?0:y*d.width+v*h.height;t.height=Math.min(this.maxHeight,t.height+b+p)}else{const b=r.mirror?0:v*d.width+y*h.height;t.width=Math.min(this.maxWidth,t.width+b+p)}this._calculatePadding(c,u,y,v)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,o){const{ticks:{align:i,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,p=0;l?c?(h=o*t.width,p=r*n.height):(h=r*t.height,p=o*n.width):i==="start"?p=n.width:i==="end"?h=t.width:i!=="inner"&&(h=t.width/2,p=n.width/2),this.paddingLeft=Math.max((h-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;i==="start"?(u=0,d=t.height):i==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){an(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++)Ot(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=DM(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/AM(n,r));let c=0,u=0,d,h,p,m,v,y,b,S,_,C,E;for(d=0;d<n;d+=l){if(m=t[d].label,v=this._resolveTickFontOptions(d),o.font=y=v.string,b=i[y]=i[y]||{data:{},gc:[]},S=v.lineHeight,_=C=0,!Ot(m)&&!wn(m))_=M0(o,b.data,b.gc,_,m),C=S;else if(wn(m))for(h=0,p=m.length;h<p;++h)E=m[h],!Ot(E)&&!wn(E)&&(_=M0(o,b.data,b.gc,_,E),C+=S);s.push(_),a.push(C),c=Math.max(_,c),u=Math.max(C,u)}Rre(i,n);const T=s.indexOf(c),A=a.indexOf(u),D=k=>({width:s[k]||0,height:a[k]||0});return{first:D(0),last:D(n-1),widest:D(T),highest:D(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 pte(this._alignToPixels?xl(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=Ore(this.getContext(),t,r))}return this.$context||(this.$context=Pre(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=yi(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(),d=this.ticks.length+(l?1:0),h=lf(i),p=[],m=a.setContext(this.getContext()),v=m.display?m.width:0,y=v/2,b=function(W){return xl(r,W,v)};let S,_,C,E,T,A,D,k,j,$,z,K;if(s==="top")S=b(this.bottom),A=this.bottom-h,k=S-y,$=b(t.top)+y,K=t.bottom;else if(s==="bottom")S=b(this.top),$=t.top,K=b(t.bottom)-y,A=S+y,k=this.top+h;else if(s==="left")S=b(this.right),T=this.right-h,D=S-y,j=b(t.left)+y,z=t.right;else if(s==="right")S=b(this.left),j=t.left,z=b(t.right)-y,T=S+y,D=this.left+h;else if(n==="x"){if(s==="center")S=b((t.top+t.bottom)/2+.5);else if(Dt(s)){const W=Object.keys(s)[0],H=s[W];S=b(this.chart.scales[W].getPixelForValue(H))}$=t.top,K=t.bottom,A=S+y,k=A+h}else if(n==="y"){if(s==="center")S=b((t.left+t.right)/2);else if(Dt(s)){const W=Object.keys(s)[0],H=s[W];S=b(this.chart.scales[W].getPixelForValue(H))}T=S-y,D=T-h,j=t.left,z=t.right}const V=st(o.ticks.maxTicksLimit,d),N=Math.max(1,Math.ceil(d/V));for(_=0;_<d;_+=N){const W=this.getContext(_),H=i.setContext(W),G=a.setContext(W),te=H.lineWidth,F=H.color,Y=G.dash||[],q=G.dashOffset,M=H.tickWidth,ne=H.tickColor,X=H.tickBorderDash||[],re=H.tickBorderDashOffset;C=Ere(this,_,l),C!==void 0&&(E=xl(r,C,te),c?T=D=j=z=E:A=k=$=K=E,p.push({tx1:T,ty1:A,tx2:D,ty2:k,x1:j,y1:$,x2:z,y2:K,width:te,color:F,borderDash:Y,borderDashOffset:q,tickWidth:M,tickColor:ne,tickBorderDash:X,tickBorderDashOffset:re}))}return this._ticksLength=d,this._borderValue=S,p}_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:d}=i,h=lf(r.grid),p=h+u,m=d?-u:p,v=-yi(this.labelRotation),y=[];let b,S,_,C,E,T,A,D,k,j,$,z,K="middle";if(o==="top")T=this.bottom-m,A=this._getXAxisLabelAlignment();else if(o==="bottom")T=this.top+m,A=this._getXAxisLabelAlignment();else if(o==="left"){const N=this._getYAxisLabelAlignment(h);A=N.textAlign,E=N.x}else if(o==="right"){const N=this._getYAxisLabelAlignment(h);A=N.textAlign,E=N.x}else if(n==="x"){if(o==="center")T=(t.top+t.bottom)/2+p;else if(Dt(o)){const N=Object.keys(o)[0],W=o[N];T=this.chart.scales[N].getPixelForValue(W)+p}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(t.left+t.right)/2-p;else if(Dt(o)){const N=Object.keys(o)[0],W=o[N];E=this.chart.scales[N].getPixelForValue(W)}A=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?K="top":l==="end"&&(K="bottom"));const V=this._getLabelSizes();for(b=0,S=a.length;b<S;++b){_=a[b],C=_.label;const N=i.setContext(this.getContext(b));D=this.getPixelForTick(b)+i.labelOffset,k=this._resolveTickFontOptions(b),j=k.lineHeight,$=wn(C)?C.length:1;const W=$/2,H=N.color,G=N.textStrokeColor,te=N.textStrokeWidth;let F=A;s?(E=D,A==="inner"&&(b===S-1?F=this.options.reverse?"left":"right":b===0?F=this.options.reverse?"right":"left":F="center"),o==="top"?c==="near"||v!==0?z=-$*j+j/2:c==="center"?z=-V.highest.height/2-W*j+j:z=-V.highest.height+j/2:c==="near"||v!==0?z=j/2:c==="center"?z=V.highest.height/2-W*j:z=V.highest.height-$*j,d&&(z*=-1),v!==0&&!N.showLabelBackdrop&&(E+=j/2*Math.sin(v))):(T=D,z=(1-$)*j/2);let Y;if(N.showLabelBackdrop){const q=hr(N.backdropPadding),M=V.heights[b],ne=V.widths[b];let X=z-q.top,re=0-q.left;switch(K){case"middle":X-=M/2;break;case"bottom":X-=M;break}switch(A){case"center":re-=ne/2;break;case"right":re-=ne;break;case"inner":b===S-1?re-=ne:b>0&&(re-=ne/2);break}Y={left:re,top:X,width:ne+q.width,height:M+q.height,color:N.backdropColor}}y.push({label:C,font:k,textOffset:z,options:{rotation:v,color:H,strokeColor:G,strokeWidth:te,textAlign:F,textBaseline:K,translation:[E,T],backdrop:Y}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-yi(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,d,h;this.isHorizontal()?(c=xl(t,this.left,s)-s/2,u=xl(t,this.right,a)+a/2,d=h=l):(d=xl(t,this.top,s)-s/2,h=xl(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&Zl(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;vc(r,c,0,u,l,a)}o&&ec(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=Gn(r.font),s=hr(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Dt(n)?(l+=s.bottom,wn(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=Mre(this,l,n,a);vc(t,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:h,textAlign:Tre(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=st(t.grid&&t.grid.z,-1),o=st(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 Gn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class lm{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;kre(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,Are(t,s,r),this.override&&An.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 An[o]&&(delete An[o][r],this.override&&delete mc[r])}}function Are(e,t,n){const r=ir(Object.create(null),[n?An.get(n):{},An.get(t),e.defaults]);An.set(t,r),e.defaultRoutes&&Dre(t,e.defaultRoutes),e.descriptors&&An.describe(t,e.descriptors)}function Dre(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(".");An.route(i,o,l,a)})}function kre(e){return"id"in e&&"defaults"in e}class Ire{constructor(){this.controllers=new lm(Qo,"datasets",!0),this.elements=new lm(ls,"elements"),this.plugins=new lm(Object,"plugins"),this.scales=new lm(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):Jt(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=HC(t);an(r["before"+o],[],r),n[t](r),an(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 Lr=new Ire;class Nre{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(an(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){Ot(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=st(r.options&&r.options.plugins,{}),i=Lre(r);return o===!1&&!n?[]:jre(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 Lre(e){const t={},n=[],r=Object.keys(Lr.plugins.items);for(let i=0;i<r.length;i++)n.push(Lr.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 Fre(e,t){return!t&&e===!1?null:e===!0?{}:e}function jre(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,c=Fre(r[l],o);c!==null&&i.push({plugin:a,options:$re(e.config,{plugin:a,local:n[l]},c,s)})}return i}function $re(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 aS(e,t){const n=An.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function zre(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Bre(e,t){return e===t?"_index_":"_value_"}function IM(e){if(e==="x"||e==="y"||e==="r")return e}function Hre(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function lS(e,...t){if(IM(e))return e;for(const n of t){const r=n.axis||Hre(n.position)||e.length>1&&IM(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function NM(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Vre(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 NM(e,"x",n[0])||NM(e,"y",n[0])}return{}}function Wre(e,t){const n=mc[e.type]||{scales:{}},r=t.scales||{},o=aS(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=lS(s,a,Vre(s,e),An.scales[a.type]),c=Bre(l,o),u=n.scales||{};i[s]=Kf(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||aS(a,t),u=(mc[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=zre(d,l),p=s[h+"AxisID"]||h;i[p]=i[p]||Object.create(null),Kf(i[p],[{axis:h},r[p],u[d]])})}),Object.keys(i).forEach(s=>{const a=i[s];Kf(a,[An.scales[a.type],An.scale])}),i}function nL(e){const t=e.options||(e.options={});t.plugins=st(t.plugins,{}),t.scales=Wre(e,t)}function rL(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Ure(e){return e=e||{},e.data=rL(e.data),nL(e),e}const LM=new Map,oL=new Set;function cm(e,t){let n=LM.get(e);return n||(n=t(),LM.set(e,n),oL.add(n)),n}const cf=(e,t,n)=>{const r=Ha(t,n);r!==void 0&&e.add(r)};class Gre{constructor(t){this._config=Ure(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=rL(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(),nL(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return cm(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return cm(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return cm(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return cm(`${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(d=>cf(l,t,d))),u.forEach(d=>cf(l,o,d)),u.forEach(d=>cf(l,mc[i]||{},d)),u.forEach(d=>cf(l,An,d)),u.forEach(d=>cf(l,iS,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),oL.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,mc[n]||{},An.datasets[n]||{},{type:n},An,iS]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=FM(this._resolverCache,t,o);let l=s;if(Yre(s,n)){i.$shared=!1,r=Va(r)?r():r;const c=this.createResolver(t,r,a);l=nd(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=FM(this._resolverCache,t,r);return Dt(n)?nd(i,n,void 0,o):i}}function FM(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:YC(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const qre=e=>Dt(e)&&Object.getOwnPropertyNames(e).some(t=>Va(e[t]));function Yre(e,t){const{isScriptable:n,isIndexable:r}=F4(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(Va(a)||qre(a))||s&&wn(a))return!0}return!1}var Kre="4.4.1";const Xre=["top","bottom","left","right","chartArea"];function jM(e,t){return e==="top"||e==="bottom"||Xre.indexOf(e)===-1&&t==="x"}function $M(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function zM(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),an(n&&n.onComplete,[e],t)}function Qre(e){const t=e.chart,n=t.options.animation;an(n&&n.onProgress,[e],t)}function iL(e){return QC()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const o0={},BM=e=>{const t=iL(e);return Object.values(o0).filter(n=>n.canvas===t).pop()};function Jre(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 Zre(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function um(e,t,n){return e.options.clip?e[n]:t[n]}function eoe(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:um(n,t,"left"),right:um(n,t,"right"),top:um(r,t,"top"),bottom:um(r,t,"bottom")}:t}class Mn{static register(...t){Lr.add(...t),HM()}static unregister(...t){Lr.remove(...t),HM()}constructor(t,n){const r=this.config=new Gre(n),o=iL(t),i=BM(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||vre(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=nte(),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 Nre,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=bte(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],o0[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ps.listen(this,"complete",zM),Ps.listen(this,"progress",Qre),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return Ot(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 Lr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():cM(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return sM(this.canvas,this.ctx),this}stop(){return Ps.stop(this),this}resize(t,n){Ps.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,cM(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),an(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Jt(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=lS(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Jt(i,s=>{const a=s.options,l=a.id,c=lS(l,a),u=st(a.type,s.dtype);(a.position===void 0||jM(a.position,c)!==jM(s.dposition))&&(a.position=s.dposition),o[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const h=Lr.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Jt(o,(s,a)=>{s||delete r[a]}),Jt(r,s=>{Sr.configure(this,s,s.options),Sr.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($M("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||aS(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=Lr.getController(a),{datasetElementType:c,dataElementType:u}=An.datasets[a];Object.assign(l,{dataElementType:Lr.getElement(u),datasetElementType:c&&Lr.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Jt(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:d}=this.getDatasetMeta(c),h=!o&&i.indexOf(d)===-1;d.buildOrUpdateElements(h),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||Jt(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort($M("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Jt(this.scales,t=>{Sr.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!QT(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;Jre(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(!QT(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;Sr.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Jt(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,Va(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&&(Ps.has(this)?this.attached&&!Ps.running(this)&&Ps.start(this):(this.draw(),zM({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=eoe(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&Zl(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&&ec(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return js(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=Xne.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=Za(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);xh(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(),Ps.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(),sM(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete o0[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)};Jt(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(){Jt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Jt(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}});!P0(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(d=>u.datasetIndex===d.datasetIndex&&u.index===d.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=lte(t),c=Zre(t,this._lastEvent,r,l);r&&(this._lastEvent=null,an(i.onHover,[t,a,this],this),l&&an(i.onClick,[t,a,this],this));const u=!P0(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(Mn,"defaults",An),Ne(Mn,"instances",o0),Ne(Mn,"overrides",mc),Ne(Mn,"registry",Lr),Ne(Mn,"version",Kre),Ne(Mn,"getChart",BM);function HM(){return Jt(Mn.instances,e=>e._plugins.invalidate())}function toe(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+Vn,r-Vn),e.closePath(),e.clip()}function noe(e){return qC(e,["outerStart","outerEnd","innerStart","innerEnd"])}function roe(e,t,n,r){const o=noe(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 or(l,0,Math.min(i,c))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:or(o.innerStart,0,s),innerEnd:or(o.innerEnd,0,s)}}function nu(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function I0(e,t,n,r,o,i){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),h=u>0?u+r+n+c:0;let p=0;const m=o-l;if(r){const N=u>0?u-r:0,W=d>0?d-r:0,H=(N+W)/2,G=H!==0?m*H/(H+r):m;p=(m-G)/2}const v=Math.max(.001,m*d-n/_n)/d,y=(m-v)/2,b=l+y+p,S=o-y-p,{outerStart:_,outerEnd:C,innerStart:E,innerEnd:T}=roe(t,h,d,S-b),A=d-_,D=d-C,k=b+_/A,j=S-C/D,$=h+E,z=h+T,K=b+E/$,V=S-T/z;if(e.beginPath(),i){const N=(k+j)/2;if(e.arc(s,a,d,k,N),e.arc(s,a,d,N,j),C>0){const te=nu(D,j,s,a);e.arc(te.x,te.y,C,j,S+Vn)}const W=nu(z,S,s,a);if(e.lineTo(W.x,W.y),T>0){const te=nu(z,V,s,a);e.arc(te.x,te.y,T,S+Vn,V+Math.PI)}const H=(S-T/h+(b+E/h))/2;if(e.arc(s,a,h,S-T/h,H,!0),e.arc(s,a,h,H,b+E/h,!0),E>0){const te=nu($,K,s,a);e.arc(te.x,te.y,E,K+Math.PI,b-Vn)}const G=nu(A,b,s,a);if(e.lineTo(G.x,G.y),_>0){const te=nu(A,k,s,a);e.arc(te.x,te.y,_,b-Vn,k)}}else{e.moveTo(s,a);const N=Math.cos(k)*d+s,W=Math.sin(k)*d+a;e.lineTo(N,W);const H=Math.cos(j)*d+s,G=Math.sin(j)*d+a;e.lineTo(H,G)}e.closePath()}function ooe(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){I0(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=s+(a%Sn||Sn))}return I0(e,t,n,r,l,o),e.fill(),l}function ioe(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=h,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(i){I0(e,t,n,r,m,o);for(let v=0;v<i;++v)e.stroke();isNaN(a)||(m=s+(a%Sn||Sn))}p&&toe(e,t,m),i||(I0(e,t,n,r,m,o),e.stroke())}class gu extends ls{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}=P4(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),p=(this.options.spacing+this.options.borderWidth)/2,v=st(h,c-l)>=Sn||wh(s,l,c),y=Ls(a,u+p,d+p);return v&&y}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,d=(i+s)/2,h=(a+l+u+c)/2;return{x:r+Math.cos(d)*h,y:o+Math.sin(d)*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>Sn?Math.floor(o/Sn):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(_n,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,ooe(n,this,u,s,a),ioe(n,this,u,s,a),n.restore()}}Ne(gu,"id","arc"),Ne(gu,"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(gu,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ne(gu,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function sL(e,t,n=t){e.lineCap=st(n.borderCapStyle,t.borderCapStyle),e.setLineDash(st(n.borderDash,t.borderDash)),e.lineDashOffset=st(n.borderDashOffset,t.borderDashOffset),e.lineJoin=st(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=st(n.borderWidth,t.borderWidth),e.strokeStyle=st(n.borderColor,t.borderColor)}function soe(e,t,n){e.lineTo(n.x,n.y)}function aoe(e){return e.stepped?Mte:e.tension||e.cubicInterpolationMode==="monotone"?Ate:soe}function aL(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 loe(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:c}=aL(o,n,r),u=aoe(i);let{move:d=!0,reverse:h}=r||{},p,m,v;for(p=0;p<=c;++p)m=o[(a+(h?c-p:p))%s],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,v,m,h,i.stepped),v=m);return l&&(m=o[(a+(h?c:0))%s],u(e,v,m,h,i.stepped)),!!l}function coe(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=aL(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,h,p,m,v,y,b;const S=C=>(s+(c?a-C:C))%i,_=()=>{v!==y&&(e.lineTo(u,y),e.lineTo(u,v),e.lineTo(u,b))};for(l&&(p=o[S(0)],e.moveTo(p.x,p.y)),h=0;h<=a;++h){if(p=o[S(h)],p.skip)continue;const C=p.x,E=p.y,T=C|0;T===m?(E<v?v=E:E>y&&(y=E),u=(d*u+C)/++d):(_(),e.lineTo(C,E),m=T,d=0,v=y=E),b=E}_()}function cS(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?coe:loe}function uoe(e){return e.stepped?cne:e.tension||e.cubicInterpolationMode==="monotone"?une:Pl}function doe(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),sL(e,t.options),e.stroke(o)}function foe(e,t,n,r){const{segments:o,options:i}=t,s=cS(t);for(const a of o)sL(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const hoe=typeof Path2D=="function";function poe(e,t,n,r){hoe&&!t.options.segment?doe(e,t,n,r):foe(e,t,n,r)}class Da extends ls{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;tne(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=mne(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=q4(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=uoe(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:h}=s[c],p=i[d],m=i[h];if(p===m){a.push(p);continue}const v=Math.abs((o-p[n])/(m[n]-p[n])),y=l(p,m,v,r.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,r){return cS(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=cS(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(),poe(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ne(Da,"id","line"),Ne(Da,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ne(Da,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ne(Da,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function VM(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class rc extends ls{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 VM(this,n,"x",r)}inYRange(n,r){return VM(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||!js(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,A0(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ne(rc,"id","point"),Ne(rc,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ne(rc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function lL(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,d;return e.horizontal?(d=s/2,a=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,a=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:a,top:c,right:l,bottom:u}}function ka(e,t,n,r){return e?0:or(t,n,r)}function goe(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=L4(r);return{t:ka(o.top,i.top,0,n),r:ka(o.right,i.right,0,t),b:ka(o.bottom,i.bottom,0,n),l:ka(o.left,i.left,0,t)}}function moe(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=tc(o),s=Math.min(t,n),a=e.borderSkipped,l=r||Dt(o);return{topLeft:ka(!l||a.top||a.left,i.topLeft,0,s),topRight:ka(!l||a.top||a.right,i.topRight,0,s),bottomLeft:ka(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:ka(!l||a.bottom||a.right,i.bottomRight,0,s)}}function voe(e){const t=lL(e),n=t.right-t.left,r=t.bottom-t.top,o=goe(e,n/2,r/2),i=moe(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 qx(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&lL(e,r);return a&&(o||Ls(t,a.left,a.right))&&(i||Ls(n,a.top,a.bottom))}function boe(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function yoe(e,t){e.rect(t.x,t.y,t.w,t.h)}function Yx(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 oc extends ls{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}=voe(this),a=boe(s.radius)?Sh:yoe;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,Yx(s,n,i)),t.clip(),a(t,Yx(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Yx(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return qx(this,t,n,r)}inXRange(t,n){return qx(this,t,null,n)}inYRange(t,n){return qx(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(oc,"id","bar"),Ne(oc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ne(oc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var xoe=Object.freeze({__proto__:null,ArcElement:gu,BarElement:oc,LineElement:Da,PointElement:rc});const uS=["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)"],WM=uS.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function cL(e){return uS[e%uS.length]}function uL(e){return WM[e%WM.length]}function woe(e,t){return e.borderColor=cL(t),e.backgroundColor=uL(t),++t}function Soe(e,t){return e.backgroundColor=e.data.map(()=>cL(t++)),t}function _oe(e,t){return e.backgroundColor=e.data.map(()=>uL(t++)),t}function Coe(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof jl?t=Soe(n,t):o instanceof Zf?t=_oe(n,t):o&&(t=woe(n,t))}}function UM(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Eoe(e){return e&&(e.borderColor||e.backgroundColor)}var Roe={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&&(UM(r)||Eoe(o)||i&&UM(i)))return;const s=Coe(e);r.forEach(s)}};function Poe(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,d,h,p,m,v;for(s[l++]=e[u],d=0;d<i-2;d++){let y=0,b=0,S;const _=Math.floor((d+1)*a)+1+t,C=Math.min(Math.floor((d+2)*a)+1,n)+t,E=C-_;for(S=_;S<C;S++)y+=e[S].x,b+=e[S].y;y/=E,b/=E;const T=Math.floor(d*a)+1+t,A=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:D,y:k}=e[u];for(p=m=-1,S=T;S<A;S++)m=.5*Math.abs((D-y)*(e[S].y-k)-(D-e[S].x)*(b-k)),m>p&&(p=m,h=e[S],v=S);s[l++]=h,u=v}return s[l++]=e[c],s}function Ooe(e,t,n,r){let o=0,i=0,s,a,l,c,u,d,h,p,m,v;const y=[],b=t+n-1,S=e[t].x,C=e[b].x-S;for(s=t;s<t+n;++s){a=e[s],l=(a.x-S)/C*r,c=a.y;const E=l|0;if(E===u)c<m?(m=c,d=s):c>v&&(v=c,h=s),o=(i*o+a.x)/++i;else{const T=s-1;if(!Ot(d)&&!Ot(h)){const A=Math.min(d,h),D=Math.max(d,h);A!==p&&A!==T&&y.push({...e[A],x:o}),D!==p&&D!==T&&y.push({...e[D],x:o})}s>0&&T!==p&&y.push(e[T]),y.push(a),u=E,i=0,m=v=c,d=h=p=s}}return y}function dL(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 GM(e){e.data.datasets.forEach(t=>{dL(t)})}function Toe(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=or(Fs(t,i.axis,s).lo,0,n-1)),c?o=or(Fs(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var Moe={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){GM(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(xn([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:d,count:h}=Toe(l,c);const p=n.threshold||4*r;if(h<=p){dL(o);return}Ot(s)&&(o._data=c,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(v){this._data=v}}));let m;switch(n.algorithm){case"lttb":m=Poe(c,d,h,r,n);break;case"min-max":m=Ooe(c,d,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=m})},destroy(e){GM(e)}};function Aoe(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=eE(l,c,o);const u=dS(n,o[l],o[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:o[l],end:o[c]});continue}const d=q4(t,u);for(const h of d){const p=dS(n,i[h.start],i[h.end],h.loop),m=G4(a,o,p);for(const v of m)s.push({source:v,target:h,start:{[n]:qM(u,p,"start",Math.max)},end:{[n]:qM(u,p,"end",Math.min)}})}}return s}function dS(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=wo(o),i=wo(i)),{property:e,start:o,end:i}}function Doe(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=eE(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 eE(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function qM(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function fL(e,t){let n=[],r=!1;return wn(e)?(r=!0,n=e):n=Doe(e,t),n.length?new Da({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function YM(e){return e&&e.fill!==!1}function koe(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(!Nn(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function Ioe(e,t,n){const r=joe(e);if(Dt(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Nn(o)&&Math.floor(o)===o?Noe(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Noe(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function Loe(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 Foe(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 joe(e){const t=e.options,n=t.fill;let r=st(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function $oe(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=zoe(t,n);a.push(fL({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++)Boe(o,s[u],a)}return new Da({points:o,options:{}})}function zoe(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 Boe(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=Hoe(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function Hoe(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],d=s[u.start][n],h=s[u.end][n];if(Ls(o,d,h)){a=o===d,l=o===h;break}}return{first:a,last:l,point:r}}class hL{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:Sn},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 Voe(e){const{chart:t,fill:n,line:r}=e;if(Nn(n))return Woe(t,n);if(n==="stack")return $oe(e);if(n==="shape")return!0;const o=Uoe(e);return o instanceof hL?o:fL(o,r)}function Woe(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Uoe(e){return(e.scale||{}).getPointPositionForValue?qoe(e):Goe(e)}function Goe(e){const{scale:t={},fill:n}=e,r=Loe(n,t);if(Nn(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function qoe(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=Foe(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new hL({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 Kx(e,t,n){const r=Voe(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};r&&o.points.length&&(Zl(e,n),Yoe(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:s}),ec(e))}function Yoe(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&&(KM(e,r,s.top),XM(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),KM(e,r,s.bottom)),XM(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function KM(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],d=o[eE(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(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function XM(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=Aoe(n,r,o);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:h=i}={}}=l,p=r!==!0;e.save(),e.fillStyle=h,Koe(e,s,p&&dS(o,u,d)),e.beginPath();const m=!!n.pathSegment(e,l);let v;if(p){m?e.closePath():QM(e,r,d,o);const y=!!r.pathSegment(e,c,{move:m,reverse:!0});v=m&&y,v||QM(e,r,u,o)}e.closePath(),e.fill(v?"evenodd":"nonzero"),e.restore()}}function Koe(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 QM(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var Xoe={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 Da&&(l={visible:e.isDatasetVisible(s),index:s,fill:Ioe(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=koe(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&&Kx(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;YM(i)&&Kx(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!YM(r)||n.drawTime!=="beforeDatasetDraw"||Kx(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const JM=(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)}},Qoe=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class ZM extends ls{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=an(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=Gn(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=JM(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 d=t;i.textAlign="left",i.textBaseline="middle";let h=-1,p=-u;return this.legendItems.forEach((m,v)=>{const y=r+n/2+i.measureText(m.text).width;(v===0||c[c.length-1]+y+2*a>s)&&(d+=u,c[c.length-(v>0?0:1)]=0,p+=u,h++),l[v]={left:0,top:p,row:h,width:y,height:o},c[c.length-1]+=y+a}),d}_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 d=a,h=0,p=0,m=0,v=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:S,itemHeight:_}=Joe(r,n,i,y,o);b>0&&p+_+2*a>u&&(d+=h+a,c.push({width:h,height:p}),m+=h+a,v++,h=p=0),l[b]={left:m,top:p,col:v,width:S,height:_},h=Math.max(h,S),p+=_+a}),d+=h,c.push({width:h,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Eu(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=xr(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=xr(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=xr(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=xr(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;Zl(t,this),this._draw(),ec(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=An.color,l=Eu(t.rtl,this.left,this.width),c=Gn(s.font),{padding:u}=s,d=c.size,h=d/2;let p;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:m,boxHeight:v,itemHeight:y}=JM(s,d),b=function(T,A,D){if(isNaN(m)||m<=0||isNaN(v)||v<0)return;o.save();const k=st(D.lineWidth,1);if(o.fillStyle=st(D.fillStyle,a),o.lineCap=st(D.lineCap,"butt"),o.lineDashOffset=st(D.lineDashOffset,0),o.lineJoin=st(D.lineJoin,"miter"),o.lineWidth=k,o.strokeStyle=st(D.strokeStyle,a),o.setLineDash(st(D.lineDash,[])),s.usePointStyle){const j={radius:v*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:k},$=l.xPlus(T,m/2),z=A+h;N4(o,j,$,z,s.pointStyleWidth&&m)}else{const j=A+Math.max((d-v)/2,0),$=l.leftForLtr(T,m),z=tc(D.borderRadius);o.beginPath(),Object.values(z).some(K=>K!==0)?Sh(o,{x:$,y:j,w:m,h:v,radius:z}):o.rect($,j,m,v),o.fill(),k!==0&&o.stroke()}o.restore()},S=function(T,A,D){vc(o,D.text,T,A+y/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},_=this.isHorizontal(),C=this._computeTitleHeight();_?p={x:xr(i,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:p={x:this.left+u,y:xr(i,this.top+C+u,this.bottom-n[0].height),line:0},V4(this.ctx,t.textDirection);const E=y+u;this.legendItems.forEach((T,A)=>{o.strokeStyle=T.fontColor,o.fillStyle=T.fontColor;const D=o.measureText(T.text).width,k=l.textAlign(T.textAlign||(T.textAlign=s.textAlign)),j=m+h+D;let $=p.x,z=p.y;l.setWidth(this.width),_?A>0&&$+j+u>this.right&&(z=p.y+=E,p.line++,$=p.x=xr(i,this.left+u,this.right-r[p.line])):A>0&&z+E>this.bottom&&($=p.x=$+n[p.line].width+u,p.line++,z=p.y=xr(i,this.top+C+u,this.bottom-n[p.line].height));const K=l.x($);if(b(K,z,T),$=yte(k,$+m+h,_?$+j:this.right,t.rtl),S(l.x($),z,T),_)p.x+=j+u;else if(typeof T.text!="string"){const V=c.lineHeight;p.y+=pL(T,V)+u}else p.y+=E}),W4(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Gn(n.font),o=hr(n.padding);if(!n.display)return;const i=Eu(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=o.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=xr(t.align,d,this.right-h);else{const m=this.columnSizes.reduce((v,y)=>Math.max(v,y.height),0);u=c+xr(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=xr(a,d,d+h);s.textAlign=i.textAlign(UC(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,vc(s,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=Gn(t.font),r=hr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Ls(t,this.left,this.right)&&Ls(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Ls(t,o.left,o.left+o.width)&&Ls(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!tie(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=Qoe(o,r);o&&!i&&an(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&an(n.onHover,[t,r,this],this)}else r&&an(n.onClick,[t,r,this],this)}}function Joe(e,t,n,r,o){const i=Zoe(r,e,t,n),s=eie(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function Zoe(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 eie(e,t,n){let r=e;return typeof t.text!="string"&&(r=pL(t,n)),r}function pL(e,t){const n=e.text?e.text.length:0;return t*n}function tie(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var nie={id:"legend",_element:ZM,start(e,t,n){const r=e.legend=new ZM({ctx:e.ctx,options:n,chart:e});Sr.configure(e,r,n),Sr.addBox(e,r)},stop(e){Sr.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Sr.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=hr(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 tE=class extends ls{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=wn(r.text)?r.text.length:1;this._padding=hr(r.padding);const i=o*Gn(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,d;return this.isHorizontal()?(u=xr(a,r,i),d=n+t,c=i-r):(s.position==="left"?(u=r+t,d=xr(a,o,n),l=_n*-.5):(u=i-t,d=xr(a,n,o),l=_n*.5),c=o-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Gn(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);vc(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:UC(n.align),textBaseline:"middle",translation:[s,a]})}};function rie(e,t){const n=new tE({ctx:e.ctx,options:t,chart:e});Sr.configure(e,n,t),Sr.addBox(e,n),e.titleBlock=n}var oie={id:"title",_element:tE,start(e,t,n){rie(e,n)},stop(e){const t=e.titleBlock;Sr.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Sr.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 dm=new WeakMap;var iie={id:"subtitle",start(e,t,n){const r=new tE({ctx:e.ctx,options:n,chart:e});Sr.configure(e,r,n),Sr.addBox(e,r),dm.set(e,r)},stop(e){Sr.removeBox(e,dm.get(e)),dm.delete(e)},beforeUpdate(e,t,n){const r=dm.get(e);Sr.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 Nf={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=oS(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 Ii(e,t){return t&&(wn(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Os(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
251
+ `)>-1?e.split(`
252
+ `):e}function sie(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 eA(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=Gn(t.bodyFont),c=Gn(t.titleFont),u=Gn(t.footerFont),d=i.length,h=o.length,p=r.length,m=hr(t.padding);let v=m.height,y=0,b=r.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(v+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;v+=p*C+(b-p)*l.lineHeight+(b-1)*t.bodySpacing}h&&(v+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let S=0;const _=function(C){y=Math.max(y,n.measureText(C).width+S)};return n.save(),n.font=c.string,Jt(e.title,_),n.font=l.string,Jt(e.beforeBody.concat(e.afterBody),_),S=t.displayColors?s+2+t.boxPadding:0,Jt(r,C=>{Jt(C.before,_),Jt(C.lines,_),Jt(C.after,_)}),S=0,n.font=u.string,Jt(e.footer,_),n.restore(),y+=m.width,{width:y,height:v}}function aie(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function lie(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 cie(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"),lie(c,e,t,n)&&(c="center"),c}function tA(e,t,n){const r=n.yAlign||t.yAlign||aie(e,n);return{xAlign:n.xAlign||t.xAlign||cie(e,t,n,r),yAlign:r}}function uie(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function die(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function nA(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=tc(s);let m=uie(t,a);const v=die(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,h)+o:a==="right"&&(m+=Math.max(d,p)+o),{x:or(m,0,r.width-t.width),y:or(v,0,r.height-t.height)}}function fm(e,t,n){const r=hr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function rA(e){return Ii([],Os(e))}function fie(e,t,n){return Za(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function oA(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const gL={beforeTitle:_s,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:_s,beforeBody:_s,beforeLabel:_s,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 Ot(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:_s,afterBody:_s,beforeFooter:_s,footer:_s,afterFooter:_s};function Yr(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?gL[t].call(n,r):o}var hw;let iA=(hw=class extends ls{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 Y4(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=fie(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Yr(r,"beforeTitle",this,t),i=Yr(r,"title",this,t),s=Yr(r,"afterTitle",this,t);let a=[];return a=Ii(a,Os(o)),a=Ii(a,Os(i)),a=Ii(a,Os(s)),a}getBeforeBody(t,n){return rA(Yr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return Jt(t,i=>{const s={before:[],lines:[],after:[]},a=oA(r,i);Ii(s.before,Os(Yr(a,"beforeLabel",this,i))),Ii(s.lines,Yr(a,"label",this,i)),Ii(s.after,Os(Yr(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return rA(Yr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Yr(r,"beforeFooter",this,t),i=Yr(r,"footer",this,t),s=Yr(r,"afterFooter",this,t);let a=[];return a=Ii(a,Os(o)),a=Ii(a,Os(i)),a=Ii(a,Os(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(sie(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,h)=>t.filter(u,d,h,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Jt(a,u=>{const d=oA(t.callbacks,u);o.push(Yr(d,"labelColor",this,u)),i.push(Yr(d,"labelPointStyle",this,u)),s.push(Yr(d,"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=Nf[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=eA(this,r),c=Object.assign({},a,l),u=tA(this.chart,r,c),d=nA(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),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:d}=tc(a),{x:h,y:p}=t,{width:m,height:v}=n;let y,b,S,_,C,E;return i==="center"?(C=p+v/2,o==="left"?(y=h,b=y-s,_=C+s,E=C-s):(y=h+m,b=y+s,_=C-s,E=C+s),S=y):(o==="left"?b=h+Math.max(l,u)+s:o==="right"?b=h+m-Math.max(c,d)-s:b=this.caretX,i==="top"?(_=p,C=_-s,y=b-s,S=b+s):(_=p+v,C=_+s,y=b+s,S=b-s),E=_),{x1:y,x2:b,x3:S,y1:_,y2:C,y3:E}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=Eu(r.rtl,this.x,this.width);for(t.x=fm(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=Gn(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=Gn(i.bodyFont),d=fm(this,"left",i),h=o.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+p;if(i.usePointStyle){const v={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=o.leftForLtr(h,c)+c/2,b=m+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,A0(t,v,y,b),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,A0(t,v,y,b)}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 v=o.leftForLtr(h,c),y=o.leftForLtr(o.xPlus(h,1),c-2),b=tc(s.borderRadius);Object.values(b).some(S=>S!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Sh(t,{x:v,y:m,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Sh(t,{x:y,y:m+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(v,m,c,l),t.strokeRect(v,m,c,l),t.fillStyle=s.backgroundColor,t.fillRect(y,m+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,d=Gn(r.bodyFont);let h=d.lineHeight,p=0;const m=Eu(r.rtl,this.x,this.width),v=function(D){n.fillText(D,m.x(t.x+p),t.y+h/2),t.y+=h+i},y=m.textAlign(s);let b,S,_,C,E,T,A;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=fm(this,y,r),n.fillStyle=r.bodyColor,Jt(this.beforeBody,v),p=a&&y!=="right"?s==="center"?c/2+u:c+2+u:0,C=0,T=o.length;C<T;++C){for(b=o[C],S=this.labelTextColors[C],n.fillStyle=S,Jt(b.before,v),_=b.lines,a&&_.length&&(this._drawColorBox(n,t,C,m,r),h=Math.max(d.lineHeight,l)),E=0,A=_.length;E<A;++E)v(_[E]),h=d.lineHeight;Jt(b.after,v)}p=0,h=d.lineHeight,Jt(this.afterBody,v),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=Eu(r.rtl,this.x,this.width);for(t.x=fm(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=Gn(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:d,topRight:h,bottomLeft:p,bottomRight:m}=tc(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+d,l),s==="top"&&this.drawCaret(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-m),n.quadraticCurveTo(a+c,l+u,a+c-m,l+u),s==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),s==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const s=Nf[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=eA(this,t),l=Object.assign({},s,this._size),c=tA(n,t,l),u=nA(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=hr(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),V4(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),W4(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=!P0(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||!P0(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=Nf[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Ne(hw,"positioners",Nf),hw);var mL={id:"tooltip",_element:iA,positioners:Nf,afterInit(e,t,n){n&&(e.tooltip=new iA({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:gL},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"]},hie=Object.freeze({__proto__:null,Colors:Roe,Decimation:Moe,Filler:Xoe,Legend:nie,SubTitle:iie,Title:oie,Tooltip:mL});const pie=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function gie(e,t,n,r){const o=e.indexOf(t);if(o===-1)return pie(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const mie=(e,t)=>e===null?null:or(Math.round(e),0,t);function sA(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class N0 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(Ot(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:gie(r,t,st(n,t),this._addedLabels),mie(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 sA.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(N0,"id","category"),Ne(N0,"defaults",{ticks:{callback:sA}});function vie(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,p=i||1,m=u-1,{min:v,max:y}=t,b=!Ot(s),S=!Ot(a),_=!Ot(c),C=(y-v)/(d+1);let E=ZT((y-v)/m/p)*p,T,A,D,k;if(E<1e-14&&!b&&!S)return[{value:v},{value:y}];k=Math.ceil(y/E)-Math.floor(v/E),k>m&&(E=ZT(k*E/m/p)*p),Ot(l)||(T=Math.pow(10,l),E=Math.ceil(E*T)/T),o==="ticks"?(A=Math.floor(v/E)*E,D=Math.ceil(y/E)*E):(A=v,D=y),b&&S&&i&&fte((a-s)/i,E/1e3)?(k=Math.round(Math.min((a-s)/E,u)),E=(a-s)/k,A=s,D=a):_?(A=b?s:A,D=S?a:D,k=c-1,E=(D-A)/k):(k=(D-A)/E,Xf(k,Math.round(k),E/1e3)?k=Math.round(k):k=Math.ceil(k));const j=Math.max(eM(E),eM(A));T=Math.pow(10,Ot(l)?j:l),A=Math.round(A*T)/T,D=Math.round(D*T)/T;let $=0;for(b&&(h&&A!==s?(n.push({value:s}),A<s&&$++,Xf(Math.round((A+$*E)*T)/T,s,aA(s,C,e))&&$++):A<s&&$++);$<k;++$){const z=Math.round((A+$*E)*T)/T;if(S&&z>a)break;n.push({value:z})}return S&&h&&D!==a?n.length&&Xf(n[n.length-1].value,a,aA(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!S||D===a)&&n.push({value:D}),n}function aA(e,t,{horizontal:n,minRotation:r}){const o=yi(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class L0 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 Ot(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=Ki(o),c=Ki(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=vie(o,i);return t.bounds==="ticks"&&R4(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 Rp(t,this.chart.options.locale,this.options.ticks.format)}}class od extends L0{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?t:0,this.max=Nn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=yi(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(od,"id","linear"),Ne(od,"defaults",{ticks:{callback:nb.formatters.numeric}});const Ch=e=>Math.floor(Aa(e)),Sl=(e,t)=>Math.pow(10,Ch(e)+t);function lA(e){return e/Math.pow(10,Ch(e))===1}function cA(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function bie(e,t){const n=t-e;let r=Ch(n);for(;cA(e,t,r)>10;)r++;for(;cA(e,t,r)<10;)r--;return Math.min(r,Ch(e))}function yie(e,{min:t,max:n}){t=bo(e.min,t);const r=[],o=Ch(t);let i=bie(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 d=Math.floor((c-u)/Math.pow(10,i)),h=bo(e.min,Math.round((l+u+d*Math.pow(10,i))*s)/s);for(;h<n;)r.push({value:h,major:lA(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,s=i>=0?1:s),h=Math.round((l+u+d*Math.pow(10,i))*s)/s;const p=bo(e.max,h);return r.push({value:p,major:lA(p),significand:d}),r}class id 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=L0.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Nn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?Math.max(0,t):null,this.max=Nn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Nn(this._userMin)&&(this.min=t===Sl(this.min,0)?Sl(this.min,-1):Sl(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(Sl(r,-1)),s(Sl(o,1)))),r<=0&&i(Sl(o,-1)),o<=0&&s(Sl(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=yie(n,this);return t.bounds==="ticks"&&R4(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":Rp(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Aa(t),this._valueRange=Aa(this.max)-Aa(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Aa(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ne(id,"id","logarithmic"),Ne(id,"defaults",{ticks:{callback:nb.formatters.logarithmic,major:{enabled:!0}}});function fS(e){const t=e.ticks;if(t.display&&e.display){const n=hr(t.backdropPadding);return st(t.font&&t.font.size,An.font.size)+n.height}return 0}function xie(e,t,n){return n=wn(n)?n:[n],{w:Tte(e,t.string,n),h:n.length*t.lineHeight}}function uA(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 wie(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?_n/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),d=Gn(c.font),h=xie(e.ctx,d,e._pointLabels[l]);r[l]=h;const p=wo(e.getIndexAngle(l)+a),m=Math.round(VC(p)),v=uA(m,u.x,h.w,0,180),y=uA(m,u.y,h.h,90,270);Sie(n,t,p,v,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Eie(e,r,o)}function Sie(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 _ie(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(VC(wo(l.angle+Vn))),u=Oie(l.y,a.h,c),d=Rie(c),h=Pie(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function Cie(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(js({x:n,y:r},t)||js({x:n,y:i},t)||js({x:o,y:r},t)||js({x:o,y:i},t))}function Eie(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:fS(i)/2,additionalAngle:s?_n/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const d=_ie(e,u,l);r.push(d),a==="auto"&&(d.visible=Cie(d,c),d.visible&&(c=d))}return r}function Rie(e){return e===0||e===180?"center":e<180?"left":"right"}function Pie(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Oie(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Tie(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!Ot(a)){const l=tc(t.borderRadius),c=hr(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=o-c.top,h=i-r+c.width,p=s-o+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),Sh(e,{x:u,y:d,w:h,h:p,radius:l}),e.fill()):e.fillRect(u,d,h,p)}}function Mie(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));Tie(n,s,i);const a=Gn(s.font),{x:l,y:c,textAlign:u}=i;vc(n,e._pointLabels[o],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function vL(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Sn);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 Aie(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(),vL(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function Die(e,t,n){return Za(e,{label:n,index:t,type:"pointLabel"})}class Lf extends L0{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=hr(fS(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=Nn(t)&&!isNaN(t)?t:0,this.max=Nn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fS(this.options))}generateTickLabels(t){L0.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=an(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?wie(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=Sn/(this._pointLabels.length||1),r=this.options.startAngle||0;return wo(t*n+yi(r))}getDistanceFromCenterForValue(t){if(Ot(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(Ot(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 Die(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-Vn+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(),vL(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&&Mie(this,s),o.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),p=o.setContext(h),m=i.setContext(h);Aie(this,p,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,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=Gn(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 d=hr(c.backdropPadding);t.fillRect(-s/2-d.left,-i-u.size/2-d.top,s+d.width,u.size+d.height)}vc(t,a.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Ne(Lf,"id","radialLinear"),Ne(Lf,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:nb.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ne(Lf,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ne(Lf,"descriptors",{angleLines:{_fallback:"grid"}});const ob={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}},no=Object.keys(ob);function dA(e,t){return e-t}function fA(e,t){if(Ot(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)),Nn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(td(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function hA(e,t,n,r){const o=no.length;for(let i=no.indexOf(e);i<o-1;++i){const s=ob[no[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return no[i]}return no[o-1]}function kie(e,t,n,r,o){for(let i=no.length-1;i>=no.indexOf(n);i--){const s=no[i];if(ob[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return no[n?no.indexOf(n):0]}function Iie(e){for(let t=no.indexOf(e)+1,n=no.length;t<n;++t)if(ob[no[t]].common)return no[t]}function pA(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=WC(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function Nie(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 gA(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:Nie(e,r,o,n)}class Eh 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 Une._date(t.adapters.date);o.init(n),Kf(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:fA(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=Nn(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Nn(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=mte(o,i,s);return this._unit=n.unit||(r.autoSkip?hA(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):kie(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Iie(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),gA(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=or(n,0,s),r=or(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||hA(i.minUnit,n,r,this._getLabelCapacity(n)),a=st(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=td(l)||l===!0,u={};let d=n,h,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,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 m=o.ticks.source==="data"&&this.getDataTimestamps();for(h=d,p=0;h<r;h=+t.add(h,a,s),p++)pA(u,h,m);return(h===r||o.bounds==="ticks"||p===1)&&pA(u,h,m),Object.keys(u).sort(dA).map(v=>+v)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const o=this.options.time.displayFormats,i=this._unit,s=n||o[i];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,o){const i=this.options,s=i.ticks.callback;if(s)return an(s,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=r[n],p=c&&d&&h&&h.major;return this._adapter.format(t,o||(p?d: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=yi(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,gA(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(fA(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return T4(t.sort(dA))}}Ne(Eh,"id","time"),Ne(Eh,"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 hm(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}=Fs(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}=Fs(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 hS extends Eh{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=hm(n,this.min),this._tableRange=hm(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(hm(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return hm(this._table,r*this._tableRange+this._minPos,!0)}}Ne(hS,"id","timeseries"),Ne(hS,"defaults",Eh.defaults);var Lie=Object.freeze({__proto__:null,CategoryScale:N0,LinearScale:od,LogarithmicScale:id,RadialLinearScale:Lf,TimeScale:Eh,TimeSeriesScale:hS});const Fie=[Wne,xoe,hie,Lie];class Wa{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let o=0;o<this._n&&o<32;o++){const i=n[o],s=t+i,a=Math.abs(t)<Math.abs(i)?t-(s-i):i-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,o,i,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,o=t[--n],s=r+o,i=o-(s-r),!i););n>0&&(i<0&&t[n-1]<0||i>0&&t[n-1]>0)&&(o=i*2,r=s+o,o==r-s&&(s=r))}return s}}function*jie(e){for(const t of e)yield*t}function bL(e){return Array.from(jie(e))}function mu(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r<o;)i[r]=e+r*n;return i}var et=1e-6,nE=1e-12,Pt=Math.PI,In=Pt/2,mA=Pt/4,To=Pt*2,kr=180/Pt,ln=Pt/180,zt=Math.abs,Sd=Math.atan,Zi=Math.atan2,gt=Math.cos,pm=Math.ceil,yL=Math.exp,F0=Math.log,Xx=Math.pow,ut=Math.sin,Xo=Math.sign||function(e){return e>0?1:e<0?-1:0},jr=Math.sqrt,rE=Math.tan;function xL(e){return e>1?0:e<-1?Pt:Math.acos(e)}function Zo(e){return e>1?In:e<-1?-In:Math.asin(e)}function rr(){}function j0(e,t){e&&bA.hasOwnProperty(e.type)&&bA[e.type](e,t)}var vA={Feature:function(e,t){j0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)j0(n[r].geometry,t)}},bA={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){pS(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)pS(n[r],t,0)},Polygon:function(e,t){yA(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)yA(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)j0(n[r],t)}};function pS(e,t,n){var r=-1,o=e.length-n,i;for(t.lineStart();++r<o;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function yA(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)pS(e[n],t,1);t.polygonEnd()}function Ml(e,t){e&&vA.hasOwnProperty(e.type)?vA[e.type](e,t):j0(e,t)}function gS(e){return[Zi(e[1],e[0]),Zo(e[2])]}function sd(e){var t=e[0],n=e[1],r=gt(n);return[r*gt(t),r*ut(t),ut(n)]}function gm(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function $0(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Qx(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function mm(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function mS(e){var t=jr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function vS(e,t){function n(r,o){return r=e(r,o),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,o){return r=t.invert(r,o),r&&e.invert(r[0],r[1])}),n}function bS(e,t){return zt(e)>Pt&&(e-=Math.round(e/To)*To),[e,t]}bS.invert=bS;function wL(e,t,n){return(e%=To)?t||n?vS(wA(e),SA(t,n)):wA(e):t||n?SA(t,n):bS}function xA(e){return function(t,n){return t+=e,zt(t)>Pt&&(t-=Math.round(t/To)*To),[t,n]}}function wA(e){var t=xA(e);return t.invert=xA(-e),t}function SA(e,t){var n=gt(e),r=ut(e),o=gt(t),i=ut(t);function s(a,l){var c=gt(l),u=gt(a)*c,d=ut(a)*c,h=ut(l),p=h*n+u*r;return[Zi(d*o-p*i,u*n-h*r),Zo(p*o+d*i)]}return s.invert=function(a,l){var c=gt(l),u=gt(a)*c,d=ut(a)*c,h=ut(l),p=h*o-d*i;return[Zi(d*o+h*i,u*n+p*r),Zo(p*n-u*r)]},s}function $ie(e){e=wL(e[0]*ln,e[1]*ln,e.length>2?e[2]*ln:0);function t(n){return n=e(n[0]*ln,n[1]*ln),n[0]*=kr,n[1]*=kr,n}return t.invert=function(n){return n=e.invert(n[0]*ln,n[1]*ln),n[0]*=kr,n[1]*=kr,n},t}function zie(e,t,n,r,o,i){if(n){var s=gt(t),a=ut(t),l=r*n;o==null?(o=t+r*To,i=t-l/2):(o=_A(s,o),i=_A(s,i),(r>0?o<i:o>i)&&(o+=r*To));for(var c,u=o;r>0?u>i:u<i;u-=l)c=gS([s,-a*gt(u),-a*ut(u)]),e.point(c[0],c[1])}}function _A(e,t){t=sd(t),t[0]-=e,mS(t);var n=xL(-t[1]);return((-t[2]<0?-n:n)+To-et)%To}function SL(){var e=[],t;return{point:function(n,r,o){t.push([n,r,o])},lineStart:function(){e.push(t=[])},lineEnd:rr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function i0(e,t){return zt(e[0]-t[0])<et&&zt(e[1]-t[1])<et}function vm(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function _L(e,t,n,r,o){var i=[],s=[],a,l;if(e.forEach(function(m){if(!((v=m.length-1)<=0)){var v,y=m[0],b=m[v],S;if(i0(y,b)){if(!y[2]&&!b[2]){for(o.lineStart(),a=0;a<v;++a)o.point((y=m[a])[0],y[1]);o.lineEnd();return}b[0]+=2*et}i.push(S=new vm(y,m,null,!0)),s.push(S.o=new vm(y,null,S,!1)),i.push(S=new vm(b,m,null,!1)),s.push(S.o=new vm(b,null,S,!0))}}),!!i.length){for(s.sort(t),CA(i),CA(s),a=0,l=s.length;a<l;++a)s[a].e=n=!n;for(var c=i[0],u,d;;){for(var h=c,p=!0;h.v;)if((h=h.n)===c)return;u=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(a=0,l=u.length;a<l;++a)o.point((d=u[a])[0],d[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(p)for(u=h.p.z,a=u.length-1;a>=0;--a)o.point((d=u[a])[0],d[1]);else r(h.x,h.p.x,-1,o);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);o.lineEnd()}}}function CA(e){if(t=e.length){for(var t,n=0,r=e[0],o;++n<t;)r.n=o=e[n],o.p=r,r=o;r.n=o=e[0],o.p=r}}function Jx(e){return zt(e[0])<=Pt?e[0]:Xo(e[0])*((zt(e[0])+Pt)%To-Pt)}function CL(e,t){var n=Jx(t),r=t[1],o=ut(r),i=[ut(n),-gt(n),0],s=0,a=0,l=new Wa;o===1?r=In+et:o===-1&&(r=-In-et);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,p=d[h-1],m=Jx(p),v=p[1]/2+mA,y=ut(v),b=gt(v),S=0;S<h;++S,m=C,y=T,b=A,p=_){var _=d[S],C=Jx(_),E=_[1]/2+mA,T=ut(E),A=gt(E),D=C-m,k=D>=0?1:-1,j=k*D,$=j>Pt,z=y*T;if(l.add(Zi(z*k*ut(j),b*A+z*gt(j))),s+=$?D+k*To:D,$^m>=n^C>=n){var K=$0(sd(p),sd(_));mS(K);var V=$0(i,K);mS(V);var N=($^D>=0?-1:1)*Zo(V[2]);(r>N||r===N&&(K[0]||K[1]))&&(a+=$^D>=0?1:-1)}}return(s<-et||s<et&&l<-nE)^a&1}function EL(e,t,n,r){return function(o){var i=t(o),s=SL(),a=t(s),l=!1,c,u,d,h={point:p,lineStart:v,lineEnd:y,polygonStart:function(){h.point=b,h.lineStart=S,h.lineEnd=_,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=v,h.lineEnd=y,u=bL(u);var C=CL(c,r);u.length?(l||(o.polygonStart(),l=!0),_L(u,Hie,C,n,o)):C&&(l||(o.polygonStart(),l=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),l&&(o.polygonEnd(),l=!1),u=c=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function p(C,E){e(C,E)&&o.point(C,E)}function m(C,E){i.point(C,E)}function v(){h.point=m,i.lineStart()}function y(){h.point=p,i.lineEnd()}function b(C,E){d.push([C,E]),a.point(C,E)}function S(){a.lineStart(),d=[]}function _(){b(d[0][0],d[0][1]),a.lineEnd();var C=a.clean(),E=s.result(),T,A=E.length,D,k,j;if(d.pop(),c.push(d),d=null,!!A){if(C&1){if(k=E[0],(D=k.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),T=0;T<D;++T)o.point((j=k[T])[0],j[1]);o.lineEnd()}return}A>1&&C&2&&E.push(E.pop().concat(E.shift())),u.push(E.filter(Bie))}}return h}}function Bie(e){return e.length>1}function Hie(e,t){return((e=e.x)[0]<0?e[1]-In-et:In-e[1])-((t=t.x)[0]<0?t[1]-In-et:In-t[1])}const EA=EL(function(){return!0},Vie,Uie,[-Pt,-In]);function Vie(e){var t=NaN,n=NaN,r=NaN,o;return{lineStart:function(){e.lineStart(),o=1},point:function(i,s){var a=i>0?Pt:-Pt,l=zt(i-t);zt(l-Pt)<et?(e.point(t,n=(n+s)/2>0?In:-In),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(i,n),o=0):r!==a&&l>=Pt&&(zt(t-r)<et&&(t-=r*et),zt(i-a)<et&&(i-=a*et),n=Wie(t,n,i,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),o=0),e.point(t=i,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-o}}}function Wie(e,t,n,r){var o,i,s=ut(e-n);return zt(s)>et?Sd((ut(t)*(i=gt(r))*ut(n)-ut(r)*(o=gt(t))*ut(e))/(o*i*s)):(t+r)/2}function Uie(e,t,n,r){var o;if(e==null)o=n*In,r.point(-Pt,o),r.point(0,o),r.point(Pt,o),r.point(Pt,0),r.point(Pt,-o),r.point(0,-o),r.point(-Pt,-o),r.point(-Pt,0),r.point(-Pt,o);else if(zt(e[0]-t[0])>et){var i=e[0]<t[0]?Pt:-Pt;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(t[0],t[1])}function Gie(e){var t=gt(e),n=2*ln,r=t>0,o=zt(t)>et;function i(u,d,h,p){zie(p,e,n,h,u,d)}function s(u,d){return gt(u)*gt(d)>t}function a(u){var d,h,p,m,v;return{lineStart:function(){m=p=!1,v=1},point:function(y,b){var S=[y,b],_,C=s(y,b),E=r?C?0:c(y,b):C?c(y+(y<0?Pt:-Pt),b):0;if(!d&&(m=p=C)&&u.lineStart(),C!==p&&(_=l(d,S),(!_||i0(d,_)||i0(S,_))&&(S[2]=1)),C!==p)v=0,C?(u.lineStart(),_=l(S,d),u.point(_[0],_[1])):(_=l(d,S),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(o&&d&&r^C){var T;!(E&h)&&(T=l(S,d,!0))&&(v=0,r?(u.lineStart(),u.point(T[0][0],T[0][1]),u.point(T[1][0],T[1][1]),u.lineEnd()):(u.point(T[1][0],T[1][1]),u.lineEnd(),u.lineStart(),u.point(T[0][0],T[0][1],3)))}C&&(!d||!i0(d,S))&&u.point(S[0],S[1]),d=S,p=C,h=E},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return v|(m&&p)<<1}}}function l(u,d,h){var p=sd(u),m=sd(d),v=[1,0,0],y=$0(p,m),b=gm(y,y),S=y[0],_=b-S*S;if(!_)return!h&&u;var C=t*b/_,E=-t*S/_,T=$0(v,y),A=mm(v,C),D=mm(y,E);Qx(A,D);var k=T,j=gm(A,k),$=gm(k,k),z=j*j-$*(gm(A,A)-1);if(!(z<0)){var K=jr(z),V=mm(k,(-j-K)/$);if(Qx(V,A),V=gS(V),!h)return V;var N=u[0],W=d[0],H=u[1],G=d[1],te;W<N&&(te=N,N=W,W=te);var F=W-N,Y=zt(F-Pt)<et,q=Y||F<et;if(!Y&&G<H&&(te=H,H=G,G=te),q?Y?H+G>0^V[1]<(zt(V[0]-N)<et?H:G):H<=V[1]&&V[1]<=G:F>Pt^(N<=V[0]&&V[0]<=W)){var M=mm(k,(-j+K)/$);return Qx(M,A),[V,gS(M)]}}}function c(u,d){var h=r?e:Pt-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return EL(s,a,i,r?[0,-e]:[-Pt,e-Pt])}function qie(e,t,n,r,o,i){var s=e[0],a=e[1],l=t[0],c=t[1],u=0,d=1,h=l-s,p=c-a,m;if(m=n-s,!(!h&&m>0)){if(m/=h,h<0){if(m<u)return;m<d&&(d=m)}else if(h>0){if(m>d)return;m>u&&(u=m)}if(m=o-s,!(!h&&m<0)){if(m/=h,h<0){if(m>d)return;m>u&&(u=m)}else if(h>0){if(m<u)return;m<d&&(d=m)}if(m=r-a,!(!p&&m>0)){if(m/=p,p<0){if(m<u)return;m<d&&(d=m)}else if(p>0){if(m>d)return;m>u&&(u=m)}if(m=i-a,!(!p&&m<0)){if(m/=p,p<0){if(m>d)return;m>u&&(u=m)}else if(p>0){if(m<u)return;m<d&&(d=m)}return u>0&&(e[0]=s+u*h,e[1]=a+u*p),d<1&&(t[0]=s+d*h,t[1]=a+d*p),!0}}}}}var Ff=1e9,bm=-Ff;function Yie(e,t,n,r){function o(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function i(c,u,d,h){var p=0,m=0;if(c==null||(p=s(c,d))!==(m=s(u,d))||l(c,u)<0^d>0)do h.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+d+4)%4)!==m);else h.point(u[0],u[1])}function s(c,u){return zt(c[0]-e)<et?u>0?0:3:zt(c[0]-n)<et?u>0?2:1:zt(c[1]-t)<et?u>0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var d=s(c,1),h=s(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=SL(),h,p,m,v,y,b,S,_,C,E,T,A={point:D,lineStart:z,lineEnd:K,polygonStart:j,polygonEnd:$};function D(N,W){o(N,W)&&u.point(N,W)}function k(){for(var N=0,W=0,H=p.length;W<H;++W)for(var G=p[W],te=1,F=G.length,Y=G[0],q,M,ne=Y[0],X=Y[1];te<F;++te)q=ne,M=X,Y=G[te],ne=Y[0],X=Y[1],M<=r?X>r&&(ne-q)*(r-M)>(X-M)*(e-q)&&++N:X<=r&&(ne-q)*(r-M)<(X-M)*(e-q)&&--N;return N}function j(){u=d,h=[],p=[],T=!0}function $(){var N=k(),W=T&&N,H=(h=bL(h)).length;(W||H)&&(c.polygonStart(),W&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),H&&_L(h,a,N,i,c),c.polygonEnd()),u=c,h=p=m=null}function z(){A.point=V,p&&p.push(m=[]),E=!0,C=!1,S=_=NaN}function K(){h&&(V(v,y),b&&C&&d.rejoin(),h.push(d.result())),A.point=D,C&&u.lineEnd()}function V(N,W){var H=o(N,W);if(p&&m.push([N,W]),E)v=N,y=W,b=H,E=!1,H&&(u.lineStart(),u.point(N,W));else if(H&&C)u.point(N,W);else{var G=[S=Math.max(bm,Math.min(Ff,S)),_=Math.max(bm,Math.min(Ff,_))],te=[N=Math.max(bm,Math.min(Ff,N)),W=Math.max(bm,Math.min(Ff,W))];qie(G,te,e,t,n,r)?(C||(u.lineStart(),u.point(G[0],G[1])),u.point(te[0],te[1]),H||u.lineEnd(),T=!1):H&&(u.lineStart(),u.point(N,W),T=!1)}S=N,_=W,C=H}return A}}var yS,xS,s0,a0,ad={sphere:rr,point:rr,lineStart:Kie,lineEnd:rr,polygonStart:rr,polygonEnd:rr};function Kie(){ad.point=Qie,ad.lineEnd=Xie}function Xie(){ad.point=ad.lineEnd=rr}function Qie(e,t){e*=ln,t*=ln,xS=e,s0=ut(t),a0=gt(t),ad.point=Jie}function Jie(e,t){e*=ln,t*=ln;var n=ut(t),r=gt(t),o=zt(e-xS),i=gt(o),s=ut(o),a=r*s,l=a0*n-s0*r*i,c=s0*n+a0*r*i;yS.add(Zi(jr(a*a+l*l),c)),xS=e,s0=n,a0=r}function Zie(e){return yS=new Wa,Ml(e,ad),+yS}var wS=[null,null],ese={type:"LineString",coordinates:wS};function SS(e,t){return wS[0]=e,wS[1]=t,Zie(ese)}var RA={Feature:function(e,t){return z0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)if(z0(n[r].geometry,t))return!0;return!1}},PA={Sphere:function(){return!0},Point:function(e,t){return OA(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(OA(n[r],t))return!0;return!1},LineString:function(e,t){return TA(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(TA(n[r],t))return!0;return!1},Polygon:function(e,t){return MA(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(MA(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)if(z0(n[r],t))return!0;return!1}};function z0(e,t){return e&&PA.hasOwnProperty(e.type)?PA[e.type](e,t):!1}function OA(e,t){return SS(e,t)===0}function TA(e,t){for(var n,r,o,i=0,s=e.length;i<s;i++){if(r=SS(e[i],t),r===0||i>0&&(o=SS(e[i],e[i-1]),o>0&&n<=o&&r<=o&&(n+r-o)*(1-Math.pow((n-r)/o,2))<nE*o))return!0;n=r}return!1}function MA(e,t){return!!CL(e.map(tse),RL(t))}function tse(e){return e=e.map(RL),e.pop(),e}function RL(e){return[e[0]*ln,e[1]*ln]}function nse(e,t){return(e&&RA.hasOwnProperty(e.type)?RA[e.type]:z0)(e,t)}function AA(e,t,n){var r=mu(e,t-et,n).concat(t);return function(o){return r.map(function(i){return[o,i]})}}function DA(e,t,n){var r=mu(e,t-et,n).concat(t);return function(o){return r.map(function(i){return[i,o]})}}function PL(){var e,t,n,r,o,i,s,a,l=10,c=l,u=90,d=360,h,p,m,v,y=2.5;function b(){return{type:"MultiLineString",coordinates:S()}}function S(){return mu(pm(r/u)*u,n,u).map(m).concat(mu(pm(a/d)*d,s,d).map(v)).concat(mu(pm(t/l)*l,e,l).filter(function(_){return zt(_%u)>et}).map(h)).concat(mu(pm(i/c)*c,o,c).filter(function(_){return zt(_%d)>et}).map(p))}return b.lines=function(){return S().map(function(_){return{type:"LineString",coordinates:_}})},b.outline=function(){return{type:"Polygon",coordinates:[m(r).concat(v(s).slice(1),m(n).reverse().slice(1),v(a).reverse().slice(1))]}},b.extent=function(_){return arguments.length?b.extentMajor(_).extentMinor(_):b.extentMinor()},b.extentMajor=function(_){return arguments.length?(r=+_[0][0],n=+_[1][0],a=+_[0][1],s=+_[1][1],r>n&&(_=r,r=n,n=_),a>s&&(_=a,a=s,s=_),b.precision(y)):[[r,a],[n,s]]},b.extentMinor=function(_){return arguments.length?(t=+_[0][0],e=+_[1][0],i=+_[0][1],o=+_[1][1],t>e&&(_=t,t=e,e=_),i>o&&(_=i,i=o,o=_),b.precision(y)):[[t,i],[e,o]]},b.step=function(_){return arguments.length?b.stepMajor(_).stepMinor(_):b.stepMinor()},b.stepMajor=function(_){return arguments.length?(u=+_[0],d=+_[1],b):[u,d]},b.stepMinor=function(_){return arguments.length?(l=+_[0],c=+_[1],b):[l,c]},b.precision=function(_){return arguments.length?(y=+_,h=AA(i,o,90),p=DA(t,e,y),m=AA(a,s,90),v=DA(r,n,y),b):y},b.extentMajor([[-180,-90+et],[180,90-et]]).extentMinor([[-180,-80-et],[180,80+et]])}function rse(){return PL()()}const _S=e=>e;var Zx=new Wa,CS=new Wa,OL,TL,ES,RS,wa={point:rr,lineStart:rr,lineEnd:rr,polygonStart:function(){wa.lineStart=ose,wa.lineEnd=sse},polygonEnd:function(){wa.lineStart=wa.lineEnd=wa.point=rr,Zx.add(zt(CS)),CS=new Wa},result:function(){var e=Zx/2;return Zx=new Wa,e}};function ose(){wa.point=ise}function ise(e,t){wa.point=ML,OL=ES=e,TL=RS=t}function ML(e,t){CS.add(RS*e-ES*t),ES=e,RS=t}function sse(){ML(OL,TL)}const kA=wa;var ld=1/0,B0=ld,Rh=-ld,H0=Rh,ase={point:lse,lineStart:rr,lineEnd:rr,polygonStart:rr,polygonEnd:rr,result:function(){var e=[[ld,B0],[Rh,H0]];return Rh=H0=-(B0=ld=1/0),e}};function lse(e,t){e<ld&&(ld=e),e>Rh&&(Rh=e),t<B0&&(B0=t),t>H0&&(H0=t)}const V0=ase;var PS=0,OS=0,jf=0,W0=0,U0=0,vu=0,TS=0,MS=0,$f=0,AL,DL,Vi,Wi,vi={point:bc,lineStart:IA,lineEnd:NA,polygonStart:function(){vi.lineStart=dse,vi.lineEnd=fse},polygonEnd:function(){vi.point=bc,vi.lineStart=IA,vi.lineEnd=NA},result:function(){var e=$f?[TS/$f,MS/$f]:vu?[W0/vu,U0/vu]:jf?[PS/jf,OS/jf]:[NaN,NaN];return PS=OS=jf=W0=U0=vu=TS=MS=$f=0,e}};function bc(e,t){PS+=e,OS+=t,++jf}function IA(){vi.point=cse}function cse(e,t){vi.point=use,bc(Vi=e,Wi=t)}function use(e,t){var n=e-Vi,r=t-Wi,o=jr(n*n+r*r);W0+=o*(Vi+e)/2,U0+=o*(Wi+t)/2,vu+=o,bc(Vi=e,Wi=t)}function NA(){vi.point=bc}function dse(){vi.point=hse}function fse(){kL(AL,DL)}function hse(e,t){vi.point=kL,bc(AL=Vi=e,DL=Wi=t)}function kL(e,t){var n=e-Vi,r=t-Wi,o=jr(n*n+r*r);W0+=o*(Vi+e)/2,U0+=o*(Wi+t)/2,vu+=o,o=Wi*e-Vi*t,TS+=o*(Vi+e),MS+=o*(Wi+t),$f+=o*3,bc(Vi=e,Wi=t)}const LA=vi;function IL(e){this._context=e}IL.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,To);break}}},result:rr};var AS=new Wa,e1,NL,LL,zf,Bf,G0={point:rr,lineStart:function(){G0.point=pse},lineEnd:function(){e1&&FL(NL,LL),G0.point=rr},polygonStart:function(){e1=!0},polygonEnd:function(){e1=null},result:function(){var e=+AS;return AS=new Wa,e}};function pse(e,t){G0.point=FL,NL=zf=e,LL=Bf=t}function FL(e,t){zf-=e,Bf-=t,AS.add(jr(zf*zf+Bf*Bf)),zf=e,Bf=t}const FA=G0;let jA,q0,$A,zA;class BA{constructor(t){this._append=t==null?jL:gse(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==$A||this._append!==q0){const r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,$A=r,q0=this._append,zA=this._,this._=o}this._+=zA;break}}}result(){const t=this._;return this._="",t.length?t:null}}function jL(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function gse(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return jL;if(t!==jA){const n=10**t;jA=t,q0=function(o){let i=1;this._+=o[0];for(const s=o.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return q0}function HA(e,t){let n=3,r=4.5,o,i;function s(a){return a&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),Ml(a,o(i))),i.result()}return s.area=function(a){return Ml(a,o(kA)),kA.result()},s.measure=function(a){return Ml(a,o(FA)),FA.result()},s.bounds=function(a){return Ml(a,o(V0)),V0.result()},s.centroid=function(a){return Ml(a,o(LA)),LA.result()},s.projection=function(a){return arguments.length?(o=a==null?(e=null,_S):(e=a).stream,s):e},s.context=function(a){return arguments.length?(i=a==null?(t=null,new BA(n)):new IL(t=a),typeof r!="function"&&i.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(i.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const l=Math.floor(a);if(!(l>=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(i=new BA(n)),s},s.projection(e).digits(n).context(t)}function oE(e){return function(t){var n=new DS;for(var r in e)n[r]=e[r];return n.stream=t,n}}function DS(){}DS.prototype={constructor:DS,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function iE(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Ml(n,e.stream(V0)),t(V0.result()),r!=null&&e.clipExtent(r),e}function sE(e,t,n){return iE(e,function(r){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),a=+t[0][0]+(o-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function $L(e,t,n){return sE(e,[[0,0],t],n)}function zL(e,t,n){return iE(e,function(r){var o=+t,i=o/(r[1][0]-r[0][0]),s=(o-i*(r[1][0]+r[0][0]))/2,a=-i*r[0][1];e.scale(150*i).translate([s,a])},n)}function BL(e,t,n){return iE(e,function(r){var o=+t,i=o/(r[1][1]-r[0][1]),s=-i*r[0][0],a=(o-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([s,a])},n)}var VA=16,mse=gt(30*ln);function WA(e,t){return+t?bse(e,t):vse(e)}function vse(e){return oE({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function bse(e,t){function n(r,o,i,s,a,l,c,u,d,h,p,m,v,y){var b=c-r,S=u-o,_=b*b+S*S;if(_>4*t&&v--){var C=s+h,E=a+p,T=l+m,A=jr(C*C+E*E+T*T),D=Zo(T/=A),k=zt(zt(T)-1)<et||zt(i-d)<et?(i+d)/2:Zi(E,C),j=e(k,D),$=j[0],z=j[1],K=$-r,V=z-o,N=S*K-b*V;(N*N/_>t||zt((b*K+S*V)/_-.5)>.3||s*h+a*p+l*m<mse)&&(n(r,o,i,s,a,l,$,z,k,C/=A,E/=A,T,v,y),y.point($,z),n($,z,k,C,E,T,c,u,d,h,p,m,v,y))}}return function(r){var o,i,s,a,l,c,u,d,h,p,m,v,y={point:b,lineStart:S,lineEnd:C,polygonStart:function(){r.polygonStart(),y.lineStart=E},polygonEnd:function(){r.polygonEnd(),y.lineStart=S}};function b(D,k){D=e(D,k),r.point(D[0],D[1])}function S(){d=NaN,y.point=_,r.lineStart()}function _(D,k){var j=sd([D,k]),$=e(D,k);n(d,h,u,p,m,v,d=$[0],h=$[1],u=D,p=j[0],m=j[1],v=j[2],VA,r),r.point(d,h)}function C(){y.point=b,r.lineEnd()}function E(){S(),y.point=T,y.lineEnd=A}function T(D,k){_(o=D,k),i=d,s=h,a=p,l=m,c=v,y.point=_}function A(){n(d,h,u,p,m,v,i,s,o,a,l,c,VA,r),y.lineEnd=C,C()}return y}}var yse=oE({point:function(e,t){this.stream.point(e*ln,t*ln)}});function xse(e){return oE({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function wse(e,t,n,r,o){function i(s,a){return s*=r,a*=o,[t+e*s,n-e*a]}return i.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*o]},i}function UA(e,t,n,r,o,i){if(!i)return wse(e,t,n,r,o);var s=gt(i),a=ut(i),l=s*e,c=a*e,u=s/e,d=a/e,h=(a*n-s*t)/e,p=(a*t+s*n)/e;function m(v,y){return v*=r,y*=o,[l*v-c*y+t,n-c*v-l*y]}return m.invert=function(v,y){return[r*(u*v-d*y+h),o*(p-d*v-u*y)]},m}function qs(e){return HL(function(){return e})()}function HL(e){var t,n=150,r=480,o=250,i=0,s=0,a=0,l=0,c=0,u,d=0,h=1,p=1,m=null,v=EA,y=null,b,S,_,C=_S,E=.5,T,A,D,k,j;function $(N){return D(N[0]*ln,N[1]*ln)}function z(N){return N=D.invert(N[0],N[1]),N&&[N[0]*kr,N[1]*kr]}$.stream=function(N){return k&&j===N?k:k=yse(xse(u)(v(T(C(j=N)))))},$.preclip=function(N){return arguments.length?(v=N,m=void 0,V()):v},$.postclip=function(N){return arguments.length?(C=N,y=b=S=_=null,V()):C},$.clipAngle=function(N){return arguments.length?(v=+N?Gie(m=N*ln):(m=null,EA),V()):m*kr},$.clipExtent=function(N){return arguments.length?(C=N==null?(y=b=S=_=null,_S):Yie(y=+N[0][0],b=+N[0][1],S=+N[1][0],_=+N[1][1]),V()):y==null?null:[[y,b],[S,_]]},$.scale=function(N){return arguments.length?(n=+N,K()):n},$.translate=function(N){return arguments.length?(r=+N[0],o=+N[1],K()):[r,o]},$.center=function(N){return arguments.length?(i=N[0]%360*ln,s=N[1]%360*ln,K()):[i*kr,s*kr]},$.rotate=function(N){return arguments.length?(a=N[0]%360*ln,l=N[1]%360*ln,c=N.length>2?N[2]%360*ln:0,K()):[a*kr,l*kr,c*kr]},$.angle=function(N){return arguments.length?(d=N%360*ln,K()):d*kr},$.reflectX=function(N){return arguments.length?(h=N?-1:1,K()):h<0},$.reflectY=function(N){return arguments.length?(p=N?-1:1,K()):p<0},$.precision=function(N){return arguments.length?(T=WA(A,E=N*N),V()):jr(E)},$.fitExtent=function(N,W){return sE($,N,W)},$.fitSize=function(N,W){return $L($,N,W)},$.fitWidth=function(N,W){return zL($,N,W)},$.fitHeight=function(N,W){return BL($,N,W)};function K(){var N=UA(n,0,0,h,p,d).apply(null,t(i,s)),W=UA(n,r-N[0],o-N[1],h,p,d);return u=wL(a,l,c),A=vS(t,W),D=vS(u,A),T=WA(A,E),V()}function V(){return k=j=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&z,K()}}function aE(e){var t=0,n=Pt/3,r=HL(e),o=r(t,n);return o.parallels=function(i){return arguments.length?r(t=i[0]*ln,n=i[1]*ln):[t*kr,n*kr]},o}function Sse(e){var t=gt(e);function n(r,o){return[r*t,ut(o)/t]}return n.invert=function(r,o){return[r/t,Zo(o*t)]},n}function _se(e,t){var n=ut(e),r=(n+ut(t))/2;if(zt(r)<et)return Sse(e);var o=1+n*(2*r-n),i=jr(o)/r;function s(a,l){var c=jr(o-2*r*ut(l))/r;return[c*ut(a*=r),i-c*gt(a)]}return s.invert=function(a,l){var c=i-l,u=Zi(a,zt(c))*Xo(c);return c*r<0&&(u-=Pt*Xo(a)*Xo(c)),[u/r,Zo((o-(a*a+c*c)*r*r)/(2*r))]},s}function Y0(){return aE(_se).scale(155.424).center([0,33.6442])}function VL(){return Y0().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Cse(e){var t=e.length;return{point:function(n,r){for(var o=-1;++o<t;)e[o].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function Ese(){var e,t,n=VL(),r,o=Y0().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,s=Y0().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,l,c={point:function(h,p){l=[h,p]}};function u(h){var p=h[0],m=h[1];return l=null,r.point(p,m),l||(i.point(p,m),l)||(a.point(p,m),l)}u.invert=function(h){var p=n.scale(),m=n.translate(),v=(h[0]-m[0])/p,y=(h[1]-m[1])/p;return(y>=.12&&y<.234&&v>=-.425&&v<-.214?o:y>=.166&&y<.234&&v>=-.214&&v<-.115?s:n).invert(h)},u.stream=function(h){return e&&t===h?e:e=Cse([n.stream(t=h),o.stream(h),s.stream(h)])},u.precision=function(h){return arguments.length?(n.precision(h),o.precision(h),s.precision(h),d()):n.precision()},u.scale=function(h){return arguments.length?(n.scale(h),o.scale(h*.35),s.scale(h),u.translate(n.translate())):n.scale()},u.translate=function(h){if(!arguments.length)return n.translate();var p=n.scale(),m=+h[0],v=+h[1];return r=n.translate(h).clipExtent([[m-.455*p,v-.238*p],[m+.455*p,v+.238*p]]).stream(c),i=o.translate([m-.307*p,v+.201*p]).clipExtent([[m-.425*p+et,v+.12*p+et],[m-.214*p-et,v+.234*p-et]]).stream(c),a=s.translate([m-.205*p,v+.212*p]).clipExtent([[m-.214*p+et,v+.166*p+et],[m-.115*p-et,v+.234*p-et]]).stream(c),d()},u.fitExtent=function(h,p){return sE(u,h,p)},u.fitSize=function(h,p){return $L(u,h,p)},u.fitWidth=function(h,p){return zL(u,h,p)},u.fitHeight=function(h,p){return BL(u,h,p)};function d(){return e=t=null,u}return u.scale(1070)}function WL(e){return function(t,n){var r=gt(t),o=gt(n),i=e(r*o);return i===1/0?[2,0]:[i*o*ut(t),i*ut(n)]}}function Op(e){return function(t,n){var r=jr(t*t+n*n),o=e(r),i=ut(o),s=gt(o);return[Zi(t*i,r*s),Zo(r&&n*i/r)]}}var UL=WL(function(e){return jr(2/(1+e))});UL.invert=Op(function(e){return 2*Zo(e/2)});function Rse(){return qs(UL).scale(124.75).clipAngle(180-.001)}var GL=WL(function(e){return(e=xL(e))&&e/ut(e)});GL.invert=Op(function(e){return e});function Pse(){return qs(GL).scale(79.4188).clipAngle(180-.001)}function ib(e,t){return[e,F0(rE((In+t)/2))]}ib.invert=function(e,t){return[e,2*Sd(yL(t))-In]};function Ose(){return qL(ib).scale(961/To)}function qL(e){var t=qs(e),n=t.center,r=t.scale,o=t.translate,i=t.clipExtent,s=null,a,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(o(d),u()):o()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?s=a=l=c=null:(s=+d[0][0],a=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var d=Pt*r(),h=t($ie(t.rotate()).invert([0,0]));return i(s==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===ib?[[Math.max(h[0]-d,s),a],[Math.min(h[0]+d,l),c]]:[[s,Math.max(h[1]-d,a)],[l,Math.min(h[1]+d,c)]])}return u()}function ym(e){return rE((In+e)/2)}function Tse(e,t){var n=gt(e),r=e===t?ut(e):F0(n/gt(t))/F0(ym(t)/ym(e)),o=n*Xx(ym(e),r)/r;if(!r)return ib;function i(s,a){o>0?a<-In+et&&(a=-In+et):a>In-et&&(a=In-et);var l=o/Xx(ym(a),r);return[l*ut(r*s),o-l*gt(r*s)]}return i.invert=function(s,a){var l=o-a,c=Xo(r)*jr(s*s+l*l),u=Zi(s,zt(l))*Xo(l);return l*r<0&&(u-=Pt*Xo(s)*Xo(l)),[u/r,2*Sd(Xx(o/c,1/r))-In]},i}function Mse(){return aE(Tse).scale(109.5).parallels([30,30])}function K0(e,t){return[e,t]}K0.invert=K0;function Ase(){return qs(K0).scale(152.63)}function Dse(e,t){var n=gt(e),r=e===t?ut(e):(n-gt(t))/(t-e),o=n/r+e;if(zt(r)<et)return K0;function i(s,a){var l=o-a,c=r*s;return[l*ut(c),o-l*gt(c)]}return i.invert=function(s,a){var l=o-a,c=Zi(s,zt(l))*Xo(l);return l*r<0&&(c-=Pt*Xo(s)*Xo(l)),[c/r,o-Xo(r)*jr(s*s+l*l)]},i}function kse(){return aE(Dse).scale(131.154).center([0,13.9389])}var eh=1.340264,th=-.081106,nh=893e-6,rh=.003796,X0=jr(3)/2,Ise=12;function YL(e,t){var n=Zo(X0*ut(t)),r=n*n,o=r*r*r;return[e*gt(n)/(X0*(eh+3*th*r+o*(7*nh+9*rh*r))),n*(eh+th*r+o*(nh+rh*r))]}YL.invert=function(e,t){for(var n=t,r=n*n,o=r*r*r,i=0,s,a,l;i<Ise&&(a=n*(eh+th*r+o*(nh+rh*r))-t,l=eh+3*th*r+o*(7*nh+9*rh*r),n-=s=a/l,r=n*n,o=r*r*r,!(zt(s)<nE));++i);return[X0*e*(eh+3*th*r+o*(7*nh+9*rh*r))/gt(n),Zo(ut(n)/X0)]};function Nse(){return qs(YL).scale(177.158)}function KL(e,t){var n=gt(t),r=gt(e)*n;return[n*ut(e)/r,ut(t)/r]}KL.invert=Op(Sd);function Lse(){return qs(KL).scale(144.049).clipAngle(60)}function XL(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}XL.invert=function(e,t){var n=t,r=25,o;do{var i=n*n,s=i*i;n-=o=(n*(1.007226+i*(.015085+s*(-.044475+.028874*i-.005916*s)))-t)/(1.007226+i*(.015085*3+s*(-.044475*7+.028874*9*i-.005916*11*s)))}while(zt(o)>et&&--r>0);return[e/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function Fse(){return qs(XL).scale(175.295)}function QL(e,t){return[gt(t)*ut(e),ut(t)]}QL.invert=Op(Zo);function jse(){return qs(QL).scale(249.5).clipAngle(90+et)}function JL(e,t){var n=gt(t),r=1+gt(e)*n;return[n*ut(e)/r,ut(t)/r]}JL.invert=Op(function(e){return 2*Sd(e)});function $se(){return qs(JL).scale(250).clipAngle(142)}function ZL(e,t){return[F0(rE((In+t)/2)),-e]}ZL.invert=function(e,t){return[-t,2*Sd(yL(e))-In]};function zse(){var e=qL(ZL),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function Yt(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function sb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function lE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _d(){}var yc=.7,cd=1/yc,Ru="\\s*([+-]?\\d+)\\s*",Ph="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bse=/^#([0-9a-f]{3,8})$/,Hse=new RegExp(`^rgb\\(${Ru},${Ru},${Ru}\\)$`),Vse=new RegExp(`^rgb\\(${Xi},${Xi},${Xi}\\)$`),Wse=new RegExp(`^rgba\\(${Ru},${Ru},${Ru},${Ph}\\)$`),Use=new RegExp(`^rgba\\(${Xi},${Xi},${Xi},${Ph}\\)$`),Gse=new RegExp(`^hsl\\(${Ph},${Xi},${Xi}\\)$`),qse=new RegExp(`^hsla\\(${Ph},${Xi},${Xi},${Ph}\\)$`),GA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};sb(_d,cE,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qA,formatHex:qA,formatHex8:Yse,formatHsl:Kse,formatRgb:YA,toString:YA});function qA(){return this.rgb().formatHex()}function Yse(){return this.rgb().formatHex8()}function Kse(){return t3(this).formatHsl()}function YA(){return this.rgb().formatRgb()}function cE(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Bse.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?KA(t):n===3?new _r(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xm(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Hse.exec(e))?new _r(t[1],t[2],t[3],1):(t=Vse.exec(e))?new _r(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Wse.exec(e))?xm(t[1],t[2],t[3],t[4]):(t=Use.exec(e))?xm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Gse.exec(e))?JA(t[1],t[2]/100,t[3]/100,1):(t=qse.exec(e))?JA(t[1],t[2]/100,t[3]/100,t[4]):GA.hasOwnProperty(e)?KA(GA[e]):e==="transparent"?new _r(NaN,NaN,NaN,0):null}function KA(e){return new _r(e>>16&255,e>>8&255,e&255,1)}function xm(e,t,n,r){return r<=0&&(e=t=n=NaN),new _r(e,t,n,r)}function e3(e){return e instanceof _d||(e=cE(e)),e?(e=e.rgb(),new _r(e.r,e.g,e.b,e.opacity)):new _r}function Oh(e,t,n,r){return arguments.length===1?e3(e):new _r(e,t,n,r??1)}function _r(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}sb(_r,Oh,lE(_d,{brighter(e){return e=e==null?cd:Math.pow(cd,e),new _r(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?yc:Math.pow(yc,e),new _r(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _r(ic(this.r),ic(this.g),ic(this.b),Q0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:XA,formatHex:XA,formatHex8:Xse,formatRgb:QA,toString:QA}));function XA(){return`#${$l(this.r)}${$l(this.g)}${$l(this.b)}`}function Xse(){return`#${$l(this.r)}${$l(this.g)}${$l(this.b)}${$l((isNaN(this.opacity)?1:this.opacity)*255)}`}function QA(){const e=Q0(this.opacity);return`${e===1?"rgb(":"rgba("}${ic(this.r)}, ${ic(this.g)}, ${ic(this.b)}${e===1?")":`, ${e})`}`}function Q0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ic(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $l(e){return e=ic(e),(e<16?"0":"")+e.toString(16)}function JA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new bi(e,t,n,r)}function t3(e){if(e instanceof bi)return new bi(e.h,e.s,e.l,e.opacity);if(e instanceof _d||(e=cE(e)),!e)return new bi;if(e instanceof bi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new bi(s,a,l,e.opacity)}function Qse(e,t,n,r){return arguments.length===1?t3(e):new bi(e,t,n,r??1)}function bi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}sb(bi,Qse,lE(_d,{brighter(e){return e=e==null?cd:Math.pow(cd,e),new bi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?yc:Math.pow(yc,e),new bi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new _r(t1(e>=240?e-240:e+120,o,r),t1(e,o,r),t1(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new bi(ZA(this.h),wm(this.s),wm(this.l),Q0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Q0(this.opacity);return`${e===1?"hsl(":"hsla("}${ZA(this.h)}, ${wm(this.s)*100}%, ${wm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZA(e){return e=(e||0)%360,e<0?e+360:e}function wm(e){return Math.max(0,Math.min(1,e||0))}function t1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Jse=Math.PI/180,Zse=180/Math.PI;var n3=-.14861,uE=1.78277,dE=-.29227,ab=-.90649,Th=1.97294,eD=Th*ab,tD=Th*uE,nD=uE*dE-ab*n3;function eae(e){if(e instanceof sc)return new sc(e.h,e.s,e.l,e.opacity);e instanceof _r||(e=e3(e));var t=e.r/255,n=e.g/255,r=e.b/255,o=(nD*r+eD*t-tD*n)/(nD+eD-tD),i=r-o,s=(Th*(n-o)-dE*i)/ab,a=Math.sqrt(s*s+i*i)/(Th*o*(1-o)),l=a?Math.atan2(s,i)*Zse-120:NaN;return new sc(l<0?l+360:l,a,o,e.opacity)}function es(e,t,n,r){return arguments.length===1?eae(e):new sc(e,t,n,r??1)}function sc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}sb(sc,es,lE(_d,{brighter(e){return e=e==null?cd:Math.pow(cd,e),new sc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?yc:Math.pow(yc,e),new sc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Jse,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),o=Math.sin(e);return new _r(255*(t+n*(n3*r+uE*o)),255*(t+n*(dE*r+ab*o)),255*(t+n*(Th*r)),this.opacity)}}));function tae(e,t,n,r,o){var i=e*e,s=i*e;return((1-3*e+3*i-s)*t+(4-6*i+3*s)*n+(1+3*e+3*i-3*s)*r+s*o)/6}function nae(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],s=r>0?e[r-1]:2*o-i,a=r<t-1?e[r+2]:2*i-o;return tae((n-r/t)*t,s,o,i,a)}}const fE=e=>()=>e;function r3(e,t){return function(n){return e+n*t}}function rae(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function oae(e,t){var n=t-e;return n?r3(e,n>180||n<-180?n-360*Math.round(n/360):n):fE(isNaN(e)?t:e)}function iae(e){return(e=+e)==1?Pu:function(t,n){return n-t?rae(t,n,e):fE(isNaN(t)?n:t)}}function Pu(e,t){var n=t-e;return n?r3(e,n):fE(isNaN(e)?t:e)}(function e(t){var n=iae(t);function r(o,i){var s=n((o=Oh(o)).r,(i=Oh(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=Pu(o.opacity,i.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r})(1);function sae(e){return function(t){var n=t.length,r=new Array(n),o=new Array(n),i=new Array(n),s,a;for(s=0;s<n;++s)a=Oh(t[s]),r[s]=a.r||0,o[s]=a.g||0,i[s]=a.b||0;return r=e(r),o=e(o),i=e(i),a.opacity=1,function(l){return a.r=r(l),a.g=o(l),a.b=i(l),a+""}}}var aae=sae(nae);function o3(e){return function t(n){n=+n;function r(o,i){var s=e((o=es(o)).h,(i=es(i)).h),a=Pu(o.s,i.s),l=Pu(o.l,i.l),c=Pu(o.opacity,i.opacity);return function(u){return o.h=s(u),o.s=a(u),o.l=l(Math.pow(u,n)),o.opacity=c(u),o+""}}return r.gamma=t,r}(1)}o3(oae);var hE=o3(Pu);const dn=e=>aae(e[e.length-1]);var lae=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Yt);const cae=dn(lae);var uae=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Yt);const dae=dn(uae);var fae=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Yt);const hae=dn(fae);var pae=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Yt);const gae=dn(pae);var mae=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Yt);const vae=dn(mae);var bae=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Yt);const yae=dn(bae);var xae=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Yt);const wae=dn(xae);var Sae=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Yt);const _ae=dn(Sae);var Cae=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Yt);const Eae=dn(Cae);var Rae=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Yt);const Pae=dn(Rae);var Oae=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Yt);const Tae=dn(Oae);var Mae=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Yt);const Aae=dn(Mae);var Dae=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Yt);const kae=dn(Dae);var Iae=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Yt);const Nae=dn(Iae);var Lae=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Yt);const Fae=dn(Lae);var jae=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Yt);const $ae=dn(jae);var zae=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Yt);const Bae=dn(zae);var Hae=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Yt);const Vae=dn(Hae);var Wae=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Yt);const Uae=dn(Wae);var Gae=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Yt);const qae=dn(Gae);var Yae=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Yt);const Kae=dn(Yae);var Xae=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Yt);const Qae=dn(Xae);var Jae=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Yt);const Zae=dn(Jae);var ele=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Yt);const tle=dn(ele);var nle=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Yt);const rle=dn(nle);var ole=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Yt);const ile=dn(ole);var sle=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Yt);const ale=dn(sle);function lle(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const cle=hE(es(300,.5,0),es(-240,.5,1));var ule=hE(es(-100,.75,.35),es(80,1.5,.8)),dle=hE(es(260,.75,.35),es(80,1.5,.8)),Sm=es();function fle(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Sm.h=360*e-100,Sm.s=1.5-1.5*t,Sm.l=.8-.9*t,Sm+""}var _m=Oh(),hle=Math.PI/3,ple=Math.PI*2/3;function gle(e){var t;return e=(.5-e)*Math.PI,_m.r=255*(t=Math.sin(e))*t,_m.g=255*(t=Math.sin(e+hle))*t,_m.b=255*(t=Math.sin(e+ple))*t,_m+""}function mle(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function lb(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const vle=lb(Yt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var ble=lb(Yt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),yle=lb(Yt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),xle=lb(Yt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function wle(e){return e}function Sle(e){if(e==null)return wle;var t,n,r=e.scale[0],o=e.scale[1],i=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var c=2,u=a.length,d=new Array(u);for(d[0]=(t+=a[0])*r+i,d[1]=(n+=a[1])*o+s;c<u;)d[c]=a[c],++c;return d}}function _le(e,t){for(var n,r=e.length,o=r-t;o<--r;)n=e[o],e[o++]=e[r],e[r]=n}function Cle(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return rD(e,n)})}:rD(e,t)}function rD(e,t){var n=t.id,r=t.bbox,o=t.properties==null?{}:t.properties,i=Ele(e,t);return n==null&&r==null?{type:"Feature",properties:o,geometry:i}:r==null?{type:"Feature",id:n,properties:o,geometry:i}:{type:"Feature",id:n,bbox:r,properties:o,geometry:i}}function Ele(e,t){var n=Sle(e.transform),r=e.arcs;function o(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],p=0,m=h.length;p<m;++p)d.push(n(h[p],p));u<0&&_le(d,m)}function i(u){return n(u)}function s(u){for(var d=[],h=0,p=u.length;h<p;++h)o(u[h],d);return d.length<2&&d.push(d[0]),d}function a(u){for(var d=s(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(a)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=i(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(i);break;case"LineString":h=s(u.arcs);break;case"MultiLineString":h=u.arcs.map(s);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}const oh={geoAzimuthalEqualArea:Rse,geoAzimuthalEquidistant:Pse,geoGnomonic:Lse,geoOrthographic:jse,geoStereographic:$se,geoEqualEarth:Nse,geoAlbers:VL,geoAlbersUsa:Ese,geoConicConformal:Mse,geoConicEqualArea:Y0,geoConicEquidistant:kse,geoEquirectangular:Ase,geoMercator:Ose,geoTransverseMercator:zse,geoNaturalEarth1:Fse};Object.keys(oh).forEach(e=>{oh[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=oh[e]});class kc extends el{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=HA()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(oh[t.projection]||oh.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=HA(this.projection.fitWidth(1e3,t)).bounds(t),r=Math.ceil(n[1][1]-n[0][1]),o=Math.ceil(n[1][0]-n[0][0]),i=this.projection.translate();this.outlineBounds={width:o,height:r,aspectRatio:o/r,refScale:this.projection.scale(),refX:i[0],refY:i[1]}}updateBounds(){const t=this.chart.chartArea,n=this.outlineBounds;if(!n)return!1;const r=this.options.padding,o=typeof r=="number"?r:r.top,i=typeof r=="number"?r:r.left,s=typeof r=="number"?r:r.bottom,a=typeof r=="number"?r:r.right,l=t.right-t.left-i-a,c=t.bottom-t.top-o-s,u=this.oldChartBounds;this.oldChartBounds={chartWidth:l,chartHeight:c};const d=Math.min(l/n.width,c/n.height),h=n.width*d,p=n.height*d,m=(l-h)*.5+t.left+i,v=(c-p)*.5+t.top+o,y=this.options;return this.projection.scale(n.refScale*d*y.projectionScale).translate([d*n.refX+m+y.projectionOffset[0],d*n.refY+v+y.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}kc.id="projection";kc.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};kc.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const cb={position:"chartArea",property:"value",grid:{z:1,drawOnChartArea:!1},ticks:{z:1},legend:{align:"right",position:"bottom-right",length:100,width:50,margin:8,indicatorWidth:10}};function Rle(e){const{indicatorWidth:t,align:n,margin:r}=e,o=(typeof r=="number"?r:r.left)+(n==="right"?t:0),i=(typeof r=="number"?r:r.top)+(n==="bottom"?t:0),s=(typeof r=="number"?r:r.right)+(n==="left"?t:0),a=(typeof r=="number"?r:r.bottom)+(n==="top"?t:0);return{left:o,top:i,right:s,bottom:a}}function Ple(e,t,n,r,o){const{indicatorWidth:i,align:s,position:a}=t,l=s==="top"||s==="bottom",c=(s==="left"?o.w:n)+(l?i:0),u=(s==="top"?o.h:r)+(l?0:i),d=Rle(t);if(typeof a=="string")switch(a){case"top-left":return[d.left,d.top];case"top":return[(e.right-c)/2,d.top];case"left":return[d.left,(e.bottom-u)/2];case"top-right":return[e.right-c-d.right,d.top];case"bottom-right":return[e.right-c-d.right,e.bottom-u-d.bottom];case"bottom":return[(e.right-c)/2,e.bottom-u-d.bottom];case"bottom-left":return[d.left,e.bottom-u-d.bottom];default:return[e.right-c-d.right,(e.bottom-u)/2]}return[a.x,a.y]}class bu extends od{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){t.position="chartArea",super.init(t),this.axis="r"}parse(t,n){return t&&typeof t[this.options.property]=="number"?t[this.options.property]:super.parse(t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(t-this._startValue)/this._valueRange}update(t,n,r){const o=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),i=Math.min(t,this.right==null?Number.POSITIVE_INFINITY:this.right),s=this.options.legend,a=this.isHorizontal(),l=(p,m)=>p<1?m*p:p,c=Math.min(i,l(a?s.length:s.width,i))-(a?0:s.indicatorWidth),u=Math.min(o,l(a?s.width:s.length,o))-(a?s.indicatorWidth:0);this.legendSize={w:c,h:u},this.bottom=u,this.height=u,this.right=c,this.width=c;const d=this.options.position;this.options.position=this.options.legend.align;const h=super.update(c,u,r);return this.options.position=d,this.height=Math.min(u,this.height),this.width=Math.min(c,this.width),h}_computeLabelArea(){}draw(t){if(!this._isVisible())return;const n=Ple(t,this.options.legend,this.width,this.height,this.legendSize),{ctx:r}=this;r.save(),r.translate(n[0],n[1]);const o=this.options.position;this.options.position=this.options.legend.align,super.draw({...t,bottom:this.height+10,right:this.width}),this.options.position=o;const{indicatorWidth:i}=this.options.legend;switch(this.options.legend.align){case"left":r.translate(this.legendSize.w,0);break;case"top":r.translate(0,this.legendSize.h);break;case"bottom":r.translate(0,-i);break;default:r.translate(-i,0);break}this._drawIndicator(),r.restore()}_drawIndicator(){}}class i3 extends id{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){bu.prototype.init.call(this,t)}parse(t,n){return bu.prototype.parse.call(this,t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(Math.log10(t)-this._startValue)/this._valueRange}update(t,n,r){return bu.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return bu.prototype.draw.call(this,t)}_drawIndicator(){}}const ks={interpolateBlues:Qae,interpolateBrBG:cae,interpolateBuGn:Pae,interpolateBuPu:Tae,interpolateCividis:lle,interpolateCool:dle,interpolateCubehelixDefault:cle,interpolateGnBu:Aae,interpolateGreens:Zae,interpolateGreys:tle,interpolateInferno:yle,interpolateMagma:ble,interpolateOrRd:kae,interpolateOranges:ale,interpolatePRGn:dae,interpolatePiYG:hae,interpolatePlasma:xle,interpolatePuBu:Fae,interpolatePuBuGn:Nae,interpolatePuOr:gae,interpolatePuRd:$ae,interpolatePurples:rle,interpolateRainbow:fle,interpolateRdBu:vae,interpolateRdGy:yae,interpolateRdPu:Bae,interpolateRdYlBu:wae,interpolateRdYlGn:_ae,interpolateReds:ile,interpolateSinebow:gle,interpolateSpectral:Eae,interpolateTurbo:mle,interpolateViridis:vle,interpolateWarm:ule,interpolateYlGn:Uae,interpolateYlGnBu:Vae,interpolateYlOrBr:qae,interpolateYlOrRd:Kae};Object.keys(ks).forEach(e=>{ks[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=ks[e],ks[e.slice(11)]=ks[e]});function s3(e,t){const n=1/t;if(e<=n)return 0;if(e>=1-n)return 1;for(let r=0;r<1;r+=n)if(e<r)return r-n/2;return e}const a3={interpolate:"blues",missing:"transparent",quantize:0};class Ua extends bu{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:ks[t.interpolate]||ks.blues:n=>`rgb(${n},${n},${n})`}getColorForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getColor(n)}getColor(t){let n=t;return this.options.quantize>0&&(n=s3(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){const{indicatorWidth:t}=this.options.legend,n=this._reversePixels;if(this.isHorizontal()){const r=this.width;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?s=>r-o-s:s=>s;for(let s=0;s<r;s+=o){const a=(s+o/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(i(s),0,o,t)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(o(i),0,1,t)}}else{const r=this.height;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?s=>r-o-s:s=>s;for(let s=0;s<r;s+=o){const a=(s+o/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(0,i(s),t,o)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(0,o(i),t,1)}}}}Ua.id="color";Ua.defaults=ir({},[od.defaults,cb,a3]);Ua.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class pE extends i3{constructor(){super(...arguments),this.interpolate=t=>`rgb(${t},${t},${t})`}init(t){super.init(t),typeof t.interpolate=="function"?this.interpolate=t.interpolate:this.interpolate=ks[t.interpolate]||ks.blues}getColorForValue(t){return Ua.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=s3(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Ua.prototype._drawIndicator.call(this)}}pE.id="colorLogarithmic";pE.defaults=ir({},[id.defaults,cb,a3]);pE.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const l3={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class Ga extends bu{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){const[n,r]=this.options.range;if(this.options.mode==="area"){const i=r*r*Math.PI,s=n*n*Math.PI,a=i-s,l=t*a+s;return Math.sqrt(l/Math.PI)}const o=r-n;return t*o+n}_drawIndicator(){const{ctx:t}=this,n=this.options.legend.indicatorWidth/2,r=this.isHorizontal(),o=this.ticks,i=this.getLabelItems(),s=i?i.map(a=>({[r?"x":"y"]:a.options.translation[r?0:1]})):o.map((a,l)=>({[r?"x":"y"]:this.getPixelForTick(l)}));if((this._gridLineItems||[]).forEach(a=>{if(t.save(),t.strokeStyle=a.color,t.lineWidth=a.width,t.setLineDash&&(t.setLineDash(a.borderDash),t.lineDashOffset=a.borderDashOffset),t.beginPath(),this.options.grid.drawTicks)switch(this.options.legend.align){case"left":t.moveTo(0,a.ty1),t.lineTo(n,a.ty2);break;case"top":t.moveTo(a.tx1,0),t.lineTo(a.tx2,n);break;case"bottom":t.moveTo(a.tx1,n),t.lineTo(a.tx2,n*2);break;default:t.moveTo(n,a.ty1),t.lineTo(n*2,a.ty2);break}t.stroke(),t.restore()}),this._model){const a=this._model;t.strokeStyle=a.borderColor,t.lineWidth=a.borderWidth||0,t.fillStyle=a.backgroundColor}else t.fillStyle="blue";o.forEach((a,l)=>{const c=s[l],u=this.getSizeForValue(a.value),d=r?c.x:n,h=r?n:c.y,p={pointStyle:"circle",borderWidth:0,...this._model||{},radius:u};A0(t,p,d,h)})}}Ga.id="size";Ga.defaults=ir({},[od.defaults,cb,l3]);Ga.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class c3 extends i3{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){return Ga.prototype.getSizeImpl.call(this,t)}_drawIndicator(){Ga.prototype._drawIndicator.call(this)}}c3.id="sizeLogarithmic";c3.defaults=ir({},[id.defaults,cb,l3]);function Ole(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class Vs extends ls{constructor(){super(...arguments),this.cache=void 0}inRange(t,n){const r=this.getBounds(),o=(Number.isNaN(t)||t>=r.x&&t<=r.x2)&&(Number.isNaN(n)||n>=r.y&&n<=r.y2),i=this.projectionScale.geoPath.projection();if(o&&!Number.isNaN(t)&&!Number.isNaN(n)&&typeof i.invert=="function"){const s=i.invert([t,n]);return s!=null&&nse(this.feature,s)}return o}inXRange(t){return this.inRange(t,Number.NaN)}inYRange(t){return this.inRange(Number.NaN,t)}getCenterPoint(){if(this.cache&&this.cache.center)return this.cache.center;let t;if(this.center){const n=this.projectionScale.projection([this.center.longitude,this.center.latitude]);t={x:n[0],y:n[1]}}else{const n=this.projectionScale.geoPath.centroid(this.feature);t={x:n[0],y:n[1]}}return this.cache={...this.cache||{},center:t},t}getBounds(){if(this.cache&&this.cache.bounds)return this.cache.bounds;const t=Ole(this.projectionScale.geoPath.bounds(this.feature),this.options.borderWidth/2),n={x:t[0][0],x2:t[1][0],y:t[0][1],y2:t[1][1],width:t[1][0]-t[0][0],height:t[1][1]-t[0][1]};return this.cache={...this.cache||{},bounds:n},n}_drawInCache(t){const n=this.getBounds();if(!Number.isFinite(n.x))return;const r=this.cache&&this.cache.canvas?this.cache.canvas:t.createElement("canvas"),o=Math.floor(n.x),i=Math.floor(n.y),s=Math.ceil(n.x+n.width),a=Math.ceil(n.y+n.height),l=this.pixelRatio||1,c=Math.ceil(Math.max(s-o,1)*l),u=Math.ceil(Math.max(a-i,1)*l);if(c<=0||u<=0)return;r.width=c,r.height=u;const d=r.getContext("2d");d&&(d.clearRect(0,0,r.width,r.height),d.save(),d.scale(l,l),d.translate(-o,-i),this._drawImpl(d),d.restore(),this.cache={...this.cache||{},canvas:r,canvasKey:this._optionsToKey()})}_optionsToKey(){const{options:t}=this;return`${t.backgroundColor};${t.borderColor};${t.borderWidth};${this.pixelRatio}`}_drawImpl(t){const{feature:n}=this,{options:r}=this;t.beginPath(),this.projectionScale.geoPath.context(t)(n),r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fill()),r.borderColor&&(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.stroke())}draw(t){const{feature:n}=this;if(!n)return;(!this.cache||this.cache.canvasKey!==this._optionsToKey())&&t.canvas.ownerDocument!=null&&this._drawInCache(t.canvas.ownerDocument);const r=this.getBounds();if(this.cache&&this.cache.canvas&&this.cache.canvas.width>0&&this.cache.canvas.height>0){const o=Math.floor(r.x),i=Math.floor(r.y),s=Math.ceil(r.x+r.width),a=Math.ceil(r.y+r.height),l=s-o,c=a-i;l>0&&c>0&&t.drawImage(this.cache.canvas,o,i,s-o,a-i)}else Number.isFinite(r.x)&&(t.save(),this._drawImpl(t),t.restore())}}Vs.id="geoFeature";Vs.defaults={...oc.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};Vs.defaultRoutes={outlineBorderColor:"borderColor",...oc.defaultRoutes||{}};const u3={showOutline:!1,showGraticule:!1,clipMap:!0},d3={scales:{projection:{axis:"x",type:kc.id,position:"chartArea",display:!1}}};function oD(e){const t={...e};return Object.keys(e).forEach(n=>{let r=n;if(n.startsWith("outline")){const o=n.slice(7);r=o[0].toLowerCase()+o.slice(1)}else if(n.startsWith("hoverOutline"))r=`hover${n.slice(12)}`;else return;delete t[n],t[r]=e[n]}),t}class f3 extends Qo{getGeoDataset(){return super.getDataset()}getGeoOptions(){return this.chart.options}getProjectionScale(){return this.getScaleForId("projection")}linkScales(){const t=this.getGeoDataset(),n=this.getMeta();n.xAxisID="projection",t.xAxisID="projection",n.yAxisID="projection",t.yAxisID="projection",n.xScale=this.getScaleForId("projection"),n.yScale=this.getScaleForId("projection"),this.getProjectionScale().computeBounds(this.resolveOutline())}showOutline(){return st(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return st(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return st(this.getGeoDataset().showGraticule,this.getGeoOptions().showGraticule)}update(t){super.update(t);const n=this.getMeta(),r=this.getProjectionScale(),o=r.updateBounds();if(this.showOutline()){const i=n.dataset;if(o&&delete i.cache,i.projectionScale=r,i.pixelRatio=this.chart.currentDevicePixelRatio,t!=="resize"){const s=oD(this.resolveDatasetElementOptions(t)),a={feature:this.resolveOutline(),options:s};this.updateElement(i,void 0,a,t),this.getGraticule()&&(n.graticule=s)}}else this.getGraticule()&&t!=="resize"&&(n.graticule=oD(this.resolveDatasetElementOptions(t)));this.updateElements(n.data,0,n.data.length,t),o&&n.data.forEach(i=>delete i.cache)}resolveOutline(){const n=this.getGeoDataset().outline||{type:"Sphere"};return Array.isArray(n)?{type:"FeatureCollection",features:n}:n}showGraticule(){const t=this.getGraticule(),n=this.getMeta().graticule;if(!t||!n)return;const{ctx:r}=this.chart,i=this.getProjectionScale().geoPath.context(r);if(r.save(),r.beginPath(),typeof t=="boolean")t&&i(rse());else{const s=PL();t.stepMajor&&s.stepMajor(t.stepMajor),t.stepMinor&&s.stepMinor(t.stepMinor),i(s())}r.strokeStyle=n.graticuleBorderColor,r.lineWidth=n.graticuleBorderWidth,r.stroke(),r.restore()}draw(){const{chart:t}=this,n=this.clipMap();let r=!1;(n===!0||n==="outline"||n==="outline+graticule")&&(r=!0,Zl(t.ctx,t.chartArea)),this.showOutline()&&this.getMeta().dataset&&this.getMeta().dataset.draw.call(this.getMeta().dataset,t.ctx,t.chartArea),n===!0||n==="graticule"||n==="outline+graticule"?r||Zl(t.ctx,t.chartArea):r&&(r=!1,ec(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||Zl(t.ctx,t.chartArea):r&&(r=!1,ec(t.ctx)),this.getMeta().data.forEach(o=>o.draw.call(o,t.ctx,t.chartArea)),r&&(r=!1,ec(t.ctx))}}function h3(e,t,n,r=[],o=[]){Lr.addControllers(n),Array.isArray(r)?Lr.addElements(...r):Lr.addElements(r),Array.isArray(o)?Lr.addScales(...o):Lr.addScales(o);const i=t;return i.type=e,i}class Cd extends f3{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="color",n.rAxisID="color",t.vAxisID="color",t.rAxisID="color",n.rScale=this.getScaleForId("color"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,{data:o}=this.getDataset(),i=this._cachedMeta;for(let s=t;s<t+n;s+=1)i._parsed[s]={[r.axis]:r.parse(o[s],s)}}updateElements(t,n,r,o){const i=this.resolveDataElementOptions(n,o),s=this.getSharedOptions(i),a=this.includeOptions(o,s),l=this.getProjectionScale();this.updateSharedOptions(s,o,i);for(let c=n;c<n+r;c+=1){const u=t[c];u.projectionScale=l,u.feature=this._data[c].feature,u.center=this._data[c].center,u.pixelRatio=this.chart.currentDevicePixelRatio;const d=u.getCenterPoint(),h={x:d.x,y:d.y};a&&(h.options=s||this.resolveDataElementOptions(c,o)),this.updateElement(u,c,h,o)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}Cd.id="choropleth";Cd.defaults=ir({},[u3,{datasetElementType:Vs.id,dataElementType:Vs.id}]);Cd.overrides=ir({},[d3,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}},colors:{enabled:!1}},scales:{color:{type:Ua.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class Tle extends Mn{constructor(t,n){super(t,h3("choropleth",n,Cd,Vs,[Ua,kc]))}}Tle.id=Cd.id;class Ed extends f3{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="size",n.rAxisID="size",t.vAxisID="size",t.rAxisID="size",n.rScale=this.getScaleForId("size"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,o=this.getDataset().data,i=this._cachedMeta;for(let s=t;s<t+n;s+=1){const a=o[s];i._parsed[s]={x:a.longitude==null?a.x:a.longitude,y:a.latitude==null?a.y:a.latitude,[r.axis]:r.parse(a,s)}}}updateElements(t,n,r,o){const i=o==="reset",s=this.resolveDataElementOptions(n,o),a=this.getSharedOptions(s),l=this.includeOptions(o,a),c=this.getProjectionScale();this.getMeta().rScale._model=s,this.updateSharedOptions(a,o,s);for(let u=n;u<n+r;u+=1){const d=t[u],h=this.getParsed(u),p=c.projection([h.x,h.y]),m={x:p?p[0]:0,y:p?p[1]:0,skip:Number.isNaN(h.x)||Number.isNaN(h.y)};l&&(m.options=a||this.resolveDataElementOptions(u,o),i&&(m.options.radius=0)),this.updateElement(d,u,m,o)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}Ed.id="bubbleMap";Ed.defaults=ir({},[u3,{dataElementType:rc.id,datasetElementType:Vs.id,showOutline:!0,clipMap:"outline+graticule"}]);Ed.overrides=ir({},[d3,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}}},scales:{size:{axis:"x",type:Ga.id}},elements:{point:{radius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)},hoverRadius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)+1}}}}]);class Mle extends Mn{constructor(t,n){super(t,h3("bubbleMap",n,Ed,Vs,[Ga,kc]))}}Mle.id=Ed.id;function Ale(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Dle(e){var n;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}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function kle(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Ile(e,t=!1){var r;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}}}function Nle(e,t){var r,o,i,s,a;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"}},plugins:{...(a=e==null?void 0:e.options)==null?void 0:a.plugins,legend:{position:"bottom",align:"center"}}}}}function Lle(e){var n;return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Fle(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:"bottom",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function jle(e){var n;return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function gE({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s,topoJson:a}){var l,c,u,d,h,p,m,v,y,b;if(t==="map"){if(!a)return null;const S=(l=s==null?void 0:s.mapVisualOptions)==null?void 0:l.objectKey;if(!S)return null;const _=Cle(a,(c=a==null?void 0:a.objects)==null?void 0:c[S]).features;if(!_)return null;const C={plugins:{datalabels:{display:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1}},projection:{axis:"x",projection:((u=s==null?void 0:s.mapVisualOptions)==null?void 0:u.projection)||"mercator",projectionScale:((d=s==null?void 0:s.mapVisualOptions)==null?void 0:d.projectionScale)||1,projectionOffset:((h=s==null?void 0:s.mapVisualOptions)==null?void 0:h.projectionOffset)||[0,0]},color:{axis:"x",interpolate:((p=s==null?void 0:s.mapVisualOptions)==null?void 0:p.colorScale)||"blues",quantize:5,legend:{position:"bottom-right",align:"right"}}}},{keys:E}=nr(e),T=_.map(z=>{var W;const K=E==null?void 0:E[0],V=E==null?void 0:E[1],N=(W=e.find(H=>(H==null?void 0:H[K])===z.properties.NAME||(H==null?void 0:H[K])===z.properties.name))==null?void 0:W[V];return{feature:z,value:N}}),D=Df([{label:S,data:T,borderColor:"lightgray"}],r),k={type:"choropleth",data:{labels:_.map(z=>z.properties.NAME||z.properties.name),datasets:D},options:C},{options:j}=y4({cfg:k,preferences:s,customCfg:r});return{...k,options:j}}if(t==="bar"){const S=kle(n);return bl({data:e,cfg:S,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const S=Ale(n);return bl({data:e,cfg:S,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pyramid"){const S=Dle(n),{dimensionKeys:_,metricKeys:C}=nr(e),E=R0({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:C[0]}),T=bl({data:E,cfg:S,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s}),A="x2";return{...T,data:{...T.data,datasets:T.data.datasets.map((k,j)=>j===1?{...k,xAxisID:A}:k)},options:{...T.options,scales:{...(m=T==null?void 0:T.options)==null?void 0:m.scales,[A]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const S=Nle(n,t),{dimensionKeys:_,metricKeys:C}=nr(e),E=R0({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:C[0],sortChart:s==null?void 0:s.sortChart});return bl({data:E,cfg:S,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const S=Lle(n);return bl({data:e,cfg:S,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="range"){const S=Ile(n),_=hee(e),C=Df(_,r),{plugins:E,options:T}=g4((s==null?void 0:s.customVisualCode)||""),A=qo((S==null?void 0:S.options)||{},(n==null?void 0:n.options)||{}),D=qo(A,(s==null?void 0:s.chartOptions)||{}),k=qo(D,(r==null?void 0:r.options)||{}),j=qo(k,T),$=b4(n,s),z=qo(j,$),K={...z,plugins:{...z==null?void 0:z.plugins,datalabels:{...(v=z==null?void 0:z.plugins)==null?void 0:v.datalabels,formatter:(G,te)=>G.map(Y=>{var q,M,ne,X;return Bs({number:Number(Y),decimalPlaces:((q=s==null?void 0:s.numberAxisFormat)==null?void 0:q.decimalPlaces)||0,useSuffix:!!((M=s==null?void 0:s.numberAxisFormat)!=null&&M.suffix),customSuffix:"",locale:((ne=s==null?void 0:s.numberAxisFormat)==null?void 0:ne.locale)||"",currency:((X=s==null?void 0:s.numberAxisFormat)==null?void 0:X.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:V}=nr(e),N=V[0];return{type:"bar",data:{labels:[...new Set(eS(e,N))],datasets:C},options:K,plugins:[...E]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const S=Fle(t,n),{dimensionKeys:_,metricKeys:C}=nr(e),E=pee(C,e),T=Df(E,r),A=_[0],D=eS(e,A),k=qo((S==null?void 0:S.options)||{},(r==null?void 0:r.options)||{}),j=qo(k,(s==null?void 0:s.chartOptions)||{}),$={...j,plugins:{...j.plugins,datalabels:{...(y=j.plugins)==null?void 0:y.datalabels,formatter:(V,N)=>{var W,H,G,te;return Bs({number:Number(V),decimalPlaces:((W=s==null?void 0:s.numberAxisFormat)==null?void 0:W.decimalPlaces)||0,useSuffix:!!((H=s==null?void 0:s.numberAxisFormat)!=null&&H.suffix),customSuffix:"",locale:((G=s==null?void 0:s.numberAxisFormat)==null?void 0:G.locale)||"",currency:((te=s==null?void 0:s.numberAxisFormat)==null?void 0:te.currency)||""})}},tooltip:{...(b=j.plugins)==null?void 0:b.tooltip,callbacks:{label:function(V){let N=V.dataset.label||"";N&&(N+=": ");const H=V.dataset.data.reduce((F,Y)=>F+Y,0),te=(V.parsed/H*100).toFixed(2);return N+=te+"%",N+` (${V.formattedValue})`}}}}};return{type:t,data:{labels:D,datasets:T},options:$,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(V,N,W){var X,re,ee,J;const{ctx:H,data:G}=V;H.save();const te=V.getDatasetMeta(0).data[0].x,F=V.getDatasetMeta(0).data[0].y,Y=Xu(vh()),q=window.getComputedStyle(H.canvas).fontFamily;H.font=`1em ${q}`,H.fontWeight="bolder",H.fillStyle=Y,H.textAlign="center",H.textBaseline="middle";const M=G.datasets[0].data.reduce((le,ce)=>le+ce,0),ne=Bs({number:Number(M),decimalPlaces:((X=s==null?void 0:s.numberAxisFormat)==null?void 0:X.decimalPlaces)||0,useSuffix:!!((re=s==null?void 0:s.numberAxisFormat)!=null&&re.suffix),customSuffix:"",locale:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.locale)||"",currency:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.currency)||""});H.fillText(ne,te,F)}}:""]}}if(t==="radar"){const S=jle(n);return bl({data:e,cfg:S,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:S}=nr(e);if(S.length<3){console.log("Bubble charts require 3 numeric columns");return}const _=fee(e),C=Df(_,r),E={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:S[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:S[1]},beginAtZero:!0,ticks:{precision:0}}}},T=qo(E,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:C},options:T}}return bl({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function $le({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=we.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)&&Ble(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&Hle(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&zle({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function zle(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((d,h)=>{var p,m;typeof d.backgroundColor=="string"&&(d.backgroundColor=new Array(d.data.length).fill(d.backgroundColor),d.borderColor=new Array(d.data.length).fill(d.borderColor)),d.backgroundColor=(p=d==null?void 0:d.backgroundColor)==null?void 0:p.map((v,y)=>y===n&&h===r?v:s),d.borderColor=(m=d==null?void 0:d.borderColor)==null?void 0:m.map((v,y)=>y===n&&h===r?v:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,h)=>{var p,m,v,y,b,S;d.backgroundColor=new Array(d.data.length).fill((v=(m=(p=o==null?void 0:o.data)==null?void 0:p.datasets)==null?void 0:m[h])==null?void 0:v.backgroundColor),d.borderColor=new Array(d.data.length).fill((S=(b=(y=o==null?void 0:o.data)==null?void 0:y.datasets)==null?void 0:b[h])==null?void 0:S.borderColor)}),t==null||t.update()}function Ble(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,d;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,p)=>p===t?h:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((h,p)=>p===t?h:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,h,p,m,v,y;c.backgroundColor=new Array(c.data.length).fill((p=(h=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:h[u])==null?void 0:p.backgroundColor),c.borderColor=new Array(c.data.length).fill((y=(v=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:v[u])==null?void 0:y.borderColor)}),e==null||e.update()}function Hle(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,d;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,p)=>p===t?h:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((h,p)=>p===t?h:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,h,p,m,v,y,b,S;typeof c.backgroundColor=="string"&&(c.backgroundColor=(p=(h=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:h[u])==null?void 0:p.backgroundColor,c.borderColor=(y=(v=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:v[u])==null?void 0:y.borderColor),c.backgroundColor=(b=c==null?void 0:c.backgroundColor)==null?void 0:b.map((_,C)=>{var E;return(E=n.data.datasets[u].backgroundColor)==null?void 0:E[C]}),c.borderColor=(S=c==null?void 0:c.borderColor)==null?void 0:S.map((_,C)=>{var E;return(E=n.data.datasets[u].borderColor)==null?void 0:E[C]})}),e==null||e.update()}function Vle({card:e,data:t,datasetIndex:n,clickIndex:r,value:o}){var i,s,a,l,c,u;try{if(!t)return;const{keys:d,dimensionKeys:h,metricKeys:p}=nr(t);if(e.type==="map"){const m=d[0],v=((s=(i=o==null?void 0:o.feature)==null?void 0:i.properties)==null?void 0:s.name)||((l=(a=o==null?void 0:o.feature)==null?void 0:a.properties)==null?void 0:l.NAME);return[{columnName:m,columnValue:v}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const m=h[0],v=(c=t[r])==null?void 0:c[m];return[{columnName:m,columnValue:v,metric:p[n],value:o}]}if(["stackedBar","pyramid"].includes(e.type)){const m=R0({dataArray:t,groupKey:h[0],pivotKey:h[1],valueKey:p[0]}),v=h[0],y=(u=m[r])==null?void 0:u[v],b=h[1],{metricKeys:S}=nr(m),_=S[n];return[{columnName:v,columnValue:y,metric:p[0],value:o},{columnName:b,columnValue:_,metric:p[0],value:o}]}if(e.type==="bubble"||e.type==="scatter"){const m=h[0],v=o.label;return[{columnName:m,columnValue:v,metric1:p[0],value1:o.x,metric2:p[1],value2:o.y,metric3:p==null?void 0:p[2],value3:o==null?void 0:o.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function p3(e){var a,l,c,u,d,h;const t=(((l=(a=e.preferences)==null?void 0:a.mapVisualOptions)==null?void 0:l.topoJsonUrl)==="custom"?(u=(c=e.preferences)==null?void 0:c.mapVisualOptions)==null?void 0:u.customTopoJsonUrl:(h=(d=e.preferences)==null?void 0:d.mapVisualOptions)==null?void 0:h.topoJsonUrl)||"",n=!!t&&e.type==="map",{data:r,isLoading:o,isFetching:i,isError:s}=xp({queryKey:["topojson",t],queryFn:()=>fetch(t).then(p=>p.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:o,isFetching:i,isError:s}}function Wle(e){var s,a;const[t]=P.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=dr(),r=n(e),o=mE(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 mE(e){var K,V,N,W;const{onChartElementClicked:t}=ko(),[n,r]=P.useState(0);((K=e==null?void 0:e.preferences)==null?void 0:K.filterOnClickColumnIndex)===void 0||(V=e.preferences)==null||V.filterOnClickColumnIndex;const o=we(H=>H.isVisualEditing),i=we(H=>H.filteringCards),s=we(H=>H.selectedSheetId),a=we(H=>H.selectedLensId);we(H=>H.selectedCardId),we(H=>H.dashboard),we(H=>H.isDashboardEditing),we(H=>H.themeStyle);const l=we(H=>H.filterValues),c=P.useRef(l),u=(N=e==null?void 0:e.preferences)==null?void 0:N.onClickFilter,{addFilteringCard:d,getCardFrame:h,addOrUpdateFilterValues:p,removeFilterValue:m,removeFilteringCard:v}=dr(),{data:y,isLoading:b,isFetching:S,isError:_,queryKey:C}=tb(e),{data:E}=p3(e),T=i==null?void 0:i.find(H=>H.id===e.id),A=h(e.id),D=(A==null?void 0:A.cards)||[],k=(D==null?void 0:D.length)==1;let j;y&&y.records&&((W=y.records)==null?void 0:W.length)>0&&e.type!=="custom"&&(j=gE({data:y==null?void 0:y.records,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences,topoJson:E}));const $=P.useRef({filteringCards:i});P.useEffect(()=>{!(y!=null&&y.records)||b||S||T&&k||o||r(H=>H+1)},[y==null?void 0:y.records,b,S,T,k,o]),P.useEffect(()=>{e.connectionId&&!T&&(c.current=l)},[l,a,e.connectionId,T]),P.useEffect(()=>{var G;T&&($.current.filteringCards=[...i||[]]),!T&&((G=$.current.filteringCards)==null?void 0:G.find(te=>te.id===e.id))&&k&&r(te=>te+1)},[T,k,e.id,i]);function z(H,G,te,F){var M;let Y=!1;if(!(y!=null&&y.records))return;const q=Vle({card:e,data:y==null?void 0:y.records,datasetIndex:G,clickIndex:te,value:F});if(console.log("fieldValues",q),t==null||t(e,q),!!(((M=e==null?void 0:e.preferences)==null?void 0:M.onClickFilter)??[]).length){if(T){const ne=e.id;m(ne),v(e)}else{if(Y=!0,!q)return;const ne=[];q.forEach((X,re)=>{const ee=u==null?void 0:u.find(le=>le.columnIndex===re);if(!ee)return;const J={filterId:e.id+"-"+X.columnName+"-"+s,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:X.columnName,expression:ee.expression,valueType:Av(q[ee.columnIndex].columnValue),operation:"=",values:[q[ee.columnIndex].columnValue]};ne.push(J)}),p(ne),d(e)}$le({chart:H,elementIndex:te,datasetIndex:G,cardType:e.type,cfg:j,apply:Y})}}return{isError:_,isLoading:b,isFetching:S,data:y,visualKey:n,handleDatapointClick:z,cfg:j}}function Qi({children:e,containerClassName:t,className:n,text:r,onSave:o,type:i="input"}){const[s,a]=P.useState(!1),[l,c]=P.useState(r),u=we(p=>p.isDashboardEditing),d=p=>{p.stopPropagation(),u&&a(!0)};function h(){return i==="textarea"?x.jsx("textarea",{className:xe("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:p=>c(p.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:p=>{p.stopPropagation(),!(p.key==="Enter"&&p.shiftKey)&&(p.key==="Enter"||p.key==="Tab")&&(a(!1),o(l))}}):x.jsx("input",{onMouseDown:p=>p.stopPropagation(),type:"text",className:xe("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:p=>c(p.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:p=>{p.stopPropagation(),(p.key==="Enter"||p.key==="Tab")&&(a(!1),o(l))}})}return x.jsx("div",{className:xe("flex",t),role:"editable",onDoubleClick:d,children:s?h():e})}function g3(e){const{authToken:t}=ko(),n=tK(t==null?void 0:t.accessToken);function r(){var i,s,a,l,c,u;if((s=(i=e.preferences)==null?void 0:i.formatNumber)!=null&&s.currency&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.currency)!=="none")return n!=null&&n.currency?n==null?void 0:n.currency:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.currency}function o(){var i,s,a,l,c,u;if((s=(i=e.preferences)==null?void 0:i.formatNumber)!=null&&s.locale&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.locale)!=="none")return n!=null&&n.locale?n==null?void 0:n.locale:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.locale}return{getCurrency:r,getLocale:o}}function m3({card:e,data:t}){var S,_,C,E,T,A,D,k,j,$,z,K,V,N,W,H;const n=we(G=>G.actions.setCardTitle),r=we(G=>G.actions.setCardDescription),o=we(G=>G.isVisualEditing),i=Nr(G=>G.card),s=Nr(G=>G.actions.setCard);Nr(G=>G.actions.setNumberFormat);const{getCurrency:a,getLocale:l}=g3(e),c=we(G=>G.selectedSheetId),u=(_=(S=e.preferences)==null?void 0:S.formatNumber)==null?void 0:_.colorRanges,{metricKeys:d}=nr(t),h=(C=t==null?void 0:t[0])==null?void 0:C[d==null?void 0:d[0]],p=(E=t==null?void 0:t[0])==null?void 0:E[d==null?void 0:d[1]],m=t&&t.length>0;function v(G){o?s({...i,title:G}):n(c,e.id,G)}function y(G){o?s({...i,description:G}):r(c,e.id,G)}const b=p&&p-h!==0?(h-p)/p:null;return x.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[x.jsxs(Dv,{className:"grow pb-3",children:[x.jsx(Qi,{text:o?i.title:e.title,onSave:v,children:x.jsx("div",{className:"flex items-center gap-2",children:x.jsx(yd,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),m&&x.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[x.jsx("p",{style:{color:FC(h,u)},className:"text-3xl font-semibold",children:Bs({number:h,decimalPlaces:((A=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:A.decimalPlaces)||0,useSuffix:!!((k=(D=e.preferences)==null?void 0:D.formatNumber)!=null&&k.suffix),customSuffix:(($=(j=e.preferences)==null?void 0:j.formatNumber)==null?void 0:$.suffix)||"",locale:l()||"",currency:a()||""})}),p&&x.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",Bs({number:p,decimalPlaces:((K=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:K.decimalPlaces)||0,useSuffix:!!((N=(V=e.preferences)==null?void 0:V.formatNumber)!=null&&N.suffix),customSuffix:((H=(W=e.preferences)==null?void 0:W.formatNumber)==null?void 0:H.suffix)||"",locale:l()||"",currency:a()||""})]})]})]}),b&&x.jsxs(kv,{className:"grow items-start gap-1 pb-4 text-sm",children:[x.jsx(v3,{children:b}),x.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[b>0?"up ":"down ",x.jsx(Qi,{text:e.description||"",onSave:y,children:e.description})]})]})]})}function v3({children:e,className:t}){var i,s;const n=we(a=>a.themeStyle),r=e>0?x.jsx("span",{children:"+"}):x.jsx("span",{children:"-"}),o=`${Math.abs(e*100).toFixed(0)}%`;return x.jsxs("div",{style:{borderRadius:(s=(i=n==null?void 0:n.chart)==null?void 0:i.options)==null?void 0:s.borderRadius},className:xe("flex items-center px-1 text-sm font-semibold",{"bg-green-600/10 text-green-600":e>0,"bg-destructive/10 text-destructive":e<0},t),children:[r,x.jsx("span",{className:"ml-[1px]",children:o})]})}const Ule=["top","right","bottom","left"],qa=Math.min,_o=Math.max,J0=Math.round,Cm=Math.floor,Ya=e=>({x:e,y:e}),Gle={left:"right",right:"left",bottom:"top",top:"bottom"},qle={start:"end",end:"start"};function kS(e,t,n){return _o(e,qa(t,n))}function Ws(e,t){return typeof e=="function"?e(t):e}function Us(e){return e.split("-")[0]}function Rd(e){return e.split("-")[1]}function vE(e){return e==="x"?"y":"x"}function bE(e){return e==="y"?"height":"width"}function Pd(e){return["top","bottom"].includes(Us(e))?"y":"x"}function yE(e){return vE(Pd(e))}function Yle(e,t,n){n===void 0&&(n=!1);const r=Rd(e),o=yE(e),i=bE(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Z0(s)),[s,Z0(s)]}function Kle(e){const t=Z0(e);return[IS(e),t,IS(t)]}function IS(e){return e.replace(/start|end/g,t=>qle[t])}function Xle(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 Qle(e,t,n,r){const o=Rd(e);let i=Xle(Us(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(IS)))),i}function Z0(e){return e.replace(/left|right|bottom|top/g,t=>Gle[t])}function Jle(e){return{top:0,right:0,bottom:0,left:0,...e}}function b3(e){return typeof e!="number"?Jle(e):{top:e,right:e,bottom:e,left:e}}function ev(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function iD(e,t,n){let{reference:r,floating:o}=e;const i=Pd(t),s=yE(t),a=bE(s),l=Us(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Rd(t)){case"start":p[s]-=h*(n&&c?-1:1);break;case"end":p[s]+=h*(n&&c?-1:1);break}return p}const Zle=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:d}=iD(c,r,l),h=r,p={},m=0;for(let v=0;v<a.length;v++){const{name:y,fn:b}=a[v],{x:S,y:_,data:C,reset:E}=await b({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=S??u,d=_??d,p={...p,[y]:{...p[y],...C}},E&&m<=50){m++,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:d}=iD(c,h,l)),v=-1;continue}}return{x:u,y:d,placement:h,strategy:o,middlewareData:p}};async function ja(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:d="floating",altBoundary:h=!1,padding:p=0}=Ws(t,e),m=b3(p),y=a[h?d==="floating"?"reference":"floating":d],b=ev(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),S=d==="floating"?{...s.floating,x:r,y:o}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),C=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},E=ev(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:_,strategy:l}):S);return{top:(b.top-E.top+m.top)/C.y,bottom:(E.bottom-b.bottom+m.bottom)/C.y,left:(b.left-E.left+m.left)/C.x,right:(E.right-b.right+m.right)/C.x}}const sD=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}=Ws(e,t)||{};if(c==null)return{};const d=b3(u),h={x:n,y:r},p=yE(o),m=bE(p),v=await s.getDimensions(c),y=p==="y",b=y?"top":"left",S=y?"bottom":"right",_=y?"clientHeight":"clientWidth",C=i.reference[m]+i.reference[p]-h[p]-i.floating[m],E=h[p]-i.reference[p],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=T?T[_]:0;(!A||!await(s.isElement==null?void 0:s.isElement(T)))&&(A=a.floating[_]||i.floating[m]);const D=C/2-E/2,k=A/2-v[m]/2-1,j=qa(d[b],k),$=qa(d[S],k),z=j,K=A-v[m]-$,V=A/2-v[m]/2+D,N=kS(z,V,K),W=!l.arrow&&Rd(o)!=null&&V!=N&&i.reference[m]/2-(V<z?j:$)-v[m]/2<0,H=W?V<z?V-z:V-K:0;return{[p]:h[p]+H,data:{[p]:N,centerOffset:V-N-H,...W&&{alignmentOffset:H}},reset:W}}}),ece=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:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...y}=Ws(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Us(o),S=Us(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=h||(S||!v?[Z0(a)]:Kle(a));!h&&m!=="none"&&C.push(...Qle(a,v,m,_));const E=[a,...C],T=await ja(t,y),A=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&A.push(T[b]),d){const z=Yle(o,s,_);A.push(T[z[0]],T[z[1]])}if(D=[...D,{placement:o,overflows:A}],!A.every(z=>z<=0)){var k,j;const z=(((k=i.flip)==null?void 0:k.index)||0)+1,K=E[z];if(K)return{data:{index:z,overflows:D},reset:{placement:K}};let V=(j=D.filter(N=>N.overflows[0]<=0).sort((N,W)=>N.overflows[1]-W.overflows[1])[0])==null?void 0:j.placement;if(!V)switch(p){case"bestFit":{var $;const N=($=D.map(W=>[W.placement,W.overflows.filter(H=>H>0).reduce((H,G)=>H+G,0)]).sort((W,H)=>W[1]-H[1])[0])==null?void 0:$[0];N&&(V=N);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function aD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lD(e){return Ule.some(t=>e[t]>=0)}const tce=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ws(e,t);switch(r){case"referenceHidden":{const i=await ja(t,{...o,elementContext:"reference"}),s=aD(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:lD(s)}}}case"escaped":{const i=await ja(t,{...o,altBoundary:!0}),s=aD(i,n.floating);return{data:{escapedOffsets:s,escaped:lD(s)}}}default:return{}}}}};async function nce(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Us(n),a=Rd(n),l=Pd(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Ws(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}const rce=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 nce(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}}}}},oce=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:y=>{let{x:b,y:S}=y;return{x:b,y:S}}},...l}=Ws(e,t),c={x:n,y:r},u=await ja(t,l),d=Pd(Us(o)),h=vE(d);let p=c[h],m=c[d];if(i){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",S=p+u[y],_=p-u[b];p=kS(S,p,_)}if(s){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",S=m+u[y],_=m-u[b];m=kS(S,m,_)}const v=a.fn({...t,[h]:p,[d]:m});return{...v,data:{x:v.x-n,y:v.y-r}}}}},ice=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}=Ws(e,t),u={x:n,y:r},d=Pd(o),h=vE(d);let p=u[h],m=u[d];const v=Ws(a,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const _=h==="y"?"height":"width",C=i.reference[h]-i.floating[_]+y.mainAxis,E=i.reference[h]+i.reference[_]-y.mainAxis;p<C?p=C:p>E&&(p=E)}if(c){var b,S;const _=h==="y"?"width":"height",C=["top","left"].includes(Us(o)),E=i.reference[d]-i.floating[_]+(C&&((b=s.offset)==null?void 0:b[d])||0)+(C?0:y.crossAxis),T=i.reference[d]+i.reference[_]+(C?0:((S=s.offset)==null?void 0:S[d])||0)-(C?y.crossAxis:0);m<E?m=E:m>T&&(m=T)}return{[h]:p,[d]:m}}}},sce=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}=Ws(e,t),l=await ja(t,a),c=Us(n),u=Rd(n),d=Pd(n)==="y",{width:h,height:p}=r.floating;let m,v;c==="top"||c==="bottom"?(m=c,v=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(v=c,m=u==="end"?"top":"bottom");const y=p-l[m],b=h-l[v],S=!t.middlewareData.shift;let _=y,C=b;if(d){const T=h-l.left-l.right;C=u||S?qa(b,T):T}else{const T=p-l.top-l.bottom;_=u||S?qa(y,T):T}if(S&&!u){const T=_o(l.left,0),A=_o(l.right,0),D=_o(l.top,0),k=_o(l.bottom,0);d?C=h-2*(T!==0||A!==0?T+A:_o(l.left,l.right)):_=p-2*(D!==0||k!==0?D+k:_o(l.top,l.bottom))}await s({...t,availableWidth:C,availableHeight:_});const E=await o.getDimensions(i.floating);return h!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function Ka(e){return y3(e)?(e.nodeName||"").toLowerCase():"#document"}function Ro(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ys(e){var t;return(t=(y3(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function y3(e){return e instanceof Node||e instanceof Ro(e).Node}function Gs(e){return e instanceof Element||e instanceof Ro(e).Element}function ts(e){return e instanceof HTMLElement||e instanceof Ro(e).HTMLElement}function cD(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ro(e).ShadowRoot}function Tp(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ei(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ace(e){return["table","td","th"].includes(Ka(e))}function xE(e){const t=wE(),n=ei(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 lce(e){let t=ud(e);for(;ts(t)&&!ub(t);){if(xE(t))return t;t=ud(t)}return null}function wE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ub(e){return["html","body","#document"].includes(Ka(e))}function ei(e){return Ro(e).getComputedStyle(e)}function db(e){return Gs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ud(e){if(Ka(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cD(e)&&e.host||Ys(e);return cD(t)?t.host:t}function x3(e){const t=ud(e);return ub(t)?e.ownerDocument?e.ownerDocument.body:e.body:ts(t)&&Tp(t)?t:x3(t)}function Mh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=x3(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ro(o);return i?t.concat(s,s.visualViewport||[],Tp(o)?o:[],s.frameElement&&n?Mh(s.frameElement):[]):t.concat(o,Mh(o,[],n))}function w3(e){const t=ei(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ts(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=J0(n)!==i||J0(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function SE(e){return Gs(e)?e:e.contextElement}function Ou(e){const t=SE(e);if(!ts(t))return Ya(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=w3(t);let s=(i?J0(n.width):n.width)/r,a=(i?J0(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const cce=Ya(0);function S3(e){const t=Ro(e);return!wE()||!t.visualViewport?cce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ro(e)?!1:t}function xc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=SE(e);let s=Ya(1);t&&(r?Gs(r)&&(s=Ou(r)):s=Ou(e));const a=uce(i,n,r)?S3(i):Ya(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=Ro(i),p=r&&Gs(r)?Ro(r):r;let m=h.frameElement;for(;m&&r&&p!==h;){const v=Ou(m),y=m.getBoundingClientRect(),b=ei(m),S=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,_=y.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=S,c+=_,m=Ro(m).frameElement}}return ev({width:u,height:d,x:l,y:c})}function dce(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=ts(n),i=Ys(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=Ya(1);const l=Ya(0);if((o||!o&&r!=="fixed")&&((Ka(n)!=="body"||Tp(i))&&(s=db(n)),ts(n))){const c=xc(n);a=Ou(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 fce(e){return Array.from(e.getClientRects())}function _3(e){return xc(Ys(e)).left+db(e).scrollLeft}function hce(e){const t=Ys(e),n=db(e),r=e.ownerDocument.body,o=_o(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=_o(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+_3(e);const a=-n.scrollTop;return ei(r).direction==="rtl"&&(s+=_o(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function pce(e,t){const n=Ro(e),r=Ys(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=wE();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function gce(e,t){const n=xc(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ts(e)?Ou(e):Ya(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 uD(e,t,n){let r;if(t==="viewport")r=pce(e,n);else if(t==="document")r=hce(Ys(e));else if(Gs(t))r=gce(t,n);else{const o=S3(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return ev(r)}function C3(e,t){const n=ud(e);return n===t||!Gs(n)||ub(n)?!1:ei(n).position==="fixed"||C3(n,t)}function mce(e,t){const n=t.get(e);if(n)return n;let r=Mh(e,[],!1).filter(a=>Gs(a)&&Ka(a)!=="body"),o=null;const i=ei(e).position==="fixed";let s=i?ud(e):e;for(;Gs(s)&&!ub(s);){const a=ei(s),l=xE(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Tp(s)&&!l&&C3(e,s))?r=r.filter(u=>u!==s):o=a,s=ud(s)}return t.set(e,r),r}function vce(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?mce(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=uD(t,u,o);return c.top=_o(d.top,c.top),c.right=qa(d.right,c.right),c.bottom=qa(d.bottom,c.bottom),c.left=_o(d.left,c.left),c},uD(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function bce(e){return w3(e)}function yce(e,t,n){const r=ts(t),o=Ys(t),i=n==="fixed",s=xc(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Ya(0);if(r||!r&&!i)if((Ka(t)!=="body"||Tp(o))&&(a=db(t)),r){const c=xc(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=_3(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function dD(e,t){return!ts(e)||ei(e).position==="fixed"?null:t?t(e):e.offsetParent}function E3(e,t){const n=Ro(e);if(!ts(e))return n;let r=dD(e,t);for(;r&&ace(r)&&ei(r).position==="static";)r=dD(r,t);return r&&(Ka(r)==="html"||Ka(r)==="body"&&ei(r).position==="static"&&!xE(r))?n:r||lce(e)||n}const xce=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||E3,i=this.getDimensions;return{reference:yce(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function wce(e){return ei(e).direction==="rtl"}const Sce={convertOffsetParentRelativeRectToViewportRelativeRect:dce,getDocumentElement:Ys,getClippingRect:vce,getOffsetParent:E3,getElementRects:xce,getClientRects:fce,getDimensions:bce,getScale:Ou,isElement:Gs,isRTL:wce};function _ce(e,t){let n=null,r;const o=Ys(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:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const p=Cm(u),m=Cm(o.clientWidth-(c+d)),v=Cm(o.clientHeight-(u+h)),y=Cm(c),S={rootMargin:-p+"px "+-m+"px "+-v+"px "+-y+"px",threshold:_o(0,qa(1,l))||1};let _=!0;function C(E){const T=E[0].intersectionRatio;if(T!==l){if(!_)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},100)}_=!1}try{n=new IntersectionObserver(C,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(e)}return s(!0),i}function R3(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=SE(e),u=o||i?[...c?Mh(c):[],...Mh(t)]:[];u.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const d=c&&a?_ce(c,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(b=>{let[S]=b;S&&S.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let m,v=l?xc(e):null;l&&y();function y(){const b=xc(e);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&n(),v=b,m=requestAnimationFrame(y)}return n(),()=>{u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d&&d(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Cce=(e,t,n)=>{const r=new Map,o={platform:Sce,...n},i={...o.platform,_c:r};return Zle(e,t,{...o,platform:i})};var l0=typeof document<"u"?P.useLayoutEffect:P.useEffect;function tv(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(!tv(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)&&!tv(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function P3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fD(e,t){const n=P3(e);return Math.round(t*n)/n}function n1(e){const t=R.useRef(e);return l0(()=>{t.current=e}),t}function O3(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,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=R.useState(r);tv(h,r)||p(r);const[m,v]=R.useState(null),[y,b]=R.useState(null),S=R.useCallback(G=>{G!==T.current&&(T.current=G,v(G))},[]),_=R.useCallback(G=>{G!==A.current&&(A.current=G,b(G))},[]),C=i||m,E=s||y,T=R.useRef(null),A=R.useRef(null),D=R.useRef(u),k=l!=null,j=n1(l),$=n1(o),z=n1(c),K=R.useCallback(()=>{if(!T.current||!A.current)return;const G={placement:t,strategy:n,middleware:h};$.current&&(G.platform=$.current),Cce(T.current,A.current,G).then(te=>{const F={...te,isPositioned:z.current!==!1};V.current&&!tv(D.current,F)&&(D.current=F,dc.flushSync(()=>{d(F)}))})},[h,t,n,$,z]);l0(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(G=>({...G,isPositioned:!1})))},[c]);const V=R.useRef(!1);l0(()=>(V.current=!0,()=>{V.current=!1}),[]),l0(()=>{if(C&&(T.current=C),E&&(A.current=E),C&&E){if(j.current)return j.current(C,E,K);K()}},[C,E,K,j,k]);const N=R.useMemo(()=>({reference:T,floating:A,setReference:S,setFloating:_}),[S,_]),W=R.useMemo(()=>({reference:C,floating:E}),[C,E]),H=R.useMemo(()=>{const G={position:n,left:0,top:0};if(!W.floating)return G;const te=fD(W.floating,u.x),F=fD(W.floating,u.y);return a?{...G,transform:"translate("+te+"px, "+F+"px)",...P3(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:F}},[n,a,W.floating,u.x,u.y]);return R.useMemo(()=>({...u,update:K,refs:N,elements:W,floatingStyles:H}),[u,K,N,W,H])}const Ece=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?sD({element:r.current,padding:o}).fn(n):{}:r?sD({element:r,padding:o}).fn(n):{}}}},_E=(e,t)=>({...rce(e),options:[e,t]}),T3=(e,t)=>({...oce(e),options:[e,t]}),Rce=(e,t)=>({...ice(e),options:[e,t]}),M3=(e,t)=>({...ece(e),options:[e,t]}),A3=(e,t)=>({...sce(e),options:[e,t]}),Pce=(e,t)=>({...tce(e),options:[e,t]}),Oce=(e,t)=>({...Ece(e),options:[e,t]});var Tce="Arrow",D3=R.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return x.jsx(Be.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});D3.displayName=Tce;var Mce=D3;function fb(e){const[t,n]=R.useState(void 0);return fr(()=>{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}var CE="Popper",[k3,cs]=Jn(CE),[Ace,I3]=k3(CE),N3=e=>{const{__scopePopper:t,children:n}=e,[r,o]=R.useState(null);return x.jsx(Ace,{scope:t,anchor:r,onAnchorChange:o,children:n})};N3.displayName=CE;var L3="PopperAnchor",F3=R.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=I3(L3,n),s=R.useRef(null),a=at(t,s);return R.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:x.jsx(Be.div,{...o,ref:a})});F3.displayName=L3;var EE="PopperContent",[Dce,kce]=k3(EE),j3=R.forwardRef((e,t)=>{var ee,J,le,ce,ye,oe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...v}=e,y=I3(EE,n),[b,S]=R.useState(null),_=at(t,ve=>S(ve)),[C,E]=R.useState(null),T=fb(C),A=(T==null?void 0:T.width)??0,D=(T==null?void 0:T.height)??0,k=r+(i!=="center"?"-"+i:""),j=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},$=Array.isArray(c)?c:[c],z=$.length>0,K={padding:j,boundary:$.filter(Nce),altBoundary:z},{refs:V,floatingStyles:N,placement:W,isPositioned:H,middlewareData:G}=O3({strategy:"fixed",placement:k,whileElementsMounted:(...ve)=>R3(...ve,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[_E({mainAxis:o+D,alignmentAxis:s}),l&&T3({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Rce():void 0,...K}),l&&M3({...K}),A3({...K,apply:({elements:ve,rects:he,availableWidth:Ee,availableHeight:ke})=>{const{width:We,height:Ie}=he.reference,Le=ve.floating.style;Le.setProperty("--radix-popper-available-width",`${Ee}px`),Le.setProperty("--radix-popper-available-height",`${ke}px`),Le.setProperty("--radix-popper-anchor-width",`${We}px`),Le.setProperty("--radix-popper-anchor-height",`${Ie}px`)}}),C&&Oce({element:C,padding:a}),Lce({arrowWidth:A,arrowHeight:D}),h&&Pce({strategy:"referenceHidden",...K})]}),[te,F]=B3(W),Y=Qn(m);fr(()=>{H&&(Y==null||Y())},[H,Y]);const q=(ee=G.arrow)==null?void 0:ee.x,M=(J=G.arrow)==null?void 0:J.y,ne=((le=G.arrow)==null?void 0:le.centerOffset)!==0,[X,re]=R.useState();return fr(()=>{b&&re(window.getComputedStyle(b).zIndex)},[b]),x.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:H?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(ce=G.transformOrigin)==null?void 0:ce.x,(ye=G.transformOrigin)==null?void 0:ye.y].join(" "),...((oe=G.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(Dce,{scope:n,placedSide:te,onArrowChange:E,arrowX:q,arrowY:M,shouldHideArrow:ne,children:x.jsx(Be.div,{"data-side":te,"data-align":F,...v,ref:_,style:{...v.style,animation:H?void 0:"none"}})})})});j3.displayName=EE;var $3="PopperArrow",Ice={top:"bottom",right:"left",bottom:"top",left:"right"},z3=R.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=kce($3,r),s=Ice[i.placedSide];return x.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:x.jsx(Mce,{...o,ref:n,style:{...o.style,display:"block"}})})});z3.displayName=$3;function Nce(e){return e!==null}var Lce=e=>({name:"transformOrigin",options:e,fn(t){var y,b,S;const{placement:n,rects:r,middlewareData:o}=t,s=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=B3(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((S=o.arrow)==null?void 0:S.y)??0)+l/2;let m="",v="";return c==="bottom"?(m=s?d:`${h}px`,v=`${-l}px`):c==="top"?(m=s?d:`${h}px`,v=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,v=s?d:`${p}px`):c==="left"&&(m=`${r.floating.width+l}px`,v=s?d:`${p}px`),{data:{x:m,y:v}}}});function B3(e){const[t,n="center"]=e.split("-");return[t,n]}var Mp=N3,Od=F3,Ap=j3,Dp=z3,Fce="Portal",kp=R.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=R.useState(!1);fr(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?wr.createPortal(x.jsx(Be.div,{...r,ref:t}),s):null});kp.displayName=Fce;function jce(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e);R.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 $ce="DismissableLayer",NS="dismissableLayer.update",zce="dismissableLayer.pointerDownOutside",Bce="dismissableLayer.focusOutside",hD,H3=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ic=R.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=R.useContext(H3),[u,d]=R.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=R.useState({}),m=at(t,A=>d(A)),v=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),S=u?v.indexOf(u):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,C=S>=b,E=Wce(A=>{const D=A.target,k=[...c.branches].some(j=>j.contains(D));!C||k||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},h),T=Uce(A=>{const D=A.target;[...c.branches].some(j=>j.contains(D))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},h);return jce(A=>{S===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},h),R.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(hD=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),pD(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=hD)}},[u,h,n,c]),R.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),pD())},[u,c]),R.useEffect(()=>{const A=()=>p({});return document.addEventListener(NS,A),()=>document.removeEventListener(NS,A)},[]),x.jsx(Be.div,{...l,ref:m,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,E.onPointerDownCapture)})});Ic.displayName=$ce;var Hce="DismissableLayerBranch",Vce=R.forwardRef((e,t)=>{const n=R.useContext(H3),r=R.useRef(null),o=at(t,r);return R.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(Be.div,{...e,ref:o})});Vce.displayName=Hce;function Wce(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e),r=R.useRef(!1),o=R.useRef(()=>{});return R.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){V3(zce,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 Uce(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e),r=R.useRef(!1);return R.useEffect(()=>{const o=i=>{i.target&&!r.current&&V3(Bce,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 pD(){const e=new CustomEvent(NS);document.dispatchEvent(e)}function V3(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?HN(o,i):o.dispatchEvent(i)}var r1,RE="HoverCard",[W3,LOe]=Jn(RE,[cs]),hb=cs(),[Gce,PE]=W3(RE),U3=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=hb(t),c=R.useRef(0),u=R.useRef(0),d=R.useRef(!1),h=R.useRef(!1),[p=!1,m]=Cr({prop:r,defaultProp:o,onChange:i}),v=R.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>m(!0),s)},[s,m]),y=R.useCallback(()=>{clearTimeout(c.current),!d.current&&!h.current&&(u.current=window.setTimeout(()=>m(!1),a))},[a,m]),b=R.useCallback(()=>m(!1),[m]);return R.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),x.jsx(Gce,{scope:t,open:p,onOpenChange:m,onOpen:v,onClose:y,onDismiss:b,hasSelectionRef:d,isPointerDownOnContentRef:h,children:x.jsx(Mp,{...l,children:n})})};U3.displayName=RE;var G3="HoverCardTrigger",q3=R.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=PE(G3,n),i=hb(n);return x.jsx(Od,{asChild:!0,...i,children:x.jsx(Be.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,rv(o.onOpen)),onPointerLeave:Te(e.onPointerLeave,rv(o.onClose)),onFocus:Te(e.onFocus,o.onOpen),onBlur:Te(e.onBlur,o.onClose),onTouchStart:Te(e.onTouchStart,s=>s.preventDefault())})})});q3.displayName=G3;var qce="HoverCardPortal",[FOe,Yce]=W3(qce,{forceMount:void 0}),nv="HoverCardContent",Y3=R.forwardRef((e,t)=>{const n=Yce(nv,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=PE(nv,e.__scopeHoverCard);return x.jsx(Yn,{present:r||i.open,children:x.jsx(Kce,{"data-state":i.open?"open":"closed",...o,onPointerEnter:Te(e.onPointerEnter,rv(i.onOpen)),onPointerLeave:Te(e.onPointerLeave,rv(i.onClose)),ref:t})})});Y3.displayName=nv;var Kce=R.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=PE(nv,n),c=hb(n),u=R.useRef(null),d=at(t,u),[h,p]=R.useState(!1);return R.useEffect(()=>{if(h){const m=document.body;return r1=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=r1,m.style.webkitUserSelect=r1}}},[h]),R.useEffect(()=>{if(u.current){const m=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())==null?void 0:y.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",m),()=>{document.removeEventListener("pointerup",m),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),R.useEffect(()=>{u.current&&Jce(u.current).forEach(v=>v.setAttribute("tabindex","-1"))}),x.jsx(Ic,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Te(i,m=>{m.preventDefault()}),onDismiss:l.onDismiss,children:x.jsx(Ap,{...c,...a,onPointerDown:Te(a.onPointerDown,m=>{m.currentTarget.contains(m.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,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)"}})})}),Xce="HoverCardArrow",Qce=R.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=hb(n);return x.jsx(Dp,{...o,...r,ref:t})});Qce.displayName=Xce;function rv(e){return t=>t.pointerType==="touch"?void 0:e()}function Jce(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}var Zce=U3,eue=q3,K3=Y3;const pb=Zce,gb=eue,Ip=R.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>x.jsx(K3,{ref:o,align:t,sideOffset:n,className:xe("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}));Ip.displayName=K3.displayName;function X3({card:e}){const{setCardInfo:t}=dr();return x.jsxs(pb,{openDelay:0,children:[x.jsx(gb,{children:x.jsx(l4,{className:"size-4 text-muted-foreground/40"})}),x.jsx(Ip,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:x.jsx(Qi,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:x.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function tue({card:e,renderFilterInfo:t}){var m,v,y,b,S,_,C,E,T,A,D,k,j,$,z,K;we(V=>V.themeStyle);const{data:n,isLoading:r}=tb(e),o=(n==null?void 0:n.records)||[],i=we(V=>V.isDashboardEditing),{getCurrency:s,getLocale:a}=g3(e),l=(v=(m=e.preferences)==null?void 0:m.formatNumber)==null?void 0:v.colorRanges,{metricKeys:c}=nr(o||[]),u=(y=o==null?void 0:o[0])==null?void 0:y[c==null?void 0:c[0]],d=(b=o==null?void 0:o[0])==null?void 0:b[c==null?void 0:c[1]],h=(o==null?void 0:o.length)>0,p=d&&d-u!==0?(u-d)/d:null;return x.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:x.jsxs("div",{className:"grow",children:[h?x.jsx("div",{className:"",children:x.jsxs("div",{className:xe("flex items-end gap-1.5",{"animate-pulse":r}),children:[x.jsx("p",{style:{color:FC(u,l)},className:"text-3xl font-semibold",children:Bs({number:u,decimalPlaces:((_=(S=e.preferences)==null?void 0:S.formatNumber)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((E=(C=e.preferences)==null?void 0:C.formatNumber)!=null&&E.suffix),customSuffix:((A=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:A.suffix)||"",locale:a()||"",currency:s()||""})}),p&&x.jsxs("div",{className:"flex items-end gap-1",children:[x.jsx(v3,{className:"",children:p}),d&&x.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${Bs({number:d,decimalPlaces:((k=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:k.decimalPlaces)||0,useSuffix:!!(($=(j=e.preferences)==null?void 0:j.formatNumber)!=null&&$.suffix),customSuffix:((K=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:K.suffix)||"",locale:a()||"",currency:s()||""})}`})]})]})}):x.jsx("div",{className:"flex h-9 items-center justify-center"}),x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsxs(yd,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(i||e.info)&&x.jsx(X3,{card:e})]}),t==null?void 0:t()]})]})})}var nue="VisuallyHidden",OE=R.forwardRef((e,t)=>x.jsx(Be.span,{...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}}));OE.displayName=nue;var rue=OE,[mb,jOe]=Jn("Tooltip",[cs]),vb=cs(),Q3="TooltipProvider",oue=700,LS="tooltip.open",[iue,TE]=mb(Q3),J3=e=>{const{__scopeTooltip:t,delayDuration:n=oue,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=R.useState(!0),l=R.useRef(!1),c=R.useRef(0);return R.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),x.jsx(iue,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:R.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:R.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:R.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:i})};J3.displayName=Q3;var bb="Tooltip",[sue,yb]=mb(bb),Z3=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=TE(bb,e.__scopeTooltip),c=vb(t),[u,d]=R.useState(null),h=qn(),p=R.useRef(0),m=s??l.disableHoverableContent,v=a??l.delayDuration,y=R.useRef(!1),[b=!1,S]=Cr({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(LS))):l.onClose(),i==null||i(A)}}),_=R.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),C=R.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,S(!0)},[S]),E=R.useCallback(()=>{window.clearTimeout(p.current),p.current=0,S(!1)},[S]),T=R.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,S(!0),p.current=0},v)},[v,S]);return R.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),x.jsx(Mp,{...c,children:x.jsx(sue,{scope:t,contentId:h,open:b,stateAttribute:_,trigger:u,onTriggerChange:d,onTriggerEnter:R.useCallback(()=>{l.isOpenDelayed?T():C()},[l.isOpenDelayed,T,C]),onTriggerLeave:R.useCallback(()=>{m?E():(window.clearTimeout(p.current),p.current=0)},[E,m]),onOpen:C,onClose:E,disableHoverableContent:m,children:n})})};Z3.displayName=bb;var FS="TooltipTrigger",ME=R.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=yb(FS,n),i=TE(FS,n),s=vb(n),a=R.useRef(null),l=at(t,a,o.onTriggerChange),c=R.useRef(!1),u=R.useRef(!1),d=R.useCallback(()=>c.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),x.jsx(Od,{asChild:!0,...s,children:x.jsx(Be.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:Te(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Te(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Te(e.onBlur,o.onClose),onClick:Te(e.onClick,o.onClose)})})});ME.displayName=FS;var aue="TooltipPortal",[$Oe,lue]=mb(aue,{forceMount:void 0}),dd="TooltipContent",eF=R.forwardRef((e,t)=>{const n=lue(dd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=yb(dd,e.__scopeTooltip);return x.jsx(Yn,{present:r||s.open,children:s.disableHoverableContent?x.jsx(tF,{side:o,...i,ref:t}):x.jsx(cue,{side:o,...i,ref:t})})}),cue=R.forwardRef((e,t)=>{const n=yb(dd,e.__scopeTooltip),r=TE(dd,e.__scopeTooltip),o=R.useRef(null),i=at(t,o),[s,a]=R.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,h=R.useCallback(()=>{a(null),d(!1)},[d]),p=R.useCallback((m,v)=>{const y=m.currentTarget,b={x:m.clientX,y:m.clientY},S=hue(b,y.getBoundingClientRect()),_=pue(b,S),C=gue(v.getBoundingClientRect()),E=vue([..._,...C]);a(E),d(!0)},[d]);return R.useEffect(()=>()=>h(),[h]),R.useEffect(()=>{if(l&&u){const m=y=>p(y,u),v=y=>p(y,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",v)}}},[l,u,p,h]),R.useEffect(()=>{if(s){const m=v=>{const y=v.target,b={x:v.clientX,y:v.clientY},S=(l==null?void 0:l.contains(y))||(u==null?void 0:u.contains(y)),_=!mue(b,s);S?h():_&&(h(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,s,c,h]),x.jsx(tF,{...e,ref:i})}),[uue,due]=mb(bb,{isInside:!1}),tF=R.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=yb(dd,n),c=vb(n),{onClose:u}=l;return R.useEffect(()=>(document.addEventListener(LS,u),()=>document.removeEventListener(LS,u)),[u]),R.useEffect(()=>{if(l.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),x.jsx(Ic,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:x.jsxs(Ap,{"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)"},children:[x.jsx(eC,{children:r}),x.jsx(uue,{scope:n,isInside:!0,children:x.jsx(rue,{id:l.contentId,role:"tooltip",children:o||r})})]})})});eF.displayName=dd;var nF="TooltipArrow",fue=R.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=vb(n);return due(nF,n).isInside?null:x.jsx(Dp,{...o,...r,ref:t})});fue.displayName=nF;function hue(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 pue(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 gue(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 mue(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 vue(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),bue(t)}function bue(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)}var yue=J3,xue=Z3,wue=ME,rF=eF;const Sue=yue,oF=xue,iF=wue,AE=R.forwardRef(({className:e,sideOffset:t=4,...n},r)=>x.jsx(rF,{ref:r,sideOffset:t,className:xe("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}));AE.displayName=rF.displayName;/*! @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:sF,setPrototypeOf:gD,isFrozen:_ue,getPrototypeOf:Cue,getOwnPropertyDescriptor:Eue}=Object;let{freeze:$r,seal:ti,create:aF}=Object,{apply:jS,construct:$S}=typeof Reflect<"u"&&Reflect;$r||($r=function(t){return t});ti||(ti=function(t){return t});jS||(jS=function(t,n,r){return t.apply(n,r)});$S||($S=function(t,n){return new t(...n)});const Em=Mo(Array.prototype.forEach),mD=Mo(Array.prototype.pop),uf=Mo(Array.prototype.push),c0=Mo(String.prototype.toLowerCase),o1=Mo(String.prototype.toString),vD=Mo(String.prototype.match),df=Mo(String.prototype.replace),Rue=Mo(String.prototype.indexOf),Pue=Mo(String.prototype.trim),fi=Mo(Object.prototype.hasOwnProperty),Tr=Mo(RegExp.prototype.test),ff=Oue(TypeError);function Mo(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 jS(e,t,r)}}function Oue(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $S(e,n)}}function At(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c0;gD&&gD(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(_ue(t)||(t[r]=i),o=i)}e[o]=!0}return e}function Tue(e){for(let t=0;t<e.length;t++)fi(e,t)||(e[t]=null);return e}function Ol(e){const t=aF(null);for(const[n,r]of sF(e))fi(e,n)&&(Array.isArray(r)?t[n]=Tue(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Ol(r):t[n]=r);return t}function hf(e,t){for(;e!==null;){const r=Eue(e,t);if(r){if(r.get)return Mo(r.get);if(typeof r.value=="function")return Mo(r.value)}e=Cue(e)}function n(){return null}return n}const bD=$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"]),i1=$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"]),s1=$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"]),Mue=$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"]),a1=$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"]),Aue=$r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yD=$r(["#text"]),xD=$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"]),l1=$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"]),wD=$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"]),Rm=$r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Due=ti(/\{\{[\w\W]*|[\w\W]*\}\}/gm),kue=ti(/<%[\w\W]*|[\w\W]*%>/gm),Iue=ti(/\${[\w\W]*}/gm),Nue=ti(/^data-[\-\w.\u00B7-\uFFFF]/),Lue=ti(/^aria-[\-\w]+$/),lF=ti(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fue=ti(/^(?:\w+script|data):/i),jue=ti(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cF=ti(/^html$/i),$ue=ti(/^[a-z][.\w]*(-[.\w]+)+$/i);var SD=Object.freeze({__proto__:null,MUSTACHE_EXPR:Due,ERB_EXPR:kue,TMPLIT_EXPR:Iue,DATA_ATTR:Nue,ARIA_ATTR:Lue,IS_ALLOWED_URI:lF,IS_SCRIPT_OR_DATA:Fue,ATTR_WHITESPACE:jue,DOCTYPE_NAME:cF,CUSTOM_ELEMENT:$ue});const pf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},zue=function(){return typeof window>"u"?null:window},Bue=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 uF(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zue();const t=Ae=>uF(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==pf.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:d,DOMParser:h,trustedTypes:p}=e,m=l.prototype,v=hf(m,"cloneNode"),y=hf(m,"remove"),b=hf(m,"nextSibling"),S=hf(m,"childNodes"),_=hf(m,"parentNode");if(typeof s=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let C,E="";const{implementation:T,createNodeIterator:A,createDocumentFragment:D,getElementsByTagName:k}=n,{importNode:j}=r;let $={};t.isSupported=typeof sF=="function"&&typeof _=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:K,TMPLIT_EXPR:V,DATA_ATTR:N,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:G,CUSTOM_ELEMENT:te}=SD;let{IS_ALLOWED_URI:F}=SD,Y=null;const q=At({},[...bD,...i1,...s1,...a1,...yD]);let M=null;const ne=At({},[...xD,...l1,...wD,...Rm]);let X=Object.seal(aF(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}})),re=null,ee=null,J=!0,le=!0,ce=!1,ye=!0,oe=!1,ve=!0,he=!1,Ee=!1,ke=!1,We=!1,Ie=!1,Le=!1,dt=!0,$t=!1;const rn="user-content-";let Nt=!0,on=!1,pe={},Pe=null;const ze=At({},["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 Ye=null;const nt=At({},["audio","video","img","source","image","track"]);let sn=null;const Cn=At({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mn="http://www.w3.org/1998/Math/MathML",jn="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml";let Ht=vn,cn=!1,Pn=null;const tt=At({},[mn,jn,vn],o1);let mt=null;const kt=["application/xhtml+xml","text/html"],Zt="text/html";let wt=null,$n=null;const oi=n.createElement("form"),Qs=function(Z){return Z instanceof RegExp||Z instanceof Function},ii=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!($n&&$n===Z)){if((!Z||typeof Z!="object")&&(Z={}),Z=Ol(Z),mt=kt.indexOf(Z.PARSER_MEDIA_TYPE)===-1?Zt:Z.PARSER_MEDIA_TYPE,wt=mt==="application/xhtml+xml"?o1:c0,Y=fi(Z,"ALLOWED_TAGS")?At({},Z.ALLOWED_TAGS,wt):q,M=fi(Z,"ALLOWED_ATTR")?At({},Z.ALLOWED_ATTR,wt):ne,Pn=fi(Z,"ALLOWED_NAMESPACES")?At({},Z.ALLOWED_NAMESPACES,o1):tt,sn=fi(Z,"ADD_URI_SAFE_ATTR")?At(Ol(Cn),Z.ADD_URI_SAFE_ATTR,wt):Cn,Ye=fi(Z,"ADD_DATA_URI_TAGS")?At(Ol(nt),Z.ADD_DATA_URI_TAGS,wt):nt,Pe=fi(Z,"FORBID_CONTENTS")?At({},Z.FORBID_CONTENTS,wt):ze,re=fi(Z,"FORBID_TAGS")?At({},Z.FORBID_TAGS,wt):{},ee=fi(Z,"FORBID_ATTR")?At({},Z.FORBID_ATTR,wt):{},pe=fi(Z,"USE_PROFILES")?Z.USE_PROFILES:!1,J=Z.ALLOW_ARIA_ATTR!==!1,le=Z.ALLOW_DATA_ATTR!==!1,ce=Z.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=Z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,oe=Z.SAFE_FOR_TEMPLATES||!1,ve=Z.SAFE_FOR_XML!==!1,he=Z.WHOLE_DOCUMENT||!1,We=Z.RETURN_DOM||!1,Ie=Z.RETURN_DOM_FRAGMENT||!1,Le=Z.RETURN_TRUSTED_TYPE||!1,ke=Z.FORCE_BODY||!1,dt=Z.SANITIZE_DOM!==!1,$t=Z.SANITIZE_NAMED_PROPS||!1,Nt=Z.KEEP_CONTENT!==!1,on=Z.IN_PLACE||!1,F=Z.ALLOWED_URI_REGEXP||lF,Ht=Z.NAMESPACE||vn,X=Z.CUSTOM_ELEMENT_HANDLING||{},Z.CUSTOM_ELEMENT_HANDLING&&Qs(Z.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=Z.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Z.CUSTOM_ELEMENT_HANDLING&&Qs(Z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=Z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Z.CUSTOM_ELEMENT_HANDLING&&typeof Z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=Z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),oe&&(le=!1),Ie&&(We=!0),pe&&(Y=At({},yD),M=[],pe.html===!0&&(At(Y,bD),At(M,xD)),pe.svg===!0&&(At(Y,i1),At(M,l1),At(M,Rm)),pe.svgFilters===!0&&(At(Y,s1),At(M,l1),At(M,Rm)),pe.mathMl===!0&&(At(Y,a1),At(M,wD),At(M,Rm))),Z.ADD_TAGS&&(Y===q&&(Y=Ol(Y)),At(Y,Z.ADD_TAGS,wt)),Z.ADD_ATTR&&(M===ne&&(M=Ol(M)),At(M,Z.ADD_ATTR,wt)),Z.ADD_URI_SAFE_ATTR&&At(sn,Z.ADD_URI_SAFE_ATTR,wt),Z.FORBID_CONTENTS&&(Pe===ze&&(Pe=Ol(Pe)),At(Pe,Z.FORBID_CONTENTS,wt)),Nt&&(Y["#text"]=!0),he&&At(Y,["html","head","body"]),Y.table&&(At(Y,["tbody"]),delete re.tbody),Z.TRUSTED_TYPES_POLICY){if(typeof Z.TRUSTED_TYPES_POLICY.createHTML!="function")throw ff('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ff('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=Z.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Bue(p,o)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));$r&&$r(Z),$n=Z}},ds=At({},["mi","mo","mn","ms","mtext"]),Oi=At({},["foreignobject","annotation-xml"]),fs=At({},["title","style","font","a","script"]),Js=At({},[...i1,...s1,...Mue]),Ti=At({},[...a1,...Aue]),hs=function(Z){let me=_(Z);(!me||!me.tagName)&&(me={namespaceURI:Ht,tagName:"template"});const De=c0(Z.tagName),lt=c0(me.tagName);return Pn[Z.namespaceURI]?Z.namespaceURI===jn?me.namespaceURI===vn?De==="svg":me.namespaceURI===mn?De==="svg"&&(lt==="annotation-xml"||ds[lt]):!!Js[De]:Z.namespaceURI===mn?me.namespaceURI===vn?De==="math":me.namespaceURI===jn?De==="math"&&Oi[lt]:!!Ti[De]:Z.namespaceURI===vn?me.namespaceURI===jn&&!Oi[lt]||me.namespaceURI===mn&&!ds[lt]?!1:!Ti[De]&&(fs[De]||!Js[De]):!!(mt==="application/xhtml+xml"&&Pn[Z.namespaceURI]):!1},Zn=function(Z){uf(t.removed,{element:Z});try{_(Z).removeChild(Z)}catch{y(Z)}},Mi=function(Z,me){try{uf(t.removed,{attribute:me.getAttributeNode(Z),from:me})}catch{uf(t.removed,{attribute:null,from:me})}if(me.removeAttribute(Z),Z==="is"&&!M[Z])if(We||Ie)try{Zn(me)}catch{}else try{me.setAttribute(Z,"")}catch{}},Zs=function(Z){let me=null,De=null;if(ke)Z="<remove></remove>"+Z;else{const pt=vD(Z,/^[\r\n\t ]+/);De=pt&&pt[0]}mt==="application/xhtml+xml"&&Ht===vn&&(Z='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Z+"</body></html>");const lt=C?C.createHTML(Z):Z;if(Ht===vn)try{me=new h().parseFromString(lt,mt)}catch{}if(!me||!me.documentElement){me=T.createDocument(Ht,"template",null);try{me.documentElement.innerHTML=cn?E:lt}catch{}}const En=me.body||me.documentElement;return Z&&De&&En.insertBefore(n.createTextNode(De),En.childNodes[0]||null),Ht===vn?k.call(me,he?"html":"body")[0]:he?me.documentElement:En},ea=function(Z){return A.call(Z.ownerDocument||Z,Z,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},I=function(Z){return Z instanceof d&&(typeof Z.nodeName!="string"||typeof Z.textContent!="string"||typeof Z.removeChild!="function"||!(Z.attributes instanceof u)||typeof Z.removeAttribute!="function"||typeof Z.setAttribute!="function"||typeof Z.namespaceURI!="string"||typeof Z.insertBefore!="function"||typeof Z.hasChildNodes!="function")},se=function(Z){return typeof a=="function"&&Z instanceof a},fe=function(Z,me,De){$[Z]&&Em($[Z],lt=>{lt.call(t,me,De,$n)})},Oe=function(Z){let me=null;if(fe("beforeSanitizeElements",Z,null),I(Z))return Zn(Z),!0;const De=wt(Z.nodeName);if(fe("uponSanitizeElement",Z,{tagName:De,allowedTags:Y}),Z.hasChildNodes()&&!se(Z.firstElementChild)&&Tr(/<[/\w]/g,Z.innerHTML)&&Tr(/<[/\w]/g,Z.textContent)||Z.nodeType===pf.progressingInstruction||ve&&Z.nodeType===pf.comment&&Tr(/<[/\w]/g,Z.data))return Zn(Z),!0;if(!Y[De]||re[De]){if(!re[De]&&Ge(De)&&(X.tagNameCheck instanceof RegExp&&Tr(X.tagNameCheck,De)||X.tagNameCheck instanceof Function&&X.tagNameCheck(De)))return!1;if(Nt&&!Pe[De]){const lt=_(Z)||Z.parentNode,En=S(Z)||Z.childNodes;if(En&&lt){const pt=En.length;for(let pr=pt-1;pr>=0;--pr){const No=v(En[pr],!0);No.__removalCount=(Z.__removalCount||0)+1,lt.insertBefore(No,b(Z))}}}return Zn(Z),!0}return Z instanceof l&&!hs(Z)||(De==="noscript"||De==="noembed"||De==="noframes")&&Tr(/<\/no(script|embed|frames)/i,Z.innerHTML)?(Zn(Z),!0):(oe&&Z.nodeType===pf.text&&(me=Z.textContent,Em([z,K,V],lt=>{me=df(me,lt," ")}),Z.textContent!==me&&(uf(t.removed,{element:Z.cloneNode()}),Z.textContent=me)),fe("afterSanitizeElements",Z,null),!1)},He=function(Z,me,De){if(dt&&(me==="id"||me==="name")&&(De in n||De in oi))return!1;if(!(le&&!ee[me]&&Tr(N,me))){if(!(J&&Tr(W,me))){if(!M[me]||ee[me]){if(!(Ge(Z)&&(X.tagNameCheck instanceof RegExp&&Tr(X.tagNameCheck,Z)||X.tagNameCheck instanceof Function&&X.tagNameCheck(Z))&&(X.attributeNameCheck instanceof RegExp&&Tr(X.attributeNameCheck,me)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(me))||me==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&Tr(X.tagNameCheck,De)||X.tagNameCheck instanceof Function&&X.tagNameCheck(De))))return!1}else if(!sn[me]){if(!Tr(F,df(De,G,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&Z!=="script"&&Rue(De,"data:")===0&&Ye[Z])){if(!(ce&&!Tr(H,df(De,G,"")))){if(De)return!1}}}}}}return!0},Ge=function(Z){return Z!=="annotation-xml"&&vD(Z,te)},$e=function(Z){fe("beforeSanitizeAttributes",Z,null);const{attributes:me}=Z;if(!me)return;const De={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M};let lt=me.length;for(;lt--;){const En=me[lt],{name:pt,namespaceURI:pr,value:No}=En,sl=wt(pt);let er=pt==="value"?No:Pue(No);if(De.attrName=sl,De.attrValue=er,De.keepAttr=!0,De.forceKeepAttr=void 0,fe("uponSanitizeAttribute",Z,De),er=De.attrValue,ve&&Tr(/((--!?|])>)|<\/(style|title)/i,er)){Mi(pt,Z);continue}if(De.forceKeepAttr||(Mi(pt,Z),!De.keepAttr))continue;if(!ye&&Tr(/\/>/i,er)){Mi(pt,Z);continue}oe&&Em([z,K,V],Ld=>{er=df(er,Ld," ")});const Nd=wt(Z.nodeName);if(He(Nd,sl,er)){if($t&&(sl==="id"||sl==="name")&&(Mi(pt,Z),er=rn+er),C&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!pr)switch(p.getAttributeType(Nd,sl)){case"TrustedHTML":{er=C.createHTML(er);break}case"TrustedScriptURL":{er=C.createScriptURL(er);break}}try{pr?Z.setAttributeNS(pr,pt,er):Z.setAttribute(pt,er),I(Z)?Zn(Z):mD(t.removed)}catch{}}}fe("afterSanitizeAttributes",Z,null)},Fe=function Ae(Z){let me=null;const De=ea(Z);for(fe("beforeSanitizeShadowDOM",Z,null);me=De.nextNode();)fe("uponSanitizeShadowNode",me,null),!Oe(me)&&(me.content instanceof i&&Ae(me.content),$e(me));fe("afterSanitizeShadowDOM",Z,null)};return t.sanitize=function(Ae){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,De=null,lt=null,En=null;if(cn=!Ae,cn&&(Ae="<!-->"),typeof Ae!="string"&&!se(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw ff("dirty is not a string, aborting")}else throw ff("toString is not a function");if(!t.isSupported)return Ae;if(Ee||ii(Z),t.removed=[],typeof Ae=="string"&&(on=!1),on){if(Ae.nodeName){const No=wt(Ae.nodeName);if(!Y[No]||re[No])throw ff("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof a)me=Zs("<!---->"),De=me.ownerDocument.importNode(Ae,!0),De.nodeType===pf.element&&De.nodeName==="BODY"||De.nodeName==="HTML"?me=De:me.appendChild(De);else{if(!We&&!oe&&!he&&Ae.indexOf("<")===-1)return C&&Le?C.createHTML(Ae):Ae;if(me=Zs(Ae),!me)return We?null:Le?E:""}me&&ke&&Zn(me.firstChild);const pt=ea(on?Ae:me);for(;lt=pt.nextNode();)Oe(lt)||(lt.content instanceof i&&Fe(lt.content),$e(lt));if(on)return Ae;if(We){if(Ie)for(En=D.call(me.ownerDocument);me.firstChild;)En.appendChild(me.firstChild);else En=me;return(M.shadowroot||M.shadowrootmode)&&(En=j.call(r,En,!0)),En}let pr=he?me.outerHTML:me.innerHTML;return he&&Y["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&Tr(cF,me.ownerDocument.doctype.name)&&(pr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
253
+ `+pr),oe&&Em([z,K,V],No=>{pr=df(pr,No," ")}),C&&Le?C.createHTML(pr):pr},t.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ii(Ae),Ee=!0},t.clearConfig=function(){$n=null,Ee=!1},t.isValidAttribute=function(Ae,Z,me){$n||ii({});const De=wt(Ae),lt=wt(Z);return He(De,lt,me)},t.addHook=function(Ae,Z){typeof Z=="function"&&($[Ae]=$[Ae]||[],uf($[Ae],Z))},t.removeHook=function(Ae){if($[Ae])return mD($[Ae])},t.removeHooks=function(Ae){$[Ae]&&($[Ae]=[])},t.removeAllHooks=function(){$={}},t}var _D=uF();function zS({card:e,isLoading:t,data:n}){var h,p;const r=n||[],{keys:o}=nr(r),i=we(m=>m.selectedSheetId),s=we(m=>m.isVisualEditing),a=(p=(h=e==null?void 0:e.preferences)==null?void 0:h.textVisualOptions)==null?void 0:p.isDynamicText,{setCardDescription:l}=dr(),{setCard:c}=Qv();function u(){var b;if(t)return x.jsxs("div",{className:"space-y-2",children:[x.jsx(_u,{className:"h-3 w-full animate-pulse bg-muted"}),x.jsx(_u,{className:"h-3 w-3/4 animate-pulse bg-muted"}),x.jsx(_u,{className:"h-3 w-1/2 animate-pulse bg-muted"})]});const m=(b=r==null?void 0:r[0])==null?void 0:b[o[0]],v=_D.sanitize(m),y=x.jsx("div",{dangerouslySetInnerHTML:{__html:v}});return x.jsx("div",{className:"text-sm hover:cursor-text",onMouseDown:S=>S.stopPropagation(),children:y})}function d(){return x.jsx("div",{onMouseDown:m=>m.stopPropagation(),children:x.jsx(Qi,{type:"textarea",className:"w-full",text:(e==null?void 0:e.description)||"Double click to add description",onSave:m=>{s===!1&&l(i,e.id,m),s===!0&&c({...e,description:m})},children:x.jsx("div",{dangerouslySetInnerHTML:{__html:_D.sanitize((e==null?void 0:e.description)||"")}})})})}return x.jsxs(x.Fragment,{children:[!a&&d(),a===!0&&u()]})}const CD=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,ED=g0,DE=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ED(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],d=i==null?void 0:i[c];if(u===null)return null;const h=CD(u)||CD(d);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...p}=u;return Object.entries(p).every(m=>{let[v,y]=m;return Array.isArray(y)?y.includes({...i,...a}[v]):{...i,...a}[v]===y})?[...c,d,h]:c},[]);return ED(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Ah=DE("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"}}),oo=R.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Hs:"button";return x.jsx(s,{className:xe(Ah({variant:t,size:n,className:e})),ref:i,...o})});oo.displayName="Button";var Hue="Separator",RD="horizontal",Vue=["horizontal","vertical"],dF=R.forwardRef((e,t)=>{const{decorative:n,orientation:r=RD,...o}=e,i=Wue(r)?r:RD,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return x.jsx(Be.div,{"data-orientation":i,...a,...o,ref:t})});dF.displayName=Hue;function Wue(e){return Vue.includes(e)}var fF=dF;const Np=R.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>x.jsx(fF,{ref:o,decorative:n,orientation:t,className:xe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Np.displayName=fF.displayName;function Uue(){var v,y;const e=we(b=>b.themeStyle),t=we(b=>b.filterValues),n=we(b=>b.dashboard.filters),r=we(b=>b.filteringCards),o=we(b=>b.selectedSheetId),{removeFilterValue:i,removeFilteringCard:s,setFilterValues:a,setFilteringCards:l}=dr(),c=n==null?void 0:n.filter(b=>b.sheetId===o||!b.sheetId),u=t==null?void 0:t.filter(b=>(c==null?void 0:c.some(S=>S.id===b.filterId))||b.filterId.endsWith(o));if(!u||u.length===0)return null;const d=u.map(b=>{const S=n==null?void 0:n.find(_=>_.id===b.filterId);return{filterId:b.filterId,name:(S==null?void 0:S.title)||b.name,values:b.values}});function h(b){return b instanceof Date?b.toLocaleDateString():b}function p(b){const S=r==null?void 0:r.find(_=>b.filterId.startsWith(_.id));S&&s(S),i(b.filterId)}function m(b){var S,_;return x.jsxs("div",{className:"space-y-2",children:[x.jsxs("div",{style:{borderRadius:(_=(S=e==null?void 0:e.chart)==null?void 0:S.options)==null?void 0:_.borderRadius},className:"flex w-fit items-center gap-2 bg-muted-foreground px-2 py-1 font-semibold text-muted",children:[x.jsx("span",{className:"break-words",children:b.name}),x.jsx(wd,{onClick:()=>p(b),className:"size-3 text-muted hover:cursor-pointer hover:text-background"})]}),x.jsx("div",{className:"flex flex-wrap gap-1",children:b.values.map(C=>{var E,T;return x.jsx("span",{style:{borderRadius:(T=(E=e==null?void 0:e.chart)==null?void 0:E.options)==null?void 0:T.borderRadius},className:"inline-block",children:h(C)},C.toString())})})]})}return x.jsxs(pb,{openDelay:100,children:[x.jsx(gb,{children:x.jsx(s4,{className:"z-100 size-3.5 text-muted-foreground/40"})}),x.jsxs(Ip,{style:{borderRadius:(y=(v=e==null?void 0:e.chart)==null?void 0:v.options)==null?void 0:y.borderRadius},className:"relative flex min-h-fit w-[300px] flex-col px-0 text-xs",align:"start",children:[x.jsx(kC,{onClick:()=>{l([]),a([])},className:"absolute right-4 size-3.5 text-muted-foreground/40 hover:cursor-pointer"}),x.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:d==null?void 0:d.map(b=>x.jsxs("div",{className:"px-5",children:[m(b),x.jsx(Np,{className:"my-2"})]},b.name))})]})]})}const kE=R.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>x.jsx("div",{style:n,className:xe("relative w-full overflow-auto",t),children:x.jsx("table",{ref:o,className:xe("w-full caption-bottom text-sm",e),...r})}));kE.displayName="Table";const IE=R.forwardRef(({className:e,...t},n)=>x.jsx("thead",{ref:n,className:xe("[&_tr]:border-b",e),...t}));IE.displayName="TableHeader";const NE=R.forwardRef(({className:e,...t},n)=>x.jsx("tbody",{ref:n,className:xe("[&_tr:last-child]:border-0",e),...t}));NE.displayName="TableBody";const Gue=R.forwardRef(({className:e,...t},n)=>x.jsx("tfoot",{ref:n,className:xe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Gue.displayName="TableFooter";const ih=R.forwardRef(({className:e,...t},n)=>x.jsx("tr",{ref:n,className:xe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ih.displayName="TableRow";const LE=R.forwardRef(({className:e,...t},n)=>x.jsx("th",{ref:n,className:xe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));LE.displayName="TableHead";const FE=R.forwardRef(({className:e,...t},n)=>x.jsx("td",{ref:n,className:xe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));FE.displayName="TableCell";const que=R.forwardRef(({className:e,...t},n)=>x.jsx("caption",{ref:n,className:xe("mt-4 text-sm text-muted-foreground",e),...t}));que.displayName="TableCaption";/**
254
+ * table-core
255
+ *
256
+ * Copyright (c) TanStack
257
+ *
258
+ * This source code is licensed under the MIT license found in the
259
+ * LICENSE.md file in the root directory of this source tree.
260
+ *
261
+ * @license MIT
262
+ */function Ia(e,t){return typeof e=="function"?e(t):e}function Ao(e,t){return n=>{t.setState(r=>({...r,[e]:Ia(n,r[e])}))}}function ov(e){return e instanceof Function}function Yue(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Kue(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 ct(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,d=u/16,h=(p,m)=>{for(p=String(p);p.length<m;)p=" "+p;return p};console.info(`%c⏱ ${h(u,5)} /${h(c,5)} ms`,`
263
+ font-size: .6rem;
264
+ font-weight: bold;
265
+ color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Xue(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 p=h;for(const v of l.split(".")){var m;p=(m=p)==null?void 0:m[v],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${v}" in deeply nested key "${l}" returned undefined.`)}return p}: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 d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:ct(()=>[!0],()=>{var h;return[d,...(h=d.columns)==null?void 0:h.flatMap(p=>p.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var h;return(h=e.options.debugAll)!=null?h:e.options.debugColumns}}),getLeafColumns:ct(()=>[e._getOrderColumnsFn()],h=>{var p;if((p=d.columns)!=null&&p.length){let m=d.columns.flatMap(v=>v.getLeafColumns());return h(m)}return[d]},{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(d,e);return d}function PD(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 Que={createTable:e=>{e.getHeaderGroups=ct(()=>[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(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return Pm(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=ct(()=>[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))),Pm(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=ct(()=>[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 Pm(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=ct(()=>[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 Pm(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=ct(()=>[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=ct(()=>[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=ct(()=>[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=ct(()=>[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=ct(()=>[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=ct(()=>[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=ct(()=>[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=ct(()=>[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=ct(()=>[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=ct(()=>[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=ct(()=>[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=ct(()=>[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 Pm(e,t,n,r){var o,i;let s=0;const a=function(h,p){p===void 0&&(p=1),s=Math.max(s,p),h.filter(m=>m.getIsVisible()).forEach(m=>{var v;(v=m.columns)!=null&&v.length&&a(m.columns,p+1)},0)};a(e);let l=[];const c=(h,p)=>{const m={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},v=[];h.forEach(y=>{const b=[...v].reverse()[0],S=y.column.depth===m.depth;let _,C=!1;if(S&&y.column.parent?_=y.column.parent:(_=y.column,C=!0),b&&(b==null?void 0:b.column)===_)b.subHeaders.push(y);else{const E=PD(n,_,{id:[r,p,_.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${v.filter(T=>T.column===_).length}`:void 0,depth:p,index:v.length});E.subHeaders.push(y),v.push(E)}m.headers.push(y),y.headerGroup=m}),l.push(m),p>0&&c(v,p-1)},u=t.map((h,p)=>PD(n,h,{depth:s,index:p}));c(u,s-1),l.reverse();const d=h=>h.filter(m=>m.column.getIsVisible()).map(m=>{let v=0,y=0,b=[0];m.subHeaders&&m.subHeaders.length?(b=[],d(m.subHeaders).forEach(_=>{let{colSpan:C,rowSpan:E}=_;v+=C,b.push(E)})):v=1;const S=Math.min(...b);return y=y+S,m.colSpan=v,m.rowSpan=y,{colSpan:v,rowSpan:y}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Om={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},c1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Jue={getDefaultColumnDef:()=>Om,getInitialState:e=>({columnSizing:{},columnSizingInfo:c1(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ao("columnSizing",e),onColumnSizingInfoChange:Ao("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:Om.minSize,(r=i??e.columnDef.size)!=null?r:Om.size),(o=e.columnDef.maxSize)!=null?o:Om.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(),u1(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[r.id,r.getSize()]],l=u1(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(b,S)=>{typeof S=="number"&&(t.setColumnSizingInfo(_=>{var C,E;const T=t.options.columnResizeDirection==="rtl"?-1:1,A=(S-((C=_==null?void 0:_.startOffset)!=null?C:0))*T,D=Math.max(A/((E=_==null?void 0:_.startSize)!=null?E:0),-.999999);return _.columnSizingStart.forEach(k=>{let[j,$]=k;c[j]=Math.round(Math.max($+$*D,0)*100)/100}),{..._,deltaOffset:A,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||b==="end")&&t.setColumnSizing(_=>({..._,...c})))},d=b=>u("move",b),h=b=>{u("end",b),t.setColumnSizingInfo(S=>({...S,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,m={moveHandler:b=>d(b.clientX),upHandler:b=>{p==null||p.removeEventListener("mousemove",m.moveHandler),p==null||p.removeEventListener("mouseup",m.upHandler),h(b.clientX)}},v={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),d(b.touches[0].clientX),!1),upHandler:b=>{var S;p==null||p.removeEventListener("touchmove",v.moveHandler),p==null||p.removeEventListener("touchend",v.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),h((S=b.touches[0])==null?void 0:S.clientX)}},y=Zue()?{passive:!1}:!1;u1(i)?(p==null||p.addEventListener("touchmove",v.moveHandler,y),p==null||p.addEventListener("touchend",v.upHandler,y)):(p==null||p.addEventListener("mousemove",m.moveHandler,y),p==null||p.addEventListener("mouseup",m.upHandler,y)),t.setColumnSizingInfo(b=>({...b,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?c1():(n=e.initialState.columnSizingInfo)!=null?n:c1())},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 Tm=null;function Zue(){if(typeof Tm=="boolean")return Tm;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 Tm=e,Tm}function u1(e){return e.type==="touchstart"}const ede={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ao("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()}}}},hF=(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))};hF.autoRemove=e=>wi(e);const pF=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};pF.autoRemove=e=>wi(e);const gF=(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())};gF.autoRemove=e=>wi(e);const mF=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};mF.autoRemove=e=>wi(e)||!(e!=null&&e.length);const vF=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});vF.autoRemove=e=>wi(e)||!(e!=null&&e.length);const bF=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});bF.autoRemove=e=>wi(e)||!(e!=null&&e.length);const yF=(e,t,n)=>e.getValue(t)===n;yF.autoRemove=e=>wi(e);const xF=(e,t,n)=>e.getValue(t)==n;xF.autoRemove=e=>wi(e);const jE=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};jE.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]};jE.autoRemove=e=>wi(e)||wi(e[0])&&wi(e[1]);const Cs={includesString:hF,includesStringSensitive:pF,equalsString:gF,arrIncludes:mF,arrIncludesAll:vF,arrIncludesSome:bF,equals:yF,weakEquals:xF,inNumberRange:jE};function wi(e){return e==null||e===""}const tde={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ao("columnFilters",e),onGlobalFilterChange:Ao("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"?Cs.includesString:typeof r=="number"?Cs.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Cs.equals:Array.isArray(r)?Cs.arrIncludes:Cs.weakEquals},e.getFilterFn=()=>{var n,r;return ov(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:Cs[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=Ia(n,i?i.value:void 0);if(OD(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=()=>Cs.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return ov(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Cs[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Ia(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(OD(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 OD(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const nde=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),rde=(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},ode=(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},ide=(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]},sde=(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},ade=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Yue(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},lde=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),cde=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,ude=(e,t)=>t.length,d1={sum:nde,min:rde,max:ode,extent:ide,mean:sde,median:ade,unique:lde,uniqueCount:cde,count:ude},dde={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:Ao("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 d1.sum;if(Object.prototype.toString.call(r)==="[object Date]")return d1.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return ov(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:d1[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 fde(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 hde={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ao("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=ct(()=>[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 fde(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},BS=0,HS=10,f1=()=>({pageIndex:BS,pageSize:HS}),pde={getInitialState:e=>({...e,pagination:{...f1(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ao("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=>Ia(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?f1():(o=e.initialState.pagination)!=null?o:f1())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Ia(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?BS:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:BS)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?HS:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:HS)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Ia(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=Ia(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=ct(()=>[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)}}},h1=()=>({left:[],right:[]}),p1=()=>({top:[],bottom:[]}),gde={getInitialState:e=>({columnPinning:h1(),rowPinning:p1(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ao("columnPinning",e),onRowPinningChange:Ao("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(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},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 d,h;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(v=>!(a!=null&&a.has(v))),bottom:[...((h=l==null?void 0:l.bottom)!=null?h:[]).filter(v=>!(a!=null&&a.has(v))),...Array.from(a)]}}if(n==="top"){var p,m;return{top:[...((p=l==null?void 0:l.top)!=null?p:[]).filter(v=>!(a!=null&&a.has(v))),...Array.from(a)],bottom:((m=l==null?void 0:l.bottom)!=null?m:[]).filter(v=>!(a!=null&&a.has(v)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(v=>!(a!=null&&a.has(v))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(v=>!(a!=null&&a.has(v)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=t._getPinnedRows(o))==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=ct(()=>[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=ct(()=>[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=ct(()=>[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?h1():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:h1())},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=ct(()=>[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=ct(()=>[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=ct(()=>[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?p1():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:p1())},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=>ct(()=>[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=ct(()=>[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}})}},mde={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ao("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=>{VS(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ct(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?g1(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=ct(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?g1(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=ct(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?g1(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 VS(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return $E(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return WS(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return WS(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)}}}},VS=(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=>VS(e,a.id,n,r,o))};function g1(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=$E(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 $E(e,t){var n;return(n=t[e.id])!=null?n:!1}function WS(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()&&($E(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=WS(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const US=/([0-9]+)/gm,vde=(e,t,n)=>wF(Xa(e.getValue(n)).toLowerCase(),Xa(t.getValue(n)).toLowerCase()),bde=(e,t,n)=>wF(Xa(e.getValue(n)),Xa(t.getValue(n))),yde=(e,t,n)=>zE(Xa(e.getValue(n)).toLowerCase(),Xa(t.getValue(n)).toLowerCase()),xde=(e,t,n)=>zE(Xa(e.getValue(n)),Xa(t.getValue(n))),wde=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Sde=(e,t,n)=>zE(e.getValue(n),t.getValue(n));function zE(e,t){return e===t?0:e>t?1:-1}function Xa(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function wF(e,t){const n=e.split(US).filter(Boolean),r=t.split(US).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 gf={alphanumeric:vde,alphanumericCaseSensitive:bde,text:yde,textCaseSensitive:xde,datetime:wde,basic:Sde},_de={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ao("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 gf.datetime;if(typeof i=="string"&&(r=!0,i.split(US).length>1))return gf.alphanumeric}return r?gf.text:gf.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 ov(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:gf[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(p=>p.id===e.id),l=s==null?void 0:s.findIndex(p=>p.id===e.id);let c=[],u,d=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:d}],c.splice(0,c.length-((h=t.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(p=>p.id===e.id?{...p,desc:d}:p):u==="remove"?c=s.filter(p=>p.id!==e.id):c=[{id:e.id,desc:d}];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())}},Cde={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ao("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=ct(()=>[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=ct(()=>[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)=>ct(()=>[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)}}},TD=[Que,Cde,hde,gde,tde,_de,dde,ede,pde,mde,Jue];function Ede(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:TD};const r=n._features.reduce((u,d)=>Object.assign(u,d.getDefaultOptions==null?void 0:d.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 d;s=(d=u.getInitialState==null?void 0:u.getInitialState(s))!=null?d:s});const a=[];let l=!1;const c={_features:TD,options:{...r,...e},initialState:s,_queue:u=>{a.push(u),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(d=>setTimeout(()=>{throw d})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const d=Ia(u,n.options);n.options=o(d)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,d,h)=>{var p;return(p=n.options.getRowId==null?void 0:n.options.getRowId(u,d,h))!=null?p:`${h?[h.id,d].join("."):d}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,d)=>{let h=(d?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:ct(()=>[n.options.defaultColumn],u=>{var d;return u=(d=u)!=null?d:{},{header:h=>{const p=h.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:h=>{var p,m;return(p=(m=h.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...n._features.reduce((h,p)=>Object.assign(h,p.getDefaultColumnDef==null?void 0:p.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:ct(()=>[n._getColumnDefs()],u=>{const d=function(h,p,m){return m===void 0&&(m=0),h.map(v=>{const y=Xue(n,v,m,p),b=v;return y.columns=b.columns?d(b.columns,y,m+1):[],y})};return d(u)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:ct(()=>[n.getAllColumns()],u=>u.flatMap(d=>d.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:ct(()=>[n.getAllFlatColumns()],u=>u.reduce((d,h)=>(d[h.id]=h,d),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:ct(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,d)=>{let h=u.flatMap(p=>p.getLeafColumns());return d(h)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>{const d=n._getAllFlatColumnsById()[u];return process.env.NODE_ENV!=="production"&&!d&&console.error(`[Table] Column with id '${u}' does not exist.`),d}};Object.assign(n,c);for(let u=0;u<n._features.length;u++){const d=n._features[u];d==null||d.createTable==null||d.createTable(n)}return n}function Rde(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:ct(()=>[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 Pde=(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:()=>Kue(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:ct(()=>[e.getAllLeafColumns()],l=>l.map(c=>Rde(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:ct(()=>[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 SF(){return e=>ct(()=>[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=Pde(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 _F(){return e=>ct(()=>[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,d)=>{for(let p=0;p<i.length;p+=1){var h;const m=i[p],v=s[m.id],y=(h=m==null?void 0:m.desc)!=null?h:!1;let b=0;if(v.sortUndefined){const S=u.getValue(m.id),_=d.getValue(m.id),C=S===void 0,E=_===void 0;(C||E)&&(b=C&&E?0:C?v.sortUndefined:-v.sortUndefined)}if(b===0&&(b=v.sortingFn(u,d,m.id)),b!==0)return y&&(b*=-1),v.invertSorting&&(b*=-1),b}return u.index-d.index}),c.forEach(u=>{var d;o.push(u),(d=u.subRows)!=null&&d.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 Ode(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 CF(e){return t=>ct(()=>[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 d;t.options.paginateExpandedRows?d={rows:s,flatRows:a,rowsById:l}:d=Ode({rows:s,flatRows:a,rowsById:l}),d.flatRows=[];const h=p=>{d.flatRows.push(p),p.subRows.length&&p.subRows.forEach(h)};return d.rows.forEach(h),d},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
266
+ * react-table
267
+ *
268
+ * Copyright (c) TanStack
269
+ *
270
+ * This source code is licensed under the MIT license found in the
271
+ * LICENSE.md file in the root directory of this source tree.
272
+ *
273
+ * @license MIT
274
+ */function GS(e,t){return e?Tde(e)?R.createElement(e,t):e:null}function Tde(e){return Mde(e)||typeof e=="function"||Ade(e)}function Mde(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Ade(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function EF(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=R.useState(()=>({current:Ede(t)})),[r,o]=R.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 qS(e,[t,n]){return Math.min(n,Math.max(t,e))}var m1=0;function xb(){R.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??MD()),document.body.insertAdjacentElement("beforeend",e[1]??MD()),m1++,()=>{m1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),m1--}},[])}function MD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var v1="focusScope.autoFocusOnMount",b1="focusScope.autoFocusOnUnmount",AD={bubbles:!1,cancelable:!0},Dde="FocusScope",Lp=R.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=R.useState(null),c=Qn(o),u=Qn(i),d=R.useRef(null),h=at(t,v=>l(v)),p=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(r){let v=function(_){if(p.paused||!a)return;const C=_.target;a.contains(C)?d.current=C:ba(d.current,{select:!0})},y=function(_){if(p.paused||!a)return;const C=_.relatedTarget;C!==null&&(a.contains(C)||ba(d.current,{select:!0}))},b=function(_){if(document.activeElement===document.body)for(const E of _)E.removedNodes.length>0&&ba(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const S=new MutationObserver(b);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),S.disconnect()}}},[r,a,p.paused]),R.useEffect(()=>{if(a){kD.add(p);const v=document.activeElement;if(!a.contains(v)){const b=new CustomEvent(v1,AD);a.addEventListener(v1,c),a.dispatchEvent(b),b.defaultPrevented||(kde(jde(RF(a)),{select:!0}),document.activeElement===v&&ba(a))}return()=>{a.removeEventListener(v1,c),setTimeout(()=>{const b=new CustomEvent(b1,AD);a.addEventListener(b1,u),a.dispatchEvent(b),b.defaultPrevented||ba(v??document.body,{select:!0}),a.removeEventListener(b1,u),kD.remove(p)},0)}}},[a,c,u,p]);const m=R.useCallback(v=>{if(!n&&!r||p.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(y&&b){const S=v.currentTarget,[_,C]=Ide(S);_&&C?!v.shiftKey&&b===C?(v.preventDefault(),n&&ba(_,{select:!0})):v.shiftKey&&b===_&&(v.preventDefault(),n&&ba(C,{select:!0})):b===S&&v.preventDefault()}},[n,r,p.paused]);return x.jsx(Be.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});Lp.displayName=Dde;function kde(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ba(r,{select:t}),document.activeElement!==n)return}function Ide(e){const t=RF(e),n=DD(t,e),r=DD(t.reverse(),e);return[n,r]}function RF(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 DD(e,t){for(const n of e)if(!Nde(n,{upTo:t}))return n}function Nde(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 Lde(e){return e instanceof HTMLInputElement&&"select"in e}function ba(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Lde(e)&&t&&e.select()}}var kD=Fde();function Fde(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ID(e,t),e.unshift(t)},remove(t){var n;e=ID(e,t),(n=e[0])==null||n.resume()}}}function ID(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jde(e){return e.filter(t=>t.tagName!=="A")}function wb(e){const t=R.useRef({value:e,previous:e});return R.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var $de=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ru=new WeakMap,Mm=new WeakMap,Am={},y1=0,PF=function(e){return e&&(e.host||PF(e.parentNode))},zde=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=PF(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})},Bde=function(e,t,n,r){var o=zde(t,Array.isArray(e)?e:[e]);Am[n]||(Am[n]=new WeakMap);var i=Am[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else{var p=h.getAttribute(r),m=p!==null&&p!=="false",v=(ru.get(h)||0)+1,y=(i.get(h)||0)+1;ru.set(h,v),i.set(h,y),s.push(h),v===1&&m&&Mm.set(h,!0),y===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}})};return u(t),a.clear(),y1++,function(){s.forEach(function(d){var h=ru.get(d)-1,p=i.get(d)-1;ru.set(d,h),i.set(d,p),h||(Mm.has(d)||d.removeAttribute(r),Mm.delete(d)),p||d.removeAttribute(n)}),y1--,y1||(ru=new WeakMap,ru=new WeakMap,Mm=new WeakMap,Am={})}},Sb=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||$de(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Bde(r,o,n,"aria-hidden")):function(){return null}},Ui=function(){return Ui=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},Ui.apply(this,arguments)};function OF(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 Hde(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 u0="right-scroll-bar-position",d0="width-before-scroll-bar",Vde="with-scroll-bars-hidden",Wde="--removed-body-scroll-bar-size";function x1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ude(e,t){var n=P.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}var Gde=typeof window<"u"?R.useLayoutEffect:R.useEffect,ND=new WeakMap;function qde(e,t){var n=Ude(t||null,function(r){return e.forEach(function(o){return x1(o,r)})});return Gde(function(){var r=ND.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||x1(a,null)}),i.forEach(function(a){o.has(a)||x1(a,s)})}ND.set(n,e)},[e]),n}function Yde(e){return e}function Kde(e,t){t===void 0&&(t=Yde);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 Xde(e){e===void 0&&(e={});var t=Kde(null);return t.options=Ui({async:!0,ssr:!1},e),t}var TF=function(e){var t=e.sideCar,n=OF(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 R.createElement(r,Ui({},n))};TF.isSideCarExport=!0;function Qde(e,t){return e.useMedium(t),TF}var MF=Xde(),w1=function(){},_b=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:w1,onWheelCapture:w1,onTouchMoveCapture:w1}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,p=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,S=e.gapMode,_=OF(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,E=qde([n,t]),T=Ui(Ui({},_),o);return R.createElement(R.Fragment,null,u&&R.createElement(C,{sideCar:MF,removeScrollBar:c,shards:d,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:S}),s?R.cloneElement(R.Children.only(a),Ui(Ui({},T),{ref:E})):R.createElement(b,Ui({},T,{className:l,ref:E}),a))});_b.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_b.classNames={fullWidth:d0,zeroRight:u0};var LD,Jde=function(){if(LD)return LD;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Zde(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Jde();return t&&e.setAttribute("nonce",t),e}function efe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tfe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nfe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Zde())&&(efe(t,n),tfe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rfe=function(){var e=nfe();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},AF=function(){var e=rfe(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ofe={left:0,top:0,right:0,gap:0},S1=function(e){return parseInt(e||"",10)||0},ife=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[S1(n),S1(r),S1(o)]},sfe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ofe;var t=ife(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])}},afe=AF(),Tu="data-scroll-locked",lfe=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
275
+ .`.concat(Vde,` {
276
+ overflow: hidden `).concat(r,`;
277
+ padding-right: `).concat(a,"px ").concat(r,`;
278
+ }
279
+ body[`).concat(Tu,`] {
280
+ overflow: hidden `).concat(r,`;
281
+ overscroll-behavior: contain;
282
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
283
+ padding-left: `.concat(o,`px;
284
+ padding-top: `).concat(i,`px;
285
+ padding-right: `).concat(s,`px;
286
+ margin-left:0;
287
+ margin-top:0;
288
+ margin-right: `).concat(a,"px ").concat(r,`;
289
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
290
+ }
291
+
292
+ .`).concat(u0,` {
293
+ right: `).concat(a,"px ").concat(r,`;
294
+ }
295
+
296
+ .`).concat(d0,` {
297
+ margin-right: `).concat(a,"px ").concat(r,`;
298
+ }
299
+
300
+ .`).concat(u0," .").concat(u0,` {
301
+ right: 0 `).concat(r,`;
302
+ }
303
+
304
+ .`).concat(d0," .").concat(d0,` {
305
+ margin-right: 0 `).concat(r,`;
306
+ }
307
+
308
+ body[`).concat(Tu,`] {
309
+ `).concat(Wde,": ").concat(a,`px;
310
+ }
311
+ `)},FD=function(){var e=parseInt(document.body.getAttribute(Tu)||"0",10);return isFinite(e)?e:0},cfe=function(){R.useEffect(function(){return document.body.setAttribute(Tu,(FD()+1).toString()),function(){var e=FD()-1;e<=0?document.body.removeAttribute(Tu):document.body.setAttribute(Tu,e.toString())}},[])},ufe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;cfe();var i=R.useMemo(function(){return sfe(o)},[o]);return R.createElement(afe,{styles:lfe(i,!t,o,n?"":"!important")})},YS=!1;if(typeof window<"u")try{var Dm=Object.defineProperty({},"passive",{get:function(){return YS=!0,!0}});window.addEventListener("test",Dm,Dm),window.removeEventListener("test",Dm,Dm)}catch{YS=!1}var ou=YS?{passive:!1}:!1,dfe=function(e){return e.tagName==="TEXTAREA"},DF=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dfe(e)&&n[t]==="visible")},ffe=function(e){return DF(e,"overflowY")},hfe=function(e){return DF(e,"overflowX")},jD=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=kF(e,r);if(o){var i=IF(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pfe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},gfe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},kF=function(e,t){return e==="v"?ffe(t):hfe(t)},IF=function(e,t){return e==="v"?pfe(t):gfe(t)},mfe=function(e,t){return e==="h"&&t==="rtl"?-1:1},vfe=function(e,t,n,r,o){var i=mfe(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,h=0;do{var p=IF(e,a),m=p[0],v=p[1],y=p[2],b=v-y-i*m;(m||b)&&kF(e,a)&&(d+=b,h+=m),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(d)<1||!o&&s>d)||!u&&(o&&Math.abs(h)<1||!o&&-s>h))&&(c=!0),c},km=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$D=function(e){return[e.deltaX,e.deltaY]},zD=function(e){return e&&"current"in e?e.current:e},bfe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yfe=function(e){return`
312
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
313
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
314
+ `)},xfe=0,iu=[];function wfe(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),o=R.useState(xfe++)[0],i=R.useState(AF)[0],s=R.useRef(e);R.useEffect(function(){s.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=Hde([e.lockRef.current],(e.shards||[]).map(zD),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=R.useCallback(function(v,y){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!s.current.allowPinchZoom;var b=km(v),S=n.current,_="deltaX"in v?v.deltaX:S[0]-b[0],C="deltaY"in v?v.deltaY:S[1]-b[1],E,T=v.target,A=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in v&&A==="h"&&T.type==="range")return!1;var D=jD(A,T);if(!D)return!0;if(D?E=A:(E=A==="v"?"h":"v",D=jD(A,T)),!D)return!1;if(!r.current&&"changedTouches"in v&&(_||C)&&(r.current=E),!E)return!0;var k=r.current||E;return vfe(k,y,v,k==="h"?_:C,!0)},[]),l=R.useCallback(function(v){var y=v;if(!(!iu.length||iu[iu.length-1]!==i)){var b="deltaY"in y?$D(y):km(y),S=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&bfe(E.delta,b)})[0];if(S&&S.should){y.cancelable&&y.preventDefault();return}if(!S){var _=(s.current.shards||[]).map(zD).filter(Boolean).filter(function(E){return E.contains(y.target)}),C=_.length>0?a(y,_[0]):!s.current.noIsolation;C&&y.cancelable&&y.preventDefault()}}},[]),c=R.useCallback(function(v,y,b,S){var _={name:v,delta:y,target:b,should:S,shadowParent:Sfe(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),u=R.useCallback(function(v){n.current=km(v),r.current=void 0},[]),d=R.useCallback(function(v){c(v.type,$D(v),v.target,a(v,e.lockRef.current))},[]),h=R.useCallback(function(v){c(v.type,km(v),v.target,a(v,e.lockRef.current))},[]);R.useEffect(function(){return iu.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ou),document.addEventListener("touchmove",l,ou),document.addEventListener("touchstart",u,ou),function(){iu=iu.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,ou),document.removeEventListener("touchmove",l,ou),document.removeEventListener("touchstart",u,ou)}},[]);var p=e.removeScrollBar,m=e.inert;return R.createElement(R.Fragment,null,m?R.createElement(i,{styles:yfe(o)}):null,p?R.createElement(ufe,{gapMode:e.gapMode}):null)}function Sfe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _fe=Qde(MF,wfe);var NF=R.forwardRef(function(e,t){return R.createElement(_b,Ui({},e,{ref:t,sideCar:_fe}))});NF.classNames=_b.classNames;const Cb=NF;var Cfe=[" ","Enter","ArrowUp","ArrowDown"],Efe=[" ","Enter"],Fp="Select",[Eb,Rb,Rfe]=Nv(Fp),[Td,zOe]=Jn(Fp,[Rfe,cs]),Pb=cs(),[Pfe,tl]=Td(Fp),[Ofe,Tfe]=Td(Fp),LF=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:h,required:p,form:m}=e,v=Pb(t),[y,b]=R.useState(null),[S,_]=R.useState(null),[C,E]=R.useState(!1),T=Mc(c),[A=!1,D]=Cr({prop:r,defaultProp:o,onChange:i}),[k,j]=Cr({prop:s,defaultProp:a,onChange:l}),$=R.useRef(null),z=y?m||!!y.closest("form"):!0,[K,V]=R.useState(new Set),N=Array.from(K).map(W=>W.props.value).join(";");return x.jsx(Mp,{...v,children:x.jsxs(Pfe,{required:p,scope:t,trigger:y,onTriggerChange:b,valueNode:S,onValueNodeChange:_,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:qn(),value:k,onValueChange:j,open:A,onOpenChange:D,dir:T,triggerPointerDownPosRef:$,disabled:h,children:[x.jsx(Eb.Provider,{scope:t,children:x.jsx(Ofe,{scope:e.__scopeSelect,onNativeOptionAdd:R.useCallback(W=>{V(H=>new Set(H).add(W))},[]),onNativeOptionRemove:R.useCallback(W=>{V(H=>{const G=new Set(H);return G.delete(W),G})},[]),children:n})}),z?x.jsxs(l6,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:k,onChange:W=>j(W.target.value),disabled:h,form:m,children:[k===void 0?x.jsx("option",{value:""}):null,Array.from(K)]},N):null]})})};LF.displayName=Fp;var FF="SelectTrigger",jF=R.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Pb(n),s=tl(FF,n),a=s.disabled||r,l=at(t,s.onTriggerChange),c=Rb(n),u=R.useRef("touch"),[d,h,p]=c6(v=>{const y=c().filter(_=>!_.disabled),b=y.find(_=>_.value===s.value),S=u6(y,v,b);S!==void 0&&s.onValueChange(S.value)}),m=v=>{a||(s.onOpenChange(!0),p()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return x.jsx(Od,{asChild:!0,...i,children:x.jsx(Be.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":a6(s.value)?"":void 0,...o,ref:l,onClick:Te(o.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&m(v)}),onPointerDown:Te(o.onPointerDown,v=>{u.current=v.pointerType;const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(m(v),v.preventDefault())}),onKeyDown:Te(o.onKeyDown,v=>{const y=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&h(v.key),!(y&&v.key===" ")&&Cfe.includes(v.key)&&(m(),v.preventDefault())})})})});jF.displayName=FF;var $F="SelectValue",zF=R.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=tl($F,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=at(t,l.onValueNodeChange);return fr(()=>{c(u)},[c,u]),x.jsx(Be.span,{...a,ref:d,style:{pointerEvents:"none"},children:a6(l.value)?x.jsx(x.Fragment,{children:s}):i})});zF.displayName=$F;var Mfe="SelectIcon",BF=R.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return x.jsx(Be.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});BF.displayName=Mfe;var Afe="SelectPortal",HF=e=>x.jsx(kp,{asChild:!0,...e});HF.displayName=Afe;var wc="SelectContent",VF=R.forwardRef((e,t)=>{const n=tl(wc,e.__scopeSelect),[r,o]=R.useState();if(fr(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?dc.createPortal(x.jsx(WF,{scope:e.__scopeSelect,children:x.jsx(Eb.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),i):null}return x.jsx(UF,{...e,ref:t})});VF.displayName=wc;var hi=10,[WF,nl]=Td(wc),Dfe="SelectContentImpl",UF=R.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:d,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:y,...b}=e,S=tl(wc,n),[_,C]=R.useState(null),[E,T]=R.useState(null),A=at(t,ee=>C(ee)),[D,k]=R.useState(null),[j,$]=R.useState(null),z=Rb(n),[K,V]=R.useState(!1),N=R.useRef(!1);R.useEffect(()=>{if(_)return Sb(_)},[_]),xb();const W=R.useCallback(ee=>{const[J,...le]=z().map(oe=>oe.ref.current),[ce]=le.slice(-1),ye=document.activeElement;for(const oe of ee)if(oe===ye||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===J&&E&&(E.scrollTop=0),oe===ce&&E&&(E.scrollTop=E.scrollHeight),oe==null||oe.focus(),document.activeElement!==ye))return},[z,E]),H=R.useCallback(()=>W([D,_]),[W,D,_]);R.useEffect(()=>{K&&H()},[K,H]);const{onOpenChange:G,triggerPointerDownPosRef:te}=S;R.useEffect(()=>{if(_){let ee={x:0,y:0};const J=ce=>{var ye,oe;ee={x:Math.abs(Math.round(ce.pageX)-(((ye=te.current)==null?void 0:ye.x)??0)),y:Math.abs(Math.round(ce.pageY)-(((oe=te.current)==null?void 0:oe.y)??0))}},le=ce=>{ee.x<=10&&ee.y<=10?ce.preventDefault():_.contains(ce.target)||G(!1),document.removeEventListener("pointermove",J),te.current=null};return te.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",le,{capture:!0})}}},[_,G,te]),R.useEffect(()=>{const ee=()=>G(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[G]);const[F,Y]=c6(ee=>{const J=z().filter(ye=>!ye.disabled),le=J.find(ye=>ye.ref.current===document.activeElement),ce=u6(J,ee,le);ce&&setTimeout(()=>ce.ref.current.focus())}),q=R.useCallback((ee,J,le)=>{const ce=!N.current&&!le;(S.value!==void 0&&S.value===J||ce)&&(k(ee),ce&&(N.current=!0))},[S.value]),M=R.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=R.useCallback((ee,J,le)=>{const ce=!N.current&&!le;(S.value!==void 0&&S.value===J||ce)&&$(ee)},[S.value]),X=r==="popper"?KS:GF,re=X===KS?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:y}:{};return x.jsx(WF,{scope:n,content:_,viewport:E,onViewportChange:T,itemRefCallback:q,selectedItem:D,onItemLeave:M,itemTextRefCallback:ne,focusSelectedItem:H,selectedItemText:j,position:r,isPositioned:K,searchRef:F,children:x.jsx(Cb,{as:Hs,allowPinchZoom:!0,children:x.jsx(Lp,{asChild:!0,trapped:S.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Te(o,ee=>{var J;(J=S.trigger)==null||J.focus({preventScroll:!0}),ee.preventDefault()}),children:x.jsx(Ic,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:x.jsx(X,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:ee=>ee.preventDefault(),...b,...re,onPlaced:()=>V(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Te(b.onKeyDown,ee=>{const J=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!J&&ee.key.length===1&&Y(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let ce=z().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const ye=ee.target,oe=ce.indexOf(ye);ce=ce.slice(oe+1)}setTimeout(()=>W(ce)),ee.preventDefault()}})})})})})})});UF.displayName=Dfe;var kfe="SelectItemAlignedPosition",GF=R.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=tl(wc,n),s=nl(wc,n),[a,l]=R.useState(null),[c,u]=R.useState(null),d=at(t,A=>u(A)),h=Rb(n),p=R.useRef(!1),m=R.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:S}=s,_=R.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&v&&y&&b){const A=i.trigger.getBoundingClientRect(),D=c.getBoundingClientRect(),k=i.valueNode.getBoundingClientRect(),j=b.getBoundingClientRect();if(i.dir!=="rtl"){const ye=j.left-D.left,oe=k.left-ye,ve=A.left-oe,he=A.width+ve,Ee=Math.max(he,D.width),ke=window.innerWidth-hi,We=qS(oe,[hi,Math.max(hi,ke-Ee)]);a.style.minWidth=he+"px",a.style.left=We+"px"}else{const ye=D.right-j.right,oe=window.innerWidth-k.right-ye,ve=window.innerWidth-A.right-oe,he=A.width+ve,Ee=Math.max(he,D.width),ke=window.innerWidth-hi,We=qS(oe,[hi,Math.max(hi,ke-Ee)]);a.style.minWidth=he+"px",a.style.right=We+"px"}const $=h(),z=window.innerHeight-hi*2,K=v.scrollHeight,V=window.getComputedStyle(c),N=parseInt(V.borderTopWidth,10),W=parseInt(V.paddingTop,10),H=parseInt(V.borderBottomWidth,10),G=parseInt(V.paddingBottom,10),te=N+W+K+G+H,F=Math.min(y.offsetHeight*5,te),Y=window.getComputedStyle(v),q=parseInt(Y.paddingTop,10),M=parseInt(Y.paddingBottom,10),ne=A.top+A.height/2-hi,X=z-ne,re=y.offsetHeight/2,ee=y.offsetTop+re,J=N+W+ee,le=te-J;if(J<=ne){const ye=$.length>0&&y===$[$.length-1].ref.current;a.style.bottom="0px";const oe=c.clientHeight-v.offsetTop-v.offsetHeight,ve=Math.max(X,re+(ye?M:0)+oe+H),he=J+ve;a.style.height=he+"px"}else{const ye=$.length>0&&y===$[0].ref.current;a.style.top="0px";const ve=Math.max(ne,N+v.offsetTop+(ye?q:0)+re)+le;a.style.height=ve+"px",v.scrollTop=J-ne+v.offsetTop}a.style.margin=`${hi}px 0`,a.style.minHeight=F+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,a,c,v,y,b,i.dir,r]);fr(()=>_(),[_]);const[C,E]=R.useState();fr(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const T=R.useCallback(A=>{A&&m.current===!0&&(_(),S==null||S(),m.current=!1)},[_,S]);return x.jsx(Nfe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:T,children:x.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:x.jsx(Be.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});GF.displayName=kfe;var Ife="SelectPopperPosition",KS=R.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=hi,...i}=e,s=Pb(n);return x.jsx(Ap,{...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)"}})});KS.displayName=Ife;var[Nfe,BE]=Td(wc,{}),XS="SelectViewport",qF=R.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=nl(XS,n),s=BE(XS,n),a=at(t,i.onViewportChange),l=R.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),x.jsx(Eb.Slot,{scope:n,children:x.jsx(Be.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Te(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&d){const p=Math.abs(l.current-u.scrollTop);if(p>0){const m=window.innerHeight-hi*2,v=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),b=Math.max(v,y);if(b<m){const S=b+p,_=Math.min(m,S),C=S-_;d.style.height=_+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});qF.displayName=XS;var YF="SelectGroup",[Lfe,Ffe]=Td(YF),KF=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=qn();return x.jsx(Lfe,{scope:n,id:o,children:x.jsx(Be.div,{role:"group","aria-labelledby":o,...r,ref:t})})});KF.displayName=YF;var XF="SelectLabel",QF=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ffe(XF,n);return x.jsx(Be.div,{id:o.id,...r,ref:t})});QF.displayName=XF;var iv="SelectItem",[jfe,JF]=Td(iv),ZF=R.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=tl(iv,n),l=nl(iv,n),c=a.value===r,[u,d]=R.useState(i??""),[h,p]=R.useState(!1),m=at(t,S=>{var _;return(_=l.itemRefCallback)==null?void 0:_.call(l,S,r,o)}),v=qn(),y=R.useRef("touch"),b=()=>{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 x.jsx(jfe,{scope:n,value:r,disabled:o,textId:v,isSelected:c,onItemTextChange:R.useCallback(S=>{d(_=>_||((S==null?void 0:S.textContent)??"").trim())},[]),children:x.jsx(Eb.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:x.jsx(Be.div,{role:"option","aria-labelledby":v,"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:m,onFocus:Te(s.onFocus,()=>p(!0)),onBlur:Te(s.onBlur,()=>p(!1)),onClick:Te(s.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:Te(s.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:Te(s.onPointerDown,S=>{y.current=S.pointerType}),onPointerMove:Te(s.onPointerMove,S=>{var _;y.current=S.pointerType,o?(_=l.onItemLeave)==null||_.call(l):y.current==="mouse"&&S.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(s.onPointerLeave,S=>{var _;S.currentTarget===document.activeElement&&((_=l.onItemLeave)==null||_.call(l))}),onKeyDown:Te(s.onKeyDown,S=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&S.key===" "||(Efe.includes(S.key)&&b(),S.key===" "&&S.preventDefault())})})})})});ZF.displayName=iv;var Hf="SelectItemText",e6=R.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=tl(Hf,n),a=nl(Hf,n),l=JF(Hf,n),c=Tfe(Hf,n),[u,d]=R.useState(null),h=at(t,b=>d(b),l.onItemTextChange,b=>{var S;return(S=a.itemTextRefCallback)==null?void 0:S.call(a,b,l.value,l.disabled)}),p=u==null?void 0:u.textContent,m=R.useMemo(()=>x.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=c;return fr(()=>(v(m),()=>y(m)),[v,y,m]),x.jsxs(x.Fragment,{children:[x.jsx(Be.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?dc.createPortal(i.children,s.valueNode):null]})});e6.displayName=Hf;var t6="SelectItemIndicator",n6=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return JF(t6,n).isSelected?x.jsx(Be.span,{"aria-hidden":!0,...r,ref:t}):null});n6.displayName=t6;var QS="SelectScrollUpButton",r6=R.forwardRef((e,t)=>{const n=nl(QS,e.__scopeSelect),r=BE(QS,e.__scopeSelect),[o,i]=R.useState(!1),s=at(t,r.onScrollButtonChange);return fr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(i6,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});r6.displayName=QS;var JS="SelectScrollDownButton",o6=R.forwardRef((e,t)=>{const n=nl(JS,e.__scopeSelect),r=BE(JS,e.__scopeSelect),[o,i]=R.useState(!1),s=at(t,r.onScrollButtonChange);return fr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(i6,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});o6.displayName=JS;var i6=R.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=nl("SelectScrollButton",n),s=R.useRef(null),a=Rb(n),l=R.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return R.useEffect(()=>()=>l(),[l]),fr(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),x.jsx(Be.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Te(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Te(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Te(o.onPointerLeave,()=>{l()})})}),$fe="SelectSeparator",s6=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.jsx(Be.div,{"aria-hidden":!0,...r,ref:t})});s6.displayName=$fe;var ZS="SelectArrow",zfe=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pb(n),i=tl(ZS,n),s=nl(ZS,n);return i.open&&s.position==="popper"?x.jsx(Dp,{...o,...r,ref:t}):null});zfe.displayName=ZS;function a6(e){return e===""||e===void 0}var l6=R.forwardRef((e,t)=>{const{value:n,...r}=e,o=R.useRef(null),i=at(t,o),s=wb(n);return R.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),x.jsx(OE,{asChild:!0,children:x.jsx("select",{...r,ref:i,defaultValue:n})})});l6.displayName="BubbleSelect";function c6(e){const t=Qn(e),n=R.useRef(""),r=R.useRef(0),o=R.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=R.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return R.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function u6(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=Bfe(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 Bfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Hfe=LF,d6=jF,Vfe=zF,Wfe=BF,Ufe=HF,f6=VF,Gfe=qF,qfe=KF,h6=QF,p6=ZF,Yfe=e6,Kfe=n6,g6=r6,m6=o6,v6=s6;const Ts=Hfe,du=qfe,Ms=Vfe,Fi=R.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(d6,{ref:r,className:xe("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,x.jsx(Wfe,{asChild:!0,children:x.jsx(Jv,{className:"h-4 w-4 opacity-50"})})]}));Fi.displayName=d6.displayName;const b6=R.forwardRef(({className:e,...t},n)=>x.jsx(g6,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(o4,{className:"h-4 w-4"})}));b6.displayName=g6.displayName;const y6=R.forwardRef(({className:e,...t},n)=>x.jsx(m6,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(Jv,{className:"h-4 w-4"})}));y6.displayName=m6.displayName;const ji=R.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>x.jsx(Ufe,{children:x.jsx(Tc,{children:x.jsxs(f6,{ref:o,className:xe("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:[x.jsx(b6,{}),x.jsx(Gfe,{className:xe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),x.jsx(y6,{})]})})}));ji.displayName=f6.displayName;const Al=R.forwardRef(({className:e,...t},n)=>x.jsx(h6,{ref:n,className:xe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Al.displayName=h6.displayName;const Hn=R.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(p6,{ref:r,className:xe("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:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(Kfe,{children:x.jsx(Cp,{className:"h-4 w-4"})})}),x.jsx(Yfe,{children:t})]}));Hn.displayName=p6.displayName;const sh=R.forwardRef(({className:e,...t},n)=>x.jsx(v6,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));sh.displayName=v6.displayName;const ac=R.forwardRef(({className:e,type:t,...n},r)=>x.jsx("input",{type:t,className:xe("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}));ac.displayName="Input";var Xfe="Label",x6=R.forwardRef((e,t)=>x.jsx(Be.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));x6.displayName=Xfe;var w6=x6;const Qfe=DE("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Tn=R.forwardRef(({className:e,...t},n)=>x.jsx(w6,{ref:n,className:xe(Qfe(),e),...t}));Tn.displayName=w6.displayName;var HE="Popover",[S6,BOe]=Jn(HE,[cs]),jp=cs(),[Jfe,rl]=S6(HE),_6=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=jp(t),l=R.useRef(null),[c,u]=R.useState(!1),[d=!1,h]=Cr({prop:r,defaultProp:o,onChange:i});return x.jsx(Mp,{...a,children:x.jsx(Jfe,{scope:t,contentId:qn(),triggerRef:l,open:d,onOpenChange:h,onOpenToggle:R.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:c,onCustomAnchorAdd:R.useCallback(()=>u(!0),[]),onCustomAnchorRemove:R.useCallback(()=>u(!1),[]),modal:s,children:n})})};_6.displayName=HE;var C6="PopoverAnchor",Zfe=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rl(C6,n),i=jp(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return R.useEffect(()=>(s(),()=>a()),[s,a]),x.jsx(Od,{...i,...r,ref:t})});Zfe.displayName=C6;var E6="PopoverTrigger",R6=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rl(E6,n),i=jp(n),s=at(t,o.triggerRef),a=x.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":A6(o.open),...r,ref:s,onClick:Te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:x.jsx(Od,{asChild:!0,...i,children:a})});R6.displayName=E6;var VE="PopoverPortal",[ehe,the]=S6(VE,{forceMount:void 0}),P6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=rl(VE,t);return x.jsx(ehe,{scope:t,forceMount:n,children:x.jsx(Yn,{present:n||i.open,children:x.jsx(kp,{asChild:!0,container:o,children:r})})})};P6.displayName=VE;var fd="PopoverContent",O6=R.forwardRef((e,t)=>{const n=the(fd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=rl(fd,e.__scopePopover);return x.jsx(Yn,{present:r||i.open,children:i.modal?x.jsx(nhe,{...o,ref:t}):x.jsx(rhe,{...o,ref:t})})});O6.displayName=fd;var nhe=R.forwardRef((e,t)=>{const n=rl(fd,e.__scopePopover),r=R.useRef(null),o=at(t,r),i=R.useRef(!1);return R.useEffect(()=>{const s=r.current;if(s)return Sb(s)},[]),x.jsx(Cb,{as:Hs,allowPinchZoom:!0,children:x.jsx(T6,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Te(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:Te(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),rhe=R.forwardRef((e,t)=>{const n=rl(fd,e.__scopePopover),r=R.useRef(!1),o=R.useRef(!1);return x.jsx(T6,{...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()}})}),T6=R.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,h=rl(fd,n),p=jp(n);return xb(),x.jsx(Lp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:x.jsx(Ic,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:x.jsx(Ap,{"data-state":A6(h.open),role:"dialog",id:h.contentId,...p,...d,ref:t,style:{...d.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)"}})})})}),M6="PopoverClose",ohe=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rl(M6,n);return x.jsx(Be.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});ohe.displayName=M6;var ihe="PopoverArrow",she=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=jp(n);return x.jsx(Dp,{...o,...r,ref:t})});she.displayName=ihe;function A6(e){return e?"open":"closed"}var ahe=_6,lhe=R6,che=P6,D6=O6;const Ob=ahe,Tb=lhe,$p=R.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>x.jsx(che,{children:x.jsx(Tc,{children:x.jsx(D6,{ref:o,align:t,sideOffset:n,className:xe("z-49 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})})}));$p.displayName=D6.displayName;function uhe(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:{}}}}function k6({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 x.jsxs("div",{className:"space-y-3",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(Tn,{children:"Color Range"}),x.jsx(oo,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:x.jsx(IC,{className:"size-3"})})]}),e.map((s,a)=>x.jsxs("div",{className:"flex items-center gap-2 px-2",children:[x.jsx(ac,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:xe(`h-7 ${Yf}`)}),x.jsx("span",{children:"-"}),x.jsx(ac,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:xe(`h-7 ${Yf}`)}),x.jsx(ac,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:xe(`h-7 min-w-14 p-0 ${Yf}`),type:"color",list:"presetColors"}),x.jsxs("datalist",{id:"presetColors",children:[x.jsx("option",{children:Gt.green[600]}),x.jsx("option",{children:Gt.red[500]}),x.jsx("option",{children:Gt.yellow[400]}),x.jsx("option",{children:Gt.orange[500]})]}),x.jsx(oo,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:x.jsx(wd,{className:"size-3"})})]},a))]})}var dhe="Toggle",I6=R.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=Cr({prop:n,onChange:o,defaultProp:r});return x.jsx(Be.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Te(e.onClick,()=>{e.disabled||a(!s)})})});I6.displayName=dhe;var N6=I6;const fhe=DE("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"}}),WE=R.forwardRef(({className:e,variant:t,size:n,...r},o)=>x.jsx(N6,{ref:o,className:xe(fhe({variant:t,size:n,className:e})),...r}));WE.displayName=N6.displayName;function hhe(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 phe(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 ghe(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 mhe(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 vhe(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 bhe(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 yhe(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 xhe(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.textAlign}function whe(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.width}function She({columnIndex:e,columnName:t}){const[n,r]=P.useState(!1),o=Nr(V=>{var N;return(N=V.card)==null?void 0:N.preferences}),[i,s]=P.useState(hhe(o,e)),[a,l]=P.useState(xhe(o,e)),[c,u]=P.useState(whe(o,e)),[d,h]=P.useState(bhe(o,e)),[p,m]=P.useState(phe(o,e)),[v,y]=P.useState(ghe(o,e)),[b,S]=P.useState(mhe(o,e)),[_,C]=P.useState(vhe(o,e).toString()),[E,T]=P.useState(yhe(o,e));P.useState("");const A=Nr(V=>V.actions.setCardPreferences);function D(){return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),x.jsxs(Ts,{value:a||"left",onValueChange:V=>l(V),children:[x.jsx(Fi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(Ms,{})}),x.jsxs(ji,{children:[x.jsx(Hn,{value:"left",children:"Left"}),x.jsx(Hn,{value:"center",children:"Center"}),x.jsx(Hn,{value:"right",children:"Right"})]})]})]}),x.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),x.jsx(ac,{placeholder:"Auto",value:c?c.toString():"",className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",onChange:V=>{V.target.value===""?u(void 0):u(Number(V.target.value))}})]})]})}function k(){const V=[...new Set(Cw.map(N=>N.currency))];return x.jsx(x.Fragment,{children:x.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),x.jsxs(Ts,{value:p,onValueChange:N=>m(N),children:[x.jsx(Fi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(Ms,{})}),x.jsx(ji,{children:x.jsxs(du,{children:[x.jsx(Al,{children:"Locale"}),Cw.map(N=>x.jsx(Hn,{value:N.locale,children:N.locale},N.locale))]})})]}),x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),x.jsxs(Ts,{value:b||"none",onValueChange:N=>S(N==="none"?void 0:N),children:[x.jsx(Fi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(Ms,{})}),x.jsx(ji,{children:x.jsxs(du,{children:[x.jsx(Al,{children:"Currency"}),x.jsx(Hn,{value:"none",children:"None"}),V.map(N=>x.jsx(Hn,{value:N,children:N},N))]})})]}),x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),x.jsxs(Ts,{value:_,onValueChange:N=>C(N),children:[x.jsx(Fi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(Ms,{})}),x.jsx(ji,{children:["0","1","2","3","4"].map(N=>x.jsx(Hn,{value:N,children:N},N))})]}),!b&&x.jsx(WE,{onPressedChange:N=>T(N),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:x.jsx(c4,{className:"size-3"})})]})})}function j(){return x.jsx(x.Fragment,{children:x.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),x.jsxs(Ts,{defaultValue:"en-US",value:p,onValueChange:V=>m(V),children:[x.jsx(Fi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(Ms,{})}),x.jsx(ji,{children:IK.map(V=>x.jsxs(du,{children:[x.jsx(Al,{children:V.label}),V.locales.map(N=>x.jsx(Hn,{value:N.code,children:N.name},N.code))]},V.label))})]}),x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Format"}),x.jsxs(Ts,{defaultValue:"short-date-time",value:v,onValueChange:V=>{console.log("format",V),y(V)},children:[x.jsx(Fi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(Ms,{})}),x.jsx(ji,{className:"",id:"type",children:x.jsxs(du,{children:[x.jsx(Al,{children:"Option"}),x.jsx(Hn,{value:"full-date-time",children:"Full Date-Time"}),x.jsx(Hn,{value:"short-date-time",children:"Short Date-Time"}),x.jsx(Hn,{value:"hours-date-time",children:"24-Hour Date-Time"}),x.jsx(Hn,{value:"short-date",children:"Short Date"}),x.jsx(Hn,{value:"long-date",children:"Long Date"})]})})]})]})})}function $(){A({...o,columnSettings:[]})}function z(){var V;A({...o,columnSettings:[...((V=o==null?void 0:o.columnSettings)==null?void 0:V.filter(N=>N.columnIdx!==e))||[]]})}function K(){var V,N,W;if(i==="date"){const H=uhe(p,v),G={columnIdx:e,type:i,options:H};A({...o,columnSettings:[...((V=o==null?void 0:o.columnSettings)==null?void 0:V.filter(te=>te.columnIdx!==e))||[],G]})}else if(i==="number"){let H;b?H={locale:p,currency:b,options:{style:"currency",currency:b,minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0}:H={locale:p,currency:void 0,options:{style:E?"percent":"decimal",minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0};const G={columnIdx:e,type:i,textAlign:a,width:c,options:H};A({...o,columnSettings:[...((N=o==null?void 0:o.columnSettings)==null?void 0:N.filter(te=>te.columnIdx!==e))||[],G]})}else{const H={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};A({...o,columnSettings:[...((W=o==null?void 0:o.columnSettings)==null?void 0:W.filter(G=>G.columnIdx!==e))||[],H]})}}return x.jsxs(Ob,{onOpenChange:V=>r(V),children:[x.jsx(Tb,{asChild:!0,children:x.jsx(NC,{className:"size-3.5 cursor-pointer text-muted"})}),x.jsx($p,{align:"center",className:"max-w-70 z-20",children:x.jsxs("div",{className:"grid gap-4",children:[x.jsxs("div",{className:"space-y-2",children:[x.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),x.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),x.jsxs("div",{className:"grid gap-2",children:[x.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[x.jsx(Tn,{htmlFor:"scale",children:"Type"}),x.jsxs(Ts,{value:i||"none",onValueChange:V=>s(V),children:[x.jsx(Fi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(Ms,{})}),x.jsx(ji,{id:"type",children:x.jsxs(du,{children:[x.jsx(Al,{children:"Option"}),x.jsx(Hn,{value:"number",children:"Number"}),x.jsx(Hn,{value:"date",children:"Date"}),x.jsx(Hn,{value:"none",children:"None"})]})})]})]}),D(),x.jsx(sh,{}),i==="number"&&k(),i==="date"&&j(),i==="number"&&x.jsxs(x.Fragment,{children:[x.jsx(sh,{}),x.jsx(k6,{colorRanges:d,setColorRanges:h})]}),x.jsx(sh,{}),x.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[x.jsx(oo,{onClick:$,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),x.jsx(oo,{onClick:z,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),x.jsx(oo,{onClick:K,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function _he(e){const t=new Date(e);return!isNaN(t.getTime())}function L6({data:e,card:t}){var C,E,T,A;const[n,r]=P.useState([]),{keys:o}=nr(e),i=we(D=>D.filteringCards),s=we(D=>D.themeStyle),a=we(D=>D.isVisualEditing),l=i==null?void 0:i.find(D=>D.id===t.id),c=(C=t==null?void 0:t.preferences)==null?void 0:C.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:d,removeFilterValue:h,removeFilteringCard:p}=dr(),m=t==null?void 0:t.preferences;function v(D,k){if((k==null?void 0:k.type)==="date"&&_he(D)){const{locale:j,options:$}=k.options,z=new Date(D);return new Date(z.getTime()).toLocaleDateString(j,$)}if((k==null?void 0:k.type)==="number"){const{locale:j,currency:$,options:z}=k.options;return $?new Intl.NumberFormat(j,{style:"currency",currency:$,...z}).format(D):new Intl.NumberFormat(j,z).format(D)}return D}const y=o.map((D,k)=>({accessorKey:D,header:({column:j})=>{var H;const $=j.getIsSorted(),z=k,K=(H=m==null?void 0:m.columnSettings)==null?void 0:H.find(G=>G.columnIdx===z),V=K==null?void 0:K.textAlign,N=K==null?void 0:K.width,W=N?{width:N}:{};return x.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[x.jsxs("div",{className:xe("flex grow cursor-pointer items-center",{"justify-center":V==="center","justify-end":V==="right","justify-start":V==="left"}),style:W,onClick:()=>j.toggleSorting(j.getIsSorted()==="asc"),children:[D,$==="asc"?x.jsx(e4,{className:"ml-2 h-5 w-5"}):$==="desc"?x.jsx(Z5,{className:"ml-2 h-5 w-5"}):null]}),a&&x.jsx(She,{columnName:j.id,columnIndex:k})]})},cell:({cell:j})=>{var W,H;const $=j.getValue(),z=(W=m==null?void 0:m.columnSettings)==null?void 0:W.find(G=>G.columnIdx===k),K=v($,z),V=FC($,(H=z==null?void 0:z.options)==null?void 0:H.colorRanges),N=z==null?void 0:z.textAlign;return z!=null&&z.width&&z.width,x.jsx("p",{className:xe("overflow-auto px-2 py-1",{"text-center":N==="center","text-right":N==="right","text-left":N==="left"}),style:{backgroundColor:V},children:K})}})),b=EF({data:e,columns:y,getCoreRowModel:SF(),getPaginationRowModel:CF(),onSortingChange:r,getSortedRowModel:_F(),manualPagination:!0,state:{sorting:n}}),S=b.getSelectedRowModel().rows;P.useEffect(()=>{if(S.length===0){if(l){const D=t.id;h(D),p(t)}return}if(c){const{dimensionKeys:D}=nr(e),k=c.map(j=>{const $=D==null?void 0:D[j.columnIndex],z=S.map(V=>V.getValue($));return{filterId:t.id+"-"+$,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:$,expression:j.expression,valueType:Av(z[0]===void 0?"":z[0]),operation:"in",values:z}});u(k),d(t)}},[d,u,t,e,l,c,h,p,S]);function _(D){D.toggleSelected()}return x.jsxs(kE,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius,borderTopLeftRadius:(T=s==null?void 0:s.chart)==null?void 0:T.options.borderRadius},onMouseDown:D=>D.stopPropagation(),children:[x.jsx(IE,{children:b.getHeaderGroups().map(D=>x.jsx(ih,{children:D.headers.map((k,j)=>{var $,z,K,V,N,W,H;return x.jsx(LE,{style:{backgroundColor:(K=(z=($=s==null?void 0:s.chart)==null?void 0:$.dataset)==null?void 0:z.backgroundColor)==null?void 0:K[0],color:Xu((W=(N=(V=s==null?void 0:s.chart)==null?void 0:V.dataset)==null?void 0:N.backgroundColor)==null?void 0:W[0])},className:xe("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":j>0&&j<D.headers.length-1,"border-l":j===1&&D.headers.length==2},(H=s==null?void 0:s.table)==null?void 0:H.tableHeaderColor),children:k.isPlaceholder?null:GS(k.column.columnDef.header,k.getContext())},k.id)})},D.id))}),x.jsx(NE,{children:(A=b.getRowModel().rows)!=null&&A.length?b.getRowModel().rows.map((D,k)=>x.jsx(ih,{onClick:()=>_(D),className:xe("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":D.getIsSelected()&&"selected",children:D.getVisibleCells().map((j,$)=>{var N,W;const z=(N=m==null?void 0:m.columnSettings)==null?void 0:N.find(H=>H.columnIdx===$),K=z==null?void 0:z.width,V=K?{maxWidth:K}:{};return x.jsx("td",{style:V,onClick:H=>{var te;const G=((te=window==null?void 0:window.getSelection())==null?void 0:te.toString())||"";(G==null?void 0:G.length)>0&&H.stopPropagation()},className:xe("",{"border-x":$>0&&$<y.length-1||$===1&&y.length==2,"border-l":$==0,"border-r":$===y.length-1,"border-b":k===((W=b.getRowModel().rows)==null?void 0:W.length)-1}),children:GS(j.column.columnDef.cell,j.getContext())},j.id)})},D.id)):x.jsx(ih,{children:x.jsx(FE,{colSpan:y.length,className:"p-1 text-center",children:"No results."})})})]})}async function Che(e,t){const n=`${e}/index.js`,r=`${e}/style.css`;return document.querySelector(`link[href="${r}"]`)||await new Promise((i,s)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=r,a.onload=()=>i(void 0),a.onerror=()=>s(new Error("Failed to load CSS")),document.head.appendChild(a)}),{default:(await import(n))[t]}}async function Ehe(e){try{const t=await import(e),n=Object.keys(t),r=[];return n.forEach(o=>{typeof t[o]=="function"&&(o==null?void 0:o[0])===(o==null?void 0:o[0].toUpperCase())&&r.push({name:o,component:o})}),r}catch(t){return console.error("Error loading the library:",t),[]}}async function F6(e){try{const t=await fetch(`${e}/manifest.json`);if(!t.ok)throw new Error(`Failed to fetch manifest: ${t.statusText}`);return await t.json()}catch(t){throw console.error("Error loading manifest:",t),t}}const j6=e=>{const[t,n]=P.useState([]),[r,o]=P.useState(!1),[i,s]=P.useState(null);P.useEffect(()=>{window.React=P,window.ReactDOM=wr,o(!0)},[]),P.useEffect(()=>{e&&r&&F6(e).then(c=>{n(c.visuals),s(c)}).catch(()=>{Ehe(e).then(c=>{console.log("componentNames",c),n(c)}).catch(c=>{console.error("Error loading manifest:",c)})})},[e,r]);const a=P.useMemo(()=>(t==null?void 0:t.map(c=>{const{name:u,component:d,dataInputs:h}=c;return{name:u,componentName:d,Component:P.lazy(()=>Che(e,d)),type:h&&h.length>1?"multiple":"single"}}))||[],[t,e]);function l(c){const u=a==null?void 0:a.find(d=>d.name===c);return u?u.Component:null}return{getCard:l,components:a,manifest:i}};function Rhe({onLoadingStatus:e,card:t}){const{isFetching:n,isLoading:r}=mE(t);return P.useEffect(()=>{e==null||e(r)},[n,r,e]),x.jsx(x.Fragment,{})}function Phe({card:e,frame:t}){var y,b,S,_,C,E,T,A,D;const{authToken:n}=ko(),r=sN(n==null?void 0:n.accessToken),o=we(k=>k.themeStyle),i={colors:((b=(y=o==null?void 0:o.chart)==null?void 0:y.dataset)==null?void 0:b.backgroundColor)||[]},[s,a]=P.useState(!1),{getCard:l}=j6(((S=e.customCardPreferences)==null?void 0:S.url)||""),c=((_=e.customCardPreferences)==null?void 0:_.visualType)||"single",u=(C=e.customCardPreferences)==null?void 0:C.componentName,{data:d}=tb(e);if(!u)return null;const h=l(u),p=k=>{console.log("data",k),e.customCardPreferences},m=Object.keys(((E=e.customCardPreferences)==null?void 0:E.dataInputCardIds)||{}).map(k=>{var z,K,V;const j=(K=(z=e.customCardPreferences)==null?void 0:z.dataInputCardIds)==null?void 0:K[k].cardId,$=(V=t==null?void 0:t.cards)==null?void 0:V.find(N=>N.id===j);return $||null});function v(k){a(k)}return x.jsx("div",{className:"semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto",children:x.jsxs(P.Suspense,{fallback:x.jsx(x.Fragment,{}),children:[h&&c==="single"&&x.jsx(h,{params:r,theme:i,settings:(T=e.customCardPreferences)==null?void 0:T.settings,onDataChange:p,data:(d==null?void 0:d.records)||[]}),h&&c==="multiple"&&x.jsxs(x.Fragment,{children:[Object.keys(((A=e.customCardPreferences)==null?void 0:A.dataInputCardIds)||{}).map(k=>{var z,K,V;const j=(K=(z=e.customCardPreferences)==null?void 0:z.dataInputCardIds)==null?void 0:K[k].cardId,$=(V=t==null?void 0:t.cards)==null?void 0:V.find(N=>N.id===j);return $?x.jsx(Rhe,{onLoadingStatus:v,onDataChange:p,dataInputIndex:k,card:$},$.id):null}),c==="multiple"&&x.jsx("div",{className:xe("flex flex-col gap-2",{"opacity-50":s}),children:x.jsx(h,{params:r,theme:i,onDataChange:p,settings:m.map(k=>{var j;return(j=k==null?void 0:k.customCardPreferences)==null?void 0:j.settings}),data:m.map(k=>(k==null?void 0:k.data)||[])})})]})]},(D=e.customCardPreferences)==null?void 0:D.componentName)})}/*!
315
+ * chartjs-plugin-datalabels v2.2.0
316
+ * https://chartjs-plugin-datalabels.netlify.app
317
+ * (c) 2017-2022 chartjs-plugin-datalabels contributors
318
+ * Released under the MIT license
319
+ */var BD=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}(),ah={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
320
+ `)):Array.isArray(n)?e.push.apply(e,n):Ot(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*BD)/BD}};function _1(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 Ohe(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 The=0,$6=1,z6=2,B6=4,H6=8;function Im(e,t,n){var r=The;return e<n.left?r|=$6:e>n.right&&(r|=z6),t<n.top?r|=H6:t>n.bottom&&(r|=B6),r}function Mhe(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=Im(n,r,t),a=Im(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&H6?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&B6?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&z6?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&$6&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=Im(n,r,t)):(o=c,i=u,a=Im(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function Nm(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=Mhe(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),Ohe(o,i,e.vx,e.vy,t.align)}var Lm={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 Nm({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=_1(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return Nm({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=_1(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)),Nm({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=_1(e,t.origin);return Nm({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)}},$s=ah.rasterize;function Ahe(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 Dhe(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 khe(e){return e instanceof gu?Lm.arc:e instanceof rc?Lm.point:e instanceof oc?Lm.bar:Lm.fallback}function Ihe(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,d=n+o-a;e.moveTo(t,c),l<u&&c<d?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,d,a,0,s),e.arc(l,d,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<d?(e.arc(l,c,a,-Math.PI,0),e.arc(l,d,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 Nhe(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),Ihe(e,$s(t.x)+i/2,$s(t.y)+i/2,$s(t.w)-i,$s(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 Lhe(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 Fhe(e,t,n){var r=e.shadowBlur,o=n.stroked,i=$s(n.x),s=$s(n.y),a=$s(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 jhe(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,d=c&&u,h;if(!(!l||!s&&!d))for(n=Lhe(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),d&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),h=0,l=t.length;h<l;++h)Fhe(e,t[h],{stroked:d,filled:s,w:n.w,x:n.x,y:n.y+n.h*h})}var V6=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};ir(V6.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=Gn(xn([n.font,{}],r,i)),a=xn([n.color,An.color],r,i);return{align:xn([n.align,"center"],r,i),anchor:xn([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:xn([n.backgroundColor,null],r,i),borderColor:xn([n.borderColor,null],r,i),borderRadius:xn([n.borderRadius,0],r,i),borderWidth:xn([n.borderWidth,0],r,i),clamp:xn([n.clamp,!1],r,i),clip:xn([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:xn([n.offset,4],r,i),opacity:xn([n.opacity,1],r,i),origin:Dhe(o._el,r),padding:hr(xn([n.padding,4],r,i)),positioner:khe(o._el),rotation:xn([n.rotation,0],r,i)*(Math.PI/180),size:ah.textSize(o._ctx,t,s),textAlign:xn([n.textAlign,"start"],r,i),textShadowBlur:xn([n.textShadowBlur,0],r,i),textShadowColor:xn([n.textShadowColor,a],r,i),textStrokeColor:xn([n.textStrokeColor,a],r,i),textStrokeWidth:xn([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=xn([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=st(an(i.formatter,[s,e]),s),l=Ot(a)?[]:ah.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=Ahe(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=ah.bound(0,o.opacity,1),r.translate($s(t.x),$s(t.y)),r.rotate(o.rotation),Nhe(r,i.frame,o),jhe(r,o.lines,i.text,o),r.restore())}});var $he=Number.MIN_SAFE_INTEGER||-9007199254740991,zhe=Number.MAX_SAFE_INTEGER||9007199254740991;function mf(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 HD(e,t){var n=zhe,r=$he,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 Fm(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 W6=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};ir(W6.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=mf(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=[Fm(t[0],t[1]),Fm(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(Fm(n[0],n[1]),Fm(n[0],n[3])),o=0;o<r.length;++o)if(i=HD(t,r[o]),s=HD(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[mf({x:t.x,y:t.y},r,n),mf({x:t.x+t.w,y:t.y},r,n),mf({x:t.x+t.w,y:t.y+t.h},r,n),mf({x:t.x,y:t.y+t.h},r,n)]}});function U6(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)),d=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*d,u*=i*d,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function Bhe(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 Hhe(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=U6(a,r.model(),i),o._box.update(s,i,r.rotation()));return Bhe(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var lh={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 W6,_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&&Hhe(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=U6(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},Vhe=function(e){if(Ot(e))return null;var t=e,n,r,o;if(Dt(e))if(!Ot(e.label))t=e.label;else if(!Ot(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},Whe={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:Vhe,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},Qr="$datalabels",G6="$default";function Uhe(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=ir({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(ir({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return Jt(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||G6]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function e_(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&an(s,[o,r])===!0&&(e[Qr]._dirty=!0,n.update(o)))}}function Ghe(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&e_(e,t.leave,n,o),i&&e_(e,t.enter,r,o))}function qhe(e,t){var n=e[Qr],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=lh.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,Ghe(e,r,o,i,t)}}function Yhe(e,t){var n=e[Qr],r=n._listeners.click,o=r&&lh.lookup(n._labels,t);o&&e_(e,r,o,t)}var Khe={id:"datalabels",defaults:Whe,beforeInit:function(e){e[Qr]={_actives:[]}},beforeUpdate:function(e){var t=e[Qr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Qr],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=Uhe(a,n),c=t.meta.data||[],u=e.ctx,d,h,p,m,v,y,b,S;for(u.save(),d=0,p=c.length;d<p;++d)if(b=c[d],b[Qr]=[],s&&b&&e.getDataVisibility(d)&&!b.skip)for(h=0,m=l.labels.length;h<m;++h)v=l.labels[h],y=v._key,S=new V6(v,u,b,d),S.$groups={_set:r,_key:y||G6},S.$context={active:!1,chart:e,dataIndex:d,dataset:a,datasetIndex:r},S.update(S.$context),b[Qr].push(S),i.push(S);u.restore(),ir(o._listeners,l.listeners,{merger:function(_,C,E){C[_]=C[_]||{},C[_][t.index]=E[_],o._listened=!0}})},afterUpdate:function(e){e[Qr]._labels=lh.prepare(e[Qr]._datasets)},afterDatasetsDraw:function(e){lh.draw(e,e[Qr]._labels)},beforeEvent:function(e,t){if(e[Qr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":qhe(e,n);break;case"click":Yhe(e,n);break}}},afterEvent:function(e){var t=e[Qr],n=t._actives,r=t._actives=e.getActiveElements(),o=ah.arrayDiff(n,r),i,s,a,l,c,u,d;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(d=c[0].element[Qr]||[],a=0,l=d.length;a<l;++a)u=d[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(lh.update(t._labels),e.render()),delete t._dirty}};Mn.register(...Fie);Mn.register(Khe);Mn.register(rc);Mn.register(Cd);Mn.register(Ed);Mn.register(Vs);Mn.register(kc);Mn.register(Ua);Mn.register(Ga);Mn.register(N0);Mn.register(mL);function UE({cfg:e,onDatapointClick:t}){var d;const[n,r]=P.useState(""),o=we(h=>h.selectedLensId),i=P.useRef(null),[s,a]=P.useState(),l=we(h=>h.themeStyle);function c(h,p){var v,y;if((((v=h.data.datasets)==null?void 0:v.filter(b=>!!b.fill))||[]).length>0){const b=(y=h==null?void 0:h.data.datasets)==null?void 0:y.map(_=>({..._,backgroundColor:[_.backgroundColor].map(C=>{const E=p.createLinearGradient(0,0,0,400);return E.addColorStop(0,C),E.addColorStop(.7,m4("--semaphor-background")),E})}));return{...h,data:{...h.data,datasets:b}}}return h}P.useEffect(()=>{if(i.current){const h=window.getComputedStyle(i.current);r(h.fontFamily)}},[]),P.useEffect(()=>{var m,v,y,b;if(!n)return;(v=(m=l==null?void 0:l.chart)==null?void 0:m.font)!=null&&v.family&&(Mn.defaults.font={...Mn.defaults.font,...(y=l==null?void 0:l.chart)==null?void 0:y.font,family:n}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const h=(b=i==null?void 0:i.current)==null?void 0:b.getContext("2d");if(!h)return;let p;try{const S=c(e,h);p=new Mn(h,S),a(p)}catch(S){console.log("error creating chart",S)}return()=>{p&&p.destroy()}},[(d=l==null?void 0:l.chart)==null?void 0:d.font,o,n]);function u(h){var m,v;if(!s)return;const p=s==null?void 0:s.getElementsAtEventForMode(h,"nearest",{intersect:!0},!0);if(p&&p.length>0){const y=p[0].datasetIndex,b=p[0].index,S=(v=(m=p[0].element)==null?void 0:m.$context)==null?void 0:v.raw;t==null||t(s,y,b,S)}}return x.jsx("div",{onClick:u,className:"relative h-[99%]",children:x.jsx("canvas",{ref:i})})}function Xhe(e,t){return R.useReducer((n,r)=>t[n][r]??n,e)}var GE="ScrollArea",[q6,HOe]=Jn(GE),[Qhe,ni]=q6(GE),qE=R.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=R.useState(null),[c,u]=R.useState(null),[d,h]=R.useState(null),[p,m]=R.useState(null),[v,y]=R.useState(null),[b,S]=R.useState(0),[_,C]=R.useState(0),[E,T]=R.useState(!1),[A,D]=R.useState(!1),k=at(t,$=>l($)),j=Mc(o);return x.jsx(Qhe,{scope:n,type:r,dir:j,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:h,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:E,onScrollbarXEnabledChange:T,scrollbarY:v,onScrollbarYChange:y,scrollbarYEnabled:A,onScrollbarYEnabledChange:D,onCornerWidthChange:S,onCornerHeightChange:C,children:x.jsx(Be.div,{dir:j,...s,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});qE.displayName=GE;var Y6="ScrollAreaViewport",K6=R.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=ni(Y6,n),a=R.useRef(null),l=at(t,a,s.onViewportChange);return x.jsxs(x.Fragment,{children:[x.jsx("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}"},nonce:o}),x.jsx(Be.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:x.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});K6.displayName=Y6;var us="ScrollAreaScrollbar",YE=R.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ni(us,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return R.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?x.jsx(Jhe,{...r,ref:t,forceMount:n}):o.type==="scroll"?x.jsx(Zhe,{...r,ref:t,forceMount:n}):o.type==="auto"?x.jsx(X6,{...r,ref:t,forceMount:n}):o.type==="always"?x.jsx(KE,{...r,ref:t}):null});YE.displayName=us;var Jhe=R.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ni(us,e.__scopeScrollArea),[i,s]=R.useState(!1);return R.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]),x.jsx(Yn,{present:n||i,children:x.jsx(X6,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Zhe=R.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ni(us,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Ab(()=>l("SCROLL_END"),100),[a,l]=Xhe("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 R.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),R.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const h=()=>{const p=c[u];d!==p&&(l("SCROLL"),s()),d=p};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[o.viewport,i,l,s]),x.jsx(Yn,{present:n||a!=="hidden",children:x.jsx(KE,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Te(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),X6=R.forwardRef((e,t)=>{const n=ni(us,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=R.useState(!1),a=e.orientation==="horizontal",l=Ab(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return hd(n.viewport,l),hd(n.content,l),x.jsx(Yn,{present:r||i,children:x.jsx(KE,{"data-state":i?"visible":"hidden",...o,ref:t})})}),KE=R.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ni(us,e.__scopeScrollArea),i=R.useRef(null),s=R.useRef(0),[a,l]=R.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=t8(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 d(h,p){return ipe(h,s.current,a,p)}return n==="horizontal"?x.jsx(epe,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,p=VD(h,a,o.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=d(h,o.dir))}}):n==="vertical"?x.jsx(tpe,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,p=VD(h,a);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=d(h))}}):null}),epe=R.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ni(us,e.__scopeScrollArea),[s,a]=R.useState(),l=R.useRef(null),c=at(t,l,i.onScrollbarXChange);return R.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),x.jsx(J6,{"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":Mb(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const h=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),r8(h,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:av(s.paddingLeft),paddingEnd:av(s.paddingRight)}})}})}),tpe=R.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ni(us,e.__scopeScrollArea),[s,a]=R.useState(),l=R.useRef(null),c=at(t,l,i.onScrollbarYChange);return R.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),x.jsx(J6,{"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":Mb(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const h=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),r8(h,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:av(s.paddingTop),paddingEnd:av(s.paddingBottom)}})}})}),[npe,Q6]=q6(us),J6=R.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...h}=e,p=ni(us,n),[m,v]=R.useState(null),y=at(t,k=>v(k)),b=R.useRef(null),S=R.useRef(""),_=p.viewport,C=r.content-r.viewport,E=Qn(u),T=Qn(l),A=Ab(d,10);function D(k){if(b.current){const j=k.clientX-b.current.left,$=k.clientY-b.current.top;c({x:j,y:$})}}return R.useEffect(()=>{const k=j=>{const $=j.target;(m==null?void 0:m.contains($))&&E(j,C)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[_,m,C,E]),R.useEffect(T,[r,T]),hd(m,A),hd(p.content,A),x.jsx(npe,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:Qn(i),onThumbPointerUp:Qn(s),onThumbPositionChange:T,onThumbPointerDown:Qn(a),children:x.jsx(Be.div,{...h,ref:y,style:{position:"absolute",...h.style},onPointerDown:Te(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),b.current=m.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),D(k))}),onPointerMove:Te(e.onPointerMove,D),onPointerUp:Te(e.onPointerUp,k=>{const j=k.target;j.hasPointerCapture(k.pointerId)&&j.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=S.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),sv="ScrollAreaThumb",Z6=R.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Q6(sv,e.__scopeScrollArea);return x.jsx(Yn,{present:n||o.hasThumb,children:x.jsx(rpe,{ref:t,...r})})}),rpe=R.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ni(sv,n),s=Q6(sv,n),{onThumbPositionChange:a}=s,l=at(t,d=>s.onThumbChange(d)),c=R.useRef(void 0),u=Ab(()=>{c.current&&(c.current(),c.current=void 0)},100);return R.useEffect(()=>{const d=i.viewport;if(d){const h=()=>{if(u(),!c.current){const p=spe(d,a);c.current=p,a()}};return a(),d.addEventListener("scroll",h),()=>d.removeEventListener("scroll",h)}},[i.viewport,u,a]),x.jsx(Be.div,{"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:Te(e.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),m=d.clientX-p.left,v=d.clientY-p.top;s.onThumbPointerDown({x:m,y:v})}),onPointerUp:Te(e.onPointerUp,s.onThumbPointerUp)})});Z6.displayName=sv;var XE="ScrollAreaCorner",e8=R.forwardRef((e,t)=>{const n=ni(XE,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?x.jsx(ope,{...e,ref:t}):null});e8.displayName=XE;var ope=R.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ni(XE,n),[i,s]=R.useState(0),[a,l]=R.useState(0),c=!!(i&&a);return hd(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),hd(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),c?x.jsx(Be.div,{...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 av(e){return e?parseInt(e,10):0}function t8(e,t){const n=e/t;return isNaN(n)?0:n}function Mb(e){const t=t8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ipe(e,t,n,r="ltr"){const o=Mb(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,d=r==="ltr"?[0,u]:[u*-1,0];return n8([l,c],d)(e)}function VD(e,t,n="ltr"){const r=Mb(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=qS(e,l);return n8([0,s],[0,a])(c)}function n8(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 r8(e,t){return e>0&&e<t}var spe=(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 Ab(e,t){const n=Qn(e),r=R.useRef(0);return R.useEffect(()=>()=>window.clearTimeout(r.current),[]),R.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hd(e,t){const n=Qn(t);fr(()=>{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])}var o8=qE,ape=K6,lpe=e8;const Dh=R.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(o8,{ref:r,className:xe("relative overflow-hidden",e),...n,children:[x.jsx(ape,{className:"h-full w-full rounded-[inherit]",children:t}),x.jsx(Db,{}),x.jsx(lpe,{})]}));Dh.displayName=o8.displayName;const Db=R.forwardRef(({className:e,orientation:t="vertical",...n},r)=>x.jsx(YE,{ref:r,orientation:t,className:xe("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:x.jsx(Z6,{className:"relative flex-1 rounded-full bg-border"})}));Db.displayName=YE.displayName;function cpe({card:e,frame:t}){var K,V,N;const{customCards:n}=ko();P.useRef(null);const r=we(W=>W.themeStyle),o=we(W=>W.selectedSheetId),i=we(W=>W.isDashboardEditing),s=we(W=>W.selectedLensId),a=we(W=>W.dashboard.filters),l=a==null?void 0:a.find(W=>W.id===t.filterId),{setCardTitle:c,setCardDescription:u,setSelectedFrameId:d,updateFilter:h}=dr(),{updateFrame:p}=dr(),m=((K=e.customCardPreferences)==null?void 0:K.showCardHeader)??!0,{isError:v,isLoading:y,isFetching:b,cfg:S,visualKey:_,data:C,handleDatapointClick:E}=mE(e);function T(){var W;if(n&&n.length>0){const H=n.find(G=>G.cardId===e.id);if(H&&H.replaceDefault){const G=H.content;if(G)return x.jsx(G,{card:e})}}return e.type==="kpi"?x.jsx(m3,{card:e,data:(C==null?void 0:C.records)||[]}):e.type==="text"&&((W=t==null?void 0:t.cards)==null?void 0:W.length)===1?x.jsx(Dh,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:x.jsx(zS,{isLoading:y||b,card:e,data:(C==null?void 0:C.records)||[]})}):z}function A(){return["{{ filters | where }}","{{ filters | and }}"].some(H=>{var G;return(G=e.sql)==null?void 0:G.includes(H)})?x.jsx(Uue,{}):null}function D(){if(v)return x.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(e.type==="table"&&(C!=null&&C.records)&&(C==null?void 0:C.records.length)>0)return x.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:x.jsx(L6,{card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="text")return x.jsx(Dh,{className:"overflow-y-auto break-words pr-2",children:x.jsx(zS,{isLoading:y||b,card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="custom")return x.jsx(Phe,{frame:t,card:e});if(n&&n.length>0){const W=n.find(H=>H.cardId===e.id);if(W&&W.content){const H=W.content;return x.jsx(H,{card:e})}}if(S)return x.jsx(UE,{cfg:S,onDatapointClick:E},`${_}-${s}`)}function k(){if(n&&n.length>0){const W=n.find(H=>H.cardId===e.id);if(W&&W.footer){const H=W.footer;if(H)return x.jsx(H,{card:e})}}return null}function j(){var W,H,G;return x.jsx(iC,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:te=>{const F={...t,activeCardId:te};p(o,F)},children:x.jsx(Fv,{style:{borderRadius:(H=(W=r==null?void 0:r.chart)==null?void 0:W.options)==null?void 0:H.borderRadius},className:"flex-end flex-wrap items-center",children:(G=t.cards.filter(te=>{var F;return!((F=te.tabTitle)!=null&&F.endsWith("__Header"))&&(te.displayTab===!0||te.displayTab===void 0)}))==null?void 0:G.map(te=>{var F,Y;return x.jsx(jv,{style:{borderRadius:(Y=(F=r==null?void 0:r.chart)==null?void 0:F.options)==null?void 0:Y.borderRadius},value:te.id,children:te.tabTitle||te.title},te.id)})})})}function $(){let W=t.cards.find(H=>H.type==="kpi"&&H.tabTitle===`${e.tabTitle}__Header`);return W||(W=t.cards.find(H=>H.type==="kpi"&&H.tabTitle==="All__Header")),W?x.jsx("div",{className:"flex items-end gap-2",children:x.jsx(tue,{renderFilterInfo:A,card:W})}):x.jsxs(x.Fragment,{children:[x.jsxs("div",{role:"card-title-container",className:"flex items-center gap-2",children:[x.jsx(Qi,{text:e.title,onSave:H=>c(o,e.id,H),children:x.jsx(yd,{className:xe("text-base",{}),children:e.title})}),(i||e.info)&&x.jsx(X3,{card:e}),e.refreshInterval&&x.jsxs(oF,{children:[x.jsx(iF,{className:"pr-1",children:x.jsx("div",{className:xe("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":y||b})})}),x.jsx(AE,{side:"right",align:"center",children:x.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),A()]}),x.jsx("div",{role:"card-description-container",children:x.jsx(Qi,{text:(e==null?void 0:e.description)||"",onSave:H=>u(o,e.id,H),children:x.jsxs(Z_,{className:xe("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const z=x.jsxs(x.Fragment,{children:[m?x.jsx(Dv,{children:x.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[x.jsx("div",{className:"grow",role:"header-container",children:$()}),x.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.cards.length>1&&j(),x.jsx("div",{children:l&&x.jsxs("div",{style:{borderRadius:(N=(V=r==null?void 0:r.chart)==null?void 0:V.options)==null?void 0:N.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[!bd.includes(l.dataType)&&x.jsx(Qi,{className:"my-1",containerClassName:"shrink-0",text:l.title||l.column,onSave:W=>h({...l,title:W}),children:x.jsx(Tn,{className:"px-3",children:l.title})}),RR(l)]})})]})]})}):x.jsx("div",{className:"h-8"}),x.jsx(kv,{className:"relative flex min-h-0 grow flex-col",children:D()}),x.jsx(zN,{children:k()})]});return x.jsx("div",{className:xe("flex h-full flex-col",{"animate-pulse":y||b}),children:T()})}function upe({frame:e,footer:t,className:n,...r}){var v,y;const o=P.useRef(null),i=we(b=>b.themeStyle),s=we(b=>b.selectedFrameId),a=we(b=>b.isDashboardEditing),{setSelectedFrameId:l}=dr(),{setSelectedConnectionId:c,setSelectedDatabaseName:u,setSelectedSchemaName:d,setSelectedTableName:h}=Qv(),p=e.cards.find(b=>b.id===e.activeCardId);xee(e,o);function m(b){b.stopPropagation(),l(e.id),p!=null&&p.connectionId&&c(p==null?void 0:p.connectionId),p!=null&&p.lastSelectedDatabase&&u(p==null?void 0:p.lastSelectedDatabase),p!=null&&p.lastSelectedSchema&&d(p==null?void 0:p.lastSelectedSchema),p!=null&&p.lastSelectedTable&&h(p==null?void 0:p.lastSelectedTable)}return x.jsx(eb,{FallbackComponent:LC,children:x.jsxs("div",{tabIndex:-1,ref:o,role:"card-frame",onClick:m,style:{borderRadius:(y=(v=i==null?void 0:i.chart)==null?void 0:v.options)==null?void 0:y.borderRadius},className:xe("relative flex h-full flex-col rounded-sm border bg-background shadow-sm",{"border-dashed border-foreground/50":s===e.id&&a},i==null?void 0:i.dashboardCard,n,"semaphor-card-frame"),...r,children:[x.jsx(p4,{frame:e}),x.jsx(cpe,{card:p,frame:e},p.id)]})})}function Bt(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 Do(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Fr(e,t){const n=Bt(e);return isNaN(t)?Do(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Ci(e,t){const n=Bt(e);if(isNaN(t))return Do(e,NaN);if(!t)return n;const r=n.getDate(),o=Do(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 QE=6048e5,dpe=864e5;let fpe={};function zp(){return fpe}function ns(e,t){var a,l,c,u;const n=zp(),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=Bt(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 Sc(e){return ns(e,{weekStartsOn:1})}function i8(e){const t=Bt(e),n=t.getFullYear(),r=Do(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Sc(r),i=Do(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=Sc(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function pd(e){const t=Bt(e);return t.setHours(0,0,0,0),t}function lv(e){const t=Bt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Yi(e,t){const n=pd(e),r=pd(t),o=+n-lv(n),i=+r-lv(r);return Math.round((o-i)/dpe)}function hpe(e){const t=i8(e),n=Do(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Sc(n)}function t_(e,t){const n=t*7;return Fr(e,n)}function ppe(e,t){return Ci(e,t*12)}function gpe(e){let t;return e.forEach(function(n){const r=Bt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function mpe(e){let t;return e.forEach(n=>{const r=Bt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function ro(e,t){const n=pd(e),r=pd(t);return+n==+r}function JE(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function vpe(e){if(!JE(e)&&typeof e!="number")return!1;const t=Bt(e);return!isNaN(Number(t))}function kh(e,t){const n=Bt(e),r=Bt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function bpe(e,t,n){const r=ns(e,n),o=ns(t,n),i=+r-lv(r),s=+o-lv(o);return Math.round((i-s)/QE)}function ZE(e){const t=Bt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function io(e){const t=Bt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function s8(e){const t=Bt(e),n=Do(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function eR(e,t){var a,l,c,u;const n=zp(),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=Bt(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 a8(e){return eR(e,{weekStartsOn:1})}const ype={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"}},xpe=(e,t,n)=>{let r;const o=ype[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 C1(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const wpe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Spe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_pe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cpe={date:C1({formats:wpe,defaultWidth:"full"}),time:C1({formats:Spe,defaultWidth:"full"}),dateTime:C1({formats:_pe,defaultWidth:"full"})},Epe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rpe=(e,t,n,r)=>Epe[e];function vf(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 Ppe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ope={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Tpe={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"]},Mpe={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"]},Ape={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"}},Dpe={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"}},kpe=(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"},Ipe={ordinalNumber:kpe,era:vf({values:Ppe,defaultWidth:"wide"}),quarter:vf({values:Ope,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vf({values:Tpe,defaultWidth:"wide"}),day:vf({values:Mpe,defaultWidth:"wide"}),dayPeriod:vf({values:Ape,defaultWidth:"wide",formattingValues:Dpe,defaultFormattingWidth:"wide"})};function bf(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)?Lpe(a,d=>d.test(s)):Npe(a,d=>d.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 Npe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Lpe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Fpe(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 jpe=/^(\d+)(th|st|nd|rd)?/i,$pe=/\d+/i,zpe={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},Bpe={any:[/^b/i,/^(a|c)/i]},Hpe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vpe={any:[/1/i,/2/i,/3/i,/4/i]},Wpe={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},Upe={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]},Gpe={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},qpe={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]},Ype={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},Kpe={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}},Xpe={ordinalNumber:Fpe({matchPattern:jpe,parsePattern:$pe,valueCallback:e=>parseInt(e,10)}),era:bf({matchPatterns:zpe,defaultMatchWidth:"wide",parsePatterns:Bpe,defaultParseWidth:"any"}),quarter:bf({matchPatterns:Hpe,defaultMatchWidth:"wide",parsePatterns:Vpe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:bf({matchPatterns:Wpe,defaultMatchWidth:"wide",parsePatterns:Upe,defaultParseWidth:"any"}),day:bf({matchPatterns:Gpe,defaultMatchWidth:"wide",parsePatterns:qpe,defaultParseWidth:"any"}),dayPeriod:bf({matchPatterns:Ype,defaultMatchWidth:"any",parsePatterns:Kpe,defaultParseWidth:"any"})},l8={code:"en-US",formatDistance:xpe,formatLong:Cpe,formatRelative:Rpe,localize:Ipe,match:Xpe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Qpe(e){const t=Bt(e);return Yi(t,s8(t))+1}function c8(e){const t=Bt(e),n=+Sc(t)-+hpe(t);return Math.round(n/QE)+1}function u8(e,t){var u,d,h,p;const n=Bt(e),r=n.getFullYear(),o=zp(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=Do(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=ns(s,t),l=Do(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=ns(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Jpe(e,t){var a,l,c,u;const n=zp(),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=u8(e,t),i=Do(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),ns(i,t)}function d8(e,t){const n=Bt(e),r=+ns(n,t)-+Jpe(n,t);return Math.round(r/QE)+1}function tn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const pa={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return tn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):tn(n+1,2)},d(e,t){return tn(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 tn(e.getHours()%12||12,t.length)},H(e,t){return tn(e.getHours(),t.length)},m(e,t){return tn(e.getMinutes(),t.length)},s(e,t){return tn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return tn(o,t.length)}},su={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},WD={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 pa.y(e,t)},Y:function(e,t,n,r){const o=u8(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return tn(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):tn(i,t.length)},R:function(e,t){const n=i8(e);return tn(n,t.length)},u:function(e,t){const n=e.getFullYear();return tn(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 tn(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 tn(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 pa.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 tn(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=d8(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):tn(o,t.length)},I:function(e,t,n){const r=c8(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):tn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):pa.d(e,t)},D:function(e,t,n){const r=Qpe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):tn(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 tn(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 tn(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 tn(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=su.noon:r===0?o=su.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=su.evening:r>=12?o=su.afternoon:r>=4?o=su.morning:o=su.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 pa.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):pa.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):tn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):tn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):pa.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):pa.s(e,t)},S:function(e,t){return pa.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return GD(r);case"XXXX":case"XX":return Tl(r);case"XXXXX":case"XXX":default:return Tl(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return GD(r);case"xxxx":case"xx":return Tl(r);case"xxxxx":case"xxx":default:return Tl(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+UD(r,":");case"OOOO":default:return"GMT"+Tl(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+UD(r,":");case"zzzz":default:return"GMT"+Tl(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return tn(r,t.length)},T:function(e,t,n){const r=e.getTime();return tn(r,t.length)}};function UD(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+tn(i,2)}function GD(e,t){return e%60===0?(e>0?"-":"+")+tn(Math.abs(e)/60,2):Tl(e,t)}function Tl(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=tn(Math.trunc(r/60),2),i=tn(r%60,2);return n+o+t+i}const qD=(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"})}},f8=(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"})}},Zpe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return qD(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}}",qD(r,t)).replace("{{time}}",f8(o,t))},ege={p:f8,P:Zpe},tge=/^D+$/,nge=/^Y+$/,rge=["D","DD","YY","YYYY"];function oge(e){return tge.test(e)}function ige(e){return nge.test(e)}function sge(e,t,n){const r=age(e,t,n);if(console.warn(r),rge.includes(e))throw new RangeError(r)}function age(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 lge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cge=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uge=/^'([^]*?)'?$/,dge=/''/g,fge=/[a-zA-Z]/;function Ji(e,t,n){var u,d,h,p,m,v,y,b;const r=zp(),o=(n==null?void 0:n.locale)??r.locale??l8,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((v=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((b=(y=r.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??0,a=Bt(e);if(!vpe(a))throw new RangeError("Invalid time value");let l=t.match(cge).map(S=>{const _=S[0];if(_==="p"||_==="P"){const C=ege[_];return C(S,o.formatLong)}return S}).join("").match(lge).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const _=S[0];if(_==="'")return{isToken:!1,value:hge(S)};if(WD[_])return{isToken:!0,value:S};if(_.match(fge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:S}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(S=>{if(!S.isToken)return S.value;const _=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&ige(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&oge(_))&&sge(_,t,String(e));const C=WD[_[0]];return C(a,_,o.localize,c)}).join("")}function hge(e){const t=e.match(uge);return t?t[1].replace(dge,"'"):e}function pge(e){const t=Bt(e),n=t.getFullYear(),r=t.getMonth(),o=Do(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function gge(e){return Math.trunc(+Bt(e)/1e3)}function mge(e){const t=Bt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function vge(e,t){return bpe(mge(e),io(e),t)+1}function n_(e,t){const n=Bt(e),r=Bt(t);return n.getTime()>r.getTime()}function h8(e,t){const n=Bt(e),r=Bt(t);return+n<+r}function tR(e,t){const n=Bt(e),r=Bt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function bge(e,t){const n=Bt(e),r=Bt(t);return n.getFullYear()===r.getFullYear()}function E1(e,t){return Fr(e,-t)}function R1(e,t){const n=Bt(e),r=n.getFullYear(),o=n.getDate(),i=Do(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=pge(i);return n.setMonth(t,Math.min(o,s)),n}function YD(e,t){const n=Bt(e);return isNaN(+n)?Do(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 yge(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 p8(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 r_={exports:{}},yf={};/**
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 KD;function xge(){return KD||(KD=1,process.env.NODE_ENV!=="production"&&function(){var e=P,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"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator";function y(I){if(I===null||typeof I!="object")return null;var se=m&&I[m]||I[v];return typeof se=="function"?se:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(I){{for(var se=arguments.length,fe=new Array(se>1?se-1:0),Oe=1;Oe<se;Oe++)fe[Oe-1]=arguments[Oe];_("error",I,fe)}}function _(I,se,fe){{var Oe=b.ReactDebugCurrentFrame,He=Oe.getStackAddendum();He!==""&&(se+="%s",fe=fe.concat([He]));var Ge=fe.map(function($e){return String($e)});Ge.unshift("Warning: "+se),Function.prototype.apply.call(console[I],console,Ge)}}var C=!1,E=!1,T=!1,A=!1,D=!1,k;k=Symbol.for("react.module.reference");function j(I){return!!(typeof I=="string"||typeof I=="function"||I===r||I===i||D||I===o||I===c||I===u||A||I===p||C||E||T||typeof I=="object"&&I!==null&&(I.$$typeof===h||I.$$typeof===d||I.$$typeof===s||I.$$typeof===a||I.$$typeof===l||I.$$typeof===k||I.getModuleId!==void 0))}function $(I,se,fe){var Oe=I.displayName;if(Oe)return Oe;var He=se.displayName||se.name||"";return He!==""?fe+"("+He+")":fe}function z(I){return I.displayName||"Context"}function K(I){if(I==null)return null;if(typeof I.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof I=="function")return I.displayName||I.name||null;if(typeof I=="string")return I;switch(I){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 I=="object")switch(I.$$typeof){case a:var se=I;return z(se)+".Consumer";case s:var fe=I;return z(fe._context)+".Provider";case l:return $(I,I.render,"ForwardRef");case d:var Oe=I.displayName||null;return Oe!==null?Oe:K(I.type)||"Memo";case h:{var He=I,Ge=He._payload,$e=He._init;try{return K($e(Ge))}catch{return null}}}return null}var V=Object.assign,N=0,W,H,G,te,F,Y,q;function M(){}M.__reactDisabledLog=!0;function ne(){{if(N===0){W=console.log,H=console.info,G=console.warn,te=console.error,F=console.group,Y=console.groupCollapsed,q=console.groupEnd;var I={configurable:!0,enumerable:!0,value:M,writable:!0};Object.defineProperties(console,{info:I,log:I,warn:I,error:I,group:I,groupCollapsed:I,groupEnd:I})}N++}}function X(){{if(N--,N===0){var I={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},I,{value:W}),info:V({},I,{value:H}),warn:V({},I,{value:G}),error:V({},I,{value:te}),group:V({},I,{value:F}),groupCollapsed:V({},I,{value:Y}),groupEnd:V({},I,{value:q})})}N<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=b.ReactCurrentDispatcher,ee;function J(I,se,fe){{if(ee===void 0)try{throw Error()}catch(He){var Oe=He.stack.trim().match(/\n( *(at )?)/);ee=Oe&&Oe[1]||""}return`
329
+ `+ee+I}}var le=!1,ce;{var ye=typeof WeakMap=="function"?WeakMap:Map;ce=new ye}function oe(I,se){if(!I||le)return"";{var fe=ce.get(I);if(fe!==void 0)return fe}var Oe;le=!0;var He=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ge;Ge=re.current,re.current=null,ne();try{if(se){var $e=function(){throw Error()};if(Object.defineProperty($e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($e,[])}catch(pt){Oe=pt}Reflect.construct(I,[],$e)}else{try{$e.call()}catch(pt){Oe=pt}I.call($e.prototype)}}else{try{throw Error()}catch(pt){Oe=pt}I()}}catch(pt){if(pt&&Oe&&typeof pt.stack=="string"){for(var Fe=pt.stack.split(`
330
+ `),Ae=Oe.stack.split(`
331
+ `),Z=Fe.length-1,me=Ae.length-1;Z>=1&&me>=0&&Fe[Z]!==Ae[me];)me--;for(;Z>=1&&me>=0;Z--,me--)if(Fe[Z]!==Ae[me]){if(Z!==1||me!==1)do if(Z--,me--,me<0||Fe[Z]!==Ae[me]){var De=`
332
+ `+Fe[Z].replace(" at new "," at ");return I.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",I.displayName)),typeof I=="function"&&ce.set(I,De),De}while(Z>=1&&me>=0);break}}}finally{le=!1,re.current=Ge,X(),Error.prepareStackTrace=He}var lt=I?I.displayName||I.name:"",En=lt?J(lt):"";return typeof I=="function"&&ce.set(I,En),En}function ve(I,se,fe){return oe(I,!1)}function he(I){var se=I.prototype;return!!(se&&se.isReactComponent)}function Ee(I,se,fe){if(I==null)return"";if(typeof I=="function")return oe(I,he(I));if(typeof I=="string")return J(I);switch(I){case c:return J("Suspense");case u:return J("SuspenseList")}if(typeof I=="object")switch(I.$$typeof){case l:return ve(I.render);case d:return Ee(I.type,se,fe);case h:{var Oe=I,He=Oe._payload,Ge=Oe._init;try{return Ee(Ge(He),se,fe)}catch{}}}return""}var ke=Object.prototype.hasOwnProperty,We={},Ie=b.ReactDebugCurrentFrame;function Le(I){if(I){var se=I._owner,fe=Ee(I.type,I._source,se?se.type:null);Ie.setExtraStackFrame(fe)}else Ie.setExtraStackFrame(null)}function dt(I,se,fe,Oe,He){{var Ge=Function.call.bind(ke);for(var $e in I)if(Ge(I,$e)){var Fe=void 0;try{if(typeof I[$e]!="function"){var Ae=Error((Oe||"React class")+": "+fe+" type `"+$e+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof I[$e]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ae.name="Invariant Violation",Ae}Fe=I[$e](se,$e,Oe,fe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Z){Fe=Z}Fe&&!(Fe instanceof Error)&&(Le(He),S("%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",fe,$e,typeof Fe),Le(null)),Fe instanceof Error&&!(Fe.message in We)&&(We[Fe.message]=!0,Le(He),S("Failed %s type: %s",fe,Fe.message),Le(null))}}}var $t=Array.isArray;function rn(I){return $t(I)}function Nt(I){{var se=typeof Symbol=="function"&&Symbol.toStringTag,fe=se&&I[Symbol.toStringTag]||I.constructor.name||"Object";return fe}}function on(I){try{return pe(I),!1}catch{return!0}}function pe(I){return""+I}function Pe(I){if(on(I))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Nt(I)),pe(I)}var ze=b.ReactCurrentOwner,Ye={key:!0,ref:!0,__self:!0,__source:!0},nt,sn,Cn;Cn={};function mn(I){if(ke.call(I,"ref")){var se=Object.getOwnPropertyDescriptor(I,"ref").get;if(se&&se.isReactWarning)return!1}return I.ref!==void 0}function jn(I){if(ke.call(I,"key")){var se=Object.getOwnPropertyDescriptor(I,"key").get;if(se&&se.isReactWarning)return!1}return I.key!==void 0}function vn(I,se){if(typeof I.ref=="string"&&ze.current&&se&&ze.current.stateNode!==se){var fe=K(ze.current.type);Cn[fe]||(S('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',K(ze.current.type),I.ref),Cn[fe]=!0)}}function Ht(I,se){{var fe=function(){nt||(nt=!0,S("%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)",se))};fe.isReactWarning=!0,Object.defineProperty(I,"key",{get:fe,configurable:!0})}}function cn(I,se){{var fe=function(){sn||(sn=!0,S("%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)",se))};fe.isReactWarning=!0,Object.defineProperty(I,"ref",{get:fe,configurable:!0})}}var Pn=function(I,se,fe,Oe,He,Ge,$e){var Fe={$$typeof:t,type:I,key:se,ref:fe,props:$e,_owner:Ge};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 tt(I,se,fe,Oe,He){{var Ge,$e={},Fe=null,Ae=null;fe!==void 0&&(Pe(fe),Fe=""+fe),jn(se)&&(Pe(se.key),Fe=""+se.key),mn(se)&&(Ae=se.ref,vn(se,He));for(Ge in se)ke.call(se,Ge)&&!Ye.hasOwnProperty(Ge)&&($e[Ge]=se[Ge]);if(I&&I.defaultProps){var Z=I.defaultProps;for(Ge in Z)$e[Ge]===void 0&&($e[Ge]=Z[Ge])}if(Fe||Ae){var me=typeof I=="function"?I.displayName||I.name||"Unknown":I;Fe&&Ht($e,me),Ae&&cn($e,me)}return Pn(I,Fe,Ae,He,Oe,ze.current,$e)}}var mt=b.ReactCurrentOwner,kt=b.ReactDebugCurrentFrame;function Zt(I){if(I){var se=I._owner,fe=Ee(I.type,I._source,se?se.type:null);kt.setExtraStackFrame(fe)}else kt.setExtraStackFrame(null)}var wt;wt=!1;function $n(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function oi(){{if(mt.current){var I=K(mt.current.type);if(I)return`
333
+
334
+ Check the render method of \``+I+"`."}return""}}function Qs(I){{if(I!==void 0){var se=I.fileName.replace(/^.*[\\\/]/,""),fe=I.lineNumber;return`
335
+
336
+ Check your code at `+se+":"+fe+"."}return""}}var ii={};function ds(I){{var se=oi();if(!se){var fe=typeof I=="string"?I:I.displayName||I.name;fe&&(se=`
337
+
338
+ Check the top-level render call using <`+fe+">.")}return se}}function Oi(I,se){{if(!I._store||I._store.validated||I.key!=null)return;I._store.validated=!0;var fe=ds(se);if(ii[fe])return;ii[fe]=!0;var Oe="";I&&I._owner&&I._owner!==mt.current&&(Oe=" It was passed a child from "+K(I._owner.type)+"."),Zt(I),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',fe,Oe),Zt(null)}}function fs(I,se){{if(typeof I!="object")return;if(rn(I))for(var fe=0;fe<I.length;fe++){var Oe=I[fe];$n(Oe)&&Oi(Oe,se)}else if($n(I))I._store&&(I._store.validated=!0);else if(I){var He=y(I);if(typeof He=="function"&&He!==I.entries)for(var Ge=He.call(I),$e;!($e=Ge.next()).done;)$n($e.value)&&Oi($e.value,se)}}}function Js(I){{var se=I.type;if(se==null||typeof se=="string")return;var fe;if(typeof se=="function")fe=se.propTypes;else if(typeof se=="object"&&(se.$$typeof===l||se.$$typeof===d))fe=se.propTypes;else return;if(fe){var Oe=K(se);dt(fe,I.props,"prop",Oe,I)}else if(se.PropTypes!==void 0&&!wt){wt=!0;var He=K(se);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof se.getDefaultProps=="function"&&!se.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ti(I){{for(var se=Object.keys(I.props),fe=0;fe<se.length;fe++){var Oe=se[fe];if(Oe!=="children"&&Oe!=="key"){Zt(I),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Zt(null);break}}I.ref!==null&&(Zt(I),S("Invalid attribute `ref` supplied to `React.Fragment`."),Zt(null))}}function hs(I,se,fe,Oe,He,Ge){{var $e=j(I);if(!$e){var Fe="";(I===void 0||typeof I=="object"&&I!==null&&Object.keys(I).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=Qs(He);Ae?Fe+=Ae:Fe+=oi();var Z;I===null?Z="null":rn(I)?Z="array":I!==void 0&&I.$$typeof===t?(Z="<"+(K(I.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):Z=typeof I,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Z,Fe)}var me=tt(I,se,fe,He,Ge);if(me==null)return me;if($e){var De=se.children;if(De!==void 0)if(Oe)if(rn(De)){for(var lt=0;lt<De.length;lt++)fs(De[lt],I);Object.freeze&&Object.freeze(De)}else S("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 fs(De,I)}return I===r?Ti(me):Js(me),me}}function Zn(I,se,fe){return hs(I,se,fe,!0)}function Mi(I,se,fe){return hs(I,se,fe,!1)}var Zs=Mi,ea=Zn;yf.Fragment=r,yf.jsx=Zs,yf.jsxs=ea}()),yf}var xf={};/**
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 XD;function wge(){if(XD)return xf;XD=1;var e=P,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,d={},h=null,p=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:p,props:d,_owner:o.current}}return xf.Fragment=n,xf.jsx=s,xf.jsxs=s,xf}process.env.NODE_ENV==="production"?r_.exports=wge():r_.exports=xge();var Ce=r_.exports;function Bp(e){return e.mode==="multiple"}function Hp(e){return e.mode==="range"}function kb(e){return e.mode==="single"}var Sge={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 _ge(e,t){return Ji(e,"LLLL y",t)}function Cge(e,t){return Ji(e,"d",t)}function Ege(e,t){return Ji(e,"LLLL",t)}function Rge(e){return"".concat(e)}function Pge(e,t){return Ji(e,"cccccc",t)}function Oge(e,t){return Ji(e,"yyyy",t)}var Tge=Object.freeze({__proto__:null,formatCaption:_ge,formatDay:Cge,formatMonthCaption:Ege,formatWeekNumber:Rge,formatWeekdayName:Pge,formatYearCaption:Oge}),Mge=function(e,t,n){return Ji(e,"do MMMM (EEEE)",n)},Age=function(){return"Month: "},Dge=function(){return"Go to next month"},kge=function(){return"Go to previous month"},Ige=function(e,t){return Ji(e,"cccc",t)},Nge=function(e){return"Week n. ".concat(e)},Lge=function(){return"Year: "},Fge=Object.freeze({__proto__:null,labelDay:Mge,labelMonthDropdown:Age,labelNext:Dge,labelPrevious:kge,labelWeekNumber:Nge,labelWeekday:Ige,labelYearDropdown:Lge});function jge(){var e="buttons",t=Sge,n=l8,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:Tge,labels:Fge,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function $ge(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=io(r):t&&(i=new Date(t,0,1)),o?s=ZE(o):n&&(s=new Date(n,11,31)),{fromDate:i?pd(i):void 0,toDate:s?pd(s):void 0}}var g8=P.createContext(void 0);function zge(e){var t,n=e.initialProps,r=jge(),o=$ge(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;(kb(n)||Bp(n)||Hp(n))&&(l=n.onSelect);var c=rt(rt(rt({},r),n),{captionLayout:a,classNames:rt(rt({},r.classNames),n.classNames),components:rt({},n.components),formatters:rt(rt({},r.formatters),n.formatters),fromDate:i,labels:rt(rt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:rt(rt({},r.modifiers),n.modifiers),modifiersClassNames:rt(rt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:rt(rt({},r.styles),n.styles),toDate:s});return Ce.jsx(g8.Provider,{value:c,children:e.children})}function gn(){var e=P.useContext(g8);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function m8(e){var t=gn(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return Ce.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Bge(e){return Ce.jsx("svg",rt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:Ce.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function v8(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=gn(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Bge;return Ce.jsxs("div",{className:a,style:l,children:[Ce.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),Ce.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),Ce.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,Ce.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function Hge(e){var t,n=gn(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return Ce.jsx(Ce.Fragment,{});if(!o)return Ce.jsx(Ce.Fragment,{});var d=[];if(bge(r,o))for(var h=io(r),p=r.getMonth();p<=o.getMonth();p++)d.push(R1(h,p));else for(var h=io(new Date),p=0;p<=11;p++)d.push(R1(h,p));var m=function(y){var b=Number(y.target.value),S=R1(io(e.displayMonth),b);e.onChange(S)},v=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:v8;return Ce.jsx(v,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:m,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:d.map(function(y){return Ce.jsx("option",{value:y.getMonth(),children:a(y,{locale:s})},y.getMonth())})})}function Vge(e){var t,n=e.displayMonth,r=gn(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,h=[];if(!o)return Ce.jsx(Ce.Fragment,{});if(!i)return Ce.jsx(Ce.Fragment,{});for(var p=o.getFullYear(),m=i.getFullYear(),v=p;v<=m;v++)h.push(YD(s8(new Date),v));var y=function(S){var _=YD(io(n),Number(S.target.value));e.onChange(_)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:v8;return Ce.jsx(b,{name:"years","aria-label":d(),className:l.dropdown_year,style:a.dropdown_year,onChange:y,value:n.getFullYear(),caption:u(n,{locale:s}),children:h.map(function(S){return Ce.jsx("option",{value:S.getFullYear(),children:u(S,{locale:s})},S.getFullYear())})})}function Wge(e,t){var n=P.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function Uge(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&&kh(i,o)<0){var c=-1*(l-1);o=Ci(i,c)}return s&&kh(o,s)<0&&(o=s),io(o)}function Gge(){var e=gn(),t=Uge(e),n=Wge(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=io(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function qge(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=io(e),i=io(Ci(o,r)),s=kh(i,o),a=[],l=0;l<s;l++){var c=Ci(o,l);a.push(c)}return n&&(a=a.reverse()),a}function Yge(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=io(e);if(!n)return Ci(a,s);var l=kh(n,e);if(!(l<i))return Ci(a,s)}}function Kge(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=io(e);if(!n)return Ci(a,-s);var l=kh(a,n);if(!(l<=0))return Ci(a,-s)}}var b8=P.createContext(void 0);function Xge(e){var t=gn(),n=Gge(),r=n[0],o=n[1],i=qge(r,t),s=Yge(r,t),a=Kge(r,t),l=function(d){return i.some(function(h){return tR(d,h)})},c=function(d,h){l(d)||(h&&h8(d,h)?o(Ci(d,1+t.numberOfMonths*-1)):o(d))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return Ce.jsx(b8.Provider,{value:u,children:e.children})}function Vp(){var e=P.useContext(b8);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function QD(e){var t,n=gn(),r=n.classNames,o=n.styles,i=n.components,s=Vp().goToMonth,a=function(u){s(Ci(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:m8,c=Ce.jsx(l,{id:e.id,displayMonth:e.displayMonth});return Ce.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[Ce.jsx("div",{className:r.vhidden,children:c}),Ce.jsx(Hge,{onChange:a,displayMonth:e.displayMonth}),Ce.jsx(Vge,{onChange:a,displayMonth:e.displayMonth})]})}function Qge(e){return Ce.jsx("svg",rt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Ce.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Jge(e){return Ce.jsx("svg",rt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Ce.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var cv=P.forwardRef(function(e,t){var n=gn(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=rt(rt({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),Ce.jsx("button",rt({},e,{ref:t,type:"button",className:s,style:a}))});function Zge(e){var t,n,r=gn(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return Ce.jsx(Ce.Fragment,{});var h=c(e.previousMonth,{locale:i}),p=[s.nav_button,s.nav_button_previous].join(" "),m=u(e.nextMonth,{locale:i}),v=[s.nav_button,s.nav_button_next].join(" "),y=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:Jge,b=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:Qge;return Ce.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&Ce.jsx(cv,{name:"previous-month","aria-label":h,className:p,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?Ce.jsx(y,{className:s.nav_icon,style:a.nav_icon}):Ce.jsx(b,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&Ce.jsx(cv,{name:"next-month","aria-label":m,className:v,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?Ce.jsx(b,{className:s.nav_icon,style:a.nav_icon}):Ce.jsx(y,{className:s.nav_icon,style:a.nav_icon})})]})}function JD(e){var t=gn().numberOfMonths,n=Vp(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(m){return tR(e.displayMonth,m)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),h=function(){r&&i(r)},p=function(){o&&i(o)};return Ce.jsx(Zge,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:h,onNextClick:p})}function eme(e){var t,n=gn(),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:m8,c;return o?c=Ce.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=Ce.jsx(QD,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=Ce.jsxs(Ce.Fragment,{children:[Ce.jsx(QD,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),Ce.jsx(JD,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=Ce.jsxs(Ce.Fragment,{children:[Ce.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Ce.jsx(JD,{displayMonth:e.displayMonth,id:e.id})]}),Ce.jsx("div",{className:r.caption,style:i.caption,children:c})}function tme(e){var t=gn(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?Ce.jsx("tfoot",{className:o,style:r.tfoot,children:Ce.jsx("tr",{children:Ce.jsx("td",{colSpan:8,children:n})})}):Ce.jsx(Ce.Fragment,{})}function nme(e,t,n){for(var r=n?Sc(new Date):ns(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=Fr(r,i);o.push(s)}return o}function rme(){var e=gn(),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=nme(o,i,s);return Ce.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&Ce.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return Ce.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:a(u,{locale:o})},d)})]})}function ome(){var e,t=gn(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:rme;return Ce.jsx("thead",{style:r.head,className:n.head,children:Ce.jsx(i,{})})}function ime(e){var t=gn(),n=t.locale,r=t.formatters.formatDay;return Ce.jsx(Ce.Fragment,{children:r(e.date,{locale:n})})}var nR=P.createContext(void 0);function sme(e){if(!Bp(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return Ce.jsx(nR.Provider,{value:t,children:e.children})}return Ce.jsx(ame,{initialProps:e.initialProps,children:e.children})}function ame(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,d){var h,p;(h=t.onDayClick)===null||h===void 0||h.call(t,c,u,d);var m=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!m){var v=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var y=r?p8([],r,!0):[];if(u.selected){var b=y.findIndex(function(S){return ro(c,S)});y.splice(b,1)}else y.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,y,c,u,d)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=i&&r.length>i-1,d=r.some(function(h){return ro(h,c)});return!!(u&&!d)});var l={selected:r,onDayClick:s,modifiers:a};return Ce.jsx(nR.Provider,{value:l,children:n})}function rR(){var e=P.useContext(nR);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function lme(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?ro(o,e)&&ro(r,e)?void 0:ro(o,e)?{from:o,to:void 0}:ro(r,e)?void 0:n_(r,e)?{from:e,to:o}:{from:r,to:e}:o?n_(e,o)?{from:o,to:e}:{from:e,to:o}:r?h8(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var oR=P.createContext(void 0);function cme(e){if(!Hp(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return Ce.jsx(oR.Provider,{value:t,children:e.children})}return Ce.jsx(ume,{initialProps:e.initialProps,children:e.children})}function ume(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(p,m,v){var y,b;(y=t.onDayClick)===null||y===void 0||y.call(t,p,m,v);var S=lme(p,r);(b=t.onSelect)===null||b===void 0||b.call(t,S,p,m,v)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],ro(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:E1(i,a-1),before:Fr(i,a-1)}),i&&s&&u.disabled.push({after:i,before:Fr(i,a-1)}),!i&&s&&u.disabled.push({after:E1(s,a-1),before:Fr(s,a-1)})),l){if(i&&!s&&(u.disabled.push({before:Fr(i,-l+1)}),u.disabled.push({after:Fr(i,l-1)})),i&&s){var d=Yi(s,i)+1,h=l-d;u.disabled.push({before:E1(i,h)}),u.disabled.push({after:Fr(s,h)})}!i&&s&&(u.disabled.push({before:Fr(s,-l+1)}),u.disabled.push({after:Fr(s,l-1)}))}return Ce.jsx(oR.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function iR(){var e=P.useContext(oR);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function f0(e){return Array.isArray(e)?p8([],e,!0):e!==void 0?[e]:[]}function dme(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=f0(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 fme=Ei.Selected,Es=Ei.Disabled,hme=Ei.Hidden,pme=Ei.Today,P1=Ei.RangeEnd,O1=Ei.RangeMiddle,T1=Ei.RangeStart,gme=Ei.Outside;function mme(e,t,n){var r,o=(r={},r[fme]=f0(e.selected),r[Es]=f0(e.disabled),r[hme]=f0(e.hidden),r[pme]=[e.today],r[P1]=[],r[O1]=[],r[T1]=[],r[gme]=[],r);return e.fromDate&&o[Es].push({before:e.fromDate}),e.toDate&&o[Es].push({after:e.toDate}),Bp(e)?o[Es]=o[Es].concat(t.modifiers[Es]):Hp(e)&&(o[Es]=o[Es].concat(n.modifiers[Es]),o[T1]=n.modifiers[T1],o[O1]=n.modifiers[O1],o[P1]=n.modifiers[P1]),o}var y8=P.createContext(void 0);function vme(e){var t=gn(),n=rR(),r=iR(),o=mme(t,n,r),i=dme(t.modifiers),s=rt(rt({},o),i);return Ce.jsx(y8.Provider,{value:s,children:e.children})}function x8(){var e=P.useContext(y8);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function bme(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function yme(e){return!!(e&&typeof e=="object"&&"from"in e)}function xme(e){return!!(e&&typeof e=="object"&&"after"in e)}function wme(e){return!!(e&&typeof e=="object"&&"before"in e)}function Sme(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function _me(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=Yi(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=Yi(e,r)>=0&&Yi(o,e)>=0;return s}return o?ro(o,e):r?ro(r,e):!1}function Cme(e){return JE(e)}function Eme(e){return Array.isArray(e)&&e.every(JE)}function Rme(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Cme(n))return ro(e,n);if(Eme(n))return n.includes(e);if(yme(n))return _me(e,n);if(Sme(n))return n.dayOfWeek.includes(e.getDay());if(bme(n)){var r=Yi(n.before,e),o=Yi(n.after,e),i=r>0,s=o<0,a=n_(n.before,n.after);return a?s&&i:i||s}return xme(n)?Yi(e,n.after)>0:wme(n)?Yi(n.before,e)>0:typeof n=="function"?n(e):!1})}function sR(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return Rme(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!tR(e,n)&&(o.outside=!0),o}function Pme(e,t){for(var n=io(e[0]),r=ZE(e[e.length-1]),o,i,s=n;s<=r;){var a=sR(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Fr(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=Fr(s,1)}return i||o}var Ome=365;function w8(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,d=o.locale,h={day:Fr,week:t_,month:Ci,year:ppe,startOfWeek:function(y){return o.ISOWeek?Sc(y):ns(y,{locale:d,weekStartsOn:l})},endOfWeek:function(y){return o.ISOWeek?a8(y):eR(y,{locale:d,weekStartsOn:l})}},p=h[n](e,r==="after"?1:-1);r==="before"&&c?p=gpe([c,p]):r==="after"&&u&&(p=mpe([u,p]));var m=!0;if(i){var v=sR(p,i);m=!v.disabled&&!v.hidden}return m?p:a.count>Ome?a.lastFocused:w8(p,{moveBy:n,direction:r,context:o,modifiers:i,retry:rt(rt({},a),{count:a.count+1})})}var S8=P.createContext(void 0);function Tme(e){var t=Vp(),n=x8(),r=P.useState(),o=r[0],i=r[1],s=P.useState(),a=s[0],l=s[1],c=Pme(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,d=function(){l(o),i(void 0)},h=function(y){i(y)},p=gn(),m=function(y,b){if(o){var S=w8(o,{moveBy:y,direction:b,context:p,modifiers:n});ro(o,S)||(t.goToDate(S,o),h(S))}},v={focusedDay:o,focusTarget:u,blur:d,focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return Ce.jsx(S8.Provider,{value:v,children:e.children})}function aR(){var e=P.useContext(S8);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Mme(e,t){var n=x8(),r=sR(e,n,t);return r}var lR=P.createContext(void 0);function Ame(e){if(!kb(e.initialProps)){var t={selected:void 0};return Ce.jsx(lR.Provider,{value:t,children:e.children})}return Ce.jsx(Dme,{initialProps:e.initialProps,children:e.children})}function Dme(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return Ce.jsx(lR.Provider,{value:o,children:n})}function _8(){var e=P.useContext(lR);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function kme(e,t){var n=gn(),r=_8(),o=rR(),i=iR(),s=aR(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,h=s.focus,p=s.focusMonthBefore,m=s.focusMonthAfter,v=s.focusYearBefore,y=s.focusYearAfter,b=s.focusStartOfWeek,S=s.focusEndOfWeek,_=function(H){var G,te,F,Y;kb(n)?(G=r.onDayClick)===null||G===void 0||G.call(r,e,t,H):Bp(n)?(te=o.onDayClick)===null||te===void 0||te.call(o,e,t,H):Hp(n)?(F=i.onDayClick)===null||F===void 0||F.call(i,e,t,H):(Y=n.onDayClick)===null||Y===void 0||Y.call(n,e,t,H)},C=function(H){var G;h(e),(G=n.onDayFocus)===null||G===void 0||G.call(n,e,t,H)},E=function(H){var G;d(),(G=n.onDayBlur)===null||G===void 0||G.call(n,e,t,H)},T=function(H){var G;(G=n.onDayMouseEnter)===null||G===void 0||G.call(n,e,t,H)},A=function(H){var G;(G=n.onDayMouseLeave)===null||G===void 0||G.call(n,e,t,H)},D=function(H){var G;(G=n.onDayPointerEnter)===null||G===void 0||G.call(n,e,t,H)},k=function(H){var G;(G=n.onDayPointerLeave)===null||G===void 0||G.call(n,e,t,H)},j=function(H){var G;(G=n.onDayTouchCancel)===null||G===void 0||G.call(n,e,t,H)},$=function(H){var G;(G=n.onDayTouchEnd)===null||G===void 0||G.call(n,e,t,H)},z=function(H){var G;(G=n.onDayTouchMove)===null||G===void 0||G.call(n,e,t,H)},K=function(H){var G;(G=n.onDayTouchStart)===null||G===void 0||G.call(n,e,t,H)},V=function(H){var G;(G=n.onDayKeyUp)===null||G===void 0||G.call(n,e,t,H)},N=function(H){var G;switch(H.key){case"ArrowLeft":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":H.preventDefault(),H.stopPropagation(),c();break;case"ArrowUp":H.preventDefault(),H.stopPropagation(),u();break;case"PageUp":H.preventDefault(),H.stopPropagation(),H.shiftKey?v():p();break;case"PageDown":H.preventDefault(),H.stopPropagation(),H.shiftKey?y():m();break;case"Home":H.preventDefault(),H.stopPropagation(),b();break;case"End":H.preventDefault(),H.stopPropagation(),S();break}(G=n.onDayKeyDown)===null||G===void 0||G.call(n,e,t,H)},W={onClick:_,onFocus:C,onBlur:E,onKeyDown:N,onKeyUp:V,onMouseEnter:T,onMouseLeave:A,onPointerEnter:D,onPointerLeave:k,onTouchCancel:j,onTouchEnd:$,onTouchMove:z,onTouchStart:K};return W}function Ime(){var e=gn(),t=_8(),n=rR(),r=iR(),o=kb(e)?t.selected:Bp(e)?n.selected:Hp(e)?r.selected:void 0;return o}function Nme(e){return Object.values(Ei).includes(e)}function Lme(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(Nme(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Fme(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 jme(e,t,n){var r,o,i,s=gn(),a=aR(),l=Mme(e,t),c=kme(e,l),u=Ime(),d=!!(s.onDayClick||s.mode!=="default");P.useEffect(function(){var T;l.outside||a.focusedDay&&d&&ro(a.focusedDay,e)&&((T=n.current)===null||T===void 0||T.focus())},[a.focusedDay,e,n,d,l.outside]);var h=Lme(s,l).join(" "),p=Fme(s,l),m=!!(l.outside&&!s.showOutsideDays||l.hidden),v=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:ime,y=Ce.jsx(v,{date:e,displayMonth:t,activeModifiers:l}),b={style:p,className:h,children:y,role:"gridcell"},S=a.focusTarget&&ro(a.focusTarget,e)&&!l.outside,_=a.focusedDay&&ro(a.focusedDay,e),C=rt(rt(rt({},b),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=_||S?0:-1,r)),c),E={isButton:d,isHidden:m,activeModifiers:l,selectedDays:u,buttonProps:C,divProps:b};return E}function $me(e){var t=P.useRef(null),n=jme(e.date,e.displayMonth,t);return n.isHidden?Ce.jsx("div",{role:"gridcell"}):n.isButton?Ce.jsx(cv,rt({name:"day",ref:t},n.buttonProps)):Ce.jsx("div",rt({},n.divProps))}function zme(e){var t=e.number,n=e.dates,r=gn(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!o)return Ce.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var d=l(Number(t),{locale:a}),h=function(p){o(t,n,p)};return Ce.jsx(cv,{name:"week-number","aria-label":d,className:s.weeknumber,style:i.weeknumber,onClick:h,children:u})}function Bme(e){var t,n,r=gn(),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:$me,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:zme,u;return s&&(u=Ce.jsx("td",{className:i.cell,style:o.cell,children:Ce.jsx(c,{number:e.weekNumber,dates:e.dates})})),Ce.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(d){return Ce.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:Ce.jsx(l,{displayMonth:e.displayMonth,date:d})},gge(d))})]})}function ZD(e,t,n){for(var r=n!=null&&n.ISOWeek?a8(t):eR(t,n),o=n!=null&&n.ISOWeek?Sc(e):ns(e,n),i=Yi(r,o),s=[],a=0;a<=i;a++)s.push(Fr(o,a));var l=s.reduce(function(c,u){var d=n!=null&&n.ISOWeek?c8(u):d8(u,n),h=c.find(function(p){return p.weekNumber===d});return h?(h.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function Hme(e,t){var n=ZD(io(e),ZE(e),t);if(t!=null&&t.useFixedWeeks){var r=vge(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=t_(i,6-r),a=ZD(t_(i,1),s,t);n.push.apply(n,a)}}return n}function Vme(e){var t,n,r,o=gn(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,h=o.firstWeekContainsDate,p=o.ISOWeek,m=Hme(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:i,weekStartsOn:d,firstWeekContainsDate:h}),v=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:ome,y=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:Bme,b=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:tme;return Ce.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&Ce.jsx(v,{}),Ce.jsx("tbody",{className:s.tbody,style:a.tbody,children:m.map(function(S){return Ce.jsx(y,{displayMonth:e.displayMonth,dates:S.dates,weekNumber:S.weekNumber},S.weekNumber)})}),Ce.jsx(b,{displayMonth:e.displayMonth})]})}function Wme(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Ume=Wme()?P.useLayoutEffect:P.useEffect,M1=!1,Gme=0;function ek(){return"react-day-picker-".concat(++Gme)}function qme(e){var t,n=e??(M1?ek():null),r=P.useState(n),o=r[0],i=r[1];return Ume(function(){o===null&&i(ek())},[]),P.useEffect(function(){M1===!1&&(M1=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function Yme(e){var t,n,r=gn(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=Vp().displayMonths,c=qme(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[i.month],h=s.month,p=e.displayIndex===0,m=e.displayIndex===l.length-1,v=!p&&!m;o==="rtl"&&(t=[p,m],m=t[0],p=t[1]),p&&(d.push(i.caption_start),h=rt(rt({},h),s.caption_start)),m&&(d.push(i.caption_end),h=rt(rt({},h),s.caption_end)),v&&(d.push(i.caption_between),h=rt(rt({},h),s.caption_between));var y=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:eme;return Ce.jsxs("div",{className:d.join(" "),style:h,children:[Ce.jsx(y,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Ce.jsx(Vme,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Kme(e){var t=gn(),n=t.classNames,r=t.styles;return Ce.jsx("div",{className:n.months,style:r.months,children:e.children})}function Xme(e){var t,n,r=e.initialProps,o=gn(),i=aR(),s=Vp(),a=P.useState(!1),l=a[0],c=a[1];P.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 d=rt(rt({},o.styles.root),o.style),h=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,v){var y;return rt(rt({},m),(y={},y[v]=r[v],y))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Kme;return Ce.jsx("div",rt({className:u.join(" "),style:d,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:Ce.jsx(p,{children:s.displayMonths.map(function(m,v){return Ce.jsx(Yme,{displayIndex:v,displayMonth:m},v)})})}))}function Qme(e){var t=e.children,n=yge(e,["children"]);return Ce.jsx(zge,{initialProps:n,children:Ce.jsx(Xge,{children:Ce.jsx(Ame,{initialProps:n,children:Ce.jsx(sme,{initialProps:n,children:Ce.jsx(cme,{initialProps:n,children:Ce.jsx(vme,{children:Ce.jsx(Tme,{children:t})})})})})})})}function Jme(e){return Ce.jsx(Qme,rt({},e,{children:Ce.jsx(Xme,{initialProps:e})}))}function C8({className:e,classNames:t,showOutsideDays:n=!0,...r}){return x.jsx(Jme,{showOutsideDays:n,className:xe("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:xe(Ah({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:xe(Ah({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})=>x.jsx(AC,{...o,className:"h-4 w-4"}),IconRight:({...o})=>x.jsx(Zv,{...o,className:"h-4 w-4"})},...r})}C8.displayName="Calendar";function E8(e){const{authToken:t}=ko(),n=we(S=>S.dashboard.filters),r=we(S=>S.selectedSheetId),o=we(S=>S.filterValues),[i,s]=P.useState(!0),a=n==null?void 0:n.filter(S=>S.sheetId===r||!S.sheetId),l=o==null?void 0:o.filter(S=>(a==null?void 0:a.some(_=>_.id===S.filterId))||S.filterId.endsWith(r));function c(S){return i?{allowQuery:!0,filterValues:S.filter(E=>E.filterId!==e.id)}:(S==null?void 0:S.find(C=>C.filterId===e.id))?{allowQuery:!1,filterValues:S}:{allowQuery:!0,filterValues:S}}const{allowQuery:u,filterValues:d}=c(l||[]),{data:h,isLoading:p,isFetching:m,isError:v,refetch:y,isSuccess:b}=xp({queryKey:["filter",e.id,e.sql,JSON.stringify(d)],queryFn:()=>Ev("https://semaphor.cloud/api/v1/query",(t==null?void 0:t.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:d,cache_config:Y_()}),enabled:!!e.sql&&!!e.connectionId&&u,placeholderData:S=>S});return P.useEffect(()=>{b&&i&&s(!1)},[b,i]),{data:h,isLoading:p,isFetching:m,isError:v,refetch:y}}function Zme({filter:e,className:t}){var _,C,E,T,A,D,k,j;const n=we($=>$.themeStyle),[r,o]=P.useState(!1),[i,s]=P.useState(),[a,l]=P.useState(),c=we($=>$.filterValues);ko();const u=we($=>$.actions.addOrUpdateFilterValue),d=we($=>$.actions.removeFilterValue),{data:h,isLoading:p,isFetching:m,isError:v,refetch:y}=E8(e);P.useEffect(()=>{var $;if((($=h==null?void 0:h.records)==null?void 0:$.length)>0){const z=h.records[0];if(!z.min||!z.max)return;s({from:new Date(z.min),to:new Date(z.max)}),l({from:new Date(z.min),to:new Date(z.max)})}},[h]),P.useEffect(()=>{if(c&&!c.find(z=>z.filterId===e.id)){s(a);return}},[c,e.id,a]);function b(){d(e.id),s(a),o(!1)}function S(){if(!i)return;console.log(i);const $=[i==null?void 0:i.from,i==null?void 0:i.to];console.log($);const z={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:wu(e),name:e.column,operation:"between",values:$};u(z),o(!1)}return p?x.jsx("div",{children:x.jsx(_u,{className:"h-8 w-full bg-foreground/10"})}):v?x.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):h?x.jsx("div",{className:xe("grid gap-2",t),children:x.jsxs(Ob,{open:r,onOpenChange:o,children:[x.jsx(Tb,{style:{borderRadius:(C=(_=n==null?void 0:n.chart)==null?void 0:_.options)==null?void 0:C.borderRadius},asChild:!0,children:x.jsxs(oo,{size:"sm",id:"date",variant:"outline",className:xe("h-[34px] w-full justify-start rounded-sm text-left font-normal",!i&&"text-muted-foreground"),children:[x.jsx(r4,{className:"mr-2 h-4 w-4"}),i!=null&&i.from?i.to?x.jsxs(x.Fragment,{children:[Ji(i.from,"LLL dd, y")," -"," ",Ji(i.to,"LLL dd, y")]}):Ji(i.from,"LLL dd, y"):x.jsx("span",{children:"Pick a date"})]})}),x.jsxs($p,{style:{borderRadius:(T=(E=n==null?void 0:n.chart)==null?void 0:E.options)==null?void 0:T.borderRadius},className:"w-auto p-0",align:"start",children:[x.jsx("div",{className:"px-4 pt-3",children:x.jsx(Tn,{children:e.title})}),x.jsx(C8,{initialFocus:!0,mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:s,numberOfMonths:2}),x.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[x.jsx(oo,{style:{borderRadius:(D=(A=n==null?void 0:n.chart)==null?void 0:A.options)==null?void 0:D.borderRadius},size:"sm",variant:"outline",onClick:S,children:"Apply"}),x.jsx(oo,{style:{borderRadius:(j=(k=n==null?void 0:n.chart)==null?void 0:k.options)==null?void 0:j.borderRadius},size:"sm",variant:"outline",onClick:b,children:"Clear"})]})]})]})}):x.jsxs(Tn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}const R8=typeof document<"u"?P.useLayoutEffect:()=>{};function e0e(e){const t=P.useRef(null);return R8(()=>{t.current=e},[e]),P.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Wp=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},zl=e=>e&&"window"in e&&e.window===e?e:Wp(e).defaultView||window;function t0e(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function n0e(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function P8(e){let t=null;return()=>(t==null&&(t=e()),t)}const r0e=P8(function(){return n0e(/^Mac/i)}),o0e=P8(function(){return t0e(/Android/i)});function i0e(e){return e.mozInputSource===0&&e.isTrusted?!0:o0e()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class s0e{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function O8(e){let t=P.useRef({isFocused:!1,observer:null});R8(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=e0e(r=>{e==null||e(r)});return P.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=s=>{t.current.isFocused=!1,o.disabled&&n(new s0e("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function a0e(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=P.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),s=O8(i),a=P.useCallback(l=>{const c=Wp(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(n&&n(l),o&&o(!0),s(l))},[o,n,s]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?i:void 0}}}let Up=null,o_=new Set,ch=new Map,_c=!1,i_=!1;const l0e={Tab:!0,Escape:!0};function cR(e,t){for(let n of o_)n(e,t)}function c0e(e){return!(e.metaKey||!r0e()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function uv(e){_c=!0,c0e(e)&&(Up="keyboard",cR("keyboard",e))}function Yo(e){Up="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(_c=!0,cR("pointer",e))}function T8(e){i0e(e)&&(_c=!0,Up="virtual")}function M8(e){e.target===window||e.target===document||(!_c&&!i_&&(Up="virtual",cR("virtual",e)),_c=!1,i_=!1)}function A8(){_c=!1,i_=!0}function s_(e){if(typeof window>"u"||ch.get(zl(e)))return;const t=zl(e),n=Wp(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){_c=!0,r.apply(this,arguments)},n.addEventListener("keydown",uv,!0),n.addEventListener("keyup",uv,!0),n.addEventListener("click",T8,!0),t.addEventListener("focus",M8,!0),t.addEventListener("blur",A8,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Yo,!0),n.addEventListener("pointermove",Yo,!0),n.addEventListener("pointerup",Yo,!0)):(n.addEventListener("mousedown",Yo,!0),n.addEventListener("mousemove",Yo,!0),n.addEventListener("mouseup",Yo,!0)),t.addEventListener("beforeunload",()=>{D8(e)},{once:!0}),ch.set(t,{focus:r})}const D8=(e,t)=>{const n=zl(e),r=Wp(e);t&&r.removeEventListener("DOMContentLoaded",t),ch.has(n)&&(n.HTMLElement.prototype.focus=ch.get(n).focus,r.removeEventListener("keydown",uv,!0),r.removeEventListener("keyup",uv,!0),r.removeEventListener("click",T8,!0),n.removeEventListener("focus",M8,!0),n.removeEventListener("blur",A8,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Yo,!0),r.removeEventListener("pointermove",Yo,!0),r.removeEventListener("pointerup",Yo,!0)):(r.removeEventListener("mousedown",Yo,!0),r.removeEventListener("mousemove",Yo,!0),r.removeEventListener("mouseup",Yo,!0)),ch.delete(n))};function u0e(e){const t=Wp(e);let n;return t.readyState!=="loading"?s_(e):(n=()=>{s_(e)},t.addEventListener("DOMContentLoaded",n)),()=>D8(e,n)}typeof document<"u"&&u0e();function k8(){return Up!=="pointer"}const d0e=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function f0e(e,t,n){var r;const o=typeof window<"u"?zl(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?zl(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?zl(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?zl(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof o&&!d0e.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof i||(n==null?void 0:n.target)instanceof s&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof a&&!l0e[n.key])}function h0e(e,t,n){s_(),P.useEffect(()=>{let r=(o,i)=>{f0e(!!(n!=null&&n.isTextInput),o,i)&&e(k8())};return o_.add(r),()=>{o_.delete(r)}},t)}function p0e(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=P.useRef({isFocusWithin:!1}),s=P.useCallback(c=>{i.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(c),o&&o(!1))},[n,o,i]),a=O8(s),l=P.useCallback(c=>{!i.current.isFocusWithin&&document.activeElement===c.target&&(r&&r(c),o&&o(!0),i.current.isFocusWithin=!0,a(c))},[r,o,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:s}}}let dv=!1,A1=0;function a_(){dv=!0,setTimeout(()=>{dv=!1},50)}function tk(e){e.pointerType==="touch"&&a_()}function g0e(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",tk):document.addEventListener("touchend",a_),A1++,()=>{A1--,!(A1>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",tk):document.removeEventListener("touchend",a_))}}function I8(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,s]=P.useState(!1),a=P.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;P.useEffect(g0e,[]);let{hoverProps:l,triggerHoverEnd:c}=P.useMemo(()=>{let u=(p,m)=>{if(a.pointerType=m,o||m==="touch"||a.isHovered||!p.currentTarget.contains(p.target))return;a.isHovered=!0;let v=p.currentTarget;a.target=v,t&&t({type:"hoverstart",target:v,pointerType:m}),n&&n(!0),s(!0)},d=(p,m)=>{if(a.pointerType="",a.target=null,m==="touch"||!a.isHovered)return;a.isHovered=!1;let v=p.currentTarget;r&&r({type:"hoverend",target:v,pointerType:m}),n&&n(!1),s(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=p=>{dv&&p.pointerType==="mouse"||u(p,p.pointerType)},h.onPointerLeave=p=>{!o&&p.currentTarget.contains(p.target)&&d(p,p.pointerType)}):(h.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=p=>{!a.ignoreEmulatedMouseEvents&&!dv&&u(p,"mouse"),a.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=p=>{!o&&p.currentTarget.contains(p.target)&&d(p,"mouse")}),{hoverProps:h,triggerHoverEnd:d}},[t,n,r,o,a]);return P.useEffect(()=>{o&&c({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:l,isHovered:i}}function N8(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=P.useRef({isFocused:!1,isFocusVisible:t||k8()}),[i,s]=P.useState(!1),[a,l]=P.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=P.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),u=P.useCallback(p=>{o.current.isFocused=p,s(p),c()},[c]);h0e(p=>{o.current.isFocusVisible=p,c()},[],{isTextInput:n});let{focusProps:d}=a0e({isDisabled:r,onFocusChange:u}),{focusWithinProps:h}=p0e({isDisabled:!r,onFocusWithinChange:u});return{isFocused:i,isFocusVisible:a,focusProps:r?h:d}}var m0e=Object.defineProperty,v0e=(e,t,n)=>t in e?m0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D1=(e,t,n)=>(v0e(e,typeof t!="symbol"?t+"":t,n),n);let b0e=class{constructor(){D1(this,"current",this.detect()),D1(this,"handoffState","pending"),D1(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"}},lc=new b0e;function Gp(e){return lc.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function L8(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function rs(){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 L8(()=>{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=rs();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||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 Md(){let[e]=P.useState(rs);return P.useEffect(()=>()=>e.dispose(),[e]),e}let nn=(e,t)=>{lc.isServer?P.useEffect(e,t):P.useLayoutEffect(e,t)};function ol(e){let t=P.useRef(e);return nn(()=>{t.current=e},[e]),t}let Ze=function(e){let t=ol(e);return P.useCallback((...n)=>t.current(...n),[t])};function y0e(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function x0e(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function w0e({disabled:e=!1}={}){let t=P.useRef(null),[n,r]=P.useState(!1),o=Md(),i=Ze(()=>{t.current=null,r(!1),o.dispose()}),s=Ze(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=Gp(a.currentTarget);o.addEventListener(l,"pointerup",i,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let u=y0e(c);r(x0e(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:i,onClick:i}}}let S0e=P.createContext(void 0);function uR(){return P.useContext(S0e)}function l_(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Si(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,Si),r}var fv=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(fv||{}),Na=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Na||{});function Io(){let e=C0e();return P.useCallback(t=>_0e({mergeRefs:e,...t}),[e])}function _0e({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??E0e;let l=F8(t,e);if(i)return jm(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...d}=l;if(u)return jm(d,n,r,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Si(u?0:1,{0(){return null},1(){return jm({...d,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return jm(l,n,r,s,a)}function jm(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=k1(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)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let d={};if(t){let h=!1,p=[];for(let[m,v]of Object.entries(t))typeof v=="boolean"&&(h=!0),v===!0&&p.push(m.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(h){d["data-headlessui-state"]=p.join(" ");for(let m of p)d[`data-${m}`]=""}}if(i===P.Fragment&&(Object.keys(ya(l)).length>0||Object.keys(ya(d)).length>0))if(!P.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(ya(l)).length>0)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(ya(l)).concat(Object.keys(ya(d))).map(h=>` - ${h}`).join(`
347
+ `),"","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(h=>` - ${h}`).join(`
348
+ `)].join(`
349
+ `))}else{let h=u.props,p=h==null?void 0:h.className,m=typeof p=="function"?(...b)=>l_(p(...b),l.className):l_(p,l.className),v=m?{className:m}:{},y=F8(u.props,ya(k1(l,["ref"])));for(let b in d)b in y&&delete d[b];return P.cloneElement(u,Object.assign({},y,d,c,{ref:o(R0e(u),c.ref)},v))}return P.createElement(i,Object.assign({},k1(l,["ref"]),i!==P.Fragment&&c,i!==P.Fragment&&d),u)}function C0e(){let e=P.useRef([]),t=P.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function E0e(...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 F8(...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"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);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 dR(...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];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let s of i)s==null||s(...o)}});return t}function ao(e){var t;return Object.assign(P.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function ya(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function k1(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function R0e(e){return P.version.split(".")[0]>="19"?e.props.ref:e.ref}function P0e(e,t,n){let[r,o]=P.useState(n),i=e!==void 0,s=P.useRef(i),a=P.useRef(!1),l=P.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,Ze(c=>(i||o(c),t==null?void 0:t(c)))]}function O0e(e){let[t]=P.useState(e);return t}function j8(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))z8(n,$8(t,r),o);return n}function $8(e,t){return e?e+"["+t+"]":t}function z8(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())z8(e,$8(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,""]):j8(n,t,e)}let T0e="span";var fR=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(fR||{});function M0e(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,hidden:(r&4)===4?!0: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 Io()({ourProps:i,theirProps:o,slot:{},defaultTag:T0e,name:"Hidden"})}let B8=ao(M0e),A0e=P.createContext(null);function D0e({children:e}){let t=P.useContext(A0e);if(!t)return P.createElement(P.Fragment,null,e);let{target:n}=t;return n?wr.createPortal(P.createElement(P.Fragment,null,e),n):null}function k0e({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,s]=P.useState(null),a=Md();return P.useEffect(()=>{if(r&&i)return a.addEventListener(i,"reset",r)},[i,t,r]),P.createElement(D0e,null,P.createElement(I0e,{setForm:s,formId:t}),j8(e).map(([l,c])=>P.createElement(B8,{features:fR.Hidden,...ya({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...o})})))}function I0e({setForm:e,formId:t}){return P.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:P.createElement(B8,{features:fR.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let N0e=P.createContext(void 0);function H8(){return P.useContext(N0e)}function L0e(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&&F0e(n)?!1:r}function F0e(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let V8=Symbol();function j0e(e,t=!0){return Object.assign(e,{[V8]:t})}function Ri(...e){let t=P.useRef(e);P.useEffect(()=>{t.current=e},[e]);let n=Ze(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[V8]))?void 0:n}let hR=P.createContext(null);hR.displayName="DescriptionContext";function W8(){let e=P.useContext(hR);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,W8),t}return e}function $0e(){var e,t;return(t=(e=P.useContext(hR))==null?void 0:e.value)!=null?t:void 0}let z0e="p";function B0e(e,t){let n=P.useId(),r=uR(),{id:o=`headlessui-description-${n}`,...i}=e,s=W8(),a=Ri(t);nn(()=>s.register(o),[o,s.register]);let l=r||!1,c=P.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),u={ref:a,...s.props,id:o};return Io()({ourProps:u,theirProps:i,slot:c,defaultTag:z0e,name:s.name||"Description"})}let H0e=ao(B0e);Object.assign(H0e,{});var Ir=(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))(Ir||{});let Ib=P.createContext(null);Ib.displayName="LabelContext";function U8(){let e=P.useContext(Ib);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,U8),t}return e}function Nb(e){var t,n,r;let o=(n=(t=P.useContext(Ib))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function V0e({inherit:e=!1}={}){let t=Nb(),[n,r]=P.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,P.useMemo(()=>function(i){let s=Ze(l=>(r(c=>[...c,l]),()=>r(c=>{let u=c.slice(),d=u.indexOf(l);return d!==-1&&u.splice(d,1),u}))),a=P.useMemo(()=>({register:s,slot:i.slot,name:i.name,props:i.props,value:i.value}),[s,i.slot,i.name,i.props,i.value]);return P.createElement(Ib.Provider,{value:a},i.children)},[r])]}let W0e="label";function U0e(e,t){var n;let r=P.useId(),o=U8(),i=H8(),s=uR(),{id:a=`headlessui-label-${r}`,htmlFor:l=i??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Ri(t);nn(()=>o.register(a),[a,o.register]);let h=Ze(y=>{let b=y.currentTarget;if(b instanceof HTMLLabelElement&&y.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(y),b instanceof HTMLLabelElement){let S=document.getElementById(b.htmlFor);if(S){let _=S.getAttribute("disabled");if(_==="true"||_==="")return;let C=S.getAttribute("aria-disabled");if(C==="true"||C==="")return;(S instanceof HTMLInputElement&&(S.type==="radio"||S.type==="checkbox")||S.role==="radio"||S.role==="checkbox"||S.role==="switch")&&S.click(),S.focus({preventScroll:!0})}}}),p=s||!1,m=P.useMemo(()=>({...o.slot,disabled:p}),[o.slot,p]),v={ref:d,...o.props,id:a,htmlFor:l,onClick:h};return c&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in u&&delete u.onClick),Io()({ourProps:v,theirProps:u,slot:m,defaultTag:l?W0e:"div",name:o.name||"Label"})}let G0e=ao(U0e),q0e=Object.assign(G0e,{});function au(e,t,n){let r=n.initialDeps??[],o;return()=>{var i,s,a,l;let c;n.key&&((i=n.debug)!=null&&i.call(n))&&(c=Date.now());const u=e();if(!(u.length!==r.length||u.some((p,m)=>r[m]!==p)))return o;r=u;let h;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(h=Date.now()),o=t(...u),n.key&&((a=n.debug)!=null&&a.call(n))){const p=Math.round((Date.now()-c)*100)/100,m=Math.round((Date.now()-h)*100)/100,v=m/16,y=(b,S)=>{for(b=String(b);b.length<S;)b=" "+b;return b};console.info(`%c⏱ ${y(m,5)} /${y(p,5)} ms`,`
350
+ font-size: .6rem;
351
+ font-weight: bold;
352
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,o),o}}function I1(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}const Y0e=(e,t)=>Math.abs(e-t)<1,K0e=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},X0e=e=>e,Q0e=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},J0e=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=s[0];if(a!=null&&a.borderBoxSize){const l=a.borderBoxSize[0];if(l){o({width:l.inlineSize,height:l.blockSize});return}}o(n.getBoundingClientRect())});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},nk={passive:!0},Z0e=typeof window>"u"?!0:"onscrollend"in window,eve=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&Z0e?()=>{}:K0e(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=c=>()=>{const{horizontal:u,isRtl:d}=e.options;o=u?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,c)},a=s(!0),l=s(!1);return l(),n.addEventListener("scroll",a,nk),n.addEventListener("scrollend",l,nk),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",l)}},tve=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},nve=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class rve{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{this._measureElement(i.target,i)})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:X0e,rangeExtractor:Q0e,onChange:()=>{},measureElement:tve,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=au(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=au(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=au(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=i(u),h=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),p=h?h.end+this.options.gap:r+o,m=a.get(d),v=typeof m=="number"?m:this.options.estimateSize(u),y=p+v,b=h?h.lane:u%this.options.lanes;c[u]={index:u,start:p,size:v,end:y,key:d,lane:b}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=au(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,o)=>this.range=n.length>0&&r>0?ove({measurements:n,outerSize:r,scrollOffset:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=au(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,o,i)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,overscan:o,count:i}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=au(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return I1(r[G8(0,r.length-1,o=>I1(r[o]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&n>=i+o&&(r="end"),r==="end"&&(n-=o);const s=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-o;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=o.start-this.options.scrollPaddingStart+(o.size-i)/2;switch(r){case"center":return[this.getOffsetForAlignment(a,r),r];case"end":return[this.getOffsetForAlignment(o.end+this.options.scrollPaddingEnd,r),r];default:return[this.getOffsetForAlignment(o.start-this.options.scrollPaddingStart,r),r]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=I1(this.getOffsetForIndex(n,a));Y0e(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:o})}else this.scrollToIndex(n,{align:a,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(i=>i.end)),Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const G8=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function ove({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,i=G8(0,r,a=>e[a].start,n);let s=i;for(;s<r&&e[s].end<n+t;)s++;return{startIndex:i,endIndex:s}}const rk=typeof document<"u"?R.useLayoutEffect:R.useEffect;function ive(e){const t=R.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?wr.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=R.useState(()=>new rve(n));return r.setOptions(n),rk(()=>r._didMount(),[]),rk(()=>r._willUpdate()),r}function sve(e){return ive({observeElementRect:J0e,observeElementOffset:eve,scrollToFn:nve,...e})}function ave(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function lve(e=ave){return P.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function cve(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function ok(e,t=!1){let[n,r]=P.useReducer(()=>({}),{}),o=P.useMemo(()=>cve(e),[e,n]);return nn(()=>{if(!e)return;let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let uve=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function q8(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let s=t[o].call(n,...i);s&&(n=s,r.forEach(a=>a()))}}}function Y8(e){return P.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let dve=new uve(()=>q8(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function pR(e,t){let n=dve.get(t),r=P.useId(),o=Y8(n);if(nn(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),s=o.length;return i===-1&&(i=s,s+=1),i===s-1}let c_=new Map,uh=new Map;function ik(e){var t;let n=(t=uh.get(e))!=null?t:0;return uh.set(e,n+1),n!==0?()=>sk(e):(c_.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>sk(e))}function sk(e){var t;let n=(t=uh.get(e))!=null?t:1;if(n===1?uh.delete(e):uh.set(e,n-1),n!==1)return;let r=c_.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,c_.delete(e))}function fve(e,{allowed:t,disallowed:n}={}){let r=pR(e,"inert-others");nn(()=>{var o,i;if(!r)return;let s=rs();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&s.add(ik(l));let a=(i=t==null?void 0:t())!=null?i:[];for(let l of a){if(!l)continue;let c=Gp(l);if(!c)continue;let u=l.parentElement;for(;u&&u!==c.body;){for(let d of u.children)a.some(h=>d.contains(h))||s.add(ik(d));u=u.parentElement}}return s.dispose},[r,t,n])}function hve(e,t,n){let r=ol(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});P.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=rs();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}return()=>i.dispose()},[t,r,e])}let u_=["[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 pve=(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[e.AutoFocus=64]="AutoFocus",e))(pve||{}),gve=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(gve||{}),mve=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(mve||{}),K8=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(K8||{});function vve(e,t=0){var n;return e===((n=Gp(e))==null?void 0:n.body)?!1:Si(t,{0(){return e.matches(u_)},1(){let r=e;for(;r!==null;){if(r.matches(u_))return!0;r=r.parentElement}return!1}})}var bve=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(bve||{});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 yve(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 X8(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function xve(){return/Android/gi.test(window.navigator.userAgent)}function Q8(){return X8()||xve()}function wf(e,t,n,r){let o=ol(n);P.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function wve(e,t,n,r){let o=ol(n);P.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const ak=30;function Sve(e,t,n){let r=pR(e,"outside-click"),o=ol(n),i=P.useCallback(function(l,c){if(l.defaultPrevented)return;let u=c(l);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let d=function h(p){return typeof p=="function"?h(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let h of d)if(h!==null&&(h.contains(u)||l.composed&&l.composedPath().includes(h)))return;return!vve(u,K8.Loose)&&u.tabIndex!==-1&&l.preventDefault(),o.current(l,u)},[o,t]),s=P.useRef(null);wf(r,"pointerdown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),wf(r,"mousedown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),wf(r,"click",l=>{Q8()||s.current&&(i(l,()=>s.current),s.current=null)},!0);let a=P.useRef({x:0,y:0});wf(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),wf(r,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=ak||Math.abs(c.y-a.current.y)>=ak))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),wve(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Lb(...e){return P.useMemo(()=>Gp(...e),[...e])}function _ve(e,t,n,r){let o=ol(n);P.useEffect(()=>{e=e??window;function i(s){o.current(s)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function J8(e){let t=P.useRef({value:"",selectionStart:null,selectionEnd:null});return _ve(e,"blur",n=>{let r=n.target;r instanceof HTMLInputElement&&(t.current={value:r.value,selectionStart:r.selectionStart,selectionEnd:r.selectionEnd})}),Ze(()=>{if(document.activeElement!==e&&e instanceof HTMLInputElement&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:n,selectionEnd:r}=t.current;n!==null&&r!==null&&e.setSelectionRange(n,r)}t.current={value:"",selectionStart:null,selectionEnd:null}}})}function Cve(e,t){return P.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Eve(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function Rve(){return X8()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=rs();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),u=e.querySelector(c);u&&!r(u)&&(s=u)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;i!==l&&window.scrollTo(0,i),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function Pve(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Ove(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Bl=q8(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:rs(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Ove(n)},o=[Rve(),Eve(),Pve()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Bl.subscribe(()=>{let e=Bl.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Bl.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Bl.dispatch("TEARDOWN",n)}});function Tve(e,t,n=()=>({containers:[]})){let r=Y8(Bl),o=t?r.get(t):void 0,i=o?o.count>0:!1;return nn(()=>{if(!(!t||!e))return Bl.dispatch("PUSH",t,n),()=>Bl.dispatch("POP",t,n)},[e,t]),i}function Mve(e,t,n=()=>[document.body]){let r=pR(e,"scroll-lock");Tve(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function lk(e){return[e.screenX,e.screenY]}function Ave(){let e=P.useRef([-1,-1]);return{wasMoved(t){let n=lk(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=lk(t)}}}function Dve(e=0){let[t,n]=P.useState(e),r=P.useCallback(l=>n(l),[t]),o=P.useCallback(l=>n(c=>c|l),[t]),i=P.useCallback(l=>(t&l)===l,[t]),s=P.useCallback(l=>n(c=>c&~l),[n]),a=P.useCallback(l=>n(c=>c^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}var ck,uk;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ck=process==null?void 0:process.env)==null?void 0:ck.NODE_ENV)==="test"&&typeof((uk=Element==null?void 0:Element.prototype)==null?void 0:uk.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
353
+ `)),[]});var kve=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(kve||{});function Z8(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function e7(e,t,n,r){let[o,i]=P.useState(n),{hasFlag:s,addFlag:a,removeFlag:l}=Dve(e&&o?3:0),c=P.useRef(!1),u=P.useRef(!1),d=Md();return nn(()=>{var h;if(e){if(n&&i(!0),!t){n&&a(3);return}return(h=r==null?void 0:r.start)==null||h.call(r,n),Ive(t,{inFlight:c,prepare(){u.current?u.current=!1:u.current=c.current,c.current=!0,!u.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){u.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var p;u.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(c.current=!1,l(7),n||i(!1),(p=r==null?void 0:r.end)==null||p.call(r,n))}})}},[e,n,t,d]),e?[o,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Ive(e,{prepare:t,run:n,done:r,inFlight:o}){let i=rs();return Lve(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(Nve(e,r))})}),i.dispose}function Nve(e,t){var n,r;let o=rs();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),o.dispose):(Promise.allSettled(s.map(a=>a.finished)).then(()=>{i||t()}),o.dispose)}function Lve(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function Fve(e,{container:t,accept:n,walk:r}){let o=P.useRef(n),i=P.useRef(r);P.useEffect(()=>{o.current=n,i.current=r},[n,r]),nn(()=>{if(!t||!e)return;let s=Gp(t);if(!s)return;let a=o.current,l=i.current,c=Object.assign(d=>a(d),{acceptNode:a}),u=s.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[t,e,o,i])}function dk(e,t){let n=P.useRef([]),r=Ze(e);P.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 jve(){return typeof window<"u"}function $ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vf(e){return jve()?e instanceof Element||e instanceof $ve(e).Element:!1}function zve(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const Bve=Math.min,N1=Math.max,Hve=Math.round;function Vve(e,t){return typeof e=="function"?e(t):e}const t7={...R},Wve=t7.useInsertionEffect,Uve=Wve||(e=>e());function n7(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Uve(()=>{t.current=e}),R.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var d_=typeof document<"u"?P.useLayoutEffect:P.useEffect;let fk=!1,Gve=0;const hk=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Gve++;function qve(){const[e,t]=R.useState(()=>fk?hk():void 0);return d_(()=>{e==null&&t(hk())},[]),R.useEffect(()=>{fk=!0},[]),e}const Yve=t7.useId,Kve=Yve||qve;let Ih;process.env.NODE_ENV!=="production"&&(Ih=new Set);function Xve(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Ih)!=null&&e.has(o))){var i;(i=Ih)==null||i.add(o),console.warn(o)}}function Qve(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Ih)!=null&&e.has(o))){var i;(i=Ih)==null||i.add(o),console.error(o)}}function Jve(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Zve=R.createContext(null),ebe=R.createContext(null),tbe=()=>{var e;return((e=R.useContext(Zve))==null?void 0:e.id)||null},nbe=()=>R.useContext(ebe),rbe="data-floating-ui-focusable";function obe(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Kve(),i=R.useRef({}),[s]=R.useState(()=>Jve()),a=tbe()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!Vf(p)&&Qve("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=R.useState(r.reference),u=n7((p,m,v)=>{i.current.openEvent=p?m:void 0,s.emit("openchange",{open:p,event:m,reason:v,nested:a}),n==null||n(p,m,v)}),d=R.useMemo(()=>({setPositionReference:c}),[]),h=R.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return R.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:h,events:s,floatingId:o,refs:d}),[t,u,h,s,o,d])}function ibe(e){e===void 0&&(e={});const{nodeId:t}=e,n=obe({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=R.useState(null),[a,l]=R.useState(null),u=(o==null?void 0:o.domReference)||i,d=R.useRef(null),h=nbe();d_(()=>{u&&(d.current=u)},[u]);const p=O3({...e,elements:{...o,...a&&{reference:a}}}),m=R.useCallback(_=>{const C=Vf(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;l(C),p.refs.setReference(C)},[p.refs]),v=R.useCallback(_=>{(Vf(_)||_===null)&&(d.current=_,s(_)),(Vf(p.refs.reference.current)||p.refs.reference.current===null||_!==null&&!Vf(_))&&p.refs.setReference(_)},[p.refs]),y=R.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:d}),[p.refs,v,m]),b=R.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),S=R.useMemo(()=>({...p,...r,refs:y,elements:b,nodeId:t}),[p,y,b,t,r]);return d_(()=>{r.dataRef.current.floatingContext=S;const _=h==null?void 0:h.nodesRef.current.find(C=>C.id===t);_&&(_.context=S)}),R.useMemo(()=>({...p,context:S,refs:y,elements:b}),[p,y,b,S])}const pk="active",gk="selected";function L1(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[pk]:s,[gk]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[rbe]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[pk,gk].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),s[c]=function(){for(var h,p=arguments.length,m=new Array(p),v=0;v<p;v++)m[v]=arguments[v];return(h=r.get(c))==null?void 0:h.map(y=>y(...m)).find(y=>y!==void 0)}}}else s[c]=u}),s),{})}}function sbe(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=R.useCallback(a=>L1(a,e,"reference"),t),i=R.useCallback(a=>L1(a,e,"floating"),n),s=R.useCallback(a=>L1(a,e,"item"),r);return R.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function mk(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const abe=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:s=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...u}=Vve(e,t),{rects:d,elements:{floating:h}}=t,p=n.current[s],m=(c==null?void 0:c.current)||h,v=h.clientTop||m.clientTop,y=h.clientTop!==0,b=m.clientTop!==0,S=h===m;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Xve('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const _={...t,...await _E(-p.offsetTop-h.clientTop-d.reference.height/2-p.offsetHeight/2-i).fn(t)},C=await ja(mk(_,m.scrollHeight+v+h.clientTop),u),E=await ja(_,{...u,elementContext:"reference"}),T=N1(0,C.top),A=_.y+T,j=(m.scrollHeight>m.clientHeight?$=>$:Hve)(N1(0,m.scrollHeight+(y&&S||b?v*2:0)-T-N1(0,C.bottom)));if(m.style.maxHeight=j+"px",m.scrollTop=T,o){const $=m.offsetHeight<p.offsetHeight*Bve(a,n.current.length)-1||E.top>=-l||E.bottom>=-l;dc.flushSync(()=>o($))}return r&&(r.current=await ja(mk({..._,y:A},m.offsetHeight+v+h.clientTop),u)),{y:A}}});function lbe(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:s,onChange:a}=t,l=n7(a),c=R.useRef(!1),u=R.useRef(null),d=R.useRef(null);R.useEffect(()=>{if(!o)return;function p(v){if(v.ctrlKey||!m||i.current==null)return;const y=v.deltaY,b=i.current.top>=-.5,S=i.current.bottom>=-.5,_=m.scrollHeight-m.clientHeight,C=y<0?-1:1,E=y<0?"max":"min";m.scrollHeight<=m.clientHeight||(!b&&y>0||!S&&y<0?(v.preventDefault(),dc.flushSync(()=>{l(T=>T+Math[E](y,_*C))})):/firefox/i.test(zve())&&(m.scrollTop+=y))}const m=(s==null?void 0:s.current)||r.floating;if(n&&m)return m.addEventListener("wheel",p),requestAnimationFrame(()=>{u.current=m.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{u.current=null,d.current=null,m.removeEventListener("wheel",p)}},[o,n,r.floating,i,s,l]);const h=R.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const p=(s==null?void 0:s.current)||r.floating;if(!(!i.current||!p||!c.current)){if(u.current!==null){const m=p.scrollTop-u.current;(i.current.bottom<-.5&&m<-1||i.current.top<-.5&&m>1)&&dc.flushSync(()=>l(v=>v+m))}requestAnimationFrame(()=>{u.current=p.scrollTop})}}}),[r.floating,l,i,s]);return R.useMemo(()=>o?{floating:h}:{},[o,h])}let qp=P.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});qp.displayName="FloatingContext";let gR=P.createContext(null);gR.displayName="PlacementContext";function cbe(e){return P.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function ube(){return P.useContext(qp).setReference}function dbe(){let{getFloatingProps:e,slot:t}=P.useContext(qp);return P.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function fbe(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=P.useContext(gR),n=P.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);nn(()=>{t==null||t(n??null)},[t,n]);let r=P.useContext(qp);return P.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let vk=4;function hbe({children:e,enabled:t=!0}){let[n,r]=P.useState(null),[o,i]=P.useState(0),s=P.useRef(null),[a,l]=P.useState(null);pbe(a);let c=t&&n!==null&&a!==null,{to:u="bottom",gap:d=0,offset:h=0,padding:p=0,inner:m}=gbe(n,a),[v,y="center"]=u.split(" ");nn(()=>{c&&i(0)},[c]);let{refs:b,floatingStyles:S,context:_}=ibe({open:c,placement:v==="selection"?y==="center"?"bottom":`bottom-${y}`:y==="center"?`${v}`:`${v}-${y}`,strategy:"absolute",transform:!1,middleware:[_E({mainAxis:v==="selection"?0:d,crossAxis:h}),T3({padding:p}),v!=="selection"&&M3({padding:p}),v==="selection"&&m?abe({...m,padding:p,overflowRef:s,offset:o,minItemsVisible:vk,referenceOverflowThreshold:p,onFallbackChange($){var z,K;if(!$)return;let V=_.elements.floating;if(!V)return;let N=parseFloat(getComputedStyle(V).scrollPaddingBottom)||0,W=Math.min(vk,V.childElementCount),H=0,G=0;for(let te of(K=(z=_.elements.floating)==null?void 0:z.childNodes)!=null?K:[])if(te instanceof HTMLElement){let F=te.offsetTop,Y=F+te.clientHeight+N,q=V.scrollTop,M=q+V.clientHeight;if(F>=q&&Y<=M)W--;else{G=Math.max(0,Math.min(Y,M)-Math.max(F,q)),H=te.clientHeight;break}}W>=1&&i(te=>{let F=H*W-G+N;return te>=F?te:F})}}):null,A3({padding:p,apply({availableWidth:$,availableHeight:z,elements:K}){Object.assign(K.floating.style,{overflow:"auto",maxWidth:`${$}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${z}px)`})}})].filter(Boolean),whileElementsMounted:R3}),[C=v,E=y]=_.placement.split("-");v==="selection"&&(C="selection");let T=P.useMemo(()=>({anchor:[C,E].filter(Boolean).join(" ")}),[C,E]),A=lbe(_,{overflowRef:s,onChange:i}),{getReferenceProps:D,getFloatingProps:k}=sbe([A]),j=Ze($=>{l($),b.setFloating($)});return R.createElement(gR.Provider,{value:r},R.createElement(qp.Provider,{value:{setFloating:j,setReference:b.setReference,styles:S,getReferenceProps:D,getFloatingProps:k,slot:T}},e))}function pbe(e){nn(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function gbe(e,t){var n,r,o;let i=F1((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=F1((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=F1((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:s,padding:a}}function F1(e,t,n=void 0){let r=Md(),o=Ze((l,c)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[n,null];let u=bk(l,c);return[u,d=>{let h=r7(l);{let p=h.map(m=>window.getComputedStyle(c).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let v=!1;for(let[b,S]of h.entries()){let _=window.getComputedStyle(c).getPropertyValue(S);if(p[b]!==_){p[b]=_,v=!0;break}}if(!v)return;let y=bk(l,c);u!==y&&(d(y),u=y)})}return r.dispose}]}return[n,null]}),i=P.useMemo(()=>o(e,t)[0],[e,t]),[s=i,a]=P.useState();return nn(()=>{let[l,c]=o(e,t);if(a(l),!!c)return c(a)},[e,t]),s}function r7(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...r7(o)]:[r]}return[]}function bk(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function mbe({children:e,freeze:t}){let n=f_(t,e);return P.createElement(P.Fragment,null,n)}function f_(e,t){let[n,r]=P.useState(t);return!e&&n!==t&&r(t),e?n:t}let mR=P.createContext(null);mR.displayName="OpenClosedContext";var xi=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(xi||{});function vR(){return P.useContext(mR)}function o7({value:e,children:t}){return P.createElement(mR.Provider,{value:e},t)}function vbe(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Dl=[];vbe(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Dl[0]===t.target)return;let n=t.target;n=n.closest(u_),Dl.unshift(n??t.target),Dl=Dl.filter(r=>r!=null&&r.isConnected),Dl.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 bbe(e){throw new Error("Unexpected object: "+e)}var Un=(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))(Un||{});function yk(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:{o===-1&&(o=n.length);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:bbe(e)}}var bR=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(bR||{});function ybe(e){let t=Ze(e),n=P.useRef(!1);P.useEffect(()=>(n.current=!1,()=>{n.current=!0,L8(()=>{n.current&&t()})}),[t])}function xbe(){let e=typeof document>"u";return"useSyncExternalStore"in R?(t=>t.useSyncExternalStore)(R)(()=>()=>{},()=>!1,()=>!e):!1}function yR(){let e=xbe(),[t,n]=R.useState(lc.isHandoffComplete);return t&&lc.isHandoffComplete===!1&&n(!1),R.useEffect(()=>{t!==!0&&n(!0)},[t]),R.useEffect(()=>lc.handoff(),[]),e?!1:t}let wbe=P.createContext(!1);function Sbe(){return P.useContext(wbe)}function _be(e){let t=Sbe(),n=P.useContext(s7),r=Lb(e),[o,i]=P.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(lc.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");if(a)return a;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return P.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),P.useEffect(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let i7=P.Fragment,Cbe=ao(function(e,t){let n=e,r=P.useRef(null),o=Ri(j0e(d=>{r.current=d}),t),i=Lb(r),s=_be(r),[a]=P.useState(()=>{var d;return lc.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=P.useContext(Obe),c=yR();nn(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),nn(()=>{if(a&&l)return l.register(a)},[l,a]),ybe(()=>{var d;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((d=s.parentElement)==null||d.removeChild(s)))});let u=Io();return c?!s||!a?null:wr.createPortal(u({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:i7,name:"Portal"}),a):null});function Ebe(e,t){let n=Ri(t),{enabled:r=!0,...o}=e,i=Io();return r?P.createElement(Cbe,{...o,ref:n}):i({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:i7,name:"Portal"})}let Rbe=P.Fragment,s7=P.createContext(null);function Pbe(e,t){let{target:n,...r}=e,o={ref:Ri(t)},i=Io();return P.createElement(s7.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:Rbe,name:"Popover.Group"}))}let Obe=P.createContext(null),Tbe=ao(Ebe),Mbe=ao(Pbe),Abe=Object.assign(Tbe,{Group:Mbe});var Dbe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Dbe||{}),kbe=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(kbe||{}),Ibe=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Ibe||{}),Nbe=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=7]="UpdateVirtualConfiguration",e[e.SetInputElement=8]="SetInputElement",e[e.SetButtonElement=9]="SetButtonElement",e[e.SetOptionsElement=10]="SetOptionsElement",e))(Nbe||{});function j1(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):yve(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let Lbe={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!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,__demoMode:!1}}return{...e,comboboxState:0,__demoMode:!1}},3(e,t){return e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping}},2(e,t){var n,r,o,i;if((n=e.dataRef.current)!=null&&n.disabled||e.optionsElement&&!((r=e.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:c,disabled:u}=e.virtual,d=t.focus===Un.Specific?t.idx:yk(t,{resolveItems:()=>c,resolveActiveIndex:()=>{var p,m;return(m=(p=e.activeOptionIndex)!=null?p:c.findIndex(v=>!u(v)))!=null?m:null},resolveDisabled:u,resolveId(){throw new Error("Function not implemented.")}}),h=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===h?e:{...e,activeOptionIndex:d,activationTrigger:h,isTyping:!1,__demoMode:!1}}let s=j1(e);if(s.activeOptionIndex===null){let c=s.options.findIndex(u=>!u.dataRef.current.disabled);c!==-1&&(s.activeOptionIndex=c)}let a=t.focus===Un.Specific?t.idx:yk(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled}),l=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===a&&e.activationTrigger===l?e:{...e,...s,isTyping:!1,activeOptionIndex:a,activationTrigger:l,__demoMode:!1}},4:(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=j1(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},5:(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=j1(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n,r;if(e.virtual===null)return{...e,virtual:{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let o=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?o=i:o=null}return{...e,activeOptionIndex:o,virtual:{options:t.options,disabled:(r=t.disabled)!=null?r:()=>!1}}},8:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},9:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},10:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},xR=P.createContext(null);xR.displayName="ComboboxActionsContext";function Yp(e){let t=P.useContext(xR);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Yp),n}return t}let a7=P.createContext(null);function Fbe(e){let t=Ad("VirtualProvider"),{options:n}=t.virtual,[r,o]=P.useMemo(()=>{let c=t.optionsElement;if(!c)return[0,0];let u=window.getComputedStyle(c);return[parseFloat(u.paddingBlockStart||u.paddingTop),parseFloat(u.paddingBlockEnd||u.paddingBottom)]},[t.optionsElement]),i=sve({enabled:n.length!==0,scrollPaddingStart:r,scrollPaddingEnd:o,count:n.length,estimateSize(){return 40},getScrollElement(){return t.optionsElement},overscan:12}),[s,a]=P.useState(0);nn(()=>{a(c=>c+1)},[n]);let l=i.getVirtualItems();return l.length===0?null:P.createElement(a7.Provider,{value:i},P.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:c=>{c&&t.activationTrigger!==0&&t.activeOptionIndex!==null&&n.length>t.activeOptionIndex&&i.scrollToIndex(t.activeOptionIndex)}},l.map(c=>{var u;return P.createElement(P.Fragment,{key:c.key},P.cloneElement((u=e.children)==null?void 0:u.call(e,{...e.slot,option:n[c.index]}),{key:`${s}-${c.key}`,"data-index":c.index,"aria-setsize":n.length,"aria-posinset":c.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${c.start}px)`,overflowAnchor:"none"}}))})))}let Nh=P.createContext(null);Nh.displayName="ComboboxDataContext";function Ad(e){let t=P.useContext(Nh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ad),n}return t}function jbe(e,t){return Si(t.type,Lbe,e,t)}let $be=P.Fragment;function zbe(e,t){var n,r;let o=uR(),{value:i,defaultValue:s,onChange:a,form:l,name:c,by:u,disabled:d=o||!1,onClose:h,__demoMode:p=!1,multiple:m=!1,immediate:v=!1,virtual:y=null,nullable:b,...S}=e,_=O0e(s),[C=m?[]:void 0,E]=P0e(i,a,_),[T,A]=P.useReducer(jbe,{dataRef:P.createRef(),comboboxState:p?0:1,isTyping:!1,options:[],virtual:y?{options:y.options,disabled:(n=y.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:p}),D=P.useRef(!1),k=P.useRef({static:!1,hold:!1}),j=lve(u),$=Ze(he=>y?u===null?y.options.indexOf(he):y.options.findIndex(Ee=>j(Ee,he)):T.options.findIndex(Ee=>j(Ee.dataRef.current.value,he))),z=P.useCallback(he=>Si(V.mode,{1:()=>C.some(Ee=>j(Ee,he)),0:()=>j(C,he)}),[C]),K=Ze(he=>T.activeOptionIndex===$(he)),V=P.useMemo(()=>({...T,immediate:v,optionsPropsRef:k,value:C,defaultValue:_,disabled:d,mode:m?1:0,virtual:y?T.virtual:null,get activeOptionIndex(){if(D.current&&T.activeOptionIndex===null&&(y?y.options.length>0:T.options.length>0)){if(y){let Ee=y.options.findIndex(ke=>{var We,Ie;return!((Ie=(We=y.disabled)==null?void 0:We.call(y,ke))!=null&&Ie)});if(Ee!==-1)return Ee}let he=T.options.findIndex(Ee=>!Ee.dataRef.current.disabled);if(he!==-1)return he}return T.activeOptionIndex},calculateIndex:$,compare:j,isSelected:z,isActive:K}),[C,_,d,m,p,T,y]);nn(()=>{var he;y&&A({type:7,options:y.options,disabled:(he=y.disabled)!=null?he:null})},[y,y==null?void 0:y.options,y==null?void 0:y.disabled]),nn(()=>{T.dataRef.current=V},[V]);let N=V.comboboxState===0;Sve(N,[V.buttonElement,V.inputElement,V.optionsElement],()=>J.closeCombobox());let W=P.useMemo(()=>{var he,Ee,ke;return{open:V.comboboxState===0,disabled:d,activeIndex:V.activeOptionIndex,activeOption:V.activeOptionIndex===null?null:V.virtual?V.virtual.options[(he=V.activeOptionIndex)!=null?he:0]:(ke=(Ee=V.options[V.activeOptionIndex])==null?void 0:Ee.dataRef.current.value)!=null?ke:null,value:C}},[V,d,C]),H=Ze(()=>{if(V.activeOptionIndex!==null){if(J.setIsTyping(!1),V.virtual)M(V.virtual.options[V.activeOptionIndex]);else{let{dataRef:he}=V.options[V.activeOptionIndex];M(he.current.value)}J.goToOption(Un.Specific,V.activeOptionIndex)}}),G=Ze(()=>{A({type:0}),D.current=!0}),te=Ze(()=>{A({type:1}),D.current=!1,h==null||h()}),F=Ze(he=>{A({type:3,isTyping:he})}),Y=Ze((he,Ee,ke)=>(D.current=!1,he===Un.Specific?A({type:2,focus:Un.Specific,idx:Ee,trigger:ke}):A({type:2,focus:he,trigger:ke}))),q=Ze((he,Ee)=>(A({type:4,payload:{id:he,dataRef:Ee}}),()=>{V.isActive(Ee.current.value)&&(D.current=!0),A({type:5,id:he})})),M=Ze(he=>Si(V.mode,{0(){return E==null?void 0:E(he)},1(){let Ee=V.value.slice(),ke=Ee.findIndex(We=>j(We,he));return ke===-1?Ee.push(he):Ee.splice(ke,1),E==null?void 0:E(Ee)}})),ne=Ze(he=>{A({type:6,trigger:he})}),X=Ze(he=>{A({type:8,element:he})}),re=Ze(he=>{A({type:9,element:he})}),ee=Ze(he=>{A({type:10,element:he})}),J=P.useMemo(()=>({onChange:M,registerOption:q,goToOption:Y,setIsTyping:F,closeCombobox:te,openCombobox:G,setActivationTrigger:ne,selectActiveOption:H,setInputElement:X,setButtonElement:re,setOptionsElement:ee}),[]),[le,ce]=V0e(),ye=t===null?{}:{ref:t},oe=P.useCallback(()=>{if(_!==void 0)return E==null?void 0:E(_)},[E,_]),ve=Io();return P.createElement(ce,{value:le,props:{htmlFor:(r=V.inputElement)==null?void 0:r.id},slot:{open:V.comboboxState===0,disabled:d}},P.createElement(hbe,null,P.createElement(xR.Provider,{value:J},P.createElement(Nh.Provider,{value:V},P.createElement(o7,{value:Si(V.comboboxState,{0:xi.Open,1:xi.Closed})},c!=null&&P.createElement(k0e,{disabled:d,data:C!=null?{[c]:C}:{},form:l,onReset:oe}),ve({ourProps:ye,theirProps:S,slot:W,defaultTag:$be,name:"Combobox"}))))))}let Bbe="input";function Hbe(e,t){var n,r,o,i,s;let a=Ad("Combobox.Input"),l=Yp("Combobox.Input"),c=P.useId(),u=H8(),{id:d=u||`headlessui-combobox-input-${c}`,onChange:h,displayValue:p,disabled:m=a.disabled||!1,autoFocus:v=!1,type:y="text",...b}=e,S=P.useRef(null),_=Ri(S,t,ube(),l.setInputElement),C=Lb(a.inputElement),E=Md(),T=Ze(()=>{l.onChange(null),a.optionsElement&&(a.optionsElement.scrollTop=0),l.goToOption(Un.Nothing)}),A=P.useMemo(()=>{var M;return typeof p=="function"&&a.value!==void 0?(M=p(a.value))!=null?M:"":typeof a.value=="string"?a.value:""},[a.value,p]);dk(([M,ne],[X,re])=>{if(a.isTyping)return;let ee=S.current;ee&&((re===0&&ne===1||M!==X)&&(ee.value=M),requestAnimationFrame(()=>{if(a.isTyping||!ee||(C==null?void 0:C.activeElement)!==ee)return;let{selectionStart:J,selectionEnd:le}=ee;Math.abs((le??0)-(J??0))===0&&J===0&&ee.setSelectionRange(ee.value.length,ee.value.length)}))},[A,a.comboboxState,C,a.isTyping]),dk(([M],[ne])=>{if(M===0&&ne===1){if(a.isTyping)return;let X=S.current;if(!X)return;let re=X.value,{selectionStart:ee,selectionEnd:J,selectionDirection:le}=X;X.value="",X.value=re,le!==null?X.setSelectionRange(ee,J,le):X.setSelectionRange(ee,J)}},[a.comboboxState]);let D=P.useRef(!1),k=Ze(()=>{D.current=!0}),j=Ze(()=>{E.nextFrame(()=>{D.current=!1})}),$=Ze(M=>{switch(l.setIsTyping(!0),M.key){case Ir.Enter:if(a.comboboxState!==0||D.current)return;if(M.preventDefault(),M.stopPropagation(),a.activeOptionIndex===null){l.closeCombobox();return}l.selectActiveOption(),a.mode===0&&l.closeCombobox();break;case Ir.ArrowDown:return M.preventDefault(),M.stopPropagation(),Si(a.comboboxState,{0:()=>l.goToOption(Un.Next),1:()=>l.openCombobox()});case Ir.ArrowUp:return M.preventDefault(),M.stopPropagation(),Si(a.comboboxState,{0:()=>l.goToOption(Un.Previous),1:()=>{wr.flushSync(()=>l.openCombobox()),a.value||l.goToOption(Un.Last)}});case Ir.Home:if(M.shiftKey)break;return M.preventDefault(),M.stopPropagation(),l.goToOption(Un.First);case Ir.PageUp:return M.preventDefault(),M.stopPropagation(),l.goToOption(Un.First);case Ir.End:if(M.shiftKey)break;return M.preventDefault(),M.stopPropagation(),l.goToOption(Un.Last);case Ir.PageDown:return M.preventDefault(),M.stopPropagation(),l.goToOption(Un.Last);case Ir.Escape:return a.comboboxState!==0?void 0:(M.preventDefault(),a.optionsElement&&!a.optionsPropsRef.current.static&&M.stopPropagation(),a.mode===0&&a.value===null&&T(),l.closeCombobox());case Ir.Tab:if(a.comboboxState!==0)return;a.mode===0&&a.activationTrigger!==1&&l.selectActiveOption(),l.closeCombobox();break}}),z=Ze(M=>{h==null||h(M),a.mode===0&&M.target.value===""&&T(),l.openCombobox()}),K=Ze(M=>{var ne,X,re;let ee=(ne=M.relatedTarget)!=null?ne:Dl.find(J=>J!==M.currentTarget);if(!((X=a.optionsElement)!=null&&X.contains(ee))&&!((re=a.buttonElement)!=null&&re.contains(ee))&&a.comboboxState===0)return M.preventDefault(),a.mode===0&&a.value===null&&T(),l.closeCombobox()}),V=Ze(M=>{var ne,X,re;let ee=(ne=M.relatedTarget)!=null?ne:Dl.find(J=>J!==M.currentTarget);(X=a.buttonElement)!=null&&X.contains(ee)||(re=a.optionsElement)!=null&&re.contains(ee)||a.disabled||a.immediate&&a.comboboxState!==0&&E.microTask(()=>{wr.flushSync(()=>l.openCombobox()),l.setActivationTrigger(1)})}),N=Nb(),W=$0e(),{isFocused:H,focusProps:G}=N8({autoFocus:v}),{isHovered:te,hoverProps:F}=I8({isDisabled:m}),Y=P.useMemo(()=>({open:a.comboboxState===0,disabled:m,hover:te,focus:H,autofocus:v}),[a,te,H,v,m]),q=dR({ref:_,id:d,role:"combobox",type:y,"aria-controls":(n=a.optionsElement)==null?void 0:n.id,"aria-expanded":a.comboboxState===0,"aria-activedescendant":a.activeOptionIndex===null?void 0:a.virtual?(r=a.options.find(M=>!M.dataRef.current.disabled&&a.compare(M.dataRef.current.value,a.virtual.options[a.activeOptionIndex])))==null?void 0:r.id:(o=a.options[a.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":N,"aria-describedby":W,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:a.defaultValue!==void 0?p==null?void 0:p(a.defaultValue):null)!=null?s:a.defaultValue,disabled:m||void 0,autoFocus:v,onCompositionStart:k,onCompositionEnd:j,onKeyDown:$,onChange:z,onFocus:V,onBlur:K},G,F);return Io()({ourProps:q,theirProps:b,slot:Y,defaultTag:Bbe,name:"Combobox.Input"})}let Vbe="button";function Wbe(e,t){var n;let r=Ad("Combobox.Button"),o=Yp("Combobox.Button"),i=Ri(t,o.setButtonElement),s=P.useId(),{id:a=`headlessui-combobox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:c=!1,...u}=e,d=J8(r.inputElement),h=Ze(A=>{switch(A.key){case Ir.Space:case Ir.Enter:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&wr.flushSync(()=>o.openCombobox()),d();return;case Ir.ArrowDown:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&(wr.flushSync(()=>o.openCombobox()),r.value||o.goToOption(Un.First)),d();return;case Ir.ArrowUp:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&(wr.flushSync(()=>o.openCombobox()),r.value||o.goToOption(Un.Last)),d();return;case Ir.Escape:if(r.comboboxState!==0)return;A.preventDefault(),r.optionsElement&&!r.optionsPropsRef.current.static&&A.stopPropagation(),wr.flushSync(()=>o.closeCombobox()),d();return;default:return}}),p=Ze(A=>{A.preventDefault(),!L0e(A.currentTarget)&&(A.button===bR.Left&&(r.comboboxState===0?o.closeCombobox():o.openCombobox()),d())}),m=Nb([a]),{isFocusVisible:v,focusProps:y}=N8({autoFocus:c}),{isHovered:b,hoverProps:S}=I8({isDisabled:l}),{pressed:_,pressProps:C}=w0e({disabled:l}),E=P.useMemo(()=>({open:r.comboboxState===0,active:_||r.comboboxState===0,disabled:l,value:r.value,hover:b,focus:v}),[r,b,v,_,l]),T=dR({ref:i,id:a,type:Cve(e,r.buttonElement),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":m,disabled:l||void 0,autoFocus:c,onMouseDown:p,onKeyDown:h},y,S,C);return Io()({ourProps:T,theirProps:u,slot:E,defaultTag:Vbe,name:"Combobox.Button"})}let Ube="div",Gbe=fv.RenderStrategy|fv.Static;function qbe(e,t){var n,r,o;let i=P.useId(),{id:s=`headlessui-combobox-options-${i}`,hold:a=!1,anchor:l,portal:c=!1,modal:u=!0,transition:d=!1,...h}=e,p=Ad("Combobox.Options"),m=Yp("Combobox.Options"),v=cbe(l);v&&(c=!0);let[y,b]=fbe(v),[S,_]=P.useState(null),C=dbe(),E=Ri(t,v?y:null,m.setOptionsElement,_),T=Lb(p.optionsElement),A=vR(),[D,k]=e7(d,S,A!==null?(A&xi.Open)===xi.Open:p.comboboxState===0);hve(D,p.inputElement,m.closeCombobox);let j=p.__demoMode?!1:u&&p.comboboxState===0;Mve(j,T);let $=p.__demoMode?!1:u&&p.comboboxState===0;fve($,{allowed:P.useCallback(()=>[p.inputElement,p.buttonElement,p.optionsElement],[p.inputElement,p.buttonElement,p.optionsElement])}),nn(()=>{var q;p.optionsPropsRef.current.static=(q=e.static)!=null?q:!1},[p.optionsPropsRef,e.static]),nn(()=>{p.optionsPropsRef.current.hold=a},[p.optionsPropsRef,a]),Fve(p.comboboxState===0,{container:p.optionsElement,accept(q){return q.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:q.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(q){q.setAttribute("role","none")}});let z=Nb([(n=p.buttonElement)==null?void 0:n.id]),K=P.useMemo(()=>({open:p.comboboxState===0,option:void 0}),[p.comboboxState]),V=Ze(()=>{m.setActivationTrigger(0)}),N=Ze(q=>{q.preventDefault(),m.setActivationTrigger(0)}),W=dR(v?C():{},{"aria-labelledby":z,role:"listbox","aria-multiselectable":p.mode===1?!0:void 0,id:s,ref:E,style:{...h.style,...b,"--input-width":ok(p.inputElement,!0).width,"--button-width":ok(p.buttonElement,!0).width},onWheel:p.activationTrigger===0?void 0:V,onMouseDown:N,...Z8(k)}),H=D&&p.comboboxState===1,G=f_(H,(r=p.virtual)==null?void 0:r.options),te=f_(H,p.value),F=Ze(q=>p.compare(te,q));if(p.virtual){if(G===void 0)throw new Error("Missing `options` in virtual mode");Object.assign(h,{children:P.createElement(Nh.Provider,{value:G!==p.virtual.options?{...p,virtual:{...p.virtual,options:G}}:p},P.createElement(Fbe,{slot:K},h.children))})}let Y=Io();return P.createElement(Abe,{enabled:c?e.static||D:!1},P.createElement(Nh.Provider,{value:p.mode===1?p:{...p,isSelected:F}},Y({ourProps:W,theirProps:{...h,children:P.createElement(mbe,{freeze:H},typeof h.children=="function"?(o=h.children)==null?void 0:o.call(h,K):h.children)},slot:K,defaultTag:Ube,features:Gbe,visible:D,name:"Combobox.Options"})))}let Ybe="div";function Kbe(e,t){var n,r,o,i;let s=Ad("Combobox.Option"),a=Yp("Combobox.Option"),l=P.useId(),{id:c=`headlessui-combobox-option-${l}`,value:u,disabled:d=(o=(r=(n=s.virtual)==null?void 0:n.disabled)==null?void 0:r.call(n,u))!=null?o:!1,order:h=null,...p}=e,m=J8(s.inputElement),v=s.virtual?s.activeOptionIndex===s.calculateIndex(u):s.activeOptionIndex===null?!1:((i=s.options[s.activeOptionIndex])==null?void 0:i.id)===c,y=s.isSelected(u),b=P.useRef(null),S=ol({disabled:d,value:u,domRef:b,order:h}),_=P.useContext(a7),C=Ri(t,b,_?_.measureElement:null),E=Ze(()=>{a.setIsTyping(!1),a.onChange(u)});nn(()=>a.registerOption(c,S),[S,c]);let T=P.useRef(!(s.virtual||s.__demoMode));nn(()=>{if(!s.virtual&&!s.__demoMode)return rs().requestAnimationFrame(()=>{T.current=!0})},[s.virtual,s.__demoMode]),nn(()=>{if(T.current&&s.comboboxState===0&&v&&s.activationTrigger!==0)return rs().requestAnimationFrame(()=>{var N,W;(W=(N=b.current)==null?void 0:N.scrollIntoView)==null||W.call(N,{block:"nearest"})})},[b,v,s.comboboxState,s.activationTrigger,s.activeOptionIndex]);let A=Ze(N=>{N.preventDefault(),N.button===bR.Left&&(d||(E(),Q8()||requestAnimationFrame(()=>m()),s.mode===0&&a.closeCombobox()))}),D=Ze(()=>{if(d)return a.goToOption(Un.Nothing);let N=s.calculateIndex(u);a.goToOption(Un.Specific,N)}),k=Ave(),j=Ze(N=>k.update(N)),$=Ze(N=>{if(!k.wasMoved(N)||d||v)return;let W=s.calculateIndex(u);a.goToOption(Un.Specific,W,0)}),z=Ze(N=>{k.wasMoved(N)&&(d||v&&(s.optionsPropsRef.current.hold||a.goToOption(Un.Nothing)))}),K=P.useMemo(()=>({active:v,focus:v,selected:y,disabled:d}),[v,y,d]),V={id:c,ref:C,role:"option",tabIndex:d===!0?void 0:-1,"aria-disabled":d===!0?!0:void 0,"aria-selected":y,disabled:void 0,onMouseDown:A,onFocus:D,onPointerEnter:j,onMouseEnter:j,onPointerMove:$,onMouseMove:$,onPointerLeave:z,onMouseLeave:z};return Io()({ourProps:V,theirProps:p,slot:K,defaultTag:Ybe,name:"Combobox.Option"})}let Xbe=ao(zbe),Qbe=ao(Wbe),Jbe=ao(Hbe),Zbe=q0e,eye=ao(qbe),tye=ao(Kbe),Sf=Object.assign(Xbe,{Input:Jbe,Button:Qbe,Label:Zbe,Options:eye,Option:tye});function nye(){let e=P.useRef(!1);return nn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function l7(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:u7)!==P.Fragment||P.Children.count(e.children)===1}let Fb=P.createContext(null);Fb.displayName="TransitionContext";var rye=(e=>(e.Visible="visible",e.Hidden="hidden",e))(rye||{});function oye(){let e=P.useContext(Fb);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function iye(){let e=P.useContext(jb);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let jb=P.createContext(null);jb.displayName="NestingContext";function $b(e){return"children"in e?$b(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function c7(e,t){let n=ol(e),r=P.useRef([]),o=nye(),i=Md(),s=Ze((p,m=Na.Hidden)=>{let v=r.current.findIndex(({el:y})=>y===p);v!==-1&&(Si(m,{[Na.Unmount](){r.current.splice(v,1)},[Na.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var y;!$b(r)&&o.current&&((y=n.current)==null||y.call(n))}))}),a=Ze(p=>{let m=r.current.find(({el:v})=>v===p);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,Na.Unmount)}),l=P.useRef([]),c=P.useRef(Promise.resolve()),u=P.useRef({enter:[],leave:[]}),d=Ze((p,m,v)=>{l.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([y])=>y!==p)),t==null||t.chains.current[m].push([p,new Promise(y=>{l.current.push(y)})]),t==null||t.chains.current[m].push([p,new Promise(y=>{Promise.all(u.current[m].map(([b,S])=>S)).then(()=>y())})]),m==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(m)):v(m)}),h=Ze((p,m,v)=>{Promise.all(u.current[m].splice(0).map(([y,b])=>b)).then(()=>{var y;(y=l.current.shift())==null||y()}).then(()=>v(m))});return P.useMemo(()=>({children:r,register:a,unregister:s,onStart:d,onStop:h,wait:c,chains:u}),[a,s,r,d,h,u,c])}let u7=P.Fragment,d7=fv.RenderStrategy;function sye(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:s,beforeLeave:a,afterLeave:l,enter:c,enterFrom:u,enterTo:d,entered:h,leave:p,leaveFrom:m,leaveTo:v,...y}=e,[b,S]=P.useState(null),_=P.useRef(null),C=l7(e),E=Ri(...C?[_,t,S]:t===null?[]:[t]),T=(n=y.unmount)==null||n?Na.Unmount:Na.Hidden,{show:A,appear:D,initial:k}=oye(),[j,$]=P.useState(A?"visible":"hidden"),z=iye(),{register:K,unregister:V}=z;nn(()=>K(_),[K,_]),nn(()=>{if(T===Na.Hidden&&_.current){if(A&&j!=="visible"){$("visible");return}return Si(j,{hidden:()=>V(_),visible:()=>K(_)})}},[j,_,K,V,A,T]);let N=yR();nn(()=>{if(C&&N&&j==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,j,N,C]);let W=k&&!D,H=D&&A&&k,G=P.useRef(!1),te=c7(()=>{G.current||($("hidden"),V(_))},z),F=Ze(ee=>{G.current=!0;let J=ee?"enter":"leave";te.onStart(_,J,le=>{le==="enter"?i==null||i():le==="leave"&&(a==null||a())})}),Y=Ze(ee=>{let J=ee?"enter":"leave";G.current=!1,te.onStop(_,J,le=>{le==="enter"?s==null||s():le==="leave"&&(l==null||l())}),J==="leave"&&!$b(te)&&($("hidden"),V(_))});P.useEffect(()=>{C&&o||(F(A),Y(A))},[A,C,o]);let q=!(!o||!C||!N||W),[,M]=e7(q,b,A,{start:F,end:Y}),ne=ya({ref:E,className:((r=l_(y.className,H&&c,H&&u,M.enter&&c,M.enter&&M.closed&&u,M.enter&&!M.closed&&d,M.leave&&p,M.leave&&!M.closed&&m,M.leave&&M.closed&&v,!M.transition&&A&&h))==null?void 0:r.trim())||void 0,...Z8(M)}),X=0;j==="visible"&&(X|=xi.Open),j==="hidden"&&(X|=xi.Closed),M.enter&&(X|=xi.Opening),M.leave&&(X|=xi.Closing);let re=Io();return P.createElement(jb.Provider,{value:te},P.createElement(o7,{value:X},re({ourProps:ne,theirProps:y,defaultTag:u7,features:d7,visible:j==="visible",name:"Transition.Child"})))}function aye(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=P.useRef(null),a=l7(e),l=Ri(...a?[s,t]:t===null?[]:[t]);yR();let c=vR();if(n===void 0&&c!==null&&(n=(c&xi.Open)===xi.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=P.useState(n?"visible":"hidden"),h=c7(()=>{n||d("hidden")}),[p,m]=P.useState(!0),v=P.useRef([n]);nn(()=>{p!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),m(!1))},[v,n]);let y=P.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);nn(()=>{n?d("visible"):!$b(h)&&s.current!==null&&d("hidden")},[n,h]);let b={unmount:o},S=Ze(()=>{var E;p&&m(!1),(E=e.beforeEnter)==null||E.call(e)}),_=Ze(()=>{var E;p&&m(!1),(E=e.beforeLeave)==null||E.call(e)}),C=Io();return P.createElement(jb.Provider,{value:h},P.createElement(Fb.Provider,{value:y},C({ourProps:{...b,as:P.Fragment,children:P.createElement(f7,{ref:l,...b,...i,beforeEnter:S,beforeLeave:_})},theirProps:{},defaultTag:P.Fragment,features:d7,visible:u==="visible",name:"Transition"})))}function lye(e,t){let n=P.useContext(Fb)!==null,r=vR()!==null;return P.createElement(P.Fragment,null,!n&&r?P.createElement(h_,{ref:t,...e}):P.createElement(f7,{ref:t,...e}))}let h_=ao(aye),f7=ao(sye),cye=ao(lye),uye=Object.assign(h_,{Child:cye,Root:h_});function dye(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 fye(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 bd.includes(e)?o:r}var wR="Checkbox",[hye,UOe]=Jn(wR),[pye,gye]=hye(wR),h7=R.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[h,p]=R.useState(null),m=at(t,C=>p(C)),v=R.useRef(!1),y=h?u||!!h.closest("form"):!0,[b=!1,S]=Cr({prop:o,defaultProp:i,onChange:c}),_=R.useRef(b);return R.useEffect(()=>{const C=h==null?void 0:h.form;if(C){const E=()=>S(_.current);return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[h,S]),x.jsxs(pye,{scope:n,state:b,disabled:a,children:[x.jsx(Be.button,{type:"button",role:"checkbox","aria-checked":$a(b)?"mixed":b,"aria-required":s,"data-state":m7(b),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onKeyDown:Te(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:Te(e.onClick,C=>{S(E=>$a(E)?!0:!E),y&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})}),y&&x.jsx(mye,{control:h,bubbles:!v.current,name:r,value:l,checked:b,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:$a(i)?!1:i})]})});h7.displayName=wR;var p7="CheckboxIndicator",g7=R.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=gye(p7,n);return x.jsx(Yn,{present:r||$a(i.state)||i.state===!0,children:x.jsx(Be.span,{"data-state":m7(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});g7.displayName=p7;var mye=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,s=R.useRef(null),a=wb(n),l=fb(t);R.useEffect(()=>{const u=s.current,d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&p){const m=new Event("click",{bubbles:r});u.indeterminate=$a(n),p.call(u,$a(n)?!1:n),u.dispatchEvent(m)}},[a,n,r]);const c=R.useRef($a(n)?!1:n);return x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function $a(e){return e==="indeterminate"}function m7(e){return $a(e)?"indeterminate":e?"checked":"unchecked"}var v7=h7,vye=g7;const zb=R.forwardRef(({className:e,...t},n)=>x.jsx(v7,{ref:n,className:xe("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:x.jsx(vye,{className:xe("flex items-center justify-center text-current"),children:x.jsx(Cp,{className:"h-4 w-4"})})}));zb.displayName=v7.displayName;function bye({filter:e}){const[t,n]=P.useState([]),[r,o]=P.useState(""),[i,s]=P.useState(""),a=P.useRef(null);ko();const l=we(D=>D.filterValues),c=we(D=>D.selectedSheetId),u=we(D=>D.actions.addOrUpdateFilterValue),d=we(D=>D.actions.removeFilterValue),{data:h,isLoading:p,isFetching:m,isError:v,refetch:y}=E8(e),b=P.useMemo(()=>{var D;return(D=h==null?void 0:h.records)==null?void 0:D.map(k=>{let j=e.column.split(".").slice(-1)[0].replace(/"/g,"");return k[j]===void 0&&(j=j.toLowerCase()),{id:k[j],value:k[j]}})},[h,e.column]);P.useEffect(()=>{if(l){const D=l.find(k=>k.filterId===e.id);if(!D){n([]);return}if(D.operation==="in"){const k=b==null?void 0:b.filter(j=>D.values.includes(j.value));k&&n(k)}else o(`${D.operation} ${D.values[0]}`)}},[h,c,l]),P.useEffect(()=>{if(l&&!l.find(k=>k.filterId===e.id)){n([]);return}},[l,e.id]);function S(D){const k=dye(D[0].toString());if(!(k!=null&&k.value)||!(k!=null&&k.operation))return;const j={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:wu(e),name:e.column,operation:k.operation,values:[Number(k.value)]};u(j)}function _(D){if(Array.isArray(D)||(D=[D]),console.log("onComboBoxChange",D),D.length===1&&b.find(j=>j.value===D[0].value)===void 0){S(D);return}if(n(D),D.length===0){d(e.id);return}const k={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:wu(e),operation:e.operation,values:D.map(j=>j.value)};u(k)}function C(D){if(D){n(b);const k={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:wu(e),operation:e.operation,values:b.map(j=>j.value)};u(k)}else n([]),d(e.id)}const E=t.length===(b==null?void 0:b.length);if(p)return x.jsx("div",{children:x.jsx(_u,{className:"h-8 w-full bg-foreground/10"})});if(v)return x.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let T=[];bp.includes(e.dataType)?T=b:T=i===""?b:b==null?void 0:b.filter(D=>D.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,"")));const A=e.type==="single";return x.jsx("div",{className:"w-full",children:x.jsx(Sf,{value:t,multiple:!A,onChange:_,children:x.jsxs("div",{className:"relative",children:[x.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:[x.jsx(Sf.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:D=>D.map(j=>j.value).join(", ")||r,onChange:D=>{o(D.target.value),s(D.target.value)}}),x.jsx(Sf.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:x.jsx($Z,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),x.jsx(uye,{as:P.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:x.jsxs(Sf.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:[e.type==="multiple"||e.type===void 0&&x.jsxs("div",{className:"flex items-center justify-between gap-2 border-b px-4 py-2",children:[x.jsx("span",{children:"Select All"}),x.jsx(zb,{checked:E,onCheckedChange:C})]}),(T==null?void 0:T.length)===0&&i!==""?x.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):T==null?void 0:T.map(D=>x.jsx(Sf.Option,{className:({active:k})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${k?"bg-muted":"text-foreground-900"}`,value:D,children:({selected:k,active:j})=>x.jsxs("div",{className:"",children:[x.jsx("span",{className:`block ${k?"font-medium":"font-normal"}`,children:typeof D.value=="boolean"?D.value?"True":"False":D.value}),k?x.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:x.jsx(X5,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},D.value))]})})]})})})}const SR=R.forwardRef(({className:e,...t},n)=>x.jsx("textarea",{className:xe("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}));SR.displayName="Textarea";var _R="Radio",[yye,b7]=Jn(_R),[xye,wye]=yye(_R),y7=R.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,form:c,...u}=e,[d,h]=R.useState(null),p=at(t,y=>h(y)),m=R.useRef(!1),v=d?c||!!d.closest("form"):!0;return x.jsxs(xye,{scope:n,checked:o,disabled:s,children:[x.jsx(Be.button,{type:"button",role:"radio","aria-checked":o,"data-state":S7(o),"data-disabled":s?"":void 0,disabled:s,value:a,...u,ref:p,onClick:Te(e.onClick,y=>{o||l==null||l(),v&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),v&&x.jsx(Sye,{control:d,bubbles:!m.current,name:r,value:a,checked:o,required:i,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});y7.displayName=_R;var x7="RadioIndicator",w7=R.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=wye(x7,n);return x.jsx(Yn,{present:r||i.checked,children:x.jsx(Be.span,{"data-state":S7(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});w7.displayName=x7;var Sye=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=R.useRef(null),s=wb(n),a=fb(t);return R.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const h=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(h)}},[s,n,r]),x.jsx("input",{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 S7(e){return e?"checked":"unchecked"}var _ye=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],CR="RadioGroup",[Cye,GOe]=Jn(CR,[xd,b7]),_7=xd(),C7=b7(),[Eye,Rye]=Cye(CR),E7=R.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:d,...h}=e,p=_7(n),m=Mc(c),[v,y]=Cr({prop:i,defaultProp:o,onChange:d});return x.jsx(Eye,{scope:n,name:r,required:s,disabled:a,value:v,onValueChange:y,children:x.jsx(tC,{asChild:!0,...p,orientation:l,dir:m,loop:u,children:x.jsx(Be.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:m,...h,ref:t})})})});E7.displayName=CR;var R7="RadioGroupItem",P7=R.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=Rye(R7,n),s=i.disabled||r,a=_7(n),l=C7(n),c=R.useRef(null),u=at(t,c),d=i.value===o.value,h=R.useRef(!1);return R.useEffect(()=>{const p=v=>{_ye.includes(v.key)&&(h.current=!0)},m=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),x.jsx(nC,{asChild:!0,...a,focusable:!s,active:d,children:x.jsx(y7,{disabled:s,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Te(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Te(o.onFocus,()=>{var p;h.current&&((p=c.current)==null||p.click())})})})});P7.displayName=R7;var Pye="RadioGroupIndicator",O7=R.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=C7(n);return x.jsx(w7,{...o,...r,ref:t})});O7.displayName=Pye;var T7=E7,M7=P7,Oye=O7;const ER=R.forwardRef(({className:e,...t},n)=>x.jsx(T7,{className:xe("grid gap-2",e),...t,ref:n}));ER.displayName=T7.displayName;const hv=R.forwardRef(({className:e,...t},n)=>x.jsx(M7,{ref:n,className:xe("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:x.jsx(Oye,{className:"flex items-center justify-center",children:x.jsx(DC,{className:"h-2.5 w-2.5 fill-current text-current"})})}));hv.displayName=M7.displayName;function Tye({label:e,onCheckedChange:t,checked:n}){return x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx(zb,{onCheckedChange:t,id:"terms",checked:n}),x.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function Mye({filter:e}){const[t,n]=P.useState(e.sql),[r,o]=P.useState(!1),i=we(d=>d.selectedSheetId),{updateFilter:s}=dr();function a(){const d={...e,sql:t};s(d),o(!1)}function l(d){console.log("operation",d);const h={...e,operation:d};s(h)}function c(d){const h={...e,type:d};s(h)}function u(d){if(!i)return;const h={...e,sheetId:d?i:void 0};s(h)}return x.jsxs(Ob,{open:r,onOpenChange:o,children:[x.jsx(Tb,{children:x.jsx(NC,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),x.jsxs($p,{onMouseDown:d=>d.stopPropagation(),onDoubleClick:d=>d.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[x.jsxs("div",{className:"space-y-2",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),x.jsx("p",{className:"rounded-md bg-muted px-2 py-1 text-xs text-muted-foreground",children:e.column})]}),x.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),x.jsx(Np,{}),x.jsxs("div",{className:"space-y-2",children:[x.jsx(Tn,{children:"Type"}),x.jsxs(ER,{onValueChange:c,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx(hv,{value:"multiple",id:"r1"}),x.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx(hv,{value:"single",id:"r2"}),x.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),x.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[x.jsxs("div",{className:"col-span-2 space-y-1",children:[x.jsx(Tn,{children:"Table Column"}),x.jsx(Tn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),x.jsxs("div",{className:"col-span-2 space-y-1",children:[x.jsx(Tn,{children:"Data Type"}),x.jsx(Tn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),x.jsxs("div",{className:"col-span-2 space-y-1",children:[x.jsx(Tn,{className:"text-sm",children:"Filter Operation"}),x.jsx(Aye,{updateFilterOperation:l,value:e.operation})]})]}),x.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[x.jsx(Tn,{className:"text-sm",children:"Values SQL"}),x.jsx(SR,{onKeyDown:d=>{d.stopPropagation()},value:t,onChange:d=>n(d.target.value),className:`min-w-full grow resize font-mono text-xs ${Yf}`})]}),x.jsx("div",{children:x.jsx(Tye,{label:"Local to sheet",onCheckedChange:u,checked:!!e.sheetId})}),x.jsx("div",{className:"flex justify-end gap-2",children:x.jsxs(oo,{onClick:a,size:"sm",variant:"outline",children:[x.jsx(Cp,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function Aye({value:e,updateFilterOperation:t}){return x.jsxs(Ts,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[x.jsx(Fi,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:x.jsx(Ms,{placeholder:"Operation"})}),x.jsxs(ji,{children:[x.jsx(Hn,{value:"=",children:"Equals"}),x.jsx(Hn,{value:"in",children:"Contains"}),x.jsx(Hn,{value:"like",children:"Like"})]})]})}function A7({filter:e}){const t=we(a=>a.isDashboardEditing),n=we(a=>a.filterValues),r=n==null?void 0:n.some(a=>a.filterId===e.id),{removeFilterValue:o,removeFilter:i,updateFilter:s}=dr();return x.jsx(Qi,{className:"my-1",text:e.title||e.column,onSave:a=>s({...e,title:a}),children:x.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[x.jsxs("div",{className:"flex grow items-center gap-2",children:[x.jsx(Tn,{className:"inline-block text-sm",children:e.title}),t&&x.jsx(Mye,{filter:e})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[r&&x.jsx("button",{onClick:()=>o(e.id),className:"text-foreground/30 hover:text-foreground/50",children:x.jsx(kC,{className:"size-3.5"})}),t&&x.jsx(wd,{onClick:()=>{o(e.id),i(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})]})]})})}var Dye=e=>{switch(e){case"success":return Nye;case"info":return Fye;case"warning":return Lye;case"error":return jye;default:return null}},kye=Array(12).fill(0),Iye=({visible:e})=>P.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},P.createElement("div",{className:"sonner-spinner"},kye.map((t,n)=>P.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Nye=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.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"})),Lye=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},P.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"})),Fye=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.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"})),jye=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.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"})),$ye=()=>{let[e,t]=P.useState(document.hidden);return P.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},p_=1,zye=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:p_++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(async i=>{if(Hye(i)&&!i.ok){o=!1;let s=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:s,description:a})}else if(t.success!==void 0){o=!1;let s=typeof t.success=="function"?await t.success(i):t.success,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:s,description:a})}}).catch(async i=>{if(t.error!==void 0){o=!1;let s=typeof t.error=="function"?await t.error(i):t.error,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:s,description:a})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||p_++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},yo=new zye,Bye=(e,t)=>{let n=(t==null?void 0:t.id)||p_++;return yo.addToast({title:e,...t,id:n}),n},Hye=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Vye=Bye,Wye=()=>yo.toasts,D7=Object.assign(Vye,{success:yo.success,info:yo.info,warning:yo.warning,error:yo.error,custom:yo.custom,message:yo.message,promise:yo.promise,dismiss:yo.dismiss,loading:yo.loading},{getHistory:Wye});function Uye(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))}Uye(`: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%)}
354
+ `);function $m(e){return e.label!==void 0}var Gye=3,qye="32px",Yye=4e3,Kye=356,Xye=14,Qye=20,Jye=200;function Zye(...e){return e.filter(Boolean).join(" ")}var exe=e=>{var t,n,r,o,i,s,a,l,c,u;let{invert:d,toast:h,unstyled:p,interacting:m,setHeights:v,visibleToasts:y,heights:b,index:S,toasts:_,expanded:C,removeToast:E,defaultRichColors:T,closeButton:A,style:D,cancelButtonStyle:k,actionButtonStyle:j,className:$="",descriptionClassName:z="",duration:K,position:V,gap:N,loadingIcon:W,expandByDefault:H,classNames:G,icons:te,closeButtonAriaLabel:F="Close toast",pauseWhenPageIsHidden:Y,cn:q}=e,[M,ne]=P.useState(!1),[X,re]=P.useState(!1),[ee,J]=P.useState(!1),[le,ce]=P.useState(!1),[ye,oe]=P.useState(0),[ve,he]=P.useState(0),Ee=P.useRef(null),ke=P.useRef(null),We=S===0,Ie=S+1<=y,Le=h.type,dt=h.dismissible!==!1,$t=h.className||"",rn=h.descriptionClassName||"",Nt=P.useMemo(()=>b.findIndex(tt=>tt.toastId===h.id)||0,[b,h.id]),on=P.useMemo(()=>{var tt;return(tt=h.closeButton)!=null?tt:A},[h.closeButton,A]),pe=P.useMemo(()=>h.duration||K||Yye,[h.duration,K]),Pe=P.useRef(0),ze=P.useRef(0),Ye=P.useRef(0),nt=P.useRef(null),[sn,Cn]=V.split("-"),mn=P.useMemo(()=>b.reduce((tt,mt,kt)=>kt>=Nt?tt:tt+mt.height,0),[b,Nt]),jn=$ye(),vn=h.invert||d,Ht=Le==="loading";ze.current=P.useMemo(()=>Nt*N+mn,[Nt,mn]),P.useEffect(()=>{ne(!0)},[]),P.useLayoutEffect(()=>{if(!M)return;let tt=ke.current,mt=tt.style.height;tt.style.height="auto";let kt=tt.getBoundingClientRect().height;tt.style.height=mt,he(kt),v(Zt=>Zt.find(wt=>wt.toastId===h.id)?Zt.map(wt=>wt.toastId===h.id?{...wt,height:kt}:wt):[{toastId:h.id,height:kt,position:h.position},...Zt])},[M,h.title,h.description,v,h.id]);let cn=P.useCallback(()=>{re(!0),oe(ze.current),v(tt=>tt.filter(mt=>mt.toastId!==h.id)),setTimeout(()=>{E(h)},Jye)},[h,E,v,ze]);P.useEffect(()=>{if(h.promise&&Le==="loading"||h.duration===1/0||h.type==="loading")return;let tt,mt=pe;return C||m||Y&&jn?(()=>{if(Ye.current<Pe.current){let kt=new Date().getTime()-Pe.current;mt=mt-kt}Ye.current=new Date().getTime()})():mt!==1/0&&(Pe.current=new Date().getTime(),tt=setTimeout(()=>{var kt;(kt=h.onAutoClose)==null||kt.call(h,h),cn()},mt)),()=>clearTimeout(tt)},[C,m,H,h,pe,cn,h.promise,Le,Y,jn]),P.useEffect(()=>{let tt=ke.current;if(tt){let mt=tt.getBoundingClientRect().height;return he(mt),v(kt=>[{toastId:h.id,height:mt,position:h.position},...kt]),()=>v(kt=>kt.filter(Zt=>Zt.toastId!==h.id))}},[v,h.id]),P.useEffect(()=>{h.delete&&cn()},[cn,h.delete]);function Pn(){return te!=null&&te.loading?P.createElement("div",{className:"sonner-loader","data-visible":Le==="loading"},te.loading):W?P.createElement("div",{className:"sonner-loader","data-visible":Le==="loading"},W):P.createElement(Iye,{visible:Le==="loading"})}return P.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:ke,className:q($,$t,G==null?void 0:G.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,G==null?void 0:G.default,G==null?void 0:G[Le],(n=h==null?void 0:h.classNames)==null?void 0:n[Le]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:T,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":M,"data-promise":!!h.promise,"data-removed":X,"data-visible":Ie,"data-y-position":sn,"data-x-position":Cn,"data-index":S,"data-front":We,"data-swiping":ee,"data-dismissible":dt,"data-type":Le,"data-invert":vn,"data-swipe-out":le,"data-expanded":!!(C||H&&M),style:{"--index":S,"--toasts-before":S,"--z-index":_.length-S,"--offset":`${X?ye:ze.current}px`,"--initial-height":H?"auto":`${ve}px`,...D,...h.style},onPointerDown:tt=>{Ht||!dt||(Ee.current=new Date,oe(ze.current),tt.target.setPointerCapture(tt.pointerId),tt.target.tagName!=="BUTTON"&&(J(!0),nt.current={x:tt.clientX,y:tt.clientY}))},onPointerUp:()=>{var tt,mt,kt,Zt;if(le||!dt)return;nt.current=null;let wt=Number(((tt=ke.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),$n=new Date().getTime()-((mt=Ee.current)==null?void 0:mt.getTime()),oi=Math.abs(wt)/$n;if(Math.abs(wt)>=Qye||oi>.11){oe(ze.current),(kt=h.onDismiss)==null||kt.call(h,h),cn(),ce(!0);return}(Zt=ke.current)==null||Zt.style.setProperty("--swipe-amount","0px"),J(!1)},onPointerMove:tt=>{var mt;if(!nt.current||!dt)return;let kt=tt.clientY-nt.current.y,Zt=tt.clientX-nt.current.x,wt=(sn==="top"?Math.min:Math.max)(0,kt),$n=tt.pointerType==="touch"?10:2;Math.abs(wt)>$n?(mt=ke.current)==null||mt.style.setProperty("--swipe-amount",`${kt}px`):Math.abs(Zt)>$n&&(nt.current=null)}},on&&!h.jsx?P.createElement("button",{"aria-label":F,"data-disabled":Ht,"data-close-button":!0,onClick:Ht||!dt?()=>{}:()=>{var tt;cn(),(tt=h.onDismiss)==null||tt.call(h,h)},className:q(G==null?void 0:G.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},P.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"},P.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),P.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||P.isValidElement(h.title)?h.jsx||h.title:P.createElement(P.Fragment,null,Le||h.icon||h.promise?P.createElement("div",{"data-icon":"",className:q(G==null?void 0:G.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Pn():null,h.type!=="loading"?h.icon||(te==null?void 0:te[Le])||Dye(Le):null):null,P.createElement("div",{"data-content":"",className:q(G==null?void 0:G.content,(s=h==null?void 0:h.classNames)==null?void 0:s.content)},P.createElement("div",{"data-title":"",className:q(G==null?void 0:G.title,(a=h==null?void 0:h.classNames)==null?void 0:a.title)},h.title),h.description?P.createElement("div",{"data-description":"",className:q(z,rn,G==null?void 0:G.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),P.isValidElement(h.cancel)?h.cancel:h.cancel&&$m(h.cancel)?P.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||k,onClick:tt=>{var mt,kt;$m(h.cancel)&&dt&&((kt=(mt=h.cancel).onClick)==null||kt.call(mt,tt),cn())},className:q(G==null?void 0:G.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,P.isValidElement(h.action)?h.action:h.action&&$m(h.action)?P.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||j,onClick:tt=>{var mt,kt;$m(h.action)&&(tt.defaultPrevented||((kt=(mt=h.action).onClick)==null||kt.call(mt,tt),cn()))},className:q(G==null?void 0:G.actionButton,(u=h==null?void 0:h.classNames)==null?void 0:u.actionButton)},h.action.label):null))};function xk(){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 txe=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:d,visibleToasts:h=Gye,toastOptions:p,dir:m=xk(),gap:v=Xye,loadingIcon:y,icons:b,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:_,cn:C=Zye}=e,[E,T]=P.useState([]),A=P.useMemo(()=>Array.from(new Set([n].concat(E.filter(Y=>Y.position).map(Y=>Y.position)))),[E,n]),[D,k]=P.useState([]),[j,$]=P.useState(!1),[z,K]=P.useState(!1),[V,N]=P.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=P.useRef(null),H=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=P.useRef(null),te=P.useRef(!1),F=P.useCallback(Y=>{var q;(q=E.find(M=>M.id===Y.id))!=null&&q.delete||yo.dismiss(Y.id),T(M=>M.filter(({id:ne})=>ne!==Y.id))},[E]);return P.useEffect(()=>yo.subscribe(Y=>{if(Y.dismiss){T(q=>q.map(M=>M.id===Y.id?{...M,delete:!0}:M));return}setTimeout(()=>{wr.flushSync(()=>{T(q=>{let M=q.findIndex(ne=>ne.id===Y.id);return M!==-1?[...q.slice(0,M),{...q[M],...Y},...q.slice(M+1)]:[Y,...q]})})})}),[]),P.useEffect(()=>{if(l!=="system"){N(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?N("dark"):N("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:Y})=>{N(Y?"dark":"light")})},[l]),P.useEffect(()=>{E.length<=1&&$(!1)},[E]),P.useEffect(()=>{let Y=q=>{var M,ne;r.every(X=>q[X]||q.code===X)&&($(!0),(M=W.current)==null||M.focus()),q.code==="Escape"&&(document.activeElement===W.current||(ne=W.current)!=null&&ne.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[r]),P.useEffect(()=>{if(W.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,te.current=!1)}},[W.current]),E.length?P.createElement("section",{"aria-label":`${S} ${H}`,tabIndex:-1},A.map((Y,q)=>{var M;let[ne,X]=Y.split("-");return P.createElement("ol",{key:Y,dir:m==="auto"?xk():m,tabIndex:-1,ref:W,className:s,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":ne,"data-x-position":X,style:{"--front-toast-height":`${((M=D[0])==null?void 0:M.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||qye,"--width":`${Kye}px`,"--gap":`${v}px`,...d},onBlur:re=>{te.current&&!re.currentTarget.contains(re.relatedTarget)&&(te.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||te.current||(te.current=!0,G.current=re.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{z||$(!1)},onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},E.filter(re=>!re.position&&q===0||re.position===Y).map((re,ee)=>{var J,le;return P.createElement(exe,{key:re.id,icons:b,index:ee,toast:re,defaultRichColors:c,duration:(J=p==null?void 0:p.duration)!=null?J:u,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:h,closeButton:(le=p==null?void 0:p.closeButton)!=null?le:i,interacting:z,position:Y,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:F,toasts:E.filter(ce=>ce.position==re.position),heights:D.filter(ce=>ce.position==re.position),setHeights:k,expandByDefault:o,gap:v,loadingIcon:y,expanded:j,pauseWhenPageIsHidden:_,cn:C})}))})):null};function nxe(){const{getSelectedFrame:e,addFrame:t,setSelectedFrameId:n}=dr(),r=we(l=>l.dashboard.sheets),i=we(l=>l.selectedSheetId)??(r==null?void 0:r[0].id),s=we(l=>l.isDashboardEditing),a=we(l=>l.isVisualEditing);P.useEffect(()=>{if(!s||a)return;async function l(d){const h=d.ctrlKey||d.metaKey;h&&d.key==="c"?(await c(),D7.success("Card copied to clipboard"),d.preventDefault()):h&&d.key==="v"&&(await u(),d.preventDefault())}async function c(){try{const d=e();d&&await navigator.clipboard.writeText(JSON.stringify(d))}catch(d){console.error("Failed to copy text:",d)}}async function u(){if(!i)return null;try{const d=await navigator.clipboard.readText();try{const h=JSON.parse(d);if(h&&h.id){h.id=Ba();const p=h.activeCardId;h.cards.forEach(m=>{const v=m.id;m.id=Ba(),v===p&&(h.activeCardId=m.id,m.title=`${m.title} (Copy)`)}),t(i,h),n(h.id)}}catch(h){console.error("Failed to parse clipboard contents: ",h)}return d}catch(d){return console.error("Failed to paste text:",d),null}}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,e,n,i,s,a])}const rxe=WT.WidthProvider(WT.Responsive),RR=e=>bd.includes(e.dataType)?x.jsx(Zme,{filter:e}):x.jsx(bye,{filter:e});function oxe({sheet:e}){var y;const t=we(b=>b.isDashboardEditing);we(b=>b.currentBreakpoint);const n=we(b=>b.themeStyle);P.useState([]);const r=we(b=>b.selectedSheetId);we(b=>b.selectedLensId);const o=e.layouts,i=we(b=>b.dashboard.filters),s=e.frames,{getSelectedSheet:a,setSheetLayouts:l,setCurrentBreakpoint:c}=we(b=>b.actions),u=a();nxe();const d=P.useCallback(b=>{c(b)},[c]),h=P.useCallback((b,S)=>{u!=null&&u.id&&l(u.id,S)},[u==null?void 0:u.id,l]);if(!r)return null;const p=(b,S)=>x.jsx(k7,{className:"after:content-none",ref:S,handleAxis:b});function m(){const b=i==null?void 0:i.filter(S=>S.sheetId===r||!S.sheetId);return b==null?void 0:b.map(S=>{var _,C;return S.location==="frame"?null:x.jsxs("div",{style:{borderRadius:(C=(_=n==null?void 0:n.chart)==null?void 0:_.options)==null?void 0:C.borderRadius},className:xe("z-50 flex flex-col rounded-md border bg-background px-3 py-2"),children:[x.jsx(A7,{filter:S}),RR(S)]},S.id)})}function v(){return s==null?void 0:s.map(b=>x.jsx("div",{role:"dashboard-frame-container",className:xe("group overflow-hidden",n==null?void 0:n.dashboardCardContainer),children:x.jsx(eb,{FallbackComponent:({error:S,resetErrorBoundary:_})=>x.jsx(_ee,{error:S,resetErrorBoundary:_,frame:b}),children:x.jsx(upe,{frame:b})})},b.id))}return x.jsx(x.Fragment,{children:x.jsxs(rxe,{margin:[10,10],isDraggable:t,resizeHandles:t?["sw","nw","ne","se","e","w"]:[],className:xe((y=n==null?void 0:n.gridLayout)==null?void 0:y.className),layouts:o,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:d,onLayoutChange:h,resizeHandle:p,children:[m(),v()]})})}const k7=P.forwardRef(({className:e,handleAxis:t,...n},r)=>(we(o=>o.themeStyle),x.jsx("div",{ref:r,className:xe(`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})));k7.displayName="ResizeHandle";var I7="vercel.ai.error",ixe=Symbol.for(I7),N7,sxe=class L7 extends Error{constructor({name:t,message:n,cause:r}){super(n),this[N7]=!0,this.name=t,this.cause=r}static isInstance(t){return L7.hasMarker(t,I7)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};N7=ixe;var gd=sxe;function F7(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var j7="AI_InvalidArgumentError",$7=`vercel.ai.error.${j7}`,axe=Symbol.for($7),z7,lxe=class extends gd{constructor({message:e,cause:t,argument:n}){super({name:j7,message:e,cause:t}),this[z7]=!0,this.argument=n}static isInstance(e){return gd.hasMarker(e,$7)}};z7=axe;var B7="AI_JSONParseError",H7=`vercel.ai.error.${B7}`,cxe=Symbol.for(H7),V7,wk=class extends gd{constructor({text:e,cause:t}){super({name:B7,message:`JSON parsing failed: Text: ${e}.
355
+ Error message: ${F7(t)}`,cause:t}),this[V7]=!0,this.text=e}static isInstance(e){return gd.hasMarker(e,H7)}};V7=cxe;var W7="AI_TypeValidationError",U7=`vercel.ai.error.${W7}`,uxe=Symbol.for(U7),G7,dxe=class g_ extends gd{constructor({value:t,cause:n}){super({name:W7,message:`Type validation failed: Value: ${JSON.stringify(t)}.
356
+ Error message: ${F7(n)}`,cause:n}),this[G7]=!0,this.value=t}static isInstance(t){return gd.hasMarker(t,U7)}static wrap({value:t,cause:n}){return g_.isInstance(n)&&n.value===t?n:new g_({value:t,cause:n})}};G7=uxe;var Sk=dxe;let fxe=(e,t=21)=>(n=t)=>{let r="",o=n|0;for(;o--;)r+=e[Math.random()*e.length|0];return r};var Dd={exports:{}};const hxe=typeof Buffer<"u",_k=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Ck=/"(?: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 q7(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),hxe&&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(_k.test(e)===!1&&Ck.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(_k.test(e)===!1)return r}else if(Ck.test(e)===!1)return r;return Y7(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function Y7(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 PR(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return q7(e,t,n)}finally{Error.stackTraceLimit=r}}function pxe(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return q7(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Dd.exports=PR;Dd.exports.default=PR;Dd.exports.parse=PR;Dd.exports.safeParse=pxe;Dd.exports.scan=Y7;var gxe=Dd.exports;const mxe=Oc(gxe);var vxe=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const o=fxe(n,t);if(e==null)return o;if(n.includes(r))throw new lxe({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return i=>`${e}${r}${o(i)}`},K7=vxe(),m_=Symbol.for("vercel.ai.validator");function bxe(e){return{[m_]:!0,validate:e}}function yxe(e){return typeof e=="object"&&e!==null&&m_ in e&&e[m_]===!0&&"validate"in e}function xxe(e){return yxe(e)?e:wxe(e)}function wxe(e){return bxe(t=>{const n=e.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}})}function Sxe({value:e,schema:t}){const n=xxe(t);try{if(n.validate==null)return{success:!0,value:e};const r=n.validate(e);return r.success?r:{success:!1,error:Sk.wrap({value:e,cause:r.error})}}catch(r){return{success:!1,error:Sk.wrap({value:e,cause:r})}}}function Ek({text:e,schema:t}){try{const n=mxe.parse(e);return t==null?{success:!0,value:n}:Sxe({value:n,schema:t})}catch(n){return{success:!1,error:wk.isInstance(n)?n:new wk({text:e,cause:n})}}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Lh={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Fh={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},jh={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}}},$h={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}}}},zh={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}}},_xe=[Lh,Fh,jh,$h,zh];Lh.code+"",Fh.code+"",jh.code+"",$h.code+"",zh.code+"";Lh.name+"",Lh.code,Fh.name+"",Fh.code,jh.name+"",jh.code,$h.name+"",$h.code,zh.name+"",zh.code;_xe.map(e=>e.code);function Cxe(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 d=e.substring(r,l+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(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 Exe(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=Ek({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=Ek({text:Cxe(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Bh={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Hh={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},Vh={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Wh={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}}},Uh={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}}},Gh={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}}},qh={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}}},Yh={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}}},Kh={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},Xh={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},Qh={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},Rxe=[Bh,Hh,Vh,Wh,Uh,Gh,qh,Yh,Kh,Xh,Qh],Pxe={[Bh.code]:Bh,[Hh.code]:Hh,[Vh.code]:Vh,[Wh.code]:Wh,[Uh.code]:Uh,[Gh.code]:Gh,[qh.code]:qh,[Yh.code]:Yh,[Kh.code]:Kh,[Xh.code]:Xh,[Qh.code]:Qh};Bh.name+"",Bh.code,Hh.name+"",Hh.code,Vh.name+"",Vh.code,Wh.name+"",Wh.code,Uh.name+"",Uh.code,Gh.name+"",Gh.code,qh.name+"",qh.code,Yh.name+"",Yh.code,Kh.name+"",Kh.code,Xh.name+"",Xh.code,Qh.name+"",Qh.code;var Oxe=Rxe.map(e=>e.code),Txe=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(!Oxe.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 Pxe[r].parse(i)},Mxe=10;function Axe(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 Dxe({stream:e,onTextPart:t,onDataPart:n,onErrorPart:r,onToolCallStreamingStartPart:o,onToolCallDeltaPart:i,onToolCallPart:s,onToolResultPart:a,onMessageAnnotationsPart:l,onFinishMessagePart:c,onFinishStepPart:u,onStartStepPart:d}){const h=e.getReader(),p=new TextDecoder,m=[];let v=0;for(;;){const{value:y}=await h.read();if(y&&(m.push(y),v+=y.length,y[y.length-1]!==Mxe))continue;if(m.length===0)break;const b=Axe(m,v);v=0;const S=p.decode(b,{stream:!0}).split(`
357
+ `).filter(_=>_!=="").map(Txe);for(const{type:_,value:C}of S)switch(_){case"text":await(t==null?void 0:t(C));break;case"data":await(n==null?void 0:n(C));break;case"error":await(r==null?void 0:r(C));break;case"message_annotations":await(l==null?void 0:l(C));break;case"tool_call_streaming_start":await(o==null?void 0:o(C));break;case"tool_call_delta":await(i==null?void 0:i(C));break;case"tool_call":await(s==null?void 0:s(C));break;case"tool_result":await(a==null?void 0:a(C));break;case"finish_message":await(c==null?void 0:c(C));break;case"finish_step":await(u==null?void 0:u(C));break;case"start_step":await(d==null?void 0:d(C));break;default:{const E=_;throw new Error(`Unknown stream part type: ${E}`)}}}}function kxe({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}async function Ixe({stream:e,update:t,onToolCall:n,onFinish:r,generateId:o=K7,getCurrentDate:i=()=>new Date}){const s=i();let a,l=!0,c;const u=[],d=[];let h;const p={};let m={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},v="unknown";function y(){const S=[...d];if(a==null){t(u,S);return}h!=null&&h.length&&(a.annotations=h);const _={...JSON.parse(JSON.stringify(a)),revisionId:o(),createdAt:a.createdAt};t([...u,_],S)}function b(){return(l||a==null)&&(a!=null&&u.push(a),a={id:c??o(),role:"assistant",content:"",createdAt:s},l=!1,c=void 0),a}await Dxe({stream:e,onTextPart(S){const _=b();a={..._,content:_.content+S},y()},onToolCallStreamingStartPart(S){const _=b();_.toolInvocations==null&&(_.toolInvocations=[]),p[S.toolCallId]={text:"",toolName:S.toolName,index:_.toolInvocations.length},_.toolInvocations.push({state:"partial-call",toolCallId:S.toolCallId,toolName:S.toolName,args:void 0}),y()},onToolCallDeltaPart(S){const _=b(),C=p[S.toolCallId];C.text+=S.argsTextDelta;const{value:E}=Exe(C.text);_.toolInvocations[C.index]={state:"partial-call",toolCallId:S.toolCallId,toolName:C.toolName,args:E},y()},async onToolCallPart(S){const _=b();if(p[S.toolCallId]!=null?_.toolInvocations[p[S.toolCallId].index]={state:"call",...S}:(_.toolInvocations==null&&(_.toolInvocations=[]),_.toolInvocations.push({state:"call",...S})),n){const C=await n({toolCall:S});C!=null&&(_.toolInvocations[_.toolInvocations.length-1]={state:"result",...S,result:C})}y()},onToolResultPart(S){const C=b().toolInvocations;if(C==null)throw new Error("tool_result must be preceded by a tool_call");const E=C.findIndex(T=>T.toolCallId===S.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",...S},y()},onDataPart(S){d.push(...S),y()},onMessageAnnotationsPart(S){h==null?h=[...S]:h.push(...S),y()},onFinishStepPart(S){l=!S.isContinued},onStartStepPart(S){c=S.messageId},onFinishMessagePart(S){v=S.finishReason,S.usage!=null&&(m=kxe(S.usage))},onErrorPart(S){throw new Error(S)}}),r==null||r({message:a,finishReason:v,usage:m})}async function Nxe({stream:e,onTextPart:t}){const n=e.pipeThrough(new TextDecoderStream).getReader();for(;;){const{done:r,value:o}=await n.read();if(r)break;await t(o)}}var Lxe=()=>fetch;async function Fxe({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:d,fetch:h=Lxe()}){var p,m;const v=await h(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(p=i==null?void 0:i())==null?void 0:p.signal,credentials:r}).catch(y=>{throw s(),y});if(a)try{await a(v)}catch(y){throw y}if(!v.ok)throw s(),new Error((m=await v.text())!=null?m:"Failed to fetch the chat response.");if(!v.body)throw new Error("The response body is empty.");switch(n){case"text":{const y={id:d(),createdAt:new Date,role:"assistant",content:""};await Nxe({stream:v.body,onTextPart:b=>{y.content+=b,l([{...y}],[])}}),c==null||c(y,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"});return}case"data":{await Ixe({stream:v.body,update:l,onToolCall:u,onFinish({message:y,finishReason:b,usage:S}){c&&y!=null&&c(y,{usage:S,finishReason:b})},generateId:d});return}default:{const y=n;throw new Error(`Unknown stream protocol: ${y}`)}}}async function Rk(e){if(!e)return[];if(e instanceof FileList)return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,o=await new Promise((i,s)=>{const a=new FileReader;a.onload=l=>{var c;i((c=l.target)==null?void 0:c.result)},a.onerror=l=>s(l),a.readAsDataURL(t)});return{name:n,contentType:r,url:o}}));if(Array.isArray(e))return e;throw new Error("Invalid attachments type")}var jxe=B_();const La=()=>{},eo=La(),$1=Object,Vt=e=>e===eo,Gi=e=>typeof e=="function",Qa=(e,t)=>({...e,...t}),$xe=e=>Gi(e.then),zm=new WeakMap;let zxe=0;const Jh=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if($1(e)===e&&!r&&n!=RegExp){if(o=zm.get(e),o)return o;if(o=++zxe+"~",zm.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=Jh(e[i])+",";zm.set(e,o)}if(n==$1){o="#";const s=$1.keys(e).sort();for(;!Vt(i=s.pop());)Vt(e[i])||(o+=i+":"+Jh(e[i])+",");zm.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Is=new WeakMap,z1={},Bm={},OR="undefined",Bb=typeof window!=OR,v_=typeof document!=OR,Bxe=()=>Bb&&typeof window.requestAnimationFrame!=OR,X7=(e,t)=>{const n=Is.get(e);return[()=>!Vt(t)&&e.get(t)||z1,r=>{if(!Vt(t)){const o=e.get(t);t in Bm||(Bm[t]=o),n[5](t,Qa(o,r),o||z1)}},n[6],()=>!Vt(t)&&t in Bm?Bm[t]:!Vt(t)&&e.get(t)||z1]};let b_=!0;const Hxe=()=>b_,[y_,x_]=Bb&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[La,La],Vxe=()=>{const e=v_&&document.visibilityState;return Vt(e)||e!=="hidden"},Wxe=e=>(v_&&document.addEventListener("visibilitychange",e),y_("focus",e),()=>{v_&&document.removeEventListener("visibilitychange",e),x_("focus",e)}),Uxe=e=>{const t=()=>{b_=!0,e()},n=()=>{b_=!1};return y_("online",t),y_("offline",n),()=>{x_("online",t),x_("offline",n)}},Gxe={isOnline:Hxe,isVisible:Vxe},qxe={initFocus:Wxe,initReconnect:Uxe},Pk=!P.useId,Zh=!Bb||"Deno"in window,Yxe=e=>Bxe()?window.requestAnimationFrame(e):setTimeout(e,1),B1=Zh?P.useEffect:P.useLayoutEffect,H1=typeof navigator<"u"&&navigator.connection,Ok=!Zh&&H1&&(["slow-2g","2g"].includes(H1.effectiveType)||H1.saveData),TR=e=>{if(Gi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Jh(e):"",[e,t]};let Kxe=0;const w_=()=>++Kxe,Q7=0,J7=1,Z7=2,Xxe=3;var _f={__proto__:null,ERROR_REVALIDATE_EVENT:Xxe,FOCUS_EVENT:Q7,MUTATE_EVENT:Z7,RECONNECT_EVENT:J7};async function e9(...e){const[t,n,r,o]=e,i=Qa({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(Gi(n)){const h=n,p=[],m=t.keys();for(const v of m)!/^\$(inf|sub)\$/.test(v)&&h(t.get(v)._k)&&p.push(v);return Promise.all(p.map(d))}return d(n);async function d(h){const[p]=TR(h);if(!p)return;const[m,v]=X7(t,p),[y,b,S,_]=Is.get(t),C=()=>{const K=y[p];return(Gi(i.revalidate)?i.revalidate(m().data,h):i.revalidate!==!1)&&(delete S[p],delete _[p],K&&K[0])?K[0](Z7).then(()=>m().data):m().data};if(e.length<3)return C();let E=r,T;const A=w_();b[p]=[A,0];const D=!Vt(l),k=m(),j=k.data,$=k._c,z=Vt($)?j:$;if(D&&(l=Gi(l)?l(z,j):l,v({data:l,_c:z})),Gi(E))try{E=E(z)}catch(K){T=K}if(E&&$xe(E))if(E=await E.catch(K=>{T=K}),A!==b[p][0]){if(T)throw T;return E}else T&&D&&c(T)&&(s=!0,v({data:z,_c:eo}));if(s&&!T)if(Gi(s)){const K=s(E,z);v({data:K,error:eo,_c:eo})}else v({data:E,error:eo,_c:eo});if(b[p][1]=w_(),Promise.resolve(C()).then(()=>{v({_c:eo})}),T){if(u)throw T;return}return E}}const Tk=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Qxe=(e,t)=>{if(!Is.has(e)){const n=Qa(qxe,t),r={},o=e9.bind(eo,e);let i=La;const s={},a=(u,d)=>{const h=s[u]||[];return s[u]=h,h.push(d),()=>h.splice(h.indexOf(d),1)},l=(u,d,h)=>{e.set(u,d);const p=s[u];if(p)for(const m of p)m(d,h)},c=()=>{if(!Is.has(e)&&(Is.set(e,[r,{},{},{},o,l,a]),!Zh)){const u=n.initFocus(setTimeout.bind(eo,Tk.bind(eo,r,Q7))),d=n.initReconnect(setTimeout.bind(eo,Tk.bind(eo,r,J7)));i=()=>{u&&u(),d&&d(),Is.delete(e)}}};return c(),[e,o,c,i]}return[e,Is.get(e)[4]]},Jxe=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Vt(i)&&s>i||setTimeout(r,a,o)},Zxe=(e,t)=>Jh(e)==Jh(t),[t9,e1e]=Qxe(new Map),t1e=Qa({onLoadingSlow:La,onSuccess:La,onError:La,onErrorRetry:Jxe,onDiscarded:La,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Ok?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Ok?5e3:3e3,compare:Zxe,isPaused:()=>!1,cache:t9,mutate:e1e,fallback:{}},Gxe),n1e=(e,t)=>{const n=Qa(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=Qa(o,s))}return n},r1e=P.createContext({}),o1e="$inf$",n9=Bb&&window.__SWR_DEVTOOLS_USE__,i1e=n9?window.__SWR_DEVTOOLS_USE__:[],s1e=()=>{n9&&(window.__SWR_DEVTOOLS_REACT__=P)},a1e=e=>Gi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],l1e=()=>Qa(t1e,P.useContext(r1e)),c1e=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=TR(t),[,,,a]=Is.get(t9);if(s.startsWith(o1e))return n(...i);const l=a[s];return Vt(l)?n(...i):(delete a[s],l)}),r),u1e=i1e.concat(c1e),d1e=e=>function(...n){const r=l1e(),[o,i,s]=a1e(n),a=n1e(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(u1e);for(let d=u.length;d--;)l=u[d](l);return l(o,i||a.fetcher||null,a)},f1e=(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())}};s1e();const Mk=P.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)}),V1={dedupe:!0},h1e=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:h}=n,[p,m,v,y]=Is.get(r),[b,S]=TR(e),_=P.useRef(!1),C=P.useRef(!1),E=P.useRef(b),T=P.useRef(t),A=P.useRef(n),D=()=>A.current,k=()=>D().isVisible()&&D().isOnline(),[j,$,z,K]=X7(r,b),V=P.useRef({}).current,N=Vt(s)?n.fallback[b]:s,W=(oe,ve)=>{for(const he in V){const Ee=he;if(Ee==="data"){if(!o(oe[Ee],ve[Ee])&&(!Vt(oe[Ee])||!o(X,ve[Ee])))return!1}else if(ve[Ee]!==oe[Ee])return!1}return!0},H=P.useMemo(()=>{const oe=!b||!t?!1:Vt(a)?D().isPaused()||i?!1:Vt(l)?!0:l:a,ve=Le=>{const dt=Qa(Le);return delete dt._k,oe?{isValidating:!0,isLoading:!0,...dt}:dt},he=j(),Ee=K(),ke=ve(he),We=he===Ee?ke:ve(Ee);let Ie=ke;return[()=>{const Le=ve(j());return W(Le,Ie)?(Ie.data=Le.data,Ie.isLoading=Le.isLoading,Ie.isValidating=Le.isValidating,Ie.error=Le.error,Ie):(Ie=Le,Le)},()=>We]},[r,b]),G=jxe.useSyncExternalStore(P.useCallback(oe=>z(b,(ve,he)=>{W(he,ve)||oe()}),[r,b]),H[0],H[1]),te=!_.current,F=p[b]&&p[b].length>0,Y=G.data,q=Vt(Y)?N:Y,M=G.error,ne=P.useRef(q),X=h?Vt(Y)?ne.current:Y:q,re=F&&!Vt(M)?!1:te&&!Vt(a)?a:D().isPaused()?!1:i?Vt(q)?!1:l:Vt(q)||l,ee=!!(b&&t&&te&&re),J=Vt(G.isValidating)?ee:G.isValidating,le=Vt(G.isLoading)?ee:G.isLoading,ce=P.useCallback(async oe=>{const ve=T.current;if(!b||!ve||C.current||D().isPaused())return!1;let he,Ee,ke=!0;const We=oe||{},Ie=!v[b]||!We.dedupe,Le=()=>Pk?!C.current&&b===E.current&&_.current:b===E.current,dt={isValidating:!1,isLoading:!1},$t=()=>{$(dt)},rn=()=>{const on=v[b];on&&on[1]===Ee&&delete v[b]},Nt={isValidating:!0};Vt(j().data)&&(Nt.isLoading=!0);try{if(Ie&&($(Nt),n.loadingTimeout&&Vt(j().data)&&setTimeout(()=>{ke&&Le()&&D().onLoadingSlow(b,n)},n.loadingTimeout),v[b]=[ve(S),w_()]),[he,Ee]=v[b],he=await he,Ie&&setTimeout(rn,n.dedupingInterval),!v[b]||v[b][1]!==Ee)return Ie&&Le()&&D().onDiscarded(b),!1;dt.error=eo;const on=m[b];if(!Vt(on)&&(Ee<=on[0]||Ee<=on[1]||on[1]===0))return $t(),Ie&&Le()&&D().onDiscarded(b),!1;const pe=j().data;dt.data=o(pe,he)?pe:he,Ie&&Le()&&D().onSuccess(he,b,n)}catch(on){rn();const pe=D(),{shouldRetryOnError:Pe}=pe;pe.isPaused()||(dt.error=on,Ie&&Le()&&(pe.onError(on,b,pe),(Pe===!0||Gi(Pe)&&Pe(on))&&(!D().revalidateOnFocus||!D().revalidateOnReconnect||k())&&pe.onErrorRetry(on,b,pe,ze=>{const Ye=p[b];Ye&&Ye[0]&&Ye[0](_f.ERROR_REVALIDATE_EVENT,ze)},{retryCount:(We.retryCount||0)+1,dedupe:!0})))}return ke=!1,$t(),!0},[b,r]),ye=P.useCallback((...oe)=>e9(r,E.current,...oe),[]);if(B1(()=>{T.current=t,A.current=n,Vt(Y)||(ne.current=Y)}),B1(()=>{if(!b)return;const oe=ce.bind(eo,V1);let ve=0;const Ee=f1e(b,p,(ke,We={})=>{if(ke==_f.FOCUS_EVENT){const Ie=Date.now();D().revalidateOnFocus&&Ie>ve&&k()&&(ve=Ie+D().focusThrottleInterval,oe())}else if(ke==_f.RECONNECT_EVENT)D().revalidateOnReconnect&&k()&&oe();else{if(ke==_f.MUTATE_EVENT)return ce();if(ke==_f.ERROR_REVALIDATE_EVENT)return ce(We)}});return C.current=!1,E.current=b,_.current=!0,$({_k:S}),re&&(Vt(q)||Zh?oe():Yxe(oe)),()=>{C.current=!0,Ee()}},[b]),B1(()=>{let oe;function ve(){const Ee=Gi(c)?c(j().data):c;Ee&&oe!==-1&&(oe=setTimeout(he,Ee))}function he(){!j().error&&(u||D().isVisible())&&(d||D().isOnline())?ce(V1).then(ve):ve()}return ve(),()=>{oe&&(clearTimeout(oe),oe=-1)}},[c,u,d,b]),P.useDebugValue(X),i&&Vt(q)&&b){if(!Pk&&Zh)throw new Error("Fallback data is required when using suspense in SSR.");T.current=t,A.current=n,C.current=!1;const oe=y[b];if(!Vt(oe)){const ve=ye(oe);Mk(ve)}if(Vt(M)){const ve=ce(V1);Vt(X)||(ve.status="fulfilled",ve.value=!0),Mk(ve)}else throw M}return{mutate:ye,get data(){return V.data=!0,X},get error(){return V.error=!0,M},get isValidating(){return V.isValidating=!0,J},get isLoading(){return V.isLoading=!0,le}}},Hm=d1e(h1e);function p1e(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);const s=Date.now(),a=s-r,l=t-a;l<=0?(r=s,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},l)}}var g1e=p1e;const m1e=Oc(g1e);function Ak(e,t){return t!=null?m1e(e,t):e}var v1e=async(e,t,n,r,o,i,s,a,l,c,u,d,h,p,m,v,y,b)=>{var S;const _=s.current;n(t.messages,!1);const C=p?t.messages:t.messages.map(({role:T,content:A,experimental_attachments:D,data:k,annotations:j,toolInvocations:$})=>({role:T,content:A,...D!==void 0&&{experimental_attachments:D},...k!==void 0&&{data:k},...j!==void 0&&{annotations:j},...$!==void 0&&{toolInvocations:$}})),E=o.current;return await Fxe({api:e,body:(S=m==null?void 0:m({id:b,messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?S:{id:b,messages:C,data:t.data,...i.current.body,...t.body},streamProtocol:c,credentials:i.current.credentials,headers:{...i.current.headers,...t.headers},abortController:()=>a.current,restoreMessagesOnFailure(){y||n(_,!1)},onResponse:d,onUpdate(T,A){n([...t.messages,...T],!1),A!=null&&A.length&&r([...E??[],...A],!1)},onToolCall:h,onFinish:u,generateId:l,fetch:v})};function b1e({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,onToolCall:i,experimental_prepareRequestBody:s,maxSteps:a=1,streamProtocol:l="data",onResponse:c,onFinish:u,onError:d,credentials:h,headers:p,body:m,generateId:v=K7,fetch:y,keepLastMessageOnError:b=!0,experimental_throttle:S}={}){const[_]=P.useState(v),C=t??_,E=typeof e=="string"?[e,C]:C,[T]=P.useState([]),{data:A,mutate:D}=Hm([E,"messages"],null,{fallbackData:n??T}),k=P.useRef(A||[]);P.useEffect(()=>{k.current=A||[]},[A]);const{data:j,mutate:$}=Hm([E,"streamData"],null),z=P.useRef(j);P.useEffect(()=>{z.current=j},[j]);const{data:K=!1,mutate:V}=Hm([E,"loading"],null),{data:N=void 0,mutate:W}=Hm([E,"error"],null),H=P.useRef(null),G=P.useRef({credentials:h,headers:p,body:m});P.useEffect(()=>{G.current={credentials:h,headers:p,body:m}},[h,p,m]);const te=P.useCallback(async ce=>{const ye=k.current.length;try{V(!0),W(void 0);const he=new AbortController;H.current=he,await v1e(e,ce,Ak(D,S),Ak($,S),z,G,k,H,v,l,u,c,i,o,s,y,b,C),H.current=null}catch(he){if(he.name==="AbortError")return H.current=null,null;d&&he instanceof Error&&d(he),W(he)}finally{V(!1)}const oe=k.current,ve=oe[oe.length-1];oe.length>ye&&ve!=null&&a>1&&Dk(ve)&&y1e(oe)<a&&await te({messages:oe})},[D,V,e,G,c,u,d,W,$,z,l,o,s,i,a,k,H,v,y,b,S,C]),F=P.useCallback(async(ce,{data:ye,headers:oe,body:ve,experimental_attachments:he}={})=>{var Ee,ke;const We=await Rk(he),Ie=k.current.concat({...ce,id:(Ee=ce.id)!=null?Ee:v(),createdAt:(ke=ce.createdAt)!=null?ke:new Date,experimental_attachments:We.length>0?We:void 0});return te({messages:Ie,headers:oe,body:ve,data:ye})},[te,v]),Y=P.useCallback(async({data:ce,headers:ye,body:oe}={})=>{const ve=k.current;if(ve.length===0)return null;const he=ve[ve.length-1];return te({messages:he.role==="assistant"?ve.slice(0,-1):ve,headers:ye,body:oe,data:ce})},[te]),q=P.useCallback(()=>{H.current&&(H.current.abort(),H.current=null)},[]),M=P.useCallback(ce=>{typeof ce=="function"&&(ce=ce(k.current)),D(ce,!1),k.current=ce},[D]),ne=P.useCallback(ce=>{typeof ce=="function"&&(ce=ce(z.current)),$(ce,!1),z.current=ce},[$]),[X,re]=P.useState(r),ee=P.useCallback(async(ce,ye={},oe)=>{var ve;if((ve=ce==null?void 0:ce.preventDefault)==null||ve.call(ce),!X&&!ye.allowEmptySubmit)return;oe&&(G.current={...G.current,...oe});const he=await Rk(ye.experimental_attachments),ke={messages:!X&&!he.length&&ye.allowEmptySubmit?k.current:k.current.concat({id:v(),createdAt:new Date,role:"user",content:X,experimental_attachments:he.length>0?he:void 0}),headers:ye.headers,body:ye.body,data:ye.data};te(ke),re("")},[X,v,te]);return{messages:A||[],id:C,setMessages:M,data:j,setData:ne,error:N,append:F,reload:Y,stop:q,input:X,setInput:re,handleInputChange:ce=>{re(ce.target.value)},handleSubmit:ee,isLoading:K,addToolResult:({toolCallId:ce,result:ye})=>{const oe=k.current.map((he,Ee,ke)=>Ee===ke.length-1&&he.role==="assistant"&&he.toolInvocations?{...he,toolInvocations:he.toolInvocations.map(We=>We.toolCallId===ce?{...We,result:ye,state:"result"}:We)}:he);D(oe,!1);const ve=oe[oe.length-1];Dk(ve)&&te({messages:oe})}}}function Dk(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function y1e(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}var MR="Switch",[x1e,qOe]=Jn(MR),[w1e,S1e]=x1e(MR),r9=R.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[h,p]=R.useState(null),m=at(t,_=>p(_)),v=R.useRef(!1),y=h?u||!!h.closest("form"):!0,[b=!1,S]=Cr({prop:o,defaultProp:i,onChange:c});return x.jsxs(w1e,{scope:n,checked:b,disabled:a,children:[x.jsx(Be.button,{type:"button",role:"switch","aria-checked":b,"aria-required":s,"data-state":s9(b),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onClick:Te(e.onClick,_=>{S(C=>!C),y&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})}),y&&x.jsx(_1e,{control:h,bubbles:!v.current,name:r,value:l,checked:b,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});r9.displayName=MR;var o9="SwitchThumb",i9=R.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=S1e(o9,n);return x.jsx(Be.span,{"data-state":s9(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});i9.displayName=o9;var _1e=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=R.useRef(null),s=wb(n),a=fb(t);return R.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const h=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(h)}},[s,n,r]),x.jsx("input",{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 s9(e){return e?"checked":"unchecked"}var Hb=r9,a9=i9;const l9=R.forwardRef(({className:e,...t},n)=>x.jsx(Hb,{className:xe("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:x.jsx(a9,{className:xe("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")})}));l9.displayName=Hb.displayName;const C1e=R.forwardRef(({className:e,...t},n)=>x.jsx(Hb,{className:xe("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:x.jsx(a9,{className:xe("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")})}));C1e.displayName=Hb.displayName;function E1e(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const R1e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P1e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,O1e={};function kk(e,t){return((t||O1e).jsx?P1e:R1e).test(e)}const T1e=/[ \t\n\f\r]/g;function M1e(e){return typeof e=="object"?e.type==="text"?Ik(e.value):!1:Ik(e)}function Ik(e){return e.replace(T1e,"")===""}class Kp{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Kp.prototype.property={};Kp.prototype.normal={};Kp.prototype.space=null;function c9(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 Kp(n,r,t)}function S_(e){return e.toLowerCase()}class ri{constructor(t,n){this.property=t,this.attribute=n}}ri.prototype.space=null;ri.prototype.boolean=!1;ri.prototype.booleanish=!1;ri.prototype.overloadedBoolean=!1;ri.prototype.number=!1;ri.prototype.commaSeparated=!1;ri.prototype.spaceSeparated=!1;ri.prototype.commaOrSpaceSeparated=!1;ri.prototype.mustUseProperty=!1;ri.prototype.defined=!1;let A1e=0;const xt=Nc(),Wn=Nc(),u9=Nc(),Me=Nc(),hn=Nc(),Mu=Nc(),vo=Nc();function Nc(){return 2**++A1e}const __=Object.freeze(Object.defineProperty({__proto__:null,boolean:xt,booleanish:Wn,commaOrSpaceSeparated:vo,commaSeparated:Mu,number:Me,overloadedBoolean:u9,spaceSeparated:hn},Symbol.toStringTag,{value:"Module"})),W1=Object.keys(__);class AR extends ri{constructor(t,n,r,o){let i=-1;if(super(t,n),Nk(this,"space",o),typeof r=="number")for(;++i<W1.length;){const s=W1[i];Nk(this,W1[i],(r&__[s])===__[s])}}}AR.prototype.defined=!0;function Nk(e,t,n){n&&(e[t]=n)}const D1e={}.hasOwnProperty;function kd(e){const t={},n={};let r;for(r in e.properties)if(D1e.call(e.properties,r)){const o=e.properties[r],i=new AR(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[S_(r)]=r,n[S_(i.attribute)]=r}return new Kp(t,n,e.space)}const d9=kd({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}}),f9=kd({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function h9(e,t){return t in e?e[t]:t}function p9(e,t){return h9(e,t.toLowerCase())}const g9=kd({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:p9,properties:{xmlns:null,xmlnsXLink:null}}),m9=kd({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Wn,ariaAutoComplete:null,ariaBusy:Wn,ariaChecked:Wn,ariaColCount:Me,ariaColIndex:Me,ariaColSpan:Me,ariaControls:hn,ariaCurrent:null,ariaDescribedBy:hn,ariaDetails:null,ariaDisabled:Wn,ariaDropEffect:hn,ariaErrorMessage:null,ariaExpanded:Wn,ariaFlowTo:hn,ariaGrabbed:Wn,ariaHasPopup:null,ariaHidden:Wn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:hn,ariaLevel:Me,ariaLive:null,ariaModal:Wn,ariaMultiLine:Wn,ariaMultiSelectable:Wn,ariaOrientation:null,ariaOwns:hn,ariaPlaceholder:null,ariaPosInSet:Me,ariaPressed:Wn,ariaReadOnly:Wn,ariaRelevant:null,ariaRequired:Wn,ariaRoleDescription:hn,ariaRowCount:Me,ariaRowIndex:Me,ariaRowSpan:Me,ariaSelected:Wn,ariaSetSize:Me,ariaSort:null,ariaValueMax:Me,ariaValueMin:Me,ariaValueNow:Me,ariaValueText:null,role:null}}),k1e=kd({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:p9,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Mu,acceptCharset:hn,accessKey:hn,action:null,allow:null,allowFullScreen:xt,allowPaymentRequest:xt,allowUserMedia:xt,alt:null,as:null,async:xt,autoCapitalize:null,autoComplete:hn,autoFocus:xt,autoPlay:xt,blocking:hn,capture:null,charSet:null,checked:xt,cite:null,className:hn,cols:Me,colSpan:null,content:null,contentEditable:Wn,controls:xt,controlsList:hn,coords:Me|Mu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:xt,defer:xt,dir:null,dirName:null,disabled:xt,download:u9,draggable:Wn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:xt,formTarget:null,headers:hn,height:Me,hidden:xt,high:Me,href:null,hrefLang:null,htmlFor:hn,httpEquiv:hn,id:null,imageSizes:null,imageSrcSet:null,inert:xt,inputMode:null,integrity:null,is:null,isMap:xt,itemId:null,itemProp:hn,itemRef:hn,itemScope:xt,itemType:hn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:xt,low:Me,manifest:null,max:null,maxLength:Me,media:null,method:null,min:null,minLength:Me,multiple:xt,muted:xt,name:null,nonce:null,noModule:xt,noValidate:xt,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:xt,optimum:Me,pattern:null,ping:hn,placeholder:null,playsInline:xt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:xt,referrerPolicy:null,rel:hn,required:xt,reversed:xt,rows:Me,rowSpan:Me,sandbox:hn,scope:null,scoped:xt,seamless:xt,selected:xt,shadowRootDelegatesFocus:xt,shadowRootMode:null,shape:null,size:Me,sizes:null,slot:null,span:Me,spellCheck:Wn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Me,step:null,style:null,tabIndex:Me,target:null,title:null,translate:null,type:null,typeMustMatch:xt,useMap:null,value:Wn,width:Me,wrap:null,align:null,aLink:null,archive:hn,axis:null,background:null,bgColor:null,border:Me,borderColor:null,bottomMargin:Me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:xt,declare:xt,event:null,face:null,frame:null,frameBorder:null,hSpace:Me,leftMargin:Me,link:null,longDesc:null,lowSrc:null,marginHeight:Me,marginWidth:Me,noResize:xt,noHref:xt,noShade:xt,noWrap:xt,object:null,profile:null,prompt:null,rev:null,rightMargin:Me,rules:null,scheme:null,scrolling:Wn,standby:null,summary:null,text:null,topMargin:Me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:xt,disableRemotePlayback:xt,prefix:null,property:null,results:Me,security:null,unselectable:null}}),I1e=kd({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:h9,properties:{about:vo,accentHeight:Me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Me,amplitude:Me,arabicForm:null,ascent:Me,attributeName:null,attributeType:null,azimuth:Me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Me,by:null,calcMode:null,capHeight:Me,className:hn,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:Me,diffuseConstant:Me,direction:null,display:null,dur:null,divisor:Me,dominantBaseline:null,download:xt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Me,enableBackground:null,end:null,event:null,exponent:Me,externalResourcesRequired:null,fill:null,fillOpacity:Me,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:Mu,g2:Mu,glyphName:Mu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Me,horizOriginX:Me,horizOriginY:Me,id:null,ideographic:Me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Me,k:Me,k1:Me,k2:Me,k3:Me,k4:Me,kernelMatrix:vo,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Me,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:Me,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:Me,overlineThickness:Me,paintOrder:null,panose1:null,path:null,pathLength:Me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:hn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Me,pointsAtY:Me,pointsAtZ:Me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vo,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vo,rev:vo,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vo,requiredFeatures:vo,requiredFonts:vo,requiredFormats:vo,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:Me,specularExponent:Me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Me,strikethroughThickness:Me,string:null,stroke:null,strokeDashArray:vo,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Me,strokeOpacity:Me,strokeWidth:null,style:null,surfaceScale:Me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vo,tabIndex:Me,tableValues:null,target:null,targetX:Me,targetY:Me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vo,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Me,underlineThickness:Me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Me,values:null,vAlphabetic:Me,vMathematical:Me,vectorEffect:null,vHanging:Me,vIdeographic:Me,version:null,vertAdvY:Me,vertOriginX:Me,vertOriginY:Me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),N1e=/^data[-\w.:]+$/i,Lk=/-[a-z]/g,L1e=/[A-Z]/g;function F1e(e,t){const n=S_(t);let r=t,o=ri;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&N1e.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Lk,$1e);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Lk.test(i)){let s=i.replace(L1e,j1e);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=AR}return new o(r,t)}function j1e(e){return"-"+e.toLowerCase()}function $1e(e){return e.charAt(1).toUpperCase()}const z1e={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"},B1e=c9([f9,d9,g9,m9,k1e],"html"),DR=c9([f9,d9,g9,m9,I1e],"svg");function H1e(e){return e.join(" ").trim()}var v9={},Fk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,V1e=/\n/g,W1e=/^\s*/,U1e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,G1e=/^:\s*/,q1e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Y1e=/^[;\s]*/,K1e=/^\s+|\s+$/g,X1e=`
358
+ `,jk="/",$k="*",kl="",Q1e="comment",J1e="declaration",Z1e=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(m){var v=m.match(V1e);v&&(n+=v.length);var y=m.lastIndexOf(X1e);r=~y?m.length-y:r+m.length}function i(){var m={line:n,column:r};return function(v){return v.position=new s(m),c(),v}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var v=new Error(t.source+":"+n+":"+r+": "+m);if(v.reason=m,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function l(m){var v=m.exec(e);if(v){var y=v[0];return o(y),e=e.slice(y.length),v}}function c(){l(W1e)}function u(m){var v;for(m=m||[];v=d();)v!==!1&&m.push(v);return m}function d(){var m=i();if(!(jk!=e.charAt(0)||$k!=e.charAt(1))){for(var v=2;kl!=e.charAt(v)&&($k!=e.charAt(v)||jk!=e.charAt(v+1));)++v;if(v+=2,kl===e.charAt(v-1))return a("End of comment missing");var y=e.slice(2,v-2);return r+=2,o(y),e=e.slice(v),r+=2,m({type:Q1e,comment:y})}}function h(){var m=i(),v=l(U1e);if(v){if(d(),!l(G1e))return a("property missing ':'");var y=l(q1e),b=m({type:J1e,property:zk(v[0].replace(Fk,kl)),value:y?zk(y[0].replace(Fk,kl)):kl});return l(Y1e),b}}function p(){var m=[];u(m);for(var v;v=h();)v!==!1&&(m.push(v),u(m));return m}return c(),p()};function zk(e){return e?e.replace(K1e,kl):kl}var ewe=xa&&xa.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(v9,"__esModule",{value:!0});var twe=ewe(Z1e);function nwe(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,twe.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 Bk=v9.default=nwe;const rwe=Bk.default||Bk,b9=y9("end"),kR=y9("start");function y9(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 owe(e){const t=kR(e),n=b9(e);if(t&&n)return{start:t,end:n}}function dh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Hk(e.position):"start"in e||"end"in e?Hk(e):"line"in e||"column"in e?C_(e):""}function C_(e){return Vk(e&&e.line)+":"+Vk(e&&e.column)}function Hk(e){return C_(e&&e.start)+"-"+C_(e&&e.end)}function Vk(e){return e&&typeof e=="number"?e:1}class Er 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=dh(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}}Er.prototype.file="";Er.prototype.name="";Er.prototype.reason="";Er.prototype.message="";Er.prototype.stack="";Er.prototype.column=void 0;Er.prototype.line=void 0;Er.prototype.ancestors=void 0;Er.prototype.cause=void 0;Er.prototype.fatal=void 0;Er.prototype.place=void 0;Er.prototype.ruleId=void 0;Er.prototype.source=void 0;const IR={}.hasOwnProperty,iwe=new Map,swe=/[A-Z]/g,awe=/-([a-z])/g,lwe=new Set(["table","tbody","thead","tfoot","tr"]),cwe=new Set(["td","th"]),x9="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function uwe(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=bwe(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=vwe(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"?DR:B1e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=w9(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function w9(e,t,n){if(t.type==="element")return dwe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fwe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return pwe(e,t,n);if(t.type==="mdxjsEsm")return hwe(e,t);if(t.type==="root")return gwe(e,t,n);if(t.type==="text")return mwe(e,t)}function dwe(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=DR,e.schema=o),e.ancestors.push(t);const i=_9(e,t.tagName,!1),s=ywe(e,t);let a=LR(e,t);return lwe.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!M1e(l):!0})),S9(e,s,i,t),NR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function fwe(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)}ep(e,t.position)}function hwe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ep(e,t.position)}function pwe(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=DR,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:_9(e,t.name,!0),s=xwe(e,t),a=LR(e,t);return S9(e,s,i,t),NR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function gwe(e,t,n){const r={};return NR(r,LR(e,t)),e.create(t,e.Fragment,r,n)}function mwe(e,t){return t.value}function S9(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function NR(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function vwe(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 bwe(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=kR(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 ywe(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&IR.call(t.properties,o)){const i=wwe(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&cwe.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 xwe(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 ep(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 ep(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function LR(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:iwe;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=w9(e,i,s);a!==void 0&&n.push(a)}return n}function wwe(e,t,n){const r=F1e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?E1e(n):H1e(n)),r.property==="style"){let o=typeof n=="object"?n:Swe(e,String(n));return e.stylePropertyNameCase==="css"&&(o=_we(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?z1e[r.property]||r.property:r.attribute,n]}}function Swe(e,t){const n={};try{rwe(t,r)}catch(o){if(!e.ignoreInvalidStyle){const i=o,s=new Er("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=x9+"#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(awe,Ewe)),n[s]=i}}function _9(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=kk(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=kk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return IR.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);ep(e)}function ep(e,t){const n=new Er("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=x9+"#cannot-handle-mdx-estrees-without-createevaluater",n}function _we(e){const t={};let n;for(n in e)IR.call(e,n)&&(t[Cwe(n)]=e[n]);return t}function Cwe(e){let t=e.replace(swe,Rwe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ewe(e,t){return t.toUpperCase()}function Rwe(e){return"-"+e.toLowerCase()}const U1={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"]},Pwe={};function Owe(e,t){const n=t||Pwe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return C9(e,r,o)}function C9(e,t,n){if(Twe(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 Wk(e.children,t,n)}return Array.isArray(e)?Wk(e,t,n):""}function Wk(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=C9(e[o],t,n);return r.join("")}function Twe(e){return!!(e&&typeof e=="object")}const Uk=document.createElement("i");function FR(e){const t="&"+e+";";Uk.innerHTML=t;const n=Uk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function os(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 Ko(e,t){return e.length>0?(os(e,e.length,0,t),e):t}const Gk={}.hasOwnProperty;function Mwe(e){const t={};let n=-1;for(;++n<e.length;)Awe(t,e[n]);return t}function Awe(e,t){let n;for(n in t){const o=(Gk.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Gk.call(o,s)||(o[s]=[]);const a=i[s];Dwe(o[s],Array.isArray(a)?a:a?[a]:[])}}}function Dwe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);os(e,0,0,r)}function E9(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 Au(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kwe=il(new RegExp("\\p{P}","u")),qi=il(/[A-Za-z]/),Co=il(/[\dA-Za-z]/),Iwe=il(/[#-'*+\--9=?A-Z^-~]/);function E_(e){return e!==null&&(e<32||e===127)}const R_=il(/\d/),Nwe=il(/[\dA-Fa-f]/),R9=il(/[!-/:-@[-`{-~]/);function ot(e){return e!==null&&e<-2}function so(e){return e!==null&&(e<0||e===32)}function qt(e){return e===-2||e===-1||e===32}function Lwe(e){return R9(e)||kwe(e)}const Fwe=il(/\s/);function il(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Id(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&Co(e.charCodeAt(n+1))&&Co(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 pn(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return qt(l)?(e.enter(n),a(l)):t(l)}function a(l){return qt(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const jwe={tokenize:$we};function $we(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"),pn(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 zwe={tokenize:Bwe},qk={tokenize:Hwe};function Bwe(e){const t=this,n=[];let r=0,o,i,s;return a;function a(_){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(_)}return c(_)}function l(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&S();const C=t.events.length;let E=C,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){T=t.events[E][1].end;break}b(r);let A=C;for(;A<t.events.length;)t.events[A][1].end=Object.assign({},T),A++;return os(t.events,E+1,0,t.events.slice(C)),t.events.length=A,c(_)}return a(_)}function c(_){if(r===n.length){if(!o)return h(_);if(o.currentConstruct&&o.currentConstruct.concrete)return m(_);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qk,u,d)(_)}function u(_){return o&&S(),b(r),h(_)}function d(_){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(_)}function h(_){return t.containerState={},e.attempt(qk,p,m)(_)}function p(_){return r++,n.push([t.currentConstruct,t.containerState]),h(_)}function m(_){if(_===null){o&&S(),b(0),e.consume(_);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:o}),v(_)}function v(_){if(_===null){y(e.exit("chunkFlow"),!0),b(0),e.consume(_);return}return ot(_)?(e.consume(_),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(_),v)}function y(_,C){const E=t.sliceStream(_);if(C&&E.push(null),_.previous=i,i&&(i.next=_),i=_,o.defineSkip(_.start),o.write(E),t.parser.lazy[_.start.line]){let T=o.events.length;for(;T--;)if(o.events[T][1].start.offset<s&&(!o.events[T][1].end||o.events[T][1].end.offset>s))return;const A=t.events.length;let D=A,k,j;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(k){j=t.events[D][1].end;break}k=!0}for(b(r),T=A;T<t.events.length;)t.events[T][1].end=Object.assign({},j),T++;os(t.events,D+1,0,t.events.slice(A)),t.events.length=T}}function b(_){let C=n.length;for(;C-- >_;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=_}function S(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Hwe(e,t,n){return pn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yk(e){if(e===null||so(e)||Fwe(e))return 1;if(Lwe(e))return 2}function jR(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 P_={name:"attention",tokenize:Wwe,resolveAll:Vwe};function Vwe(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 d=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);Kk(d,-l),Kk(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,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=Ko(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ko(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=Ko(c,jR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ko(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=Ko(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,os(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 Wwe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Yk(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=Yk(l),d=!u||u===2&&o||n.includes(l),h=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(o||!h)),c._close=!!(i===42?h:h&&(u||!d)),t(l)}}function Kk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Uwe={name:"autolink",tokenize:Gwe};function Gwe(e,t,n){let r=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return qi(p)?(e.consume(p),s):c(p)}function s(p){return p===43||p===45||p===46||Co(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Co(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||E_(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):Iwe(p)?(e.consume(p),c):n(p)}function u(p){return Co(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||Co(p))&&r++<63){const m=p===45?h:d;return e.consume(p),m}return n(p)}}const Vb={tokenize:qwe,partial:!0};function qwe(e,t,n){return r;function r(i){return qt(i)?pn(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ot(i)?t(i):n(i)}}const P9={name:"blockQuote",tokenize:Ywe,continuation:{tokenize:Kwe},exit:Xwe};function Ywe(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 qt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Kwe(e,t,n){const r=this;return o;function o(s){return qt(s)?pn(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(P9,t,n)(s)}}function Xwe(e){e.exit("blockQuote")}const O9={name:"characterEscape",tokenize:Qwe};function Qwe(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 R9(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const T9={name:"characterReference",tokenize:Jwe};function Jwe(e,t,n){const r=this;let o=0,i,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=Co,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=Nwe,u):(e.enter("characterReferenceValue"),i=7,s=R_,u(d))}function u(d){if(d===59&&o){const h=e.exit("characterReferenceValue");return s===Co&&!FR(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&o++<i?(e.consume(d),u):n(d)}}const Xk={tokenize:eSe,partial:!0},Qk={name:"codeFenced",tokenize:Zwe,concrete:!0};function Zwe(e,t,n){const r=this,o={tokenize:E,partial:!0};let i=0,s=0,a;return l;function l(T){return c(T)}function c(T){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(T)}function u(T){return T===a?(s++,e.consume(T),u):s<3?n(T):(e.exit("codeFencedFenceSequence"),qt(T)?pn(e,d,"whitespace")(T):d(T))}function d(T){return T===null||ot(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(Xk,v,C)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===null||ot(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(T)):qt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),pn(e,p,"whitespace")(T)):T===96&&T===a?n(T):(e.consume(T),h)}function p(T){return T===null||ot(T)?d(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(T))}function m(T){return T===null||ot(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(T)):T===96&&T===a?n(T):(e.consume(T),m)}function v(T){return e.attempt(o,C,y)(T)}function y(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),b}function b(T){return i>0&&qt(T)?pn(e,S,"linePrefix",i+1)(T):S(T)}function S(T){return T===null||ot(T)?e.check(Xk,v,C)(T):(e.enter("codeFlowValue"),_(T))}function _(T){return T===null||ot(T)?(e.exit("codeFlowValue"),S(T)):(e.consume(T),_)}function C(T){return e.exit("codeFenced"),t(T)}function E(T,A,D){let k=0;return j;function j(N){return T.enter("lineEnding"),T.consume(N),T.exit("lineEnding"),$}function $(N){return T.enter("codeFencedFence"),qt(N)?pn(T,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):z(N)}function z(N){return N===a?(T.enter("codeFencedFenceSequence"),K(N)):D(N)}function K(N){return N===a?(k++,T.consume(N),K):k>=s?(T.exit("codeFencedFenceSequence"),qt(N)?pn(T,V,"whitespace")(N):V(N)):D(N)}function V(N){return N===null||ot(N)?(T.exit("codeFencedFence"),A(N)):D(N)}}}function eSe(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 G1={name:"codeIndented",tokenize:nSe},tSe={tokenize:rSe,partial:!0};function nSe(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),pn(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(tSe,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 rSe(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):pn(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 oSe={name:"codeText",tokenize:aSe,resolve:iSe,previous:sSe};function iSe(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 sSe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function aSe(e,t,n){let r=0,o,i;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(i=e.enter("codeTextSequence"),o=0,u(d)):ot(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ot(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}function M9(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,lSe(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),os(e,o,n-o+1,a))}}return!c}function lSe(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,d,h=-1,p=n,m=0,v=0;const y=[v];for(;p;){for(;e[++o][1]!==p;);i.push(o),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=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&&(v=h+1,y.push(v),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),h=y.length;h--;){const b=a.slice(y[h],y[h+1]),S=i.pop();l.unshift([S,S+b.length-1]),os(e,S,2,b)}for(h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const cSe={tokenize:fSe,resolve:dSe},uSe={tokenize:hSe,partial:!0};function dSe(e){return M9(e),e}function fSe(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(uSe,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 hSe(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),pn(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 A9(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(b){return b===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(b),e.exit(i),h):b===null||b===32||b===41||E_(b)?n(b):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(b))}function h(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(a),h(b)):b===null||b===60||ot(b)?n(b):(e.consume(b),b===92?m:p)}function m(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function v(b){return!u&&(b===null||b===41||so(b))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(b)):u<c&&b===40?(e.consume(b),u++,v):b===41?(e.consume(b),u--,v):b===null||b===32||b===40||E_(b)?n(b):(e.consume(b),b===92?y:v)}function y(b){return b===40||b===41||b===92?(e.consume(b),v):v(b)}}function D9(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(o),e.consume(p),e.exit(o),e.enter(i),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(i),e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):ot(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||ot(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!qt(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function k9(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"),pn(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?d:u)}function d(h){return h===s||h===92?(e.consume(h),u):u(h)}}function fh(e,t){let n;return r;function r(o){return ot(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):qt(o)?pn(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const pSe={name:"definition",tokenize:mSe},gSe={tokenize:vSe,partial:!0};function mSe(e,t,n){const r=this;let o;return i;function i(p){return e.enter("definition"),s(p)}function s(p){return D9.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return o=Au(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return so(p)?fh(e,c)(p):c(p)}function c(p){return A9(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(gSe,d,d)(p)}function d(p){return qt(p)?pn(e,h,"whitespace")(p):h(p)}function h(p){return p===null||ot(p)?(e.exit("definition"),r.parser.defined.push(o),t(p)):n(p)}}function vSe(e,t,n){return r;function r(a){return so(a)?fh(e,o)(a):n(a)}function o(a){return k9(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return qt(a)?pn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ot(a)?t(a):n(a)}}const bSe={name:"hardBreakEscape",tokenize:ySe};function ySe(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 xSe={name:"headingAtx",tokenize:SSe,resolve:wSe};function wSe(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"},os(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function SSe(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||so(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)):qt(u)?pn(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||so(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const _Se=["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"],Jk=["pre","script","style","textarea"],CSe={name:"htmlFlow",tokenize:OSe,resolveTo:PSe,concrete:!0},ESe={tokenize:MSe,partial:!0},RSe={tokenize:TSe,partial:!0};function PSe(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 OSe(e,t,n){const r=this;let o,i,s,a,l;return c;function c(M){return u(M)}function u(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),h):M===47?(e.consume(M),i=!0,v):M===63?(e.consume(M),o=3,r.interrupt?t:F):qi(M)?(e.consume(M),s=String.fromCharCode(M),y):n(M)}function h(M){return M===45?(e.consume(M),o=2,p):M===91?(e.consume(M),o=5,a=0,m):qi(M)?(e.consume(M),o=4,r.interrupt?t:F):n(M)}function p(M){return M===45?(e.consume(M),r.interrupt?t:F):n(M)}function m(M){const ne="CDATA[";return M===ne.charCodeAt(a++)?(e.consume(M),a===ne.length?r.interrupt?t:z:m):n(M)}function v(M){return qi(M)?(e.consume(M),s=String.fromCharCode(M),y):n(M)}function y(M){if(M===null||M===47||M===62||so(M)){const ne=M===47,X=s.toLowerCase();return!ne&&!i&&Jk.includes(X)?(o=1,r.interrupt?t(M):z(M)):_Se.includes(s.toLowerCase())?(o=6,ne?(e.consume(M),b):r.interrupt?t(M):z(M)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):i?S(M):_(M))}return M===45||Co(M)?(e.consume(M),s+=String.fromCharCode(M),y):n(M)}function b(M){return M===62?(e.consume(M),r.interrupt?t:z):n(M)}function S(M){return qt(M)?(e.consume(M),S):j(M)}function _(M){return M===47?(e.consume(M),j):M===58||M===95||qi(M)?(e.consume(M),C):qt(M)?(e.consume(M),_):j(M)}function C(M){return M===45||M===46||M===58||M===95||Co(M)?(e.consume(M),C):E(M)}function E(M){return M===61?(e.consume(M),T):qt(M)?(e.consume(M),E):_(M)}function T(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),l=M,A):qt(M)?(e.consume(M),T):D(M)}function A(M){return M===l?(e.consume(M),l=null,k):M===null||ot(M)?n(M):(e.consume(M),A)}function D(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||so(M)?E(M):(e.consume(M),D)}function k(M){return M===47||M===62||qt(M)?_(M):n(M)}function j(M){return M===62?(e.consume(M),$):n(M)}function $(M){return M===null||ot(M)?z(M):qt(M)?(e.consume(M),$):n(M)}function z(M){return M===45&&o===2?(e.consume(M),W):M===60&&o===1?(e.consume(M),H):M===62&&o===4?(e.consume(M),Y):M===63&&o===3?(e.consume(M),F):M===93&&o===5?(e.consume(M),te):ot(M)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(ESe,q,K)(M)):M===null||ot(M)?(e.exit("htmlFlowData"),K(M)):(e.consume(M),z)}function K(M){return e.check(RSe,V,q)(M)}function V(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),N}function N(M){return M===null||ot(M)?K(M):(e.enter("htmlFlowData"),z(M))}function W(M){return M===45?(e.consume(M),F):z(M)}function H(M){return M===47?(e.consume(M),s="",G):z(M)}function G(M){if(M===62){const ne=s.toLowerCase();return Jk.includes(ne)?(e.consume(M),Y):z(M)}return qi(M)&&s.length<8?(e.consume(M),s+=String.fromCharCode(M),G):z(M)}function te(M){return M===93?(e.consume(M),F):z(M)}function F(M){return M===62?(e.consume(M),Y):M===45&&o===2?(e.consume(M),F):z(M)}function Y(M){return M===null||ot(M)?(e.exit("htmlFlowData"),q(M)):(e.consume(M),Y)}function q(M){return e.exit("htmlFlow"),t(M)}}function TSe(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 MSe(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Vb,t,n)}}const ASe={name:"htmlText",tokenize:DSe};function DSe(e,t,n){const r=this;let o,i,s;return a;function a(F){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(F),l}function l(F){return F===33?(e.consume(F),c):F===47?(e.consume(F),E):F===63?(e.consume(F),_):qi(F)?(e.consume(F),D):n(F)}function c(F){return F===45?(e.consume(F),u):F===91?(e.consume(F),i=0,m):qi(F)?(e.consume(F),S):n(F)}function u(F){return F===45?(e.consume(F),p):n(F)}function d(F){return F===null?n(F):F===45?(e.consume(F),h):ot(F)?(s=d,H(F)):(e.consume(F),d)}function h(F){return F===45?(e.consume(F),p):d(F)}function p(F){return F===62?W(F):F===45?h(F):d(F)}function m(F){const Y="CDATA[";return F===Y.charCodeAt(i++)?(e.consume(F),i===Y.length?v:m):n(F)}function v(F){return F===null?n(F):F===93?(e.consume(F),y):ot(F)?(s=v,H(F)):(e.consume(F),v)}function y(F){return F===93?(e.consume(F),b):v(F)}function b(F){return F===62?W(F):F===93?(e.consume(F),b):v(F)}function S(F){return F===null||F===62?W(F):ot(F)?(s=S,H(F)):(e.consume(F),S)}function _(F){return F===null?n(F):F===63?(e.consume(F),C):ot(F)?(s=_,H(F)):(e.consume(F),_)}function C(F){return F===62?W(F):_(F)}function E(F){return qi(F)?(e.consume(F),T):n(F)}function T(F){return F===45||Co(F)?(e.consume(F),T):A(F)}function A(F){return ot(F)?(s=A,H(F)):qt(F)?(e.consume(F),A):W(F)}function D(F){return F===45||Co(F)?(e.consume(F),D):F===47||F===62||so(F)?k(F):n(F)}function k(F){return F===47?(e.consume(F),W):F===58||F===95||qi(F)?(e.consume(F),j):ot(F)?(s=k,H(F)):qt(F)?(e.consume(F),k):W(F)}function j(F){return F===45||F===46||F===58||F===95||Co(F)?(e.consume(F),j):$(F)}function $(F){return F===61?(e.consume(F),z):ot(F)?(s=$,H(F)):qt(F)?(e.consume(F),$):k(F)}function z(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),o=F,K):ot(F)?(s=z,H(F)):qt(F)?(e.consume(F),z):(e.consume(F),V)}function K(F){return F===o?(e.consume(F),o=void 0,N):F===null?n(F):ot(F)?(s=K,H(F)):(e.consume(F),K)}function V(F){return F===null||F===34||F===39||F===60||F===61||F===96?n(F):F===47||F===62||so(F)?k(F):(e.consume(F),V)}function N(F){return F===47||F===62||so(F)?k(F):n(F)}function W(F){return F===62?(e.consume(F),e.exit("htmlTextData"),e.exit("htmlText"),t):n(F)}function H(F){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),G}function G(F){return qt(F)?pn(e,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):te(F)}function te(F){return e.enter("htmlTextData"),s(F)}}const $R={name:"labelEnd",tokenize:jSe,resolveTo:FSe,resolveAll:LSe},kSe={tokenize:$Se},ISe={tokenize:zSe},NSe={tokenize:BSe};function LSe(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 FSe(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=Ko(a,e.slice(i+1,i+r+3)),a=Ko(a,[["enter",u,t]]),a=Ko(a,jR(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=Ko(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=Ko(a,e.slice(s+1)),a=Ko(a,[["exit",l,t]]),os(e,i,e.length,a),e}function jSe(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?d(h):(s=r.parser.defined.includes(Au(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(kSe,u,s?u:d)(h):h===91?e.attempt(ISe,u,s?c:d)(h):s?u(h):d(h)}function c(h){return e.attempt(NSe,u,d)(h)}function u(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function $Se(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),o}function o(d){return so(d)?fh(e,i)(d):i(d)}function i(d){return d===41?u(d):A9(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return so(d)?fh(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?k9(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return so(d)?fh(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function zSe(e,t,n){const r=this;return o;function o(a){return D9.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Au(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function BSe(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 HSe={name:"labelStartImage",tokenize:VSe,resolveAll:$R.resolveAll};function VSe(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 WSe={name:"labelStartLink",tokenize:USe,resolveAll:$R.resolveAll};function USe(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 q1={name:"lineEnding",tokenize:GSe};function GSe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),pn(e,t,"linePrefix")}}const h0={name:"thematicBreak",tokenize:qSe};function qSe(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"),qt(c)?pn(e,a,"whitespace")(c):a(c))}}const Kr={name:"list",tokenize:XSe,continuation:{tokenize:QSe},exit:ZSe},YSe={tokenize:e_e,partial:!0},KSe={tokenize:JSe,partial:!0};function XSe(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(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:R_(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(h0,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return R_(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Vb,r.interrupt?n:u,e.attempt(YSe,h,d))}function u(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function d(p){return qt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function QSe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Vb,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,pn(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!qt(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(KSe,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,pn(e,e.attempt(Kr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function JSe(e,t,n){const r=this;return pn(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 ZSe(e){e.exit(this.containerState.type)}function e_e(e,t,n){const r=this;return pn(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!qt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Zk={name:"setextUnderline",tokenize:n_e,resolveTo:t_e};function t_e(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 n_e(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(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"),qt(c)?pn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ot(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const r_e={tokenize:o_e};function o_e(e){const t=this,n=e.attempt(Vb,r,e.attempt(this.parser.constructs.flowInitial,o,pn(e,e.attempt(this.parser.constructs.flow,o,e.attempt(cSe,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 i_e={resolveAll:N9()},s_e=I9("string"),a_e=I9("text");function I9(e){return{tokenize:t,resolveAll:N9(e==="text"?l_e: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 d=o[u];let h=-1;if(d)for(;++h<d.length;){const p=d[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function N9(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 l_e(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 c_e(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:S,enter:_,exit:C,attempt:A(E),check:A(T),interrupt:A(T,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:h,now:m,defineSkip:v,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d($){return s=Ko(s,$),y(),s[s.length-1]!==null?[]:(D(t,0),c.events=jR(i,c.events,c),c.events)}function h($,z){return d_e(p($),z)}function p($){return u_e(s,$)}function m(){const{line:$,column:z,offset:K,_index:V,_bufferIndex:N}=r;return{line:$,column:z,offset:K,_index:V,_bufferIndex:N}}function v($){o[$.line]=$.column,j()}function y(){let $;for(;r._index<s.length;){const z=s[r._index];if(typeof z=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<z.length;)b(z.charCodeAt(r._bufferIndex));else b(z)}}function b($){u=u($)}function S($){ot($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,j()):$!==-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=$}function _($,z){const K=z||{};return K.type=$,K.start=m(),c.events.push(["enter",K,c]),a.push(K),K}function C($){const z=a.pop();return z.end=m(),c.events.push(["exit",z,c]),z}function E($,z){D($,z.from)}function T($,z){z.restore()}function A($,z){return K;function K(V,N,W){let H,G,te,F;return Array.isArray(V)?q(V):"tokenize"in V?q([V]):Y(V);function Y(re){return ee;function ee(J){const le=J!==null&&re[J],ce=J!==null&&re.null,ye=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(ce)?ce:ce?[ce]:[]];return q(ye)(J)}}function q(re){return H=re,G=0,re.length===0?W:M(re[G])}function M(re){return ee;function ee(J){return F=k(),te=re,re.partial||(c.currentConstruct=re),re.name&&c.parser.constructs.disable.null.includes(re.name)?X():re.tokenize.call(z?Object.assign(Object.create(c),z):c,l,ne,X)(J)}}function ne(re){return $(te,F),N}function X(re){return F.restore(),++G<H.length?M(H[G]):W}}}function D($,z){$.resolveAll&&!i.includes($)&&i.push($),$.resolve&&os(c.events,z,c.events.length-z,$.resolve(c.events.slice(z),c)),$.resolveTo&&(c.events=$.resolveTo(c.events,c))}function k(){const $=m(),z=c.previous,K=c.currentConstruct,V=c.events.length,N=Array.from(a);return{restore:W,from:V};function W(){r=$,c.previous=z,c.currentConstruct=K,c.events.length=V,a=N,j()}}function j(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function u_e(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 d_e(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=`
359
+ `;break}case-3:{s=`\r
360
+ `;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 f_e={42:Kr,43:Kr,45:Kr,48:Kr,49:Kr,50:Kr,51:Kr,52:Kr,53:Kr,54:Kr,55:Kr,56:Kr,57:Kr,62:P9},h_e={91:pSe},p_e={[-2]:G1,[-1]:G1,32:G1},g_e={35:xSe,42:h0,45:[Zk,h0],60:CSe,61:Zk,95:h0,96:Qk,126:Qk},m_e={38:T9,92:O9},v_e={[-5]:q1,[-4]:q1,[-3]:q1,33:HSe,38:T9,42:P_,60:[Uwe,ASe],91:WSe,92:[bSe,O9],93:$R,95:P_,96:oSe},b_e={null:[P_,i_e]},y_e={null:[42,95]},x_e={null:[]},w_e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:y_e,contentInitial:h_e,disable:x_e,document:f_e,flow:g_e,flowInitial:p_e,insideSpan:b_e,string:m_e,text:v_e},Symbol.toStringTag,{value:"Module"}));function S_e(e){const n=Mwe([w_e,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(jwe),document:o(zwe),flow:o(r_e),string:o(s_e),text:o(a_e)};return r;function o(i){return s;function s(a){return c_e(r,i,a)}}}function __e(e){for(;!M9(e););return e}const eI=/[\0\t\n\r]/g;function C_e(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,d,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(eI.lastIndex=d,c=eI.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){t=i.slice(d);break}if(p===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(i.slice(d,h)),e+=h-d),p){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}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const E_e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function R_e(e){return e.replace(E_e,P_e)}function P_e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return E9(n.slice(i?2:1),i?16:10)}return FR(n)||e}const L9={}.hasOwnProperty;function O_e(e,t,n){return typeof t!="string"&&(n=t,t=void 0),T_e(n)(__e(S_e(n).document().write(C_e()(e,t,!0))))}function T_e(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ie),autolinkProtocol:k,autolinkEmail:k,atxHeading:i(he),blockQuote:i(le),characterEscape:k,characterReference:k,codeFenced:i(ce),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ce,s),codeText:i(ye,s),codeTextData:k,data:k,codeFlowValue:k,definition:i(oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ve),hardBreakEscape:i(Ee),hardBreakTrailing:i(Ee),htmlFlow:i(ke,s),htmlFlowData:k,htmlText:i(ke,s),htmlTextData:k,image:i(We),label:s,link:i(Ie),listItem:i(dt),listItemValue:h,listOrdered:i(Le,d),listUnordered:i(Le),paragraph:i($t),reference:M,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(he),strong:i(rn),thematicBreak:i(on)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:J,autolinkProtocol:ee,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:re,codeFenced:l(y),codeFencedFence:v,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:j,codeIndented:l(b),codeText:l(N),codeTextData:j,data:j,definition:l(),definitionDestinationString:C,definitionLabelString:S,definitionTitleString:_,emphasis:l(),hardBreakEscape:l(z),hardBreakTrailing:l(z),htmlFlow:l(K),htmlFlowData:j,htmlText:l(V),htmlTextData:j,image:l(H),label:te,labelText:G,lineEnding:$,link:l(W),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ne,resourceDestinationString:F,resourceTitleString:Y,resource:q,setextHeading:l(D),setextHeadingLineSequence:A,setextHeadingText:T,strong:l(),thematicBreak:l()}};F9(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(pe){let Pe={type:"root",children:[]};const ze={stack:[Pe],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},Ye=[];let nt=-1;for(;++nt<pe.length;)if(pe[nt][1].type==="listOrdered"||pe[nt][1].type==="listUnordered")if(pe[nt][0]==="enter")Ye.push(nt);else{const sn=Ye.pop();nt=o(pe,sn,nt)}for(nt=-1;++nt<pe.length;){const sn=t[pe[nt][0]];L9.call(sn,pe[nt][1].type)&&sn[pe[nt][1].type].call(Object.assign({sliceSerialize:pe[nt][2].sliceSerialize},ze),pe[nt][1])}if(ze.tokenStack.length>0){const sn=ze.tokenStack[ze.tokenStack.length-1];(sn[1]||tI).call(ze,void 0,sn[0])}for(Pe.position={start:ga(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:ga(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)Pe=t.transforms[nt](Pe)||Pe;return Pe}function o(pe,Pe,ze){let Ye=Pe-1,nt=-1,sn=!1,Cn,mn,jn,vn;for(;++Ye<=ze;){const Ht=pe[Ye];switch(Ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ht[0]==="enter"?nt++:nt--,vn=void 0;break}case"lineEndingBlank":{Ht[0]==="enter"&&(Cn&&!vn&&!nt&&!jn&&(jn=Ye),vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:vn=void 0}if(!nt&&Ht[0]==="enter"&&Ht[1].type==="listItemPrefix"||nt===-1&&Ht[0]==="exit"&&(Ht[1].type==="listUnordered"||Ht[1].type==="listOrdered")){if(Cn){let cn=Ye;for(mn=void 0;cn--;){const Pn=pe[cn];if(Pn[1].type==="lineEnding"||Pn[1].type==="lineEndingBlank"){if(Pn[0]==="exit")continue;mn&&(pe[mn][1].type="lineEndingBlank",sn=!0),Pn[1].type="lineEnding",mn=cn}else if(!(Pn[1].type==="linePrefix"||Pn[1].type==="blockQuotePrefix"||Pn[1].type==="blockQuotePrefixWhitespace"||Pn[1].type==="blockQuoteMarker"||Pn[1].type==="listItemIndent"))break}jn&&(!mn||jn<mn)&&(Cn._spread=!0),Cn.end=Object.assign({},mn?pe[mn][1].start:Ht[1].end),pe.splice(mn||Ye,0,["exit",Cn,Ht[2]]),Ye++,ze++}if(Ht[1].type==="listItemPrefix"){const cn={type:"listItem",_spread:!1,start:Object.assign({},Ht[1].start),end:void 0};Cn=cn,pe.splice(Ye,0,["enter",cn,Ht[2]]),Ye++,ze++,jn=void 0,vn=!0}}}return pe[Pe][1]._spread=sn,ze}function i(pe,Pe){return ze;function ze(Ye){a.call(this,pe(Ye),Ye),Pe&&Pe.call(this,Ye)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(pe,Pe,ze){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Pe,ze]),pe.position={start:ga(Pe.start),end:void 0}}function l(pe){return Pe;function Pe(ze){pe&&pe.call(this,ze),c.call(this,ze)}}function c(pe,Pe){const ze=this.stack.pop(),Ye=this.tokenStack.pop();if(Ye)Ye[0].type!==pe.type&&(Pe?Pe.call(this,pe,Ye[0]):(Ye[1]||tI).call(this,pe,Ye[0]));else throw new Error("Cannot close `"+pe.type+"` ("+dh({start:pe.start,end:pe.end})+"): it’s not open");ze.position.end=ga(pe.end)}function u(){return Owe(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(pe){if(this.data.expectingFirstListItemValue){const Pe=this.stack[this.stack.length-2];Pe.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.lang=pe}function m(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.meta=pe}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=pe.replace(/(\r?\n|\r)$/g,"")}function S(pe){const Pe=this.resume(),ze=this.stack[this.stack.length-1];ze.label=Pe,ze.identifier=Au(this.sliceSerialize(pe)).toLowerCase()}function _(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=pe}function C(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=pe}function E(pe){const Pe=this.stack[this.stack.length-1];if(!Pe.depth){const ze=this.sliceSerialize(pe).length;Pe.depth=ze}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function A(pe){const Pe=this.stack[this.stack.length-1];Pe.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function k(pe){const ze=this.stack[this.stack.length-1].children;let Ye=ze[ze.length-1];(!Ye||Ye.type!=="text")&&(Ye=Nt(),Ye.position={start:ga(pe.start),end:void 0},ze.push(Ye)),this.stack.push(Ye)}function j(pe){const Pe=this.stack.pop();Pe.value+=this.sliceSerialize(pe),Pe.position.end=ga(pe.end)}function $(pe){const Pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ze=Pe.children[Pe.children.length-1];ze.position.end=ga(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Pe.type)&&(k.call(this,pe),j.call(this,pe))}function z(){this.data.atHardBreak=!0}function K(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=pe}function V(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=pe}function N(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=pe}function W(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Pe,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function H(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Pe,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function G(pe){const Pe=this.sliceSerialize(pe),ze=this.stack[this.stack.length-2];ze.label=R_e(Pe),ze.identifier=Au(Pe).toLowerCase()}function te(){const pe=this.stack[this.stack.length-1],Pe=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){const Ye=pe.children;ze.children=Ye}else ze.alt=Pe}function F(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=pe}function Y(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=pe}function q(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function ne(pe){const Pe=this.resume(),ze=this.stack[this.stack.length-1];ze.label=Pe,ze.identifier=Au(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function X(pe){this.data.characterReferenceType=pe.type}function re(pe){const Pe=this.sliceSerialize(pe),ze=this.data.characterReferenceType;let Ye;ze?(Ye=E9(Pe,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ye=FR(Pe);const nt=this.stack.pop();nt.value+=Ye,nt.position.end=ga(pe.end)}function ee(pe){j.call(this,pe);const Pe=this.stack[this.stack.length-1];Pe.url=this.sliceSerialize(pe)}function J(pe){j.call(this,pe);const Pe=this.stack[this.stack.length-1];Pe.url="mailto:"+this.sliceSerialize(pe)}function le(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function ye(){return{type:"inlineCode",value:""}}function oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ve(){return{type:"emphasis",children:[]}}function he(){return{type:"heading",depth:0,children:[]}}function Ee(){return{type:"break"}}function ke(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Ie(){return{type:"link",title:null,url:"",children:[]}}function Le(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function dt(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function $t(){return{type:"paragraph",children:[]}}function rn(){return{type:"strong",children:[]}}function Nt(){return{type:"text",value:""}}function on(){return{type:"thematicBreak"}}}function ga(e){return{line:e.line,column:e.column,offset:e.offset}}function F9(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?F9(e,r):M_e(e,r)}}function M_e(e,t){let n;for(n in t)if(L9.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 tI(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+dh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+dh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+dh({start:t.start,end:t.end})+") is still open")}function A_e(e){const t=this;t.parser=n;function n(r){return O_e(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function D_e(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 k_e(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
361
+ `}]}function I_e(e,t){const n=t.value?t.value+`
362
+ `:"",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 N_e(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function L_e(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function F_e(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Id(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 j_e(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 $_e(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function j9(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 z_e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return j9(e,t);const o={src:Id(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 B_e(e,t){const n={src:Id(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 H_e(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 V_e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return j9(e,t);const o={href:Id(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 W_e(e,t){const n={href:Id(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 U_e(e,t,n){const r=e.all(t),o=n?G_e(n):$9(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.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:`
363
+ `}),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:`
364
+ `});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function G_e(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=$9(n[r])}return t}function $9(e){const t=e.spread;return t??e.children.length>1}function q_e(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 Y_e(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function K_e(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function X_e(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q_e(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=kR(t.children[1]),l=b9(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 J_e(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 d=t.children[l],h={},p=s?s[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function Z_e(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const nI=9,rI=32;function eCe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(oI(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(oI(t.slice(o),o>0,!1)),i.join("")}function oI(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===nI||i===rI;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===nI||i===rI;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function tCe(e,t){const n={type:"text",value:eCe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function nCe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const rCe={blockquote:D_e,break:k_e,code:I_e,delete:N_e,emphasis:L_e,footnoteReference:F_e,heading:j_e,html:$_e,imageReference:z_e,image:B_e,inlineCode:H_e,linkReference:V_e,link:W_e,listItem:U_e,list:q_e,paragraph:Y_e,root:K_e,strong:X_e,table:Q_e,tableCell:Z_e,tableRow:J_e,text:tCe,thematicBreak:nCe,toml:Vm,yaml:Vm,definition:Vm,footnoteDefinition:Vm};function Vm(){}const z9=-1,Wb=0,pv=1,gv=2,zR=3,BR=4,HR=5,VR=6,B9=7,H9=8,iI=typeof self=="object"?self:globalThis,oCe=(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 Wb:case z9:return n(s,o);case pv:{const a=n([],o);for(const l of s)a.push(r(l));return a}case gv:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case zR:return n(new Date(s),o);case BR:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case HR:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case VR:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case B9:{const{name:a,message:l}=s;return n(new iI[a](l),o)}case H9:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o)}return n(new iI[i](s),o)};return r},sI=e=>oCe(new Map,e)(0),lu="",{toString:iCe}={},{keys:sCe}=Object,Cf=e=>{const t=typeof e;if(t!=="object"||!e)return[Wb,t];const n=iCe.call(e).slice(8,-1);switch(n){case"Array":return[pv,lu];case"Object":return[gv,lu];case"Date":return[zR,lu];case"RegExp":return[BR,lu];case"Map":return[HR,lu];case"Set":return[VR,lu]}return n.includes("Array")?[pv,n]:n.includes("Error")?[B9,n]:[gv,n]},Wm=([e,t])=>e===Wb&&(t==="function"||t==="symbol"),aCe=(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]=Cf(s);switch(a){case Wb:{let u=s;switch(l){case"bigint":a=H9,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([z9],s)}return o([a,u],s)}case pv:{if(l)return o([l,[...s]],s);const u=[],d=o([a,u],s);for(const h of s)u.push(i(h));return d}case gv:{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=[],d=o([a,u],s);for(const h of sCe(s))(e||!Wm(Cf(s[h])))&&u.push([i(h),i(s[h])]);return d}case zR:return o([a,s.toISOString()],s);case BR:{const{source:u,flags:d}=s;return o([a,{source:u,flags:d}],s)}case HR:{const u=[],d=o([a,u],s);for(const[h,p]of s)(e||!(Wm(Cf(h))||Wm(Cf(p))))&&u.push([i(h),i(p)]);return d}case VR:{const u=[],d=o([a,u],s);for(const h of s)(e||!Wm(Cf(h)))&&u.push(i(h));return d}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},aI=(e,{json:t,lossy:n}={})=>{const r=[];return aCe(!(t||n),!!t,new Map,r)(e),r},mv=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?sI(aI(e,t)):structuredClone(e):(e,t)=>sI(aI(e,t));function lCe(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 cCe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function uCe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||lCe,r=e.options.footnoteBackLabel||cCe,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),d=String(c.identifier).toUpperCase(),h=Id(d.toLowerCase());let p=0;const m=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++p<=v;){m.length>0&&m.push({type:"text",value:" "});let S=typeof n=="string"?n:n(l,p);typeof S=="string"&&(S={type:"text",value:S}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const S=y.children[y.children.length-1];S&&S.type==="text"?S.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else u.push(...m);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,b),a.push(b)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...mv(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
365
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
366
+ `}]}}const V9=function(e){if(e==null)return pCe;if(typeof e=="function")return Ub(e);if(typeof e=="object")return Array.isArray(e)?dCe(e):fCe(e);if(typeof e=="string")return hCe(e);throw new Error("Expected function, string, or object as test")};function dCe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=V9(e[n]);return Ub(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function fCe(e){const t=e;return Ub(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function hCe(e){return Ub(t);function t(n){return n&&n.type===e}}function Ub(e){return t;function t(n,r,o){return!!(gCe(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function pCe(){return!0}function gCe(e){return e!==null&&typeof e=="object"&&"type"in e}const W9=[],mCe=!0,lI=!1,vCe="skip";function bCe(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=V9(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=W9,m,v,y;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=yCe(n(l,u)),p[0]===lI))return p;if("children"in l&&l.children){const b=l;if(b.children&&p[0]!==vCe)for(v=(r?b.children.length:-1)+s,y=u.concat(b);v>-1&&v<b.children.length;){const S=b.children[v];if(m=a(S,v,y)(),m[0]===lI)return m;v=typeof m[1]=="number"?m[1]:v+s}}return p}}}function yCe(e){return Array.isArray(e)?e:typeof e=="number"?[mCe,e]:e==null?W9:[e]}function U9(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),bCe(e,i,a,o);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const O_={}.hasOwnProperty,xCe={};function wCe(e,t){const n=t||xCe,r=new Map,o=new Map,i=new Map,s={...rCe,...n.handlers},a={all:c,applyData:_Ce,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:SCe,wrap:ECe};return U9(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:o,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,p=a.handlers[h];if(O_.call(a.handlers,h)&&p)return p(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:v,...y}=u,b=mv(y);return b.children=a.all(u),b}return mv(u)}return(a.options.unknownHandler||CCe)(a,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const m=a.one(h[p],u);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=cI(m.value)),!Array.isArray(m)&&m.type==="element")){const v=m.children[0];v&&v.type==="text"&&(v.value=cI(v.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function SCe(e,t){e.position&&(t.position=owe(e))}function _Ce(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,mv(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function CCe(e,t){const n=t.data||{},r="value"in t&&!(O_.call(n,"hProperties")||O_.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 ECe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
367
+ `});++r<e.length;)r&&n.push({type:"text",value:`
368
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
369
+ `}),n}function cI(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function uI(e,t){const n=wCe(e,t),r=n.one(e,void 0),o=uCe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
370
+ `},o),i}function RCe(e,t){return e&&"run"in e?async function(n,r){const o=uI(n,{file:r,...t});await e.run(o,r)}:function(n,r){return uI(n,{file:r,...t||e})}}function dI(e){if(e)throw e}var p0=Object.prototype.hasOwnProperty,G9=Object.prototype.toString,fI=Object.defineProperty,hI=Object.getOwnPropertyDescriptor,pI=function(t){return typeof Array.isArray=="function"?Array.isArray(t):G9.call(t)==="[object Array]"},gI=function(t){if(!t||G9.call(t)!=="[object Object]")return!1;var n=p0.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&p0.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||p0.call(t,o)},mI=function(t,n){fI&&n.name==="__proto__"?fI(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},vI=function(t,n){if(n==="__proto__")if(p0.call(t,n)){if(hI)return hI(t,n).value}else return;return t[n]},PCe=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=vI(a,n),o=vI(t,n),a!==o&&(u&&o&&(gI(o)||(i=pI(o)))?(i?(i=!1,s=r&&pI(r)?r:[]):s=r&&gI(r)?r:{},mI(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&mI(a,{name:n,newValue:o}));return a};const Y1=Oc(PCe);function T_(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 OCe(){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 d=-1;if(l){s(l);return}for(;++d<o.length;)(c[d]===null||c[d]===void 0)&&(c[d]=o[d]);o=c,u?TCe(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 TCe(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 Li={basename:MCe,dirname:ACe,extname:DCe,join:kCe,sep:"/"};function MCe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Xp(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 ACe(e){if(Xp(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 DCe(e){Xp(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 kCe(...e){let t=-1,n;for(;++t<e.length;)Xp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":ICe(n)}function ICe(e){Xp(e);const t=e.codePointAt(0)===47;let n=NCe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function NCe(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 Xp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const LCe={cwd:FCe};function FCe(){return"/"}function M_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jCe(e){if(typeof e=="string")e=new URL(e);else if(!M_(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 $Ce(e)}function $Ce(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 K1=["history","path","basename","stem","extname","dirname"];class q9{constructor(t){let n;t?M_(t)?n={path:t}:typeof t=="string"||zCe(t)?n={value:t}:n=t:n={},this.cwd=LCe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<K1.length;){const i=K1[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)K1.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Li.basename(this.path):void 0}set basename(t){Q1(t,"basename"),X1(t,"basename"),this.path=Li.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Li.dirname(this.path):void 0}set dirname(t){bI(this.basename,"dirname"),this.path=Li.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Li.extname(this.path):void 0}set extname(t){if(X1(t,"extname"),bI(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=Li.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){M_(t)&&(t=jCe(t)),Q1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Li.basename(this.path,this.extname):void 0}set stem(t){Q1(t,"stem"),X1(t,"stem"),this.path=Li.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 Er(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 X1(e,t){if(e&&e.includes(Li.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Li.sep+"`")}function Q1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function bI(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function zCe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BCe=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},HCe={}.hasOwnProperty;class WR extends BCe{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=OCe()}copy(){const t=new WR;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Y1(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ew("data",this.frozen),this.namespace[t]=n,this):HCe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ew("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=Um(t),r=this.parser||this.Parser;return J1("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),J1("process",this.parser||this.Parser),Z1("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Um(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const p=d,m=r.stringify(p,h);UCe(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?s(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),J1("processSync",this.parser||this.Parser),Z1("processSync",this.compiler||this.Compiler),this.process(t,o),xI("processSync","process",n),r;function o(i,s){n=!0,dI(i),r=s}}run(t,n,r){yI(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=Um(n);o.run(t,l,c);function c(u,d,h){const p=d||t;u?a(u):s?s(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),xI("runSync","run",r),o;function i(s,a){dI(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Um(n),o=this.compiler||this.Compiler;return Z1("stringify",o),yI(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(ew("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,...d]=c;l(u,d)}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=Y1(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...m]=u;const v=r[h][1];T_(v)&&T_(p)&&(p=Y1(!0,v,p)),r[h]=[c,p,...m]}}}}const VCe=new WR().freeze();function J1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Z1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ew(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 yI(e){if(!T_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function xI(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Um(e){return WCe(e)?e:new q9(e)}function WCe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function UCe(e){return typeof e=="string"||GCe(e)}function GCe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const qCe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wI=[],SI={allowDangerousHtml:!0},YCe=/^(https?|ircs?|mailto|xmpp)$/i,KCe=[{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 Y9(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||wI,l=e.remarkPlugins||wI,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...SI}:SI,u=e.skipHtml,d=e.unwrapDisallowed,h=e.urlTransform||XCe,p=VCe().use(A_e).use(l).use(RCe,c).use(a),m=new q9;typeof r=="string"&&(m.value=r);for(const S of KCe)Object.hasOwn(e,S.from)&&(""+S.from+(S.to?"use `"+S.to+"` instead":"remove it")+qCe+S.id,void 0);const v=p.parse(m);let y=p.runSync(v,m);return o&&(y={type:"element",tagName:"div",properties:{className:o},children:y.type==="root"?y.children:[y]}),U9(y,b),uwe(y,{Fragment:x.Fragment,components:i,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function b(S,_,C){if(S.type==="raw"&&C&&typeof _=="number")return u?C.children.splice(_,1):C.children[_]={type:"text",value:S.value},_;if(S.type==="element"){let E;for(E in U1)if(Object.hasOwn(U1,E)&&Object.hasOwn(S.properties,E)){const T=S.properties[E],A=U1[E];(A===null||A.includes(S.tagName))&&(S.properties[E]=h(String(T||""),E,S))}}if(S.type==="element"){let E=t?!t.includes(S.tagName):s?s.includes(S.tagName):!1;if(!E&&n&&typeof _=="number"&&(E=!n(S,_,C)),E&&C&&typeof _=="number")return d&&S.children?C.children.splice(_,1,...S.children):C.children.splice(_,1),_}}}function XCe(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||YCe.test(e.slice(0,t))?e:""}function QCe(){const e=P.useRef(null),[t,n]=P.useState(""),[r,o]=P.useState(!1),i=we(k=>k.dashboard.aiScopeTables);Qv();const s=we(k=>k.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=dr(),{authToken:u}=ko(),d=J_(),{messages:h,input:p,handleInputChange:m,handleSubmit:v,addToolResult:y,stop:b,isLoading:S}=b1e({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},async onToolCall({toolCall:k}){if(C(k.toolName),k.toolName==="getLocation"){const j=["New York","Los Angeles","Chicago","San Francisco"];return j[Math.floor(Math.random()*j.length)]}if(k.toolName==="getTables")return JSON.stringify(i||[]);if(k.toolName==="getData"){console.log(k.args);const j=k.args;if(!(j!=null&&j.sql)||!(j!=null&&j.connectionId))return"Please provide sql, connectionId and table";const $=await d.fetchQuery({queryKey:["chat",j.connectionId,j.sql],queryFn:()=>Ev("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:j.connectionId,sql:j.sql,cache_config:Y_()})});return n("Summarizing"),JSON.stringify($)}},onFinish(k,j){console.log("onFinish",k,j),k.content&&n("")}}),_=()=>{var k;(k=e.current)==null||k.scrollIntoView({behavior:"smooth"})};P.useEffect(()=>{_()},[h]);function C(k){k==="getTables"&&n("Initializing"),k==="getSchemas"&&n("Analyzing"),k==="getData"&&n("Fetching")}function E(k){const j=k.toolInvocations||[];return j.length===0||j.find(z=>z.toolName==="getData"&&"result"in z)?!0:r}function T(k){return k==null?void 0:k.map(j=>{var z;const $=j.role==="user";return E(j)?x.jsxs("div",{className:xe("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":$}),children:[x.jsx("div",{className:"space-y-2",children:x.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[x.jsx("div",{className:"text-muted-foreground",children:$?x.jsx(h4,{className:"size-5 shrink-0"}):x.jsx(tS,{className:"size-5 shrink-0"})}),x.jsx("div",{children:x.jsx(Y9,{components:JCe,children:j.content})})]})}),(z=j.toolInvocations)==null?void 0:z.map(K=>{const V=K.toolCallId;return"result"in K?x.jsx("div",{children:A(K)},V):x.jsxs("div",{children:["Calling ",K.toolName,"..."]},V)})]},j.id):null})}function A(k){if("result"in k){let j;try{const $=JSON.parse(k.result);if(j=x.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify($,null,2)}),k.toolName==="getData"){const z=gE({cardType:k.args.chartType,data:$.records});return x.jsxs("div",{className:"space-y-2",children:[r&&x.jsxs("div",{children:[x.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${k.toolName}: `,j]}),x.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[x.jsx(oo,{onClick:()=>{const K=k.args.chartTitle,V=k.args.connectionId;D({sql:k.args.sql,data:$.records,cardType:k.args.chartType,cardCfg:z,cardTitle:K,connectionId:V})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),z&&x.jsx(UE,{cfg:z})]})]})}}catch{j=x.jsx("span",{children:k.result})}return x.jsxs("div",{children:[x.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${k.toolName}: `,j]})}return`Calling ${k.toolName}...`}function D({sql:k,data:j,cardCfg:$,cardTitle:z,connectionId:K,cardType:V}){if(!s)return;const N={id:Ba(),title:z||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:V==="horizontalBar"?"y":"x"}},type:$.type,cfg:$,sql:k,data:j,connectionId:K},W={id:Ba(),cards:[N],activeCardId:N.id};c(!0),a(s,W,"start"),l(W.id)}return x.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:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx(Tn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),x.jsxs(pb,{openDelay:700,children:[x.jsx(gb,{children:x.jsx(u4,{className:"size-4 text-muted-foreground"})}),x.jsx(Ip,{className:"w-70",children:x.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[x.jsx(tS,{className:"size-5"}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("p",{className:"text-sm",children:i&&(i==null?void 0:i.length)>0?"I can analyze following datasets":"No datasets in scope"}),x.jsx("div",{className:"space-y-2 pt-2",children:i==null?void 0:i.map((k,j)=>x.jsxs("div",{className:"flex gap-2 text-xs",children:[x.jsx(f4,{className:"size-4 opacity-70"}),x.jsx("span",{children:k.tableName})]},j))})]})]})})]}),!1]}),x.jsx(Np,{className:"my-4"}),x.jsx("div",{className:"",children:x.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:v,children:[x.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[x.jsx(ac,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:p,disabled:S,placeholder:"What can I help you with?",onChange:m}),x.jsx("button",{className:"mr-3",children:x.jsx(J5,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),S&&x.jsx(oo,{size:"sm",className:"rounded-full",onClick:()=>b(),children:x.jsx(ree,{className:"size-2.5 bg-background"})})]})}),x.jsxs(Dh,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[x.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[S&&t!==""&&x.jsx(WZ,{className:"size-10 animate-pulse"}),t]}),x.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:T(h)}),x.jsx(Db,{orientation:"vertical"})]})]})}const JCe={li:({node:e,...t})=>x.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>x.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:md,createContext:ZCe,createRef:YOe,forwardRef:K9,useCallback:Xr,useContext:X9,useEffect:cc,useImperativeHandle:Q9,useLayoutEffect:eEe,useMemo:tEe,useRef:Zr,useState:Du}=R,_I=R[`useId${Math.random()}`.slice(0,5)],nEe=eEe,Gb=ZCe(null);Gb.displayName="PanelGroupContext";const uc=nEe,rEe=typeof _I=="function"?_I:()=>null;let oEe=0;function UR(e=null){const t=rEe(),n=Zr(e||t||null);return n.current===null&&(n.current=""+oEe++),e??n.current}function J9({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:h,style:p,tagName:m="div",...v}){const y=X9(Gb);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:b,expandPanel:S,getPanelSize:_,getPanelStyle:C,groupId:E,isPanelCollapsed:T,reevaluatePanelConstraints:A,registerPanel:D,resizePanel:k,unregisterPanel:j}=y,$=UR(s),z=Zr({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:$,idIsFromProps:s!==void 0,order:h});Zr({didLogMissingDefaultSizeWarning:!1}),uc(()=>{const{callbacks:V,constraints:N}=z.current,W={...N};z.current.id=$,z.current.idIsFromProps=s!==void 0,z.current.order=h,V.onCollapse=c,V.onExpand=u,V.onResize=d,N.collapsedSize=n,N.collapsible=r,N.defaultSize=o,N.maxSize=a,N.minSize=l,(W.collapsedSize!==N.collapsedSize||W.collapsible!==N.collapsible||W.maxSize!==N.maxSize||W.minSize!==N.minSize)&&A(z.current,W)}),uc(()=>{const V=z.current;return D(V),()=>{j(V)}},[h,$,D,j]),Q9(i,()=>({collapse:()=>{b(z.current)},expand:V=>{S(z.current,V)},getId(){return $},getSize(){return _(z.current)},isCollapsed(){return T(z.current)},isExpanded(){return!T(z.current)},resize:V=>{k(z.current,V)}}),[b,S,_,T,$,k]);const K=C(z.current,o);return md(m,{...v,children:e,className:t,id:s,style:{...K,...p},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":E,"data-panel-id":$,"data-panel-size":parseFloat(""+K.flexGrow).toFixed(1)})}const Z9=K9((e,t)=>md(J9,{...e,forwardedRef:t}));J9.displayName="Panel";Z9.displayName="forwardRef(Panel)";let A_=null,Hl=null;function iEe(e,t){if(t){const n=(t&oj)!==0,r=(t&ij)!==0,o=(t&sj)!==0,i=(t&aj)!==0;if(n)return o?"se-resize":i?"ne-resize":"e-resize";if(r)return o?"sw-resize":i?"nw-resize":"w-resize";if(o)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function sEe(){Hl!==null&&(document.head.removeChild(Hl),A_=null,Hl=null)}function tw(e,t){const n=iEe(e,t);A_!==n&&(A_=n,Hl===null&&(Hl=document.createElement("style"),document.head.appendChild(Hl)),Hl.innerHTML=`*{cursor: ${n}!important;}`)}function ej(e){return e.type==="keydown"}function tj(e){return e.type.startsWith("pointer")}function nj(e){return e.type.startsWith("mouse")}function qb(e){if(tj(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(nj(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function aEe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function lEe(e,t,n){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function cEe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:RI(e),b:RI(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Et(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:EI(CI(n.a)),b:EI(CI(n.b))};if(o.a===o.b){const i=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const l=i[a];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(o.a-o.b)}const uEe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function dEe(e){var t;const n=getComputedStyle((t=rj(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function fEe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||dEe(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||uEe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function CI(e){let t=e.length;for(;t--;){const n=e[t];if(Et(n,"Missing node"),fEe(n))return n}return null}function EI(e){return e&&Number(getComputedStyle(e).zIndex)||0}function RI(e){const t=[];for(;e;)t.push(e),e=rj(e);return t}function rj(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const oj=1,ij=2,sj=4,aj=8,hEe=aEe()==="coarse";let _i=[],ku=!1,Sa=new Map,Yb=new Map;const tp=new Set;function pEe(e,t,n,r,o){var i;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=Sa.get(s))!==null&&i!==void 0?i:0;return Sa.set(s,l+1),tp.add(a),vv(),function(){var u;Yb.delete(e),tp.delete(a);const d=(u=Sa.get(s))!==null&&u!==void 0?u:1;if(Sa.set(s,d-1),vv(),d===1&&Sa.delete(s),_i.includes(a)){const h=_i.indexOf(a);h>=0&&_i.splice(h,1),qR(),o("up",!0,null)}}}function PI(e){const{target:t}=e,{x:n,y:r}=qb(e);ku=!0,GR({target:t,x:n,y:r}),vv(),_i.length>0&&(bv("down",e),e.preventDefault(),e.stopPropagation())}function Ef(e){const{x:t,y:n}=qb(e);if(ku&&e.buttons===0&&(ku=!1,bv("up",e)),!ku){const{target:r}=e;GR({target:r,x:t,y:n})}bv("move",e),qR(),_i.length>0&&e.preventDefault()}function cu(e){const{target:t}=e,{x:n,y:r}=qb(e);Yb.clear(),ku=!1,_i.length>0&&e.preventDefault(),bv("up",e),GR({target:t,x:n,y:r}),qR(),vv()}function GR({target:e,x:t,y:n}){_i.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),tp.forEach(o=>{const{element:i,hitAreaMargins:s}=o,a=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,h=hEe?s.coarse:s.fine;if(t>=c-h&&t<=u+h&&n>=d-h&&n<=l+h){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&cEe(r,i)>0){let m=r,v=!1;for(;m&&!m.contains(i);){if(lEe(m.getBoundingClientRect(),a,!0)){v=!0;break}m=m.parentElement}if(v)return}_i.push(o)}})}function nw(e,t){Yb.set(e,t)}function qR(){let e=!1,t=!1;_i.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;Yb.forEach(r=>{n|=r}),e&&t?tw("intersection",n):e?tw("horizontal",n):t?tw("vertical",n):sEe()}function vv(){Sa.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",cu),n.removeEventListener("pointerdown",PI),n.removeEventListener("pointerleave",Ef),n.removeEventListener("pointermove",Ef)}),window.removeEventListener("pointerup",cu),window.removeEventListener("pointercancel",cu),tp.size>0&&(ku?(_i.length>0&&Sa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",cu),n.addEventListener("pointerleave",Ef),n.addEventListener("pointermove",Ef))}),window.addEventListener("pointerup",cu),window.addEventListener("pointercancel",cu)):Sa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",PI,{capture:!0}),n.addEventListener("pointermove",Ef))}))}function bv(e,t){tp.forEach(n=>{const{setResizeHandlerState:r}=n,o=_i.includes(n);r(e,o,t)})}function gEe(){const[e,t]=Du(0);return Xr(()=>t(n=>n+1),[])}function Et(e,t){if(!e)throw console.error(t),Error(t)}const YR=10;function Cc(e,t,n=YR){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Ns(e,t,n=YR){return Cc(e,t,n)===0}function xo(e,t,n){return Cc(e,t,n)===0}function mEe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],i=t[r];if(!xo(o,i,n))return!1}return!0}function yu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Et(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(Cc(n,a)<0)if(i){const l=(o+a)/2;Cc(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(YR)),n}function Wf({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(xo(e,0))return t;const s=[...t],[a,l]=r;Et(a!=null,"Invalid first pivot index"),Et(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=e<0?l:a,h=n[d];Et(h,`Panel constraints not found for index ${d}`);const{collapsedSize:p=0,collapsible:m,minSize:v=0}=h;if(m){const y=t[d];if(Et(y!=null,`Previous layout not found for panel index ${d}`),xo(y,p)){const b=v-y;Cc(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}{const d=e<0?a:l,h=n[d];Et(h,`No panel constraints found for index ${d}`);const{collapsedSize:p=0,collapsible:m,minSize:v=0}=h;if(m){const y=t[d];if(Et(y!=null,`Previous layout not found for panel index ${d}`),xo(y,v)){const b=y-p;Cc(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}}{const d=e<0?1:-1;let h=e<0?l:a,p=0;for(;;){const v=t[h];Et(v!=null,`Previous layout not found for panel index ${h}`);const b=yu({panelConstraints:n,panelIndex:h,size:100})-v;if(p+=b,h+=d,h<0||h>=n.length)break}const m=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-m:m}{let h=e<0?a:l;for(;h>=0&&h<n.length;){const p=Math.abs(e)-Math.abs(c),m=t[h];Et(m!=null,`Previous layout not found for panel index ${h}`);const v=m-p,y=yu({panelConstraints:n,panelIndex:h,size:v});if(!xo(m,y)&&(c+=m-y,s[h]=y,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?h--:h++}}if(mEe(o,s))return o;{const d=e<0?l:a,h=t[d];Et(h!=null,`Previous layout not found for panel index ${d}`);const p=h+c,m=yu({panelConstraints:n,panelIndex:d,size:p});if(s[d]=m,!xo(m,p)){let v=p-m,b=e<0?l:a;for(;b>=0&&b<n.length;){const S=s[b];Et(S!=null,`Previous layout not found for panel index ${b}`);const _=S+v,C=yu({panelConstraints:n,panelIndex:b,size:_});if(xo(S,C)||(v-=C-S,s[b]=C),xo(v,0))break;e>0?b--:b++}}}const u=s.reduce((d,h)=>h+d,0);return xo(u,100)?s:o}function vEe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];Et(a!=null,"No pivot index found"),t.forEach((d,h)=>{const{constraints:p}=d,{maxSize:m=100,minSize:v=0}=p;h===a?(r=v,o=m):(i+=v,s+=m)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function np(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function lj(e,t,n=document){const o=np(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function cj(e,t,n){const r=lj(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function uj(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Kb(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function bEe(e,t,n,r=document){var o,i,s,a;const l=Kb(t,r),c=np(e,r),u=l?c.indexOf(l):-1,d=(o=(i=n[u])===null||i===void 0?void 0:i.id)!==null&&o!==void 0?o:null,h=(s=(a=n[u+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[d,h]}function yEe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:s}){Zr({didWarnAboutMissingResizeHandle:!1}),uc(()=>{if(!i)return;const a=np(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=vEe({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),h=a[l];if(h!=null){const p=o[l];Et(p,`No panel data found for index "${l}"`),h.setAttribute("aria-controls",p.id),h.setAttribute("aria-valuemax",""+Math.round(c)),h.setAttribute("aria-valuemin",""+Math.round(u)),h.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,i]),cc(()=>{if(!i)return;const a=t.current;Et(a,"Eager values not found");const{panelDataArray:l}=a,c=uj(n,i);Et(c!=null,`No group found for id "${n}"`);const u=np(n,i);Et(u,`No resize handles found for group id "${n}"`);const d=u.map(h=>{const p=h.getAttribute("data-panel-resize-handle-id");Et(p,"Resize handle element has no handle id attribute");const[m,v]=bEe(n,p,l,i);if(m==null||v==null)return()=>{};const y=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const S=l.findIndex(_=>_.id===m);if(S>=0){const _=l[S];Et(_,`No panel data found for index ${S}`);const C=r[S],{collapsedSize:E=0,collapsible:T,minSize:A=0}=_.constraints;if(C!=null&&T){const D=Wf({delta:xo(C,E)?A-E:E-C,initialLayout:r,panelConstraints:l.map(k=>k.constraints),pivotIndices:cj(n,p,i),prevLayout:r,trigger:"keyboard"});r!==D&&s(D)}}break}}};return h.addEventListener("keydown",y),()=>{h.removeEventListener("keydown",y)}});return()=>{d.forEach(h=>h())}},[i,e,t,n,r,o,s])}function OI(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 dj(e,t){const n=e==="horizontal",{x:r,y:o}=qb(t);return n?r:o}function xEe(e,t,n,r,o){const i=n==="horizontal",s=Kb(t,o);Et(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");Et(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=dj(n,e),u=uj(a,o);Et(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),h=i?d.width:d.height;return(c-l)/h*100}function wEe(e,t,n,r,o,i){if(ej(e)){const s=n==="horizontal";let a=0;e.shiftKey?a=100:o!=null?a=o:a=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:a;break;case"ArrowLeft":l=s?-a:0;break;case"ArrowRight":l=s?a:0;break;case"ArrowUp":l=s?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:xEe(e,t,n,r,i)}function SEe({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];Et(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];Et(s,`Panel constraints not found for index ${i}`);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 uu(e,t,n){t.forEach((r,o)=>{const i=e[o];Et(i,`Panel data not found for index ${o}`);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:h,onExpand:p,onResize:m}=s;m&&m(r,d),u&&(h||p)&&(p&&(d==null||Ns(d,c))&&!Ns(r,c)&&p(),h&&(d==null||!Ns(d,c))&&Ns(r,c)&&h())}})}function Gm(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 _Ee({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e!=null?e.toPrecision(i):"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function CEe(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function TI(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 fj(e){return`react-resizable-panels:${e}`}function hj(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 pj(e,t){try{const n=fj(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function EEe(e,t,n){var r,o;const i=(r=pj(e,n))!==null&&r!==void 0?r:{},s=hj(t);return(o=i[s])!==null&&o!==void 0?o:null}function REe(e,t,n,r,o){var i;const s=fj(e),a=hj(t),l=(i=pj(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 MI({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(!xo(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const s=n[i];Et(s!=null,`No layout data found for index ${i}`);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];Et(s!=null,`No layout data found for index ${i}`);const a=yu({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!xo(o,0))for(let i=0;i<t.length;i++){const s=n[i];Et(s!=null,`No layout data found for index ${i}`);const a=s+o,l=yu({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,xo(o,0)))break}return n}const PEe=100,Uf={getItem:e=>(TI(Uf),Uf.getItem(e)),setItem:(e,t)=>{TI(Uf),Uf.setItem(e,t)}},AI={};function gj({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Uf,style:c,tagName:u="div",...d}){const h=UR(i),p=Zr(null),[m,v]=Du(null),[y,b]=Du([]),S=gEe(),_=Zr({}),C=Zr(new Map),E=Zr(0),T=Zr({autoSaveId:e,direction:r,dragState:m,id:h,keyboardResizeBy:a,onLayout:s,storage:l}),A=Zr({layout:y,panelDataArray:[],panelDataArrayChanged:!1});Zr({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Q9(o,()=>({getId:()=>T.current.id,getLayout:()=>{const{layout:M}=A.current;return M},setLayout:M=>{const{onLayout:ne}=T.current,{layout:X,panelDataArray:re}=A.current,ee=MI({layout:M,panelConstraints:re.map(J=>J.constraints)});OI(X,ee)||(b(ee),A.current.layout=ee,ne&&ne(ee),uu(re,ee,_.current))}}),[]),uc(()=>{T.current.autoSaveId=e,T.current.direction=r,T.current.dragState=m,T.current.id=h,T.current.onLayout=s,T.current.storage=l}),yEe({committedValuesRef:T,eagerValuesRef:A,groupId:h,layout:y,panelDataArray:A.current.panelDataArray,setLayout:b,panelGroupElement:p.current}),cc(()=>{const{panelDataArray:M}=A.current;if(e){if(y.length===0||y.length!==M.length)return;let ne=AI[e];ne==null&&(ne=CEe(REe,PEe),AI[e]=ne);const X=[...M],re=new Map(C.current);ne(e,X,re,y,l)}},[e,y,l]),cc(()=>{});const D=Xr(M=>{const{onLayout:ne}=T.current,{layout:X,panelDataArray:re}=A.current;if(M.constraints.collapsible){const ee=re.map(ye=>ye.constraints),{collapsedSize:J=0,panelSize:le,pivotIndices:ce}=_l(re,M,X);if(Et(le!=null,`Panel size not found for panel "${M.id}"`),!Ns(le,J)){C.current.set(M.id,le);const oe=fu(re,M)===re.length-1?le-J:J-le,ve=Wf({delta:oe,initialLayout:X,panelConstraints:ee,pivotIndices:ce,prevLayout:X,trigger:"imperative-api"});Gm(X,ve)||(b(ve),A.current.layout=ve,ne&&ne(ve),uu(re,ve,_.current))}}},[]),k=Xr((M,ne)=>{const{onLayout:X}=T.current,{layout:re,panelDataArray:ee}=A.current;if(M.constraints.collapsible){const J=ee.map(he=>he.constraints),{collapsedSize:le=0,panelSize:ce=0,minSize:ye=0,pivotIndices:oe}=_l(ee,M,re),ve=ne??ye;if(Ns(ce,le)){const he=C.current.get(M.id),Ee=he!=null&&he>=ve?he:ve,We=fu(ee,M)===ee.length-1?ce-Ee:Ee-ce,Ie=Wf({delta:We,initialLayout:re,panelConstraints:J,pivotIndices:oe,prevLayout:re,trigger:"imperative-api"});Gm(re,Ie)||(b(Ie),A.current.layout=Ie,X&&X(Ie),uu(ee,Ie,_.current))}}},[]),j=Xr(M=>{const{layout:ne,panelDataArray:X}=A.current,{panelSize:re}=_l(X,M,ne);return Et(re!=null,`Panel size not found for panel "${M.id}"`),re},[]),$=Xr((M,ne)=>{const{panelDataArray:X}=A.current,re=fu(X,M);return _Ee({defaultSize:ne,dragState:m,layout:y,panelData:X,panelIndex:re})},[m,y]),z=Xr(M=>{const{layout:ne,panelDataArray:X}=A.current,{collapsedSize:re=0,collapsible:ee,panelSize:J}=_l(X,M,ne);return Et(J!=null,`Panel size not found for panel "${M.id}"`),ee===!0&&Ns(J,re)},[]),K=Xr(M=>{const{layout:ne,panelDataArray:X}=A.current,{collapsedSize:re=0,collapsible:ee,panelSize:J}=_l(X,M,ne);return Et(J!=null,`Panel size not found for panel "${M.id}"`),!ee||Cc(J,re)>0},[]),V=Xr(M=>{const{panelDataArray:ne}=A.current;ne.push(M),ne.sort((X,re)=>{const ee=X.order,J=re.order;return ee==null&&J==null?0:ee==null?-1:J==null?1:ee-J}),A.current.panelDataArrayChanged=!0,S()},[S]);uc(()=>{if(A.current.panelDataArrayChanged){A.current.panelDataArrayChanged=!1;const{autoSaveId:M,onLayout:ne,storage:X}=T.current,{layout:re,panelDataArray:ee}=A.current;let J=null;if(M){const ce=EEe(M,ee,X);ce&&(C.current=new Map(Object.entries(ce.expandToSizes)),J=ce.layout)}J==null&&(J=SEe({panelDataArray:ee}));const le=MI({layout:J,panelConstraints:ee.map(ce=>ce.constraints)});OI(re,le)||(b(le),A.current.layout=le,ne&&ne(le),uu(ee,le,_.current))}}),uc(()=>{const M=A.current;return()=>{M.layout=[]}},[]);const N=Xr(M=>{let ne=!1;const X=p.current;return X&&window.getComputedStyle(X,null).getPropertyValue("direction")==="rtl"&&(ne=!0),function(ee){ee.preventDefault();const J=p.current;if(!J)return()=>null;const{direction:le,dragState:ce,id:ye,keyboardResizeBy:oe,onLayout:ve}=T.current,{layout:he,panelDataArray:Ee}=A.current,{initialLayout:ke}=ce??{},We=cj(ye,M,J);let Ie=wEe(ee,M,le,ce,oe,J);const Le=le==="horizontal";Le&&ne&&(Ie=-Ie);const dt=Ee.map(Nt=>Nt.constraints),$t=Wf({delta:Ie,initialLayout:ke??he,panelConstraints:dt,pivotIndices:We,prevLayout:he,trigger:ej(ee)?"keyboard":"mouse-or-touch"}),rn=!Gm(he,$t);(tj(ee)||nj(ee))&&E.current!=Ie&&(E.current=Ie,!rn&&Ie!==0?Le?nw(M,Ie<0?oj:ij):nw(M,Ie<0?sj:aj):nw(M,0)),rn&&(b($t),A.current.layout=$t,ve&&ve($t),uu(Ee,$t,_.current))}},[]),W=Xr((M,ne)=>{const{onLayout:X}=T.current,{layout:re,panelDataArray:ee}=A.current,J=ee.map(he=>he.constraints),{panelSize:le,pivotIndices:ce}=_l(ee,M,re);Et(le!=null,`Panel size not found for panel "${M.id}"`);const oe=fu(ee,M)===ee.length-1?le-ne:ne-le,ve=Wf({delta:oe,initialLayout:re,panelConstraints:J,pivotIndices:ce,prevLayout:re,trigger:"imperative-api"});Gm(re,ve)||(b(ve),A.current.layout=ve,X&&X(ve),uu(ee,ve,_.current))},[]),H=Xr((M,ne)=>{const{layout:X,panelDataArray:re}=A.current,{collapsedSize:ee=0,collapsible:J}=ne,{collapsedSize:le=0,collapsible:ce,maxSize:ye=100,minSize:oe=0}=M.constraints,{panelSize:ve}=_l(re,M,X);ve!=null&&(J&&ce&&Ns(ve,ee)?Ns(ee,le)||W(M,le):ve<oe?W(M,oe):ve>ye&&W(M,ye))},[W]),G=Xr((M,ne)=>{const{direction:X}=T.current,{layout:re}=A.current;if(!p.current)return;const ee=Kb(M,p.current);Et(ee,`Drag handle element not found for id "${M}"`);const J=dj(X,ne);v({dragHandleId:M,dragHandleRect:ee.getBoundingClientRect(),initialCursorPosition:J,initialLayout:re})},[]),te=Xr(()=>{v(null)},[]),F=Xr(M=>{const{panelDataArray:ne}=A.current,X=fu(ne,M);X>=0&&(ne.splice(X,1),delete _.current[M.id],A.current.panelDataArrayChanged=!0,S())},[S]),Y=tEe(()=>({collapsePanel:D,direction:r,dragState:m,expandPanel:k,getPanelSize:j,getPanelStyle:$,groupId:h,isPanelCollapsed:z,isPanelExpanded:K,reevaluatePanelConstraints:H,registerPanel:V,registerResizeHandle:N,resizePanel:W,startDragging:G,stopDragging:te,unregisterPanel:F,panelGroupElement:p.current}),[D,m,r,k,j,$,h,z,K,H,V,N,W,G,te,F]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return md(Gb.Provider,{value:Y},md(u,{...d,children:t,className:n,id:i,ref:p,style:{...q,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const mj=K9((e,t)=>md(gj,{...e,forwardedRef:t}));gj.displayName="PanelGroup";mj.displayName="forwardRef(PanelGroup)";function fu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function _l(e,t,n){const r=fu(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:i}}function OEe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){cc(()=>{if(e||n==null||r==null)return;const o=Kb(t,r);if(o==null)return;const i=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=o.getAttribute("data-panel-group-id");Et(a,`No group element found for id "${a}"`);const l=np(a,r),c=lj(a,t,r);Et(c!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}},[r,e,t,n])}function KR({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onDragging:s,onFocus:a,style:l={},tabIndex:c=0,tagName:u="div",...d}){var h,p;const m=Zr(null),v=Zr({onDragging:s});cc(()=>{v.current.onDragging=s});const y=X9(Gb);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:b,groupId:S,registerResizeHandle:_,startDragging:C,stopDragging:E,panelGroupElement:T}=y,A=UR(o),[D,k]=Du("inactive"),[j,$]=Du(!1),[z,K]=Du(null),V=Zr({state:D});uc(()=>{V.current.state=D}),cc(()=>{if(n)K(null);else{const G=_(A);K(()=>G)}},[n,A,_]);const N=(h=r==null?void 0:r.coarse)!==null&&h!==void 0?h:15,W=(p=r==null?void 0:r.fine)!==null&&p!==void 0?p:5;return cc(()=>{if(n||z==null)return;const G=m.current;return Et(G,"Element ref not attached"),pEe(A,G,b,{coarse:N,fine:W},(F,Y,q)=>{if(Y)switch(F){case"down":{k("drag"),Et(q,'Expected event to be defined for "down" action'),C(A,q);const{onDragging:M}=v.current;M&&M(!0);break}case"move":{const{state:M}=V.current;M!=="drag"&&k("hover"),Et(q,'Expected event to be defined for "move" action'),z(q);break}case"up":{k("hover"),E();const{onDragging:M}=v.current;M&&M(!1);break}}else k("inactive")})},[N,b,n,W,_,A,z,C,E]),OEe({disabled:n,handleId:A,resizeHandler:z,panelGroupElement:T}),md(u,{...d,children:e,className:t,id:o,onBlur:()=>{$(!1),i==null||i()},onFocus:()=>{$(!0),a==null||a()},ref:m,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":b,"data-panel-group-id":S,"data-resize-handle":"","data-resize-handle-active":D==="drag"?"pointer":j?"keyboard":void 0,"data-resize-handle-state":D,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":A})}KR.displayName="PanelResizeHandle";const vj=({className:e,...t})=>x.jsx(mj,{className:xe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),D_=Z9,TEe=({withHandle:e,className:t,...n})=>x.jsx(KR,{className:xe("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&&x.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:x.jsx(a4,{className:"h-2.5 w-2.5"})})}),MEe=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>x.jsx(KR,{className:xe("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&&x.jsx("div",{className:xe("z-50 flex items-center justify-start",{"border-l":r}),children:x.jsx(oo,{variant:"secondary",className:xe("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?x.jsx(Zv,{className:"size-4"}):x.jsx(AC,{className:"size-4"})})})});var XR="Dialog",[bj,yj]=Jn(XR),[AEe,Pi]=bj(XR),xj=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=R.useRef(null),l=R.useRef(null),[c=!1,u]=Cr({prop:r,defaultProp:o,onChange:i});return x.jsx(AEe,{scope:t,triggerRef:a,contentRef:l,contentId:qn(),titleId:qn(),descriptionId:qn(),open:c,onOpenChange:u,onOpenToggle:R.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};xj.displayName=XR;var wj="DialogTrigger",Sj=R.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Pi(wj,n),i=at(t,o.triggerRef);return x.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ZR(o.open),...r,ref:i,onClick:Te(e.onClick,o.onOpenToggle)})});Sj.displayName=wj;var QR="DialogPortal",[DEe,_j]=bj(QR,{forceMount:void 0}),Cj=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Pi(QR,t);return x.jsx(DEe,{scope:t,forceMount:n,children:R.Children.map(r,s=>x.jsx(Yn,{present:n||i.open,children:x.jsx(kp,{asChild:!0,container:o,children:s})}))})};Cj.displayName=QR;var yv="DialogOverlay",Ej=R.forwardRef((e,t)=>{const n=_j(yv,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Pi(yv,e.__scopeDialog);return i.modal?x.jsx(Yn,{present:r||i.open,children:x.jsx(kEe,{...o,ref:t})}):null});Ej.displayName=yv;var kEe=R.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Pi(yv,n);return x.jsx(Cb,{as:Hs,allowPinchZoom:!0,shards:[o.contentRef],children:x.jsx(Be.div,{"data-state":ZR(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ec="DialogContent",Rj=R.forwardRef((e,t)=>{const n=_j(Ec,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Pi(Ec,e.__scopeDialog);return x.jsx(Yn,{present:r||i.open,children:i.modal?x.jsx(IEe,{...o,ref:t}):x.jsx(NEe,{...o,ref:t})})});Rj.displayName=Ec;var IEe=R.forwardRef((e,t)=>{const n=Pi(Ec,e.__scopeDialog),r=R.useRef(null),o=at(t,n.contentRef,r);return R.useEffect(()=>{const i=r.current;if(i)return Sb(i)},[]),x.jsx(Pj,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault())})}),NEe=R.forwardRef((e,t)=>{const n=Pi(Ec,e.__scopeDialog),r=R.useRef(!1),o=R.useRef(!1);return x.jsx(Pj,{...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()}})}),Pj=R.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Pi(Ec,n),l=R.useRef(null),c=at(t,l);return xb(),x.jsxs(x.Fragment,{children:[x.jsx(Lp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:x.jsx(Ic,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ZR(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(FEe,{titleId:a.titleId}),x.jsx($Ee,{contentRef:l,descriptionId:a.descriptionId})]})]})}),JR="DialogTitle",Oj=R.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Pi(JR,n);return x.jsx(Be.h2,{id:o.titleId,...r,ref:t})});Oj.displayName=JR;var Tj="DialogDescription",Mj=R.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Pi(Tj,n);return x.jsx(Be.p,{id:o.descriptionId,...r,ref:t})});Mj.displayName=Tj;var Aj="DialogClose",Dj=R.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Pi(Aj,n);return x.jsx(Be.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});Dj.displayName=Aj;function ZR(e){return e?"open":"closed"}var kj="DialogTitleWarning",[LEe,Ij]=EX(kj,{contentName:Ec,titleName:JR,docsSlug:"dialog"}),FEe=({titleId:e})=>{const t=Ij(kj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
371
+
372
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
373
+
374
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return R.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jEe="DialogDescriptionWarning",$Ee=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ij(jEe).contentName}}.`;return R.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},e2=xj,Nj=Sj,t2=Cj,Xb=Ej,Qb=Rj,n2=Oj,r2=Mj,o2=Dj,Lj="AlertDialog",[zEe,KOe]=Jn(Lj,[yj]),Ks=yj(),Fj=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ks(t);return x.jsx(e2,{...r,...n,modal:!0})};Fj.displayName=Lj;var BEe="AlertDialogTrigger",HEe=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ks(n);return x.jsx(Nj,{...o,...r,ref:t})});HEe.displayName=BEe;var VEe="AlertDialogPortal",jj=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ks(t);return x.jsx(t2,{...r,...n})};jj.displayName=VEe;var WEe="AlertDialogOverlay",$j=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ks(n);return x.jsx(Xb,{...o,...r,ref:t})});$j.displayName=WEe;var Iu="AlertDialogContent",[UEe,GEe]=zEe(Iu),zj=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=Ks(n),s=R.useRef(null),a=at(t,s),l=R.useRef(null);return x.jsx(LEe,{contentName:Iu,titleName:Bj,docsSlug:"alert-dialog",children:x.jsx(UEe,{scope:n,cancelRef:l,children:x.jsxs(Qb,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:Te(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[x.jsx(eC,{children:r}),x.jsx(YEe,{contentRef:s})]})})})});zj.displayName=Iu;var Bj="AlertDialogTitle",Hj=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ks(n);return x.jsx(n2,{...o,...r,ref:t})});Hj.displayName=Bj;var Vj="AlertDialogDescription",Wj=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ks(n);return x.jsx(r2,{...o,...r,ref:t})});Wj.displayName=Vj;var qEe="AlertDialogAction",Uj=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ks(n);return x.jsx(o2,{...o,...r,ref:t})});Uj.displayName=qEe;var Gj="AlertDialogCancel",qj=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=GEe(Gj,n),i=Ks(n),s=at(t,o);return x.jsx(o2,{...i,...r,ref:s})});qj.displayName=Gj;var YEe=({contentRef:e})=>{const t=`\`${Iu}\` requires a description for the component to be accessible for screen reader users.
375
+
376
+ You can add a description to the \`${Iu}\` by passing a \`${Vj}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
377
+
378
+ 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 \`${Iu}\`. 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.
379
+
380
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return R.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},KEe=Fj,XEe=jj,Yj=$j,Kj=zj,Xj=Uj,Qj=qj,Jj=Hj,Zj=Wj;const QEe=KEe,JEe=XEe,e$=R.forwardRef(({className:e,...t},n)=>x.jsx(Yj,{className:xe("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}));e$.displayName=Yj.displayName;const t$=R.forwardRef(({className:e,...t},n)=>x.jsx(JEe,{children:x.jsxs(Tc,{children:[x.jsx(e$,{}),x.jsx(Kj,{ref:n,className:xe("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})]})}));t$.displayName=Kj.displayName;const n$=({className:e,...t})=>x.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",e),...t});n$.displayName="AlertDialogHeader";const r$=({className:e,...t})=>x.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});r$.displayName="AlertDialogFooter";const o$=R.forwardRef(({className:e,...t},n)=>x.jsx(Jj,{ref:n,className:xe("text-lg font-semibold",e),...t}));o$.displayName=Jj.displayName;const i$=R.forwardRef(({className:e,...t},n)=>x.jsx(Zj,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));i$.displayName=Zj.displayName;const s$=R.forwardRef(({className:e,...t},n)=>x.jsx(Xj,{ref:n,className:xe(Ah(),e),...t}));s$.displayName=Xj.displayName;const a$=R.forwardRef(({className:e,...t},n)=>x.jsx(Qj,{ref:n,className:xe(Ah({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));a$.displayName=Qj.displayName;function ZEe({open:e,setOpen:t}){const n=we(i=>i.selectedSheetId),{deleteSheet:r}=dr();function o(){n&&(r(n),t(!1))}return x.jsx(QEe,{open:e,onOpenChange:t,children:x.jsxs(t$,{children:[x.jsxs(n$,{children:[x.jsx(o$,{children:"Delete Sheet"}),x.jsx(i$,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),x.jsxs(r$,{children:[x.jsx(a$,{children:"Cancel"}),x.jsx(s$,{onClick:o,children:"Delete"})]})]})})}function l$(){var y,b;const[e,t]=P.useState(!1),n=we(S=>{var _;return(_=S.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=ko(),o=P.useRef(null),[i,s]=P.useState(!1),a=we(S=>S.isDashboardEditing),l=we(S=>S.themeStyle);we(S=>S.isVisualEditing);const c=we(S=>S.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:d,addSheet:h}=dr();if(!n)return null;function p(S){var _,C;S?((_=o.current)==null||_.resize(35),s(!0)):(s(!1),(C=o.current)==null||C.resize(0))}function m(){const S={id:Ba(),title:"New Sheet"};h(S)}function v(){return(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)?"hsl(var(--semaphor-muted))":(l==null?void 0:l.canvasTheme)==="clear"?"":l==null?void 0:l.canvasTheme}return x.jsxs(iC,{role:"dashboard-tabs-container",className:xe("relative flex grow flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:S=>{u(S)},value:c||n[0].id,children:[x.jsx("div",{children:(n.length>1||a)&&x.jsxs(Fv,{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(S=>{var _,C;return x.jsx(Qi,{text:S.title,onSave:E=>d(S.id,E),children:x.jsxs(jv,{style:{borderRadius:(C=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:C.borderRadius},onClick:()=>u(S.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:S.id,children:[S.title,a&&c===S.id&&n.length>1&&x.jsx(wd,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},S.id)}),a&&x.jsx("div",{style:{borderRadius:(b=(y=l==null?void 0:l.chart)==null?void 0:y.options)==null?void 0:b.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:m,children:x.jsx(IC,{className:"size-3"})})]})}),x.jsxs(vj,{className:"grow",direction:"horizontal",children:[x.jsx(D_,{children:x.jsx("div",{style:{},children:n==null?void 0:n.map(S=>x.jsx(sC,{style:{backgroundColor:v()},className:xe("mt-0",{}),value:S.id,children:x.jsx(oxe,{sheet:S})},S.id))})}),r===!0&&x.jsxs(x.Fragment,{children:[x.jsx(MEe,{open:i,onTabClick:p,withHandle:!0}),x.jsx(D_,{onResize:S=>{S<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:x.jsx(QCe,{})})]})]}),x.jsx(ZEe,{open:e,setOpen:t})]})}function c$({children:e}){return x.jsx(VK,{defaultTheme:"system",storageKey:"vite-ui-theme",children:x.jsx(Sue,{delayDuration:0,children:e})})}function u$(e){return x.jsx(eb,{FallbackComponent:LC,children:x.jsx(FN,{dashboardProps:e,children:x.jsx(c$,{children:x.jsx(BN,{...e,children:x.jsx(l$,{})})})})})}var k_=["Enter"," "],eRe=["ArrowDown","PageUp","Home"],d$=["ArrowUp","PageDown","End"],tRe=[...eRe,...d$],nRe={ltr:[...k_,"ArrowRight"],rtl:[...k_,"ArrowLeft"]},rRe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qp="Menu",[rp,oRe,iRe]=Nv(Qp),[Lc,f$]=Jn(Qp,[iRe,cs,xd]),Jb=cs(),h$=xd(),[sRe,Fc]=Lc(Qp),[aRe,Jp]=Lc(Qp),p$=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=Jb(t),[l,c]=R.useState(null),u=R.useRef(!1),d=Qn(i),h=Mc(o);return R.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),x.jsx(Mp,{...a,children:x.jsx(sRe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:x.jsx(aRe,{scope:t,onClose:R.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:h,modal:s,children:r})})})};p$.displayName=Qp;var lRe="MenuAnchor",i2=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Jb(n);return x.jsx(Od,{...o,...r,ref:t})});i2.displayName=lRe;var s2="MenuPortal",[cRe,g$]=Lc(s2,{forceMount:void 0}),m$=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Fc(s2,t);return x.jsx(cRe,{scope:t,forceMount:n,children:x.jsx(Yn,{present:n||i.open,children:x.jsx(kp,{asChild:!0,container:o,children:r})})})};m$.displayName=s2;var Jo="MenuContent",[uRe,a2]=Lc(Jo),v$=R.forwardRef((e,t)=>{const n=g$(Jo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Fc(Jo,e.__scopeMenu),s=Jp(Jo,e.__scopeMenu);return x.jsx(rp.Provider,{scope:e.__scopeMenu,children:x.jsx(Yn,{present:r||i.open,children:x.jsx(rp.Slot,{scope:e.__scopeMenu,children:s.modal?x.jsx(dRe,{...o,ref:t}):x.jsx(fRe,{...o,ref:t})})})})}),dRe=R.forwardRef((e,t)=>{const n=Fc(Jo,e.__scopeMenu),r=R.useRef(null),o=at(t,r);return R.useEffect(()=>{const i=r.current;if(i)return Sb(i)},[]),x.jsx(l2,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),fRe=R.forwardRef((e,t)=>{const n=Fc(Jo,e.__scopeMenu);return x.jsx(l2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),l2=R.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:m,...v}=e,y=Fc(Jo,n),b=Jp(Jo,n),S=Jb(n),_=h$(n),C=oRe(n),[E,T]=R.useState(null),A=R.useRef(null),D=at(t,A,y.onContentChange),k=R.useRef(0),j=R.useRef(""),$=R.useRef(0),z=R.useRef(null),K=R.useRef("right"),V=R.useRef(0),N=m?Cb:R.Fragment,W=m?{as:Hs,allowPinchZoom:!0}:void 0,H=te=>{var ee,J;const F=j.current+te,Y=C().filter(le=>!le.disabled),q=document.activeElement,M=(ee=Y.find(le=>le.ref.current===q))==null?void 0:ee.textValue,ne=Y.map(le=>le.textValue),X=CRe(ne,F,M),re=(J=Y.find(le=>le.textValue===X))==null?void 0:J.ref.current;(function le(ce){j.current=ce,window.clearTimeout(k.current),ce!==""&&(k.current=window.setTimeout(()=>le(""),1e3))})(F),re&&setTimeout(()=>re.focus())};R.useEffect(()=>()=>window.clearTimeout(k.current),[]),xb();const G=R.useCallback(te=>{var Y,q;return K.current===((Y=z.current)==null?void 0:Y.side)&&RRe(te,(q=z.current)==null?void 0:q.area)},[]);return x.jsx(uRe,{scope:n,searchRef:j,onItemEnter:R.useCallback(te=>{G(te)&&te.preventDefault()},[G]),onItemLeave:R.useCallback(te=>{var F;G(te)||((F=A.current)==null||F.focus(),T(null))},[G]),onTriggerLeave:R.useCallback(te=>{G(te)&&te.preventDefault()},[G]),pointerGraceTimerRef:$,onPointerGraceIntentChange:R.useCallback(te=>{z.current=te},[]),children:x.jsx(N,{...W,children:x.jsx(Lp,{asChild:!0,trapped:o,onMountAutoFocus:Te(i,te=>{var F;te.preventDefault(),(F=A.current)==null||F.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:x.jsx(Ic,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:p,children:x.jsx(tC,{asChild:!0,..._,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:T,onEntryFocus:Te(l,te=>{b.isUsingKeyboardRef.current||te.preventDefault()}),preventScrollOnEntryFocus:!0,children:x.jsx(Ap,{role:"menu","aria-orientation":"vertical","data-state":k$(y.open),"data-radix-menu-content":"",dir:b.dir,...S,...v,ref:D,style:{outline:"none",...v.style},onKeyDown:Te(v.onKeyDown,te=>{const Y=te.target.closest("[data-radix-menu-content]")===te.currentTarget,q=te.ctrlKey||te.altKey||te.metaKey,M=te.key.length===1;Y&&(te.key==="Tab"&&te.preventDefault(),!q&&M&&H(te.key));const ne=A.current;if(te.target!==ne||!tRe.includes(te.key))return;te.preventDefault();const re=C().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);d$.includes(te.key)&&re.reverse(),SRe(re)}),onBlur:Te(e.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout(k.current),j.current="")}),onPointerMove:Te(e.onPointerMove,op(te=>{const F=te.target,Y=V.current!==te.clientX;if(te.currentTarget.contains(F)&&Y){const q=te.clientX>V.current?"right":"left";K.current=q,V.current=te.clientX}}))})})})})})})});v$.displayName=Jo;var hRe="MenuGroup",c2=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(Be.div,{role:"group",...r,ref:t})});c2.displayName=hRe;var pRe="MenuLabel",b$=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(Be.div,{...r,ref:t})});b$.displayName=pRe;var xv="MenuItem",DI="menu.itemSelect",Zb=R.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=R.useRef(null),s=Jp(xv,e.__scopeMenu),a=a2(xv,e.__scopeMenu),l=at(t,i),c=R.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const h=new CustomEvent(DI,{bubbles:!0,cancelable:!0});d.addEventListener(DI,p=>r==null?void 0:r(p),{once:!0}),HN(d,h),h.defaultPrevented?c.current=!1:s.onClose()}};return x.jsx(y$,{...o,ref:l,disabled:n,onClick:Te(e.onClick,u),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),c.current=!0},onPointerUp:Te(e.onPointerUp,d=>{var h;c.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:Te(e.onKeyDown,d=>{const h=a.searchRef.current!=="";n||h&&d.key===" "||k_.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Zb.displayName=xv;var y$=R.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=a2(xv,n),a=h$(n),l=R.useRef(null),c=at(t,l),[u,d]=R.useState(!1),[h,p]=R.useState("");return R.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[i.children]),x.jsx(rp.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:x.jsx(nC,{asChild:!0,...a,focusable:!r,children:x.jsx(Be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:Te(e.onPointerMove,op(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,op(m=>s.onItemLeave(m))),onFocus:Te(e.onFocus,()=>d(!0)),onBlur:Te(e.onBlur,()=>d(!1))})})})}),gRe="MenuCheckboxItem",x$=R.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return x.jsx(E$,{scope:e.__scopeMenu,checked:n,children:x.jsx(Zb,{role:"menuitemcheckbox","aria-checked":wv(n)?"mixed":n,...o,ref:t,"data-state":d2(n),onSelect:Te(o.onSelect,()=>r==null?void 0:r(wv(n)?!0:!n),{checkForDefaultPrevented:!1})})})});x$.displayName=gRe;var w$="MenuRadioGroup",[mRe,vRe]=Lc(w$,{value:void 0,onValueChange:()=>{}}),S$=R.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Qn(r);return x.jsx(mRe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:x.jsx(c2,{...o,ref:t})})});S$.displayName=w$;var _$="MenuRadioItem",C$=R.forwardRef((e,t)=>{const{value:n,...r}=e,o=vRe(_$,e.__scopeMenu),i=n===o.value;return x.jsx(E$,{scope:e.__scopeMenu,checked:i,children:x.jsx(Zb,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":d2(i),onSelect:Te(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});C$.displayName=_$;var u2="MenuItemIndicator",[E$,bRe]=Lc(u2,{checked:!1}),R$=R.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=bRe(u2,n);return x.jsx(Yn,{present:r||wv(i.checked)||i.checked===!0,children:x.jsx(Be.span,{...o,ref:t,"data-state":d2(i.checked)})})});R$.displayName=u2;var yRe="MenuSeparator",P$=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(Be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});P$.displayName=yRe;var xRe="MenuArrow",O$=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Jb(n);return x.jsx(Dp,{...o,...r,ref:t})});O$.displayName=xRe;var wRe="MenuSub",[XOe,T$]=Lc(wRe),Gf="MenuSubTrigger",M$=R.forwardRef((e,t)=>{const n=Fc(Gf,e.__scopeMenu),r=Jp(Gf,e.__scopeMenu),o=T$(Gf,e.__scopeMenu),i=a2(Gf,e.__scopeMenu),s=R.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=R.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return R.useEffect(()=>u,[u]),R.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),x.jsx(i2,{asChild:!0,...c,children:x.jsx(y$,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":k$(n.open),...e,ref:Iv(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,op(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Te(e.onPointerLeave,op(d=>{var p,m;u();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const v=(m=n.content)==null?void 0:m.dataset.side,y=v==="right",b=y?-5:5,S=h[y?"left":"right"],_=h[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+b,y:d.clientY},{x:S,y:h.top},{x:_,y:h.top},{x:_,y:h.bottom},{x:S,y:h.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,d=>{var p;const h=i.searchRef.current!=="";e.disabled||h&&d.key===" "||nRe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});M$.displayName=Gf;var A$="MenuSubContent",D$=R.forwardRef((e,t)=>{const n=g$(Jo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Fc(Jo,e.__scopeMenu),s=Jp(Jo,e.__scopeMenu),a=T$(A$,e.__scopeMenu),l=R.useRef(null),c=at(t,l);return x.jsx(rp.Provider,{scope:e.__scopeMenu,children:x.jsx(Yn,{present:r||i.open,children:x.jsx(rp.Slot,{scope:e.__scopeMenu,children:x.jsx(l2,{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 d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Te(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Te(e.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),h=rRe[s.dir].includes(u.key);d&&h&&(i.onOpenChange(!1),(p=a.trigger)==null||p.focus(),u.preventDefault())})})})})})});D$.displayName=A$;function k$(e){return e?"open":"closed"}function wv(e){return e==="indeterminate"}function d2(e){return wv(e)?"indeterminate":e?"checked":"unchecked"}function SRe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function _Re(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function CRe(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=_Re(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 ERe(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 RRe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ERe(n,t)}function op(e){return t=>t.pointerType==="mouse"?e(t):void 0}var PRe=p$,ORe=i2,TRe=m$,MRe=v$,ARe=c2,DRe=b$,kRe=Zb,IRe=x$,NRe=S$,LRe=C$,FRe=R$,jRe=P$,$Re=O$,zRe=M$,BRe=D$,f2="DropdownMenu",[HRe,QOe]=Jn(f2,[f$]),Br=f$(),[VRe,I$]=HRe(f2),N$=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=Br(t),c=R.useRef(null),[u=!1,d]=Cr({prop:o,defaultProp:i,onChange:s});return x.jsx(VRe,{scope:t,triggerId:qn(),triggerRef:c,contentId:qn(),open:u,onOpenChange:d,onOpenToggle:R.useCallback(()=>d(h=>!h),[d]),modal:a,children:x.jsx(PRe,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};N$.displayName=f2;var L$="DropdownMenuTrigger",F$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=I$(L$,n),s=Br(n);return x.jsx(ORe,{asChild:!0,...s,children:x.jsx(Be.button,{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:Iv(t,i.triggerRef),onPointerDown:Te(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Te(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});F$.displayName=L$;var WRe="DropdownMenuPortal",j$=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Br(t);return x.jsx(TRe,{...r,...n})};j$.displayName=WRe;var $$="DropdownMenuContent",z$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=I$($$,n),i=Br(n),s=R.useRef(!1);return x.jsx(MRe,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Te(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)"}})});z$.displayName=$$;var URe="DropdownMenuGroup",GRe=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx(ARe,{...o,...r,ref:t})});GRe.displayName=URe;var qRe="DropdownMenuLabel",B$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx(DRe,{...o,...r,ref:t})});B$.displayName=qRe;var YRe="DropdownMenuItem",H$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx(kRe,{...o,...r,ref:t})});H$.displayName=YRe;var KRe="DropdownMenuCheckboxItem",V$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx(IRe,{...o,...r,ref:t})});V$.displayName=KRe;var XRe="DropdownMenuRadioGroup",W$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx(NRe,{...o,...r,ref:t})});W$.displayName=XRe;var QRe="DropdownMenuRadioItem",U$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx(LRe,{...o,...r,ref:t})});U$.displayName=QRe;var JRe="DropdownMenuItemIndicator",G$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx(FRe,{...o,...r,ref:t})});G$.displayName=JRe;var ZRe="DropdownMenuSeparator",q$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx(jRe,{...o,...r,ref:t})});q$.displayName=ZRe;var e2e="DropdownMenuArrow",t2e=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx($Re,{...o,...r,ref:t})});t2e.displayName=e2e;var n2e="DropdownMenuSubTrigger",Y$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx(zRe,{...o,...r,ref:t})});Y$.displayName=n2e;var r2e="DropdownMenuSubContent",K$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Br(n);return x.jsx(BRe,{...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)"}})});K$.displayName=r2e;var o2e=N$,i2e=F$,s2e=j$,X$=z$,Q$=B$,J$=H$,Z$=V$,a2e=W$,ez=U$,tz=G$,nz=q$,rz=Y$,oz=K$;const l2e=o2e,c2e=i2e,u2e=a2e,d2e=R.forwardRef(({className:e,inset:t,children:n,...r},o)=>x.jsxs(rz,{ref:o,className:xe("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,x.jsx(Zv,{className:"ml-auto h-4 w-4"})]}));d2e.displayName=rz.displayName;const f2e=R.forwardRef(({className:e,...t},n)=>x.jsx(Tc,{children:x.jsx(oz,{ref:n,className:xe("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})}));f2e.displayName=oz.displayName;const iz=R.forwardRef(({className:e,sideOffset:t=4,...n},r)=>x.jsx(s2e,{children:x.jsx(Tc,{children:x.jsx(X$,{ref:r,sideOffset:t,className:xe("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})})}));iz.displayName=X$.displayName;const sz=R.forwardRef(({className:e,inset:t,...n},r)=>x.jsx(J$,{ref:r,className:xe("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}));sz.displayName=J$.displayName;const az=R.forwardRef(({className:e,children:t,checked:n,...r},o)=>x.jsxs(Z$,{ref:o,className:xe("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:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(tz,{children:x.jsx(Cp,{className:"h-4 w-4"})})}),t]}));az.displayName=Z$.displayName;const lz=R.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(ez,{ref:r,className:xe("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:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(tz,{children:x.jsx(DC,{className:"h-2 w-2 fill-current"})})}),t]}));lz.displayName=ez.displayName;const cz=R.forwardRef(({className:e,inset:t,...n},r)=>x.jsx(Q$,{ref:r,className:xe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));cz.displayName=Q$.displayName;const uz=R.forwardRef(({className:e,...t},n)=>x.jsx(nz,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));uz.displayName=nz.displayName;const h2e=e2,p2e=Nj,g2e=t2,dz=R.forwardRef(({className:e,...t},n)=>x.jsx(Xb,{ref:n,className:xe("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}));dz.displayName=Xb.displayName;const fz=R.forwardRef(({className:e,children:t,...n},r)=>x.jsx(g2e,{children:x.jsxs(Tc,{children:[x.jsx(dz,{}),x.jsxs(Qb,{ref:r,className:xe("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,x.jsxs(o2,{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:[x.jsx(wd,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));fz.displayName=Qb.displayName;const hz=({className:e,...t})=>x.jsx("div",{className:xe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});hz.displayName="DialogHeader";const pz=({className:e,...t})=>x.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});pz.displayName="DialogFooter";const gz=R.forwardRef(({className:e,...t},n)=>x.jsx(n2,{ref:n,className:xe("text-lg font-semibold leading-none tracking-tight",e),...t}));gz.displayName=n2.displayName;const mz=R.forwardRef(({className:e,...t},n)=>x.jsx(r2,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));mz.displayName=r2.displayName;const vz=P.forwardRef(({className:e,...t},n)=>x.jsx("div",{role:"editor-panel",ref:n,className:xe("flex grow h-full",e),...t}));vz.displayName="EditorPanel";const bz=P.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:xe(" flex flex-col space-y-2 w-[270px]",e),...t}));bz.displayName="EditorAside";const yz=P.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:xe(" grow",e),...t}));yz.displayName="EditorMain";function m2e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kI(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 II(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(n),!0).forEach(function(r){m2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function v2e(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 b2e(e,t){if(e==null)return{};var n=v2e(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 y2e(e,t){return x2e(e)||w2e(e,t)||S2e(e,t)||_2e()}function x2e(e){if(Array.isArray(e))return e}function w2e(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 S2e(e,t){if(e){if(typeof e=="string")return NI(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 NI(e,t)}}function NI(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 _2e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
381
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C2e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LI(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 FI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(n),!0).forEach(function(r){C2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E2e(){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 qf(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 Sv(e){return{}.toString.call(e).includes("Object")}function R2e(e){return!Object.keys(e).length}function ip(e){return typeof e=="function"}function P2e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function O2e(e,t){return Sv(t)||za("changeType"),Object.keys(t).some(function(n){return!P2e(e,n)})&&za("changeField"),t}function T2e(e){ip(e)||za("selectorType")}function M2e(e){ip(e)||Sv(e)||za("handlerType"),Sv(e)&&Object.values(e).some(function(t){return!ip(t)})&&za("handlersType")}function A2e(e){e||za("initialIsRequired"),Sv(e)||za("initialType"),R2e(e)&&za("initialContent")}function D2e(e,t){throw new Error(e[t]||e.default)}var k2e={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"},za=qf(D2e)(k2e),qm={changes:O2e,selector:T2e,handler:M2e,initial:A2e};function I2e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};qm.initial(e),qm.handler(t);var n={current:e},r=qf(F2e)(n,t),o=qf(L2e)(n),i=qf(qm.changes)(e),s=qf(N2e)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return qm.selector(c),c(n.current)}function l(c){E2e(r,o,i,s)(c)}return[a,l]}function N2e(e,t){return ip(t)?t(e.current):t}function L2e(e,t){return e.current=FI(FI({},e.current),t),t}function F2e(e,t,n){return ip(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 j2e={create:I2e},$2e={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function z2e(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 B2e(e){return{}.toString.call(e).includes("Object")}function H2e(e){return e||jI("configIsRequired"),B2e(e)||jI("configType"),e.urls?(V2e(),{paths:{vs:e.urls.monacoBase}}):e}function V2e(){console.warn(xz.deprecation)}function W2e(e,t){throw new Error(e[t]||e.default)}var xz={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!
382
+ You are using deprecated way of configuration.
383
+
384
+ Instead of using
385
+ monaco.config({ urls: { monacoBase: '...' } })
386
+ use
387
+ monaco.config({ paths: { vs: '...' } })
388
+
389
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
390
+ `},jI=z2e(W2e)(xz),U2e={config:H2e},G2e=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 wz(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],wz(e[n],t[n]))}),II(II({},e),t)}var q2e={type:"cancelation",msg:"operation is manually canceled"};function rw(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(q2e):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Y2e=j2e.create({config:$2e,isInitialized:!1,resolve:null,reject:null,monaco:null}),Sz=y2e(Y2e,2),Zp=Sz[0],ey=Sz[1];function K2e(e){var t=U2e.config(e),n=t.monaco,r=b2e(t,["monaco"]);ey(function(o){return{config:wz(o.config,r),monaco:n}})}function X2e(){var e=Zp(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(ey({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),rw(ow);if(window.monaco&&window.monaco.editor)return _z(window.monaco),e.resolve(window.monaco),rw(ow);G2e(Q2e,Z2e)(ePe)}return rw(ow)}function Q2e(e){return document.body.appendChild(e)}function J2e(e){var t=document.createElement("script");return e&&(t.src=e),t}function Z2e(e){var t=Zp(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=J2e("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function ePe(){var e=Zp(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){_z(n),e.resolve(n)},function(n){e.reject(n)})}function _z(e){Zp().monaco||ey({monaco:e})}function tPe(){return Zp(function(e){var t=e.monaco;return t})}var ow=new Promise(function(e,t){return ey({resolve:e,reject:t})}),Cz={config:K2e,init:X2e,__getMonacoInstance:tPe},nPe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},iw=nPe,rPe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},oPe=rPe;function iPe({children:e}){return P.createElement("div",{style:oPe.container},e)}var sPe=iPe,aPe=sPe;function lPe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return P.createElement("section",{style:{...iw.wrapper,width:e,height:t},...s},!n&&P.createElement(aPe,null,r),P.createElement("div",{ref:o,style:{...iw.fullWidth,...!n&&iw.hide},className:i}))}var cPe=lPe,Ez=P.memo(cPe);function uPe(e){P.useEffect(e,[])}var Rz=uPe;function dPe(e,t,n=!0){let r=P.useRef(!0);P.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var So=dPe;function hh(){}function xu(e,t,n,r){return fPe(e,r)||hPe(e,t,n,r)}function fPe(e,t){return e.editor.getModel(Pz(e,t))}function hPe(e,t,n,r){return e.editor.createModel(t,n,r?Pz(e,r):void 0)}function Pz(e,t){return e.Uri.parse(t)}function pPe({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:d={},height:h="100%",width:p="100%",className:m,wrapperProps:v={},beforeMount:y=hh,onMount:b=hh}){let[S,_]=P.useState(!1),[C,E]=P.useState(!0),T=P.useRef(null),A=P.useRef(null),D=P.useRef(null),k=P.useRef(b),j=P.useRef(y),$=P.useRef(!1);Rz(()=>{let N=Cz.init();return N.then(W=>(A.current=W)&&E(!1)).catch(W=>(W==null?void 0:W.type)!=="cancelation"&&console.error("Monaco initialization: error:",W)),()=>T.current?V():N.cancel()}),So(()=>{if(T.current&&A.current){let N=T.current.getOriginalEditor(),W=xu(A.current,e||"",r||n||"text",i||"");W!==N.getModel()&&N.setModel(W)}},[i],S),So(()=>{if(T.current&&A.current){let N=T.current.getModifiedEditor(),W=xu(A.current,t||"",o||n||"text",s||"");W!==N.getModel()&&N.setModel(W)}},[s],S),So(()=>{let N=T.current.getModifiedEditor();N.getOption(A.current.editor.EditorOption.readOnly)?N.setValue(t||""):t!==N.getValue()&&(N.executeEdits("",[{range:N.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),N.pushUndoStop())},[t],S),So(()=>{var N,W;(W=(N=T.current)==null?void 0:N.getModel())==null||W.original.setValue(e||"")},[e],S),So(()=>{let{original:N,modified:W}=T.current.getModel();A.current.editor.setModelLanguage(N,r||n||"text"),A.current.editor.setModelLanguage(W,o||n||"text")},[n,r,o],S),So(()=>{var N;(N=A.current)==null||N.editor.setTheme(c)},[c],S),So(()=>{var N;(N=T.current)==null||N.updateOptions(d)},[d],S);let z=P.useCallback(()=>{var H;if(!A.current)return;j.current(A.current);let N=xu(A.current,e||"",r||n||"text",i||""),W=xu(A.current,t||"",o||n||"text",s||"");(H=T.current)==null||H.setModel({original:N,modified:W})},[n,t,o,e,r,i,s]),K=P.useCallback(()=>{var N;!$.current&&D.current&&(T.current=A.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...d}),z(),(N=A.current)==null||N.editor.setTheme(c),_(!0),$.current=!0)},[d,c,z]);P.useEffect(()=>{S&&k.current(T.current,A.current)},[S]),P.useEffect(()=>{!C&&!S&&K()},[C,S,K]);function V(){var W,H,G,te;let N=(W=T.current)==null?void 0:W.getModel();a||((H=N==null?void 0:N.original)==null||H.dispose()),l||((G=N==null?void 0:N.modified)==null||G.dispose()),(te=T.current)==null||te.dispose()}return P.createElement(Ez,{width:p,height:h,isEditorReady:S,loading:u,_ref:D,className:m,wrapperProps:v})}var gPe=pPe;P.memo(gPe);function mPe(e){let t=P.useRef();return P.useEffect(()=>{t.current=e},[e]),t.current}var vPe=mPe,Ym=new Map;function bPe({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:d=!0,keepCurrentModel:h=!1,width:p="100%",height:m="100%",className:v,wrapperProps:y={},beforeMount:b=hh,onMount:S=hh,onChange:_,onValidate:C=hh}){let[E,T]=P.useState(!1),[A,D]=P.useState(!0),k=P.useRef(null),j=P.useRef(null),$=P.useRef(null),z=P.useRef(S),K=P.useRef(b),V=P.useRef(),N=P.useRef(r),W=vPe(i),H=P.useRef(!1),G=P.useRef(!1);Rz(()=>{let Y=Cz.init();return Y.then(q=>(k.current=q)&&D(!1)).catch(q=>(q==null?void 0:q.type)!=="cancelation"&&console.error("Monaco initialization: error:",q)),()=>j.current?F():Y.cancel()}),So(()=>{var q,M,ne,X;let Y=xu(k.current,e||r||"",t||o||"",i||n||"");Y!==((q=j.current)==null?void 0:q.getModel())&&(d&&Ym.set(W,(M=j.current)==null?void 0:M.saveViewState()),(ne=j.current)==null||ne.setModel(Y),d&&((X=j.current)==null||X.restoreViewState(Ym.get(i))))},[i],E),So(()=>{var Y;(Y=j.current)==null||Y.updateOptions(c)},[c],E),So(()=>{!j.current||r===void 0||(j.current.getOption(k.current.editor.EditorOption.readOnly)?j.current.setValue(r):r!==j.current.getValue()&&(G.current=!0,j.current.executeEdits("",[{range:j.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),j.current.pushUndoStop(),G.current=!1))},[r],E),So(()=>{var q,M;let Y=(q=j.current)==null?void 0:q.getModel();Y&&o&&((M=k.current)==null||M.editor.setModelLanguage(Y,o))},[o],E),So(()=>{var Y;a!==void 0&&((Y=j.current)==null||Y.revealLine(a))},[a],E),So(()=>{var Y;(Y=k.current)==null||Y.editor.setTheme(s)},[s],E);let te=P.useCallback(()=>{var Y;if(!(!$.current||!k.current)&&!H.current){K.current(k.current);let q=i||n,M=xu(k.current,r||e||"",t||o||"",q||"");j.current=(Y=k.current)==null?void 0:Y.editor.create($.current,{model:M,automaticLayout:!0,...c},u),d&&j.current.restoreViewState(Ym.get(q)),k.current.editor.setTheme(s),a!==void 0&&j.current.revealLine(a),T(!0),H.current=!0}},[e,t,n,r,o,i,c,u,d,s,a]);P.useEffect(()=>{E&&z.current(j.current,k.current)},[E]),P.useEffect(()=>{!A&&!E&&te()},[A,E,te]),N.current=r,P.useEffect(()=>{var Y,q;E&&_&&((Y=V.current)==null||Y.dispose(),V.current=(q=j.current)==null?void 0:q.onDidChangeModelContent(M=>{G.current||_(j.current.getValue(),M)}))},[E,_]),P.useEffect(()=>{if(E){let Y=k.current.editor.onDidChangeMarkers(q=>{var ne;let M=(ne=j.current.getModel())==null?void 0:ne.uri;if(M&&q.find(X=>X.path===M.path)){let X=k.current.editor.getModelMarkers({resource:M});C==null||C(X)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[E,C]);function F(){var Y,q;(Y=V.current)==null||Y.dispose(),h?d&&Ym.set(i,j.current.saveViewState()):(q=j.current.getModel())==null||q.dispose(),j.current.dispose()}return P.createElement(Ez,{width:p,height:m,isEditorReady:E,loading:l,_ref:$,className:v,wrapperProps:y})}var yPe=bPe,Oz=P.memo(yPe),xPe=Oz,h2="Collapsible",[wPe,Tz]=Jn(h2),[SPe,p2]=wPe(h2),Mz=R.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=Cr({prop:r,defaultProp:o,onChange:s});return x.jsx(SPe,{scope:n,disabled:i,contentId:qn(),open:l,onOpenToggle:R.useCallback(()=>c(u=>!u),[c]),children:x.jsx(Be.div,{"data-state":m2(l),"data-disabled":i?"":void 0,...a,ref:t})})});Mz.displayName=h2;var Az="CollapsibleTrigger",Dz=R.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=p2(Az,n);return x.jsx(Be.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":m2(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Te(e.onClick,o.onOpenToggle)})});Dz.displayName=Az;var g2="CollapsibleContent",kz=R.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=p2(g2,e.__scopeCollapsible);return x.jsx(Yn,{present:n||o.open,children:({present:i})=>x.jsx(_Pe,{...r,ref:t,present:i})})});kz.displayName=g2;var _Pe=R.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=p2(g2,n),[a,l]=R.useState(r),c=R.useRef(null),u=at(t,c),d=R.useRef(0),h=d.current,p=R.useRef(0),m=p.current,v=s.open||a,y=R.useRef(v),b=R.useRef(void 0);return R.useEffect(()=>{const S=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(S)},[]),fr(()=>{const S=c.current;if(S){b.current=b.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const _=S.getBoundingClientRect();d.current=_.height,p.current=_.width,y.current||(S.style.transitionDuration=b.current.transitionDuration,S.style.animationName=b.current.animationName),l(r)}},[s.open,r]),x.jsx(Be.div,{"data-state":m2(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!v,...i,ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:v&&o})});function m2(e){return e?"open":"closed"}var CPe=Mz,EPe=Dz,RPe=kz,Xs="Accordion",PPe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[v2,OPe,TPe]=Nv(Xs),[ty,JOe]=Jn(Xs,[TPe,Tz]),b2=Tz(),Iz=P.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return x.jsx(v2.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?x.jsx(kPe,{...i,ref:t}):x.jsx(DPe,{...o,ref:t})})});Iz.displayName=Xs;var[Nz,MPe]=ty(Xs),[Lz,APe]=ty(Xs,{collapsible:!1}),DPe=P.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=Cr({prop:n,defaultProp:r,onChange:o});return x.jsx(Nz,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:P.useCallback(()=>i&&l(""),[i,l]),children:x.jsx(Lz,{scope:e.__scopeAccordion,collapsible:i,children:x.jsx(Fz,{...s,ref:t})})})}),kPe=P.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=Cr({prop:n,defaultProp:r,onChange:o}),l=P.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=P.useCallback(u=>a((d=[])=>d.filter(h=>h!==u)),[a]);return x.jsx(Nz,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c,children:x.jsx(Lz,{scope:e.__scopeAccordion,collapsible:!0,children:x.jsx(Fz,{...i,ref:t})})})}),[IPe,ny]=ty(Xs),Fz=P.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=P.useRef(null),l=at(a,t),c=OPe(n),d=Mc(o)==="ltr",h=Te(e.onKeyDown,p=>{var D;if(!PPe.includes(p.key))return;const m=p.target,v=c().filter(k=>{var j;return!((j=k.ref.current)!=null&&j.disabled)}),y=v.findIndex(k=>k.ref.current===m),b=v.length;if(y===-1)return;p.preventDefault();let S=y;const _=0,C=b-1,E=()=>{S=y+1,S>C&&(S=_)},T=()=>{S=y-1,S<_&&(S=C)};switch(p.key){case"Home":S=_;break;case"End":S=C;break;case"ArrowRight":i==="horizontal"&&(d?E():T());break;case"ArrowDown":i==="vertical"&&E();break;case"ArrowLeft":i==="horizontal"&&(d?T():E());break;case"ArrowUp":i==="vertical"&&T();break}const A=S%b;(D=v[A].ref.current)==null||D.focus()});return x.jsx(IPe,{scope:n,disabled:r,direction:o,orientation:i,children:x.jsx(v2.Slot,{scope:n,children:x.jsx(Be.div,{...s,"data-orientation":i,ref:l,onKeyDown:r?void 0:h})})})}),_v="AccordionItem",[NPe,y2]=ty(_v),jz=P.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=ny(_v,n),s=MPe(_v,n),a=b2(n),l=qn(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return x.jsx(NPe,{scope:n,open:c,disabled:u,triggerId:l,children:x.jsx(CPe,{"data-orientation":i.orientation,"data-state":Wz(c),...a,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})})});jz.displayName=_v;var $z="AccordionHeader",zz=P.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=ny(Xs,n),i=y2($z,n);return x.jsx(Be.h3,{"data-orientation":o.orientation,"data-state":Wz(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});zz.displayName=$z;var I_="AccordionTrigger",Bz=P.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=ny(Xs,n),i=y2(I_,n),s=APe(I_,n),a=b2(n);return x.jsx(v2.ItemSlot,{scope:n,children:x.jsx(EPe,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...a,...r,ref:t})})});Bz.displayName=I_;var Hz="AccordionContent",Vz=P.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=ny(Xs,n),i=y2(Hz,n),s=b2(n);return x.jsx(RPe,{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}})});Vz.displayName=Hz;function Wz(e){return e?"open":"closed"}var LPe=Iz,FPe=jz,jPe=zz,Uz=Bz,Gz=Vz;const $Pe=LPe,qz=R.forwardRef(({className:e,...t},n)=>x.jsx(FPe,{ref:n,className:xe("border-b",e),...t}));qz.displayName="AccordionItem";const Yz=R.forwardRef(({className:e,children:t,...n},r)=>x.jsx(jPe,{className:"flex",children:x.jsxs(Uz,{ref:r,className:xe("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,x.jsx(Jv,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Yz.displayName=Uz.displayName;const Kz=R.forwardRef(({className:e,children:t,...n},r)=>x.jsx(Gz,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:x.jsx("div",{className:xe("pb-4 pt-0",e),children:t})}));Kz.displayName=Gz.displayName;var $I=1,zPe=.9,BPe=.8,HPe=.17,sw=.1,aw=.999,VPe=.9999,WPe=.99,UPe=/[\\\/_+.#"@\[\(\{&]/,GPe=/[\\\/_+.#"@\[\(\{&]/g,qPe=/[\s-]/,Xz=/[\s-]/g;function N_(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?$I:WPe;var a=`${o},${i}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(i),c=n.indexOf(l,o),u=0,d,h,p,m;c>=0;)d=N_(e,t,n,r,c+1,i+1,s),d>u&&(c===o?d*=$I:UPe.test(e.charAt(c-1))?(d*=BPe,p=e.slice(o,c-1).match(GPe),p&&o>0&&(d*=Math.pow(aw,p.length))):qPe.test(e.charAt(c-1))?(d*=zPe,m=e.slice(o,c-1).match(Xz),m&&o>0&&(d*=Math.pow(aw,m.length))):(d*=HPe,o>0&&(d*=Math.pow(aw,c-o))),e.charAt(c)!==t.charAt(i)&&(d*=VPe)),(d<sw&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(h=N_(e,t,n,r,c+1,i+2,s),h*sw>d&&(d=h*sw)),d>u&&(u=d),c=n.indexOf(l,c+1);return s[a]=u,u}function zI(e){return e.toLowerCase().replace(Xz," ")}function YPe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,N_(e,t,zI(e),zI(t),0,0,{})}var L_={exports:{}},lw={};/**
391
+ * @license React
392
+ * use-sync-external-store-shim.development.js
393
+ *
394
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
395
+ *
396
+ * This source code is licensed under the MIT license found in the
397
+ * LICENSE file in the root directory of this source tree.
398
+ */var BI;function KPe(){return BI||(BI=1,process.env.NODE_ENV!=="production"&&function(){function e(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}function t(p,m){u||o.startTransition===void 0||(u=!0,console.error("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 v=m();if(!d){var y=m();i(v,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=s({inst:{value:v,getSnapshot:m}});var b=y[0].inst,S=y[1];return l(function(){b.value=v,b.getSnapshot=m,n(b)&&S({inst:b})},[p,v,m]),a(function(){return n(b)&&S({inst:b}),p(function(){n(b)&&S({inst:b})})},[p]),c(v),v}function n(p){var m=p.getSnapshot;p=p.value;try{var v=m();return!i(p,v)}catch{return!0}}function r(p,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=P,i=typeof Object.is=="function"?Object.is:e,s=o.useState,a=o.useEffect,l=o.useLayoutEffect,c=o.useDebugValue,u=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;lw.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),lw}var cw={};/**
399
+ * @license React
400
+ * use-sync-external-store-shim.production.js
401
+ *
402
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
403
+ *
404
+ * This source code is licensed under the MIT license found in the
405
+ * LICENSE file in the root directory of this source tree.
406
+ */var HI;function XPe(){if(HI)return cw;HI=1;var e=P;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&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(d,h){var p=h(),m=r({inst:{value:p,getSnapshot:h}}),v=m[0].inst,y=m[1];return i(function(){v.value=p,v.getSnapshot=h,l(v)&&y({inst:v})},[d,p,h]),o(function(){return l(v)&&y({inst:v}),d(function(){l(v)&&y({inst:v})})},[d]),s(p),p}function l(d){var h=d.getSnapshot;d=d.value;try{var p=h();return!n(d,p)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return cw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,cw}process.env.NODE_ENV==="production"?L_.exports=XPe():L_.exports=KPe();var QPe=L_.exports,Rf='[cmdk-group=""]',uw='[cmdk-group-items=""]',JPe='[cmdk-group-heading=""]',x2='[cmdk-item=""]',VI=`${x2}:not([aria-disabled="true"])`,F_="cmdk-item-select",Il="data-value",ZPe=(e,t,n)=>YPe(e,t,n),Qz=R.createContext(void 0),eg=()=>R.useContext(Qz),Jz=R.createContext(void 0),w2=()=>R.useContext(Jz),Zz=R.createContext(void 0),eB=R.forwardRef((e,t)=>{let n=hu(()=>{var q,M;return{search:"",value:(M=(q=e.value)!=null?q:e.defaultValue)!=null?M:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=hu(()=>new Set),o=hu(()=>new Map),i=hu(()=>new Map),s=hu(()=>new Set),a=tB(e),{label:l,children:c,value:u,onValueChange:d,filter:h,shouldFilter:p,loop:m,disablePointerSelection:v=!1,vimBindings:y=!0,...b}=e,S=qn(),_=qn(),C=qn(),E=R.useRef(null),T=uOe();Rc(()=>{if(u!==void 0){let q=u.trim();n.current.value=q,A.emit()}},[u]),Rc(()=>{T(6,K)},[]);let A=R.useMemo(()=>({subscribe:q=>(s.current.add(q),()=>s.current.delete(q)),snapshot:()=>n.current,setState:(q,M,ne)=>{var X,re,ee;if(!Object.is(n.current[q],M)){if(n.current[q]=M,q==="search")z(),j(),T(1,$);else if(q==="value"&&(ne||T(5,K),((X=a.current)==null?void 0:X.value)!==void 0)){let J=M??"";(ee=(re=a.current).onValueChange)==null||ee.call(re,J);return}A.emit()}},emit:()=>{s.current.forEach(q=>q())}}),[]),D=R.useMemo(()=>({value:(q,M,ne)=>{var X;M!==((X=i.current.get(q))==null?void 0:X.value)&&(i.current.set(q,{value:M,keywords:ne}),n.current.filtered.items.set(q,k(M,ne)),T(2,()=>{j(),A.emit()}))},item:(q,M)=>(r.current.add(q),M&&(o.current.has(M)?o.current.get(M).add(q):o.current.set(M,new Set([q]))),T(3,()=>{z(),j(),n.current.value||$(),A.emit()}),()=>{i.current.delete(q),r.current.delete(q),n.current.filtered.items.delete(q);let ne=V();T(4,()=>{z(),(ne==null?void 0:ne.getAttribute("id"))===q&&$(),A.emit()})}),group:q=>(o.current.has(q)||o.current.set(q,new Set),()=>{i.current.delete(q),o.current.delete(q)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:S,inputId:C,labelId:_,listInnerRef:E}),[]);function k(q,M){var ne,X;let re=(X=(ne=a.current)==null?void 0:ne.filter)!=null?X:ZPe;return q?re(q,n.current.search,M):0}function j(){if(!n.current.search||a.current.shouldFilter===!1)return;let q=n.current.filtered.items,M=[];n.current.filtered.groups.forEach(X=>{let re=o.current.get(X),ee=0;re.forEach(J=>{let le=q.get(J);ee=Math.max(le,ee)}),M.push([X,ee])});let ne=E.current;N().sort((X,re)=>{var ee,J;let le=X.getAttribute("id"),ce=re.getAttribute("id");return((ee=q.get(ce))!=null?ee:0)-((J=q.get(le))!=null?J:0)}).forEach(X=>{let re=X.closest(uw);re?re.appendChild(X.parentElement===re?X:X.closest(`${uw} > *`)):ne.appendChild(X.parentElement===ne?X:X.closest(`${uw} > *`))}),M.sort((X,re)=>re[1]-X[1]).forEach(X=>{var re;let ee=(re=E.current)==null?void 0:re.querySelector(`${Rf}[${Il}="${encodeURIComponent(X[0])}"]`);ee==null||ee.parentElement.appendChild(ee)})}function $(){let q=N().find(ne=>ne.getAttribute("aria-disabled")!=="true"),M=q==null?void 0:q.getAttribute(Il);A.setState("value",M||void 0)}function z(){var q,M,ne,X;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let re=0;for(let ee of r.current){let J=(M=(q=i.current.get(ee))==null?void 0:q.value)!=null?M:"",le=(X=(ne=i.current.get(ee))==null?void 0:ne.keywords)!=null?X:[],ce=k(J,le);n.current.filtered.items.set(ee,ce),ce>0&&re++}for(let[ee,J]of o.current)for(let le of J)if(n.current.filtered.items.get(le)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=re}function K(){var q,M,ne;let X=V();X&&(((q=X.parentElement)==null?void 0:q.firstChild)===X&&((ne=(M=X.closest(Rf))==null?void 0:M.querySelector(JPe))==null||ne.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function V(){var q;return(q=E.current)==null?void 0:q.querySelector(`${x2}[aria-selected="true"]`)}function N(){var q;return Array.from(((q=E.current)==null?void 0:q.querySelectorAll(VI))||[])}function W(q){let M=N()[q];M&&A.setState("value",M.getAttribute(Il))}function H(q){var M;let ne=V(),X=N(),re=X.findIndex(J=>J===ne),ee=X[re+q];(M=a.current)!=null&&M.loop&&(ee=re+q<0?X[X.length-1]:re+q===X.length?X[0]:X[re+q]),ee&&A.setState("value",ee.getAttribute(Il))}function G(q){let M=V(),ne=M==null?void 0:M.closest(Rf),X;for(;ne&&!X;)ne=q>0?lOe(ne,Rf):cOe(ne,Rf),X=ne==null?void 0:ne.querySelector(VI);X?A.setState("value",X.getAttribute(Il)):H(q)}let te=()=>W(N().length-1),F=q=>{q.preventDefault(),q.metaKey?te():q.altKey?G(1):H(1)},Y=q=>{q.preventDefault(),q.metaKey?W(0):q.altKey?G(-1):H(-1)};return R.createElement(Be.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:q=>{var M;if((M=b.onKeyDown)==null||M.call(b,q),!q.defaultPrevented)switch(q.key){case"n":case"j":{y&&q.ctrlKey&&F(q);break}case"ArrowDown":{F(q);break}case"p":case"k":{y&&q.ctrlKey&&Y(q);break}case"ArrowUp":{Y(q);break}case"Home":{q.preventDefault(),W(0);break}case"End":{q.preventDefault(),te();break}case"Enter":if(!q.nativeEvent.isComposing&&q.keyCode!==229){q.preventDefault();let ne=V();if(ne){let X=new Event(F_);ne.dispatchEvent(X)}}}}},R.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:fOe},l),ry(e,q=>R.createElement(Jz.Provider,{value:A},R.createElement(Qz.Provider,{value:D},q))))}),eOe=R.forwardRef((e,t)=>{var n,r;let o=qn(),i=R.useRef(null),s=R.useContext(Zz),a=eg(),l=tB(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Rc(()=>{if(!c)return a.item(o,s==null?void 0:s.id)},[c]);let u=nB(o,i,[e.value,e.children,i],e.keywords),d=w2(),h=Pc(T=>T.value&&T.value===u.current),p=Pc(T=>c||a.filter()===!1?!0:T.search?T.filtered.items.get(o)>0:!0);R.useEffect(()=>{let T=i.current;if(!(!T||e.disabled))return T.addEventListener(F_,m),()=>T.removeEventListener(F_,m)},[p,e.onSelect,e.disabled]);function m(){var T,A;v(),(A=(T=l.current).onSelect)==null||A.call(T,u.current)}function v(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:y,value:b,onSelect:S,forceMount:_,keywords:C,...E}=e;return R.createElement(Be.div,{ref:sp([i,t]),...E,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||a.getDisablePointerSelection()?void 0:v,onClick:y?void 0:m},e.children)}),tOe=R.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=qn(),a=R.useRef(null),l=R.useRef(null),c=qn(),u=eg(),d=Pc(p=>o||u.filter()===!1?!0:p.search?p.filtered.groups.has(s):!0);Rc(()=>u.group(s),[]),nB(s,a,[e.value,e.heading,l]);let h=R.useMemo(()=>({id:s,forceMount:o}),[o]);return R.createElement(Be.div,{ref:sp([a,t]),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&R.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),ry(e,p=>R.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},R.createElement(Zz.Provider,{value:h},p))))}),nOe=R.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=R.useRef(null),i=Pc(s=>!s.search);return!n&&!i?null:R.createElement(Be.div,{ref:sp([o,t]),...r,"cmdk-separator":"",role:"separator"})}),rOe=R.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=w2(),s=Pc(u=>u.search),a=Pc(u=>u.value),l=eg(),c=R.useMemo(()=>{var u;let d=(u=l.listInnerRef.current)==null?void 0:u.querySelector(`${x2}[${Il}="${encodeURIComponent(a)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return R.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),R.createElement(Be.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:o?e.value:s,onChange:u=>{o||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),oOe=R.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=R.useRef(null),s=R.useRef(null),a=eg();return R.useEffect(()=>{if(s.current&&i.current){let l=s.current,c=i.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let h=l.offsetHeight;c.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return d.observe(l),()=>{cancelAnimationFrame(u),d.unobserve(l)}}},[]),R.createElement(Be.div,{ref:sp([i,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},ry(e,l=>R.createElement("div",{ref:sp([s,a.listInnerRef]),"cmdk-list-sizer":""},l)))}),iOe=R.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...a}=e;return R.createElement(e2,{open:n,onOpenChange:r},R.createElement(t2,{container:s},R.createElement(Xb,{"cmdk-overlay":"",className:o}),R.createElement(Qb,{"aria-label":e.label,"cmdk-dialog":"",className:i},R.createElement(eB,{ref:t,...a}))))}),sOe=R.forwardRef((e,t)=>Pc(n=>n.filtered.count===0)?R.createElement(Be.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),aOe=R.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return R.createElement(Be.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},ry(e,s=>R.createElement("div",{"aria-hidden":!0},s)))}),lo=Object.assign(eB,{List:oOe,Item:eOe,Input:rOe,Group:tOe,Separator:nOe,Dialog:iOe,Empty:sOe,Loading:aOe});function lOe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function cOe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function tB(e){let t=R.useRef(e);return Rc(()=>{t.current=e}),t}var Rc=typeof window>"u"?R.useEffect:R.useLayoutEffect;function hu(e){let t=R.useRef();return t.current===void 0&&(t.current=e()),t}function sp(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Pc(e){let t=w2(),n=()=>e(t.snapshot());return QPe.useSyncExternalStore(t.subscribe,n,n)}function nB(e,t,n,r=[]){let o=R.useRef(),i=eg();return Rc(()=>{var s;let a=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():o.current}})(),l=r.map(c=>c.trim());i.value(e,a,l),(s=t.current)==null||s.setAttribute(Il,a),o.current=a}),o}var uOe=()=>{let[e,t]=R.useState(),n=hu(()=>new Map);return Rc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function dOe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ry({asChild:e,children:t},n){return e&&R.isValidElement(t)?R.cloneElement(dOe(t),{ref:t.ref},n(t.props.children)):n(t)}var fOe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const rB=R.forwardRef(({className:e,...t},n)=>x.jsx(lo,{ref:n,className:xe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));rB.displayName=lo.displayName;const oB=R.forwardRef(({className:e,...t},n)=>x.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[x.jsx(d4,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),x.jsx(lo.Input,{ref:n,className:xe("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));oB.displayName=lo.Input.displayName;const iB=R.forwardRef(({className:e,...t},n)=>x.jsx(lo.List,{ref:n,className:xe("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));iB.displayName=lo.List.displayName;const sB=R.forwardRef((e,t)=>x.jsx(lo.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));sB.displayName=lo.Empty.displayName;const aB=R.forwardRef(({className:e,...t},n)=>x.jsx(lo.Group,{ref:n,className:xe("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));aB.displayName=lo.Group.displayName;const hOe=R.forwardRef(({className:e,...t},n)=>x.jsx(lo.Separator,{ref:n,className:xe("-mx-1 h-px bg-border",e),...t}));hOe.displayName=lo.Separator.displayName;const lB=R.forwardRef(({className:e,...t},n)=>x.jsx(lo.Item,{ref:n,className:xe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));lB.displayName=lo.Item.displayName;var pOe=Object.defineProperty,gOe=(e,t,n)=>t in e?pOe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Km=(e,t,n)=>(gOe(e,typeof t!="symbol"?t+"":t,n),n);const mOe={stringify:e=>e,parse:e=>e},vOe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},bOe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},yOe={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}},xOe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},dw={string:mOe,number:vOe,boolean:bOe,function:yOe,json:xOe},fw=Symbol.for("r2wc.render"),Xm=Symbol.for("r2wc.connected"),Cl=Symbol.for("r2wc.context"),ma=Symbol.for("r2wc.props");function wOe(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(d=>d!=="container"),a={},l={},c={};for(const d of s){a[d]=Array.isArray(t.props)?"string":t.props[d];const h=SOe(d);l[d]=h,c[h]=d}class u extends HTMLElement{constructor(){super(),Km(this,r,!0),Km(this,o),Km(this,i,{}),Km(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[ma].container=this.container;for(const h of s){const p=l[h],m=this.getAttribute(p),v=a[h],y=dw[v];m&&y!=null&&y.parse&&(this[ma][h]=y.parse(m,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Xm]=!0,this[fw]()}disconnectedCallback(){this[Xm]=!1,this[Cl]&&n.unmount(this[Cl]),delete this[Cl]}attributeChangedCallback(h,p,m){const v=c[h],y=a[v],b=dw[y];v in a&&b!=null&&b.parse&&(this[ma][v]=b.parse(m,this),this[fw]())}[(r=Xm,o=Cl,i=ma,fw)](){this[Xm]&&(this[Cl]?n.update(this[Cl],this[ma]):this[Cl]=n.mount(this.container,e,this[ma]))}}for(const d of s){const h=l[d],p=a[d];Object.defineProperty(u.prototype,d,{enumerable:!0,configurable:!0,get(){return this[ma][d]},set(m){this[ma][d]=m;const v=dw[p];if(v!=null&&v.stringify){const y=v.stringify(m);this.getAttribute(h)!==y&&this.setAttribute(h,y)}}})}return u}function SOe(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function _Oe(e,t,n){const r=_w(e),o=P.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function COe({root:e,ReactComponent:t},n){const r=P.createElement(t,n);e.render(r)}function EOe({root:e}){e.unmount()}function ROe(e,t={}){return wOe(e,t,{mount:_Oe,update:COe,unmount:EOe})}const POe={id:"string",version:"string",authToken:"json",defaultFilterValues:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onFilterValuesChange:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean"},OOe=ROe(u$,{props:POe});exports.Accordion=$Pe;exports.AccordionContent=Kz;exports.AccordionItem=qz;exports.AccordionTrigger=Yz;exports.BOOLEAN_DATA_TYPES=G_;exports.Bot=tS;exports.Button=oo;exports.Calendar=r4;exports.Card=$N;exports.CardContent=kv;exports.CardDescription=Z_;exports.CardHeader=Dv;exports.CardTitle=yd;exports.CaretSortIcon=LZ;exports.ChartJsVisual=UE;exports.Check=Cp;exports.CheckIcon=X5;exports.Checkbox=zb;exports.ChevronDown=Jv;exports.ChevronLeft=AC;exports.ChevronRight=Zv;exports.ChevronUp=o4;exports.Circle=DC;exports.ClipboardCopyIcon=BZ;exports.ColorFormat=k6;exports.Command=rB;exports.CommandEmpty=sB;exports.CommandGroup=aB;exports.CommandInput=oB;exports.CommandItem=lB;exports.CommandList=iB;exports.Cross2Icon=Q5;exports.DATAMODEL_NAMESPCACE=xN;exports.DATE_DATA_TYPES=bd;exports.Dashboard=u$;exports.DashboardPanel=BN;exports.DashboardTabs=l$;exports.DashboardWC=OOe;exports.Dialog=h2e;exports.DialogContent=fz;exports.DialogDescription=mz;exports.DialogFooter=pz;exports.DialogHeader=hz;exports.DialogTitle=gz;exports.DialogTrigger=p2e;exports.Download=i4;exports.DropdownMenu=l2e;exports.DropdownMenuCheckboxItem=az;exports.DropdownMenuContent=iz;exports.DropdownMenuItem=sz;exports.DropdownMenuLabel=cz;exports.DropdownMenuRadioGroup=u2e;exports.DropdownMenuRadioItem=lz;exports.DropdownMenuSeparator=uz;exports.DropdownMenuTrigger=c2e;exports.Editable=Qi;exports.EditorAside=bz;exports.EditorMain=yz;exports.EditorPanel=vz;exports.ErrorBoundary=eb;exports.Fallback=LC;exports.FallbackEditorCard=Cee;exports.Filter=s4;exports.FilterHeader=A7;exports.FilterX=kC;exports.Ft=xPe;exports.GripVertical=a4;exports.HoverCard=pb;exports.HoverCardContent=Ip;exports.HoverCardTrigger=gb;exports.Icon=n4;exports.Info=l4;exports.InfoCircledIcon=XZ;exports.Input=ac;exports.Jt=D7;exports.KPICard=m3;exports.LOCALE_CURRENCY_PAIRS=Cw;exports.Label=Tn;exports.Markdown=Y9;exports.NUMBER_DATA_TYPES=bp;exports.PYTHON_DEFAULT_CODE=yN;exports.PaperPlaneIcon=J5;exports.Percent=c4;exports.PlayIcon=ZZ;exports.Plus=IC;exports.Popover=Ob;exports.PopoverContent=$p;exports.PopoverTrigger=Tb;exports.RadioGroup=ER;exports.RadioGroupItem=hv;exports.ResizableHandle=TEe;exports.ResizablePanel=D_;exports.ResizablePanelGroup=vj;exports.ScanSearch=u4;exports.ScrollArea=Dh;exports.ScrollArea$1=qE;exports.ScrollBar=Db;exports.Search=d4;exports.Select=Ts;exports.SelectContent=ji;exports.SelectGroup=du;exports.SelectItem=Hn;exports.SelectLabel=Al;exports.SelectSeparator=sh;exports.SelectTrigger=Fi;exports.SelectValue=Ms;exports.SemaphorContextProvider=FN;exports.SemaphorQueryClient=NN;exports.Separator=Np;exports.Settings=NC;exports.SliderIcon=tee;exports.Switch=l9;exports.TEXT_DATA_TYPES=Mv;exports.Table=f4;exports.Table$1=kE;exports.TableBody=NE;exports.TableCell=FE;exports.TableHead=LE;exports.TableHeader=IE;exports.TableRow=ih;exports.TableVisual=L6;exports.Tabs=iC;exports.TabsContent=sC;exports.TabsList=Fv;exports.TabsTrigger=jv;exports.Te=txe;exports.TextCard=zS;exports.Textarea=SR;exports.Toggle=WE;exports.Tooltip=oF;exports.TooltipContent=AE;exports.TooltipTrigger=iF;exports.TooltipTrigger$1=ME;exports.TriangleDownIcon=Z5;exports.TriangleUpIcon=e4;exports.UXProvider=c$;exports.UserRound=h4;exports.X=wd;exports._=Ql;exports.cn=xe;exports.copyToClipboard=nK;exports.createChartConfig=gE;exports.createLucideIcon=Fn;exports.createSqlGenConfig=LK;exports.de=Oz;exports.flexRender=GS;exports.fmt=q_;exports.getCanvasBackgroundColor=vh;exports.getColumnDataType=FK;exports.getContrastColor=Xu;exports.getCoreRowModel=SF;exports.getCssVariableValue=m4;exports.getDefaultFilterSql=fye;exports.getFilterComponent=RR;exports.getFilterValueType=wu;exports.getKeys=nr;exports.getNumberAxis=jC;exports.getPaginationRowModel=CF;exports.getPlugins=aK;exports.getQualifiedTableName=wN;exports.getRequest=ZY;exports.getSortedRowModel=_F;exports.getSql=NK;exports.getTenantAndEndUserId=eK;exports.getTokenParams=sN;exports.isColumnInSqlGen=jK;exports.jsxRuntimeExports=x;exports.loadManifest=F6;exports.pivotData=R0;exports.postRequest=Ev;exports.removeRing=Yf;exports.resolveDataType=Av;exports.titleCase=iK;exports.useCard=Wle;exports.useCustomVisual=j6;exports.useDashboardActions=dr;exports.useDashboardCardQuery=tb;exports.useDashboardStore=we;exports.useEditorActions=Qv;exports.useEditorStore=Nr;exports.useQuery=xp;exports.useQueryClient=J_;exports.useReactTable=EF;exports.useSemaphorContext=ko;exports.useTheme=_N;exports.useTopoJson=p3;exports.v4=Ba;