@yoast/ai-insights-client 1.4.37 → 1.4.38
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.
|
@@ -39,15 +39,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the MIT license found in the
|
|
41
41
|
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var K0;function L_(){return K0||(K0=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,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,p=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function S(oe){return typeof oe=="string"||typeof oe=="function"||oe===r||oe===u||oe===s||oe===i||oe===d||oe===f||typeof oe=="object"&&oe!==null&&(oe.$$typeof===g||oe.$$typeof===h||oe.$$typeof===o||oe.$$typeof===a||oe.$$typeof===c||oe.$$typeof===p||oe.$$typeof===v||oe.$$typeof===b||oe.$$typeof===m)}function C(oe){if(typeof oe=="object"&&oe!==null){var He=oe.$$typeof;switch(He){case t:var lt=oe.type;switch(lt){case l:case u:case r:case s:case i:case d:return lt;default:var dt=lt&<.$$typeof;switch(dt){case a:case c:case g:case h:case o:return dt;default:return He}}case n:return He}}}var x=l,k=u,w=a,_=o,O=t,E=c,T=r,j=g,B=h,R=n,A=s,M=i,D=d,H=!1;function Q(oe){return H||(H=!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)===u}function G(oe){return C(oe)===a}function ie(oe){return C(oe)===o}function ae(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===t}function N(oe){return C(oe)===c}function le(oe){return C(oe)===r}function te(oe){return C(oe)===g}function me(oe){return C(oe)===h}function J(oe){return C(oe)===n}function
|
|
42
|
+
*/var K0;function L_(){return K0||(K0=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,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,p=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function S(oe){return typeof oe=="string"||typeof oe=="function"||oe===r||oe===u||oe===s||oe===i||oe===d||oe===f||typeof oe=="object"&&oe!==null&&(oe.$$typeof===g||oe.$$typeof===h||oe.$$typeof===o||oe.$$typeof===a||oe.$$typeof===c||oe.$$typeof===p||oe.$$typeof===v||oe.$$typeof===b||oe.$$typeof===m)}function C(oe){if(typeof oe=="object"&&oe!==null){var He=oe.$$typeof;switch(He){case t:var lt=oe.type;switch(lt){case l:case u:case r:case s:case i:case d:return lt;default:var dt=lt&<.$$typeof;switch(dt){case a:case c:case g:case h:case o:return dt;default:return He}}case n:return He}}}var x=l,k=u,w=a,_=o,O=t,E=c,T=r,j=g,B=h,R=n,A=s,M=i,D=d,H=!1;function Q(oe){return H||(H=!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)===u}function G(oe){return C(oe)===a}function ie(oe){return C(oe)===o}function ae(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===t}function N(oe){return C(oe)===c}function le(oe){return C(oe)===r}function te(oe){return C(oe)===g}function me(oe){return C(oe)===h}function J(oe){return C(oe)===n}function Se(oe){return C(oe)===s}function ge(oe){return C(oe)===i}function ze(oe){return C(oe)===d}Ge.AsyncMode=x,Ge.ConcurrentMode=k,Ge.ContextConsumer=w,Ge.ContextProvider=_,Ge.Element=O,Ge.ForwardRef=E,Ge.Fragment=T,Ge.Lazy=j,Ge.Memo=B,Ge.Portal=R,Ge.Profiler=A,Ge.StrictMode=M,Ge.Suspense=D,Ge.isAsyncMode=Q,Ge.isConcurrentMode=F,Ge.isContextConsumer=G,Ge.isContextProvider=ie,Ge.isElement=ae,Ge.isForwardRef=N,Ge.isFragment=le,Ge.isLazy=te,Ge.isMemo=me,Ge.isPortal=J,Ge.isProfiler=Se,Ge.isStrictMode=ge,Ge.isSuspense=ze,Ge.isValidElementType=S,Ge.typeOf=C}()),Ge}var V0;function g2(){return V0||(V0=1,process.env.NODE_ENV==="production"?ol.exports=D_():ol.exports=L_()),ol.exports}/*
|
|
43
43
|
object-assign
|
|
44
44
|
(c) Sindre Sorhus
|
|
45
45
|
@license MIT
|
|
46
|
-
*/var xc,W0;function I_(){if(W0)return xc;W0=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}return xc=i()?Object.assign:function(s,o){for(var a,l=r(s),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){u=e(a);for(var f=0;f<u.length;f++)n.call(a,u[f])&&(l[u[f]]=a[u[f]])}}return l},xc}var wc,Q0;function Df(){if(Q0)return wc;Q0=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return wc=e,wc}var Sc,Y0;function y2(){return Y0||(Y0=1,Sc=Function.call.bind(Object.prototype.hasOwnProperty)),Sc}var Cc,X0;function R_(){if(X0)return Cc;X0=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Df(),n={},r=y2();e=function(s){var o="Warning: "+s;typeof console!="undefined"&&console.error(o);try{throw new Error(o)}catch(a){}}}function i(s,o,a,l,u){if(process.env.NODE_ENV!=="production"){for(var c in s)if(r(s,c)){var d;try{if(typeof s[c]!="function"){var f=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[c](o,c,l,a,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+c+"` 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 h=u?u():"";e("Failed "+a+" type: "+d.message+(h!=null?h:""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Cc=i,Cc}var _c,Z0;function N_(){if(Z0)return _c;Z0=1;var e=g2(),t=I_(),n=Df(),r=y2(),i=R_(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console!="undefined"&&console.error(l);try{throw new Error(l)}catch(u){}});function o(){return null}return _c=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function d(F){var G=F&&(u&&F[u]||F[c]);if(typeof G=="function")return G}var f="<<anonymous>>",h={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:b(),arrayOf:S,element:C(),elementType:x(),instanceOf:k,node:E(),objectOf:_,oneOf:w,oneOfType:O,shape:j,exact:B};function g(F,G){return F===G?F!==0||1/F===1/G:F!==F&&G!==G}function m(F,G){this.message=F,this.data=G&&typeof G=="object"?G:{},this.stack=""}m.prototype=Error.prototype;function p(F){if(process.env.NODE_ENV!=="production")var G={},ie=0;function ae(le,te,me,J,
|
|
46
|
+
*/var xc,W0;function I_(){if(W0)return xc;W0=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}return xc=i()?Object.assign:function(s,o){for(var a,l=r(s),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){u=e(a);for(var f=0;f<u.length;f++)n.call(a,u[f])&&(l[u[f]]=a[u[f]])}}return l},xc}var wc,Q0;function Df(){if(Q0)return wc;Q0=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return wc=e,wc}var Sc,Y0;function y2(){return Y0||(Y0=1,Sc=Function.call.bind(Object.prototype.hasOwnProperty)),Sc}var Cc,X0;function R_(){if(X0)return Cc;X0=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Df(),n={},r=y2();e=function(s){var o="Warning: "+s;typeof console!="undefined"&&console.error(o);try{throw new Error(o)}catch(a){}}}function i(s,o,a,l,u){if(process.env.NODE_ENV!=="production"){for(var c in s)if(r(s,c)){var d;try{if(typeof s[c]!="function"){var f=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[c](o,c,l,a,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+c+"` 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 h=u?u():"";e("Failed "+a+" type: "+d.message+(h!=null?h:""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Cc=i,Cc}var _c,Z0;function N_(){if(Z0)return _c;Z0=1;var e=g2(),t=I_(),n=Df(),r=y2(),i=R_(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console!="undefined"&&console.error(l);try{throw new Error(l)}catch(u){}});function o(){return null}return _c=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function d(F){var G=F&&(u&&F[u]||F[c]);if(typeof G=="function")return G}var f="<<anonymous>>",h={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:b(),arrayOf:S,element:C(),elementType:x(),instanceOf:k,node:E(),objectOf:_,oneOf:w,oneOfType:O,shape:j,exact:B};function g(F,G){return F===G?F!==0||1/F===1/G:F!==F&&G!==G}function m(F,G){this.message=F,this.data=G&&typeof G=="object"?G:{},this.stack=""}m.prototype=Error.prototype;function p(F){if(process.env.NODE_ENV!=="production")var G={},ie=0;function ae(le,te,me,J,Se,ge,ze){if(J=J||f,ge=ge||me,ze!==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!="undefined"){var He=J+":"+me;!G[He]&&ie<3&&(s("You are manually calling a React.PropTypes validation function for the `"+ge+"` 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."),G[He]=!0,ie++)}}return te[me]==null?le?te[me]===null?new m("The "+Se+" `"+ge+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new m("The "+Se+" `"+ge+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:F(te,me,J,Se,ge)}var N=ae.bind(null,!1);return N.isRequired=ae.bind(null,!0),N}function v(F){function G(ie,ae,N,le,te,me){var J=ie[ae],Se=M(J);if(Se!==F){var ge=D(J);return new m("Invalid "+le+" `"+te+"` of type "+("`"+ge+"` supplied to `"+N+"`, expected ")+("`"+F+"`."),{expectedType:F})}return null}return p(G)}function b(){return p(o)}function S(F){function G(ie,ae,N,le,te){if(typeof F!="function")return new m("Property `"+te+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var me=ie[ae];if(!Array.isArray(me)){var J=M(me);return new m("Invalid "+le+" `"+te+"` of type "+("`"+J+"` supplied to `"+N+"`, expected an array."))}for(var Se=0;Se<me.length;Se++){var ge=F(me,Se,N,le,te+"["+Se+"]",n);if(ge instanceof Error)return ge}return null}return p(G)}function C(){function F(G,ie,ae,N,le){var te=G[ie];if(!a(te)){var me=M(te);return new m("Invalid "+N+" `"+le+"` of type "+("`"+me+"` supplied to `"+ae+"`, expected a single ReactElement."))}return null}return p(F)}function x(){function F(G,ie,ae,N,le){var te=G[ie];if(!e.isValidElementType(te)){var me=M(te);return new m("Invalid "+N+" `"+le+"` of type "+("`"+me+"` supplied to `"+ae+"`, expected a single ReactElement type."))}return null}return p(F)}function k(F){function G(ie,ae,N,le,te){if(!(ie[ae]instanceof F)){var me=F.name||f,J=Q(ie[ae]);return new m("Invalid "+le+" `"+te+"` of type "+("`"+J+"` supplied to `"+N+"`, expected ")+("instance of `"+me+"`."))}return null}return p(G)}function w(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("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])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function G(ie,ae,N,le,te){for(var me=ie[ae],J=0;J<F.length;J++)if(g(me,F[J]))return null;var Se=JSON.stringify(F,function(ze,oe){var He=D(oe);return He==="symbol"?String(oe):oe});return new m("Invalid "+le+" `"+te+"` of value `"+String(me)+"` "+("supplied to `"+N+"`, expected one of "+Se+"."))}return p(G)}function _(F){function G(ie,ae,N,le,te){if(typeof F!="function")return new m("Property `"+te+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var me=ie[ae],J=M(me);if(J!=="object")return new m("Invalid "+le+" `"+te+"` of type "+("`"+J+"` supplied to `"+N+"`, expected an object."));for(var Se in me)if(r(me,Se)){var ge=F(me,Se,N,le,te+"."+Se,n);if(ge instanceof Error)return ge}return null}return p(G)}function O(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var G=0;G<F.length;G++){var ie=F[G];if(typeof ie!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+H(ie)+" at index "+G+"."),o}function ae(N,le,te,me,J){for(var Se=[],ge=0;ge<F.length;ge++){var ze=F[ge],oe=ze(N,le,te,me,J,n);if(oe==null)return null;oe.data&&r(oe.data,"expectedType")&&Se.push(oe.data.expectedType)}var He=Se.length>0?", expected one of type ["+Se.join(", ")+"]":"";return new m("Invalid "+me+" `"+J+"` supplied to "+("`"+te+"`"+He+"."))}return p(ae)}function E(){function F(G,ie,ae,N,le){return R(G[ie])?null:new m("Invalid "+N+" `"+le+"` supplied to "+("`"+ae+"`, expected a ReactNode."))}return p(F)}function T(F,G,ie,ae,N){return new m((F||"React class")+": "+G+" type `"+ie+"."+ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function j(F){function G(ie,ae,N,le,te){var me=ie[ae],J=M(me);if(J!=="object")return new m("Invalid "+le+" `"+te+"` of type `"+J+"` "+("supplied to `"+N+"`, expected `object`."));for(var Se in F){var ge=F[Se];if(typeof ge!="function")return T(N,le,te,Se,D(ge));var ze=ge(me,Se,N,le,te+"."+Se,n);if(ze)return ze}return null}return p(G)}function B(F){function G(ie,ae,N,le,te){var me=ie[ae],J=M(me);if(J!=="object")return new m("Invalid "+le+" `"+te+"` of type `"+J+"` "+("supplied to `"+N+"`, expected `object`."));var Se=t({},ie[ae],F);for(var ge in Se){var ze=F[ge];if(r(F,ge)&&typeof ze!="function")return T(N,le,te,ge,D(ze));if(!ze)return new m("Invalid "+le+" `"+te+"` key `"+ge+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(ie[ae],null," ")+`
|
|
47
47
|
Valid keys: `+JSON.stringify(Object.keys(F),null," "));var oe=ze(me,ge,N,le,te+"."+ge,n);if(oe)return oe}return null}return p(G)}function R(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(R);if(F===null||a(F))return!0;var G=d(F);if(G){var ie=G.call(F),ae;if(G!==F.entries){for(;!(ae=ie.next()).done;)if(!R(ae.value))return!1}else for(;!(ae=ie.next()).done;){var N=ae.value;if(N&&!R(N[1]))return!1}}else return!1;return!0;default:return!1}}function A(F,G){return F==="symbol"?!0:G?G["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&G instanceof Symbol:!1}function M(F){var G=typeof F;return Array.isArray(F)?"array":F instanceof RegExp?"object":A(G,F)?"symbol":G}function D(F){if(typeof F=="undefined"||F===null)return""+F;var G=M(F);if(G==="object"){if(F instanceof Date)return"date";if(F instanceof RegExp)return"regexp"}return G}function H(F){var G=D(F);switch(G){case"array":case"object":return"an "+G;case"boolean":case"date":case"regexp":return"a "+G;default:return G}}function Q(F){return!F.constructor||!F.constructor.name?f:F.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},_c}var kc,J0;function F_(){if(J0)return kc;J0=1;var e=Df();function t(){}function n(){}return n.resetWarningCache=t,kc=function(){function r(o,a,l,u,c,d){if(d!==e){var f=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 f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},kc}var eg;function B_(){if(eg)return sl.exports;if(eg=1,process.env.NODE_ENV!=="production"){var e=g2(),t=!0;sl.exports=N_()(e.isElement,t)}else sl.exports=F_()();return sl.exports}var q_=B_();const $d=yp(q_);var Ha=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:Oe("yst-my-6",r)})};Ha.propTypes={className:$d.string};const m2=6048e5,z_=864e5,tg=Symbol.for("constructDateFrom");function cn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&tg in e?e[tg](t):e instanceof Date?new e.constructor(t):new Date(t)}function Kt(e,t){return cn(t||e,e)}function p2(e,t,n){const r=Kt(e,n==null?void 0:n.in);if(isNaN(t))return cn(e,NaN);if(!t)return r;const i=r.getDate(),s=cn(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return i>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}let H_={};function Bu(){return H_}function oa(e,t){var a,l,u,c,d,f,h,g;const n=Bu(),r=(g=(h=(c=(u=t==null?void 0:t.weekStartsOn)!=null?u:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)!=null?c:n.weekStartsOn)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)!=null?g:0,i=Kt(e,t==null?void 0:t.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function eu(e,t){return oa(e,{...t,weekStartsOn:1})}function v2(e,t){const n=Kt(e,t==null?void 0:t.in),r=n.getFullYear(),i=cn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=eu(i),o=cn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=eu(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function ng(e){const t=Kt(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 qu(e,...t){const n=cn.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function tu(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function U_(e,t,n){const[r,i]=qu(n==null?void 0:n.in,e,t),s=tu(r),o=tu(i),a=+s-ng(s),l=+o-ng(o);return Math.round((a-l)/z_)}function G_(e,t){const n=v2(e,t),r=cn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),eu(r)}function K_(e){return cn(e,Date.now())}function V_(e,t,n){const[r,i]=qu(n==null?void 0:n.in,e,t);return+tu(r)==+tu(i)}function W_(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Q_(e){return!(!W_(e)&&typeof e!="number"||isNaN(+Kt(e)))}function Y_(e,t){const n=Kt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function X_(e,t){const[n,r]=qu(e,t.start,t.end);return{start:n,end:r}}function Z_(e,t){const{start:n,end:r}=X_(t==null?void 0:t.in,e);let i=+n>+r;const s=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let a=1;const l=[];for(;+o<=s;)l.push(cn(n,o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return i?l.reverse():l}function J_(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function e8(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const t8={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"}},n8=(e,t,n)=>{let r;const i=t8[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Oc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const r8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},i8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o8={date:Oc({formats:r8,defaultWidth:"full"}),time:Oc({formats:i8,defaultWidth:"full"}),dateTime:Oc({formats:s8,defaultWidth:"full"})},a8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},l8=(e,t,n,r)=>a8[e];function mo(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const u8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},c8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},d8={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"]},f8={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"]},h8={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"}},g8={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"}},y8=(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"},m8={ordinalNumber:y8,era:mo({values:u8,defaultWidth:"wide"}),quarter:mo({values:c8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:mo({values:d8,defaultWidth:"wide"}),day:mo({values:f8,defaultWidth:"wide"}),dayPeriod:mo({values:h8,defaultWidth:"wide",formattingValues:g8,defaultFormattingWidth:"wide"})};function po(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?v8(a,d=>d.test(o)):p8(a,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function p8(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function v8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function b8(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const x8=/^(\d+)(th|st|nd|rd)?/i,w8=/\d+/i,S8={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},C8={any:[/^b/i,/^(a|c)/i]},_8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},k8={any:[/1/i,/2/i,/3/i,/4/i]},O8={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},E8={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]},A8={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},P8={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]},T8={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},M8={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}},j8={ordinalNumber:b8({matchPattern:x8,parsePattern:w8,valueCallback:e=>parseInt(e,10)}),era:po({matchPatterns:S8,defaultMatchWidth:"wide",parsePatterns:C8,defaultParseWidth:"any"}),quarter:po({matchPatterns:_8,defaultMatchWidth:"wide",parsePatterns:k8,defaultParseWidth:"any",valueCallback:e=>e+1}),month:po({matchPatterns:O8,defaultMatchWidth:"wide",parsePatterns:E8,defaultParseWidth:"any"}),day:po({matchPatterns:A8,defaultMatchWidth:"wide",parsePatterns:P8,defaultParseWidth:"any"}),dayPeriod:po({matchPatterns:T8,defaultMatchWidth:"any",parsePatterns:M8,defaultParseWidth:"any"})},$8={code:"en-US",formatDistance:n8,formatLong:o8,formatRelative:l8,localize:m8,match:j8,options:{weekStartsOn:0,firstWeekContainsDate:1}};function D8(e,t){const n=Kt(e,t==null?void 0:t.in);return U_(n,e8(n))+1}function L8(e,t){const n=Kt(e,t==null?void 0:t.in),r=+eu(n)-+G_(n);return Math.round(r/m2)+1}function b2(e,t){var c,d,f,h,g,m,p,v;const n=Kt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Bu(),s=(v=(p=(h=(f=t==null?void 0:t.firstWeekContainsDate)!=null?f:(d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)!=null?h:i.firstWeekContainsDate)!=null?p:(m=(g=i.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)!=null?v:1,o=cn((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=oa(o,t),l=cn((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=oa(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function I8(e,t){var a,l,u,c,d,f,h,g;const n=Bu(),r=(g=(h=(c=(u=t==null?void 0:t.firstWeekContainsDate)!=null?u:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)!=null?c:n.firstWeekContainsDate)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,i=b2(e,t),s=cn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),oa(s,t)}function R8(e,t){const n=Kt(e,t==null?void 0:t.in),r=+oa(n,t)-+I8(n,t);return Math.round(r/m2)+1}function We(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Er={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return We(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):We(n+1,2)},d(e,t){return We(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 We(e.getHours()%12||12,t.length)},H(e,t){return We(e.getHours(),t.length)},m(e,t){return We(e.getMinutes(),t.length)},s(e,t){return We(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return We(i,t.length)}},Zi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},rg={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(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Er.y(e,t)},Y:function(e,t,n,r){const i=b2(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return We(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):We(s,t.length)},R:function(e,t){const n=v2(e);return We(n,t.length)},u:function(e,t){const n=e.getFullYear();return We(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 We(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 We(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 Er.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 We(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 i=R8(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):We(i,t.length)},I:function(e,t,n){const r=L8(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):We(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Er.d(e,t)},D:function(e,t,n){const r=D8(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):We(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 i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return We(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return We(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return We(i,t.length);case"io":return n.ordinalNumber(i,{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 i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Zi.noon:r===0?i=Zi.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Zi.evening:r>=12?i=Zi.afternoon:r>=4?i=Zi.morning:i=Zi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{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 Er.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Er.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):We(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):We(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Er.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Er.s(e,t)},S:function(e,t){return Er.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return sg(r);case"XXXX":case"XX":return di(r);case"XXXXX":case"XXX":default:return di(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return sg(r);case"xxxx":case"xx":return di(r);case"xxxxx":case"xxx":default:return di(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ig(r,":");case"OOOO":default:return"GMT"+di(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ig(r,":");case"zzzz":default:return"GMT"+di(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return We(r,t.length)},T:function(e,t,n){return We(+e,t.length)}};function ig(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+We(s,2)}function sg(e,t){return e%60===0?(e>0?"-":"+")+We(Math.abs(e)/60,2):di(e,t)}function di(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=We(Math.trunc(r/60),2),s=We(r%60,2);return n+i+t+s}const og=(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"})}},x2=(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"})}},N8=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return og(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",og(r,t)).replace("{{time}}",x2(i,t))},F8={p:x2,P:N8},B8=/^D+$/,q8=/^Y+$/,z8=["D","DD","YY","YYYY"];function H8(e){return B8.test(e)}function U8(e){return q8.test(e)}function G8(e,t,n){const r=K8(e,t,n);if(console.warn(r),z8.includes(e))throw new RangeError(r)}function K8(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 V8=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,W8=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Q8=/^'([^]*?)'?$/,Y8=/''/g,X8=/[a-zA-Z]/;function Mo(e,t,n){var c,d,f,h,g,m,p,v,b;const r=Bu(),i=(c=r.locale)!=null?c:$8,s=(g=(h=r.firstWeekContainsDate)!=null?h:(f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,o=(b=(v=r.weekStartsOn)!=null?v:(p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)!=null?b:0,a=Kt(e,n==null?void 0:n.in);if(!Q_(a))throw new RangeError("Invalid time value");let l=t.match(W8).map(S=>{const C=S[0];if(C==="p"||C==="P"){const x=F8[C];return x(S,i.formatLong)}return S}).join("").match(V8).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:Z8(S)};if(rg[C])return{isToken:!0,value:S};if(C.match(X8))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const C=S.value;(U8(C)||H8(C))&&G8(C,t,String(e));const x=rg[C[0]];return x(a,C,i.localize,u)}).join("")}function Z8(e){const t=e.match(Q8);return t?t[1].replace(Y8,"'"):e}function ag(e,t,n){const[r,i]=qu(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function J8(e,t){return V_(cn(e,e),K_(e))}function e7(e,t,n){return p2(e,-1,n)}function aa(e){"@babel/helpers - typeof";return aa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aa(e)}function Ec(e,t,n){return(t=t7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t7(e){var t=n7(e,"string");return aa(t)=="symbol"?t:t+""}function n7(e,t){if(aa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(aa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lg(e,t){return o7(e)||s7(e,t)||i7(e,t)||r7()}function r7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
48
48
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i7(e,t){if(e){if(typeof e=="string")return ug(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ug(e,t):void 0}}function ug(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function o7(e){if(Array.isArray(e))return e}var qn={selected:{background:"yst-bg-primary-500",text:"yst-text-white",hover:"hover:yst-bg-primary-600"},hasAnalysis:{border:"yst-border-2 yst-border-primary-500",text:"yst-text-slate-900",hover:"hover:yst-bg-primary-50"},today:{underline:"yst-border-b-2 yst-border-slate-400"},indicator:{default:"yst-bg-blue-500"}},a7=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.isOpen,l=a===void 0?!1:a,u=t.onClose,c=z.useState(new Date),d=lg(c,2),f=d[0],h=d[1],g=function(_){if(!_)return null;var O=_.slice(0,10),E=O.split("-"),T=lg(E,3),j=T[0],B=T[1],R=T[2],A=Number(j),M=Number(B),D=Number(R);return Number.isNaN(A)||Number.isNaN(M)||Number.isNaN(D)||M<1||M>12||D<1||D>31?null:new Date(A,M-1,D)},m=z.useMemo(function(){var w=new Map;return n.forEach(function(_){var O=g(_.createdAt),E=O?Mo(O,"yyyy-MM-dd"):"";E&&(w.has(E)||w.set(E,[]),w.get(E).push(_))}),w},[n]);z.useEffect(function(){if(l&&r){var w=n.find(function(T){return T.id===r});if(w){var _=g(w.createdAt);_&&h(_)}}else if(l&&n.length>0){var O=n.reduce(function(T,j){return new Date(j.createdAt)>new Date(T.createdAt)?j:T}),E=g(O.createdAt);E&&h(E)}},[l,r,n]);var p=z.useMemo(function(){return n.length===0?null:n.reduce(function(w,_){return new Date(_.createdAt)>new Date(w.createdAt)?_:w})},[n]),v=function(){if(p){var _=g(p.createdAt);_&&h(_)}},b=z.useMemo(function(){if(!p)return!1;var w=g(p.createdAt);return w?ag(w,f):!1},[p,f]),S=z.useMemo(function(){var w=J_(f),_=Y_(f),O=new Date(w),E=O.getDay(),T=E===0?6:E-1;O.setDate(O.getDate()-T);var j=new Date(_),B=j.getDay(),R=B===0?0:7-B;return j.setDate(j.getDate()+R),Z_({start:O,end:j}).map(function(A){var M=Mo(A,"yyyy-MM-dd"),D=m.get(M)||[],H=D.find(function(Q){return String(Q.id)===String(r)});return{date:M,dateObj:A,isCurrentMonth:ag(A,f),isToday:J8(A),isSelected:!!H,hasAnalyses:D.length>0,analyses:D}})},[f,m,r]),C=function(){h(function(_){return e7(_)})},x=function(){h(function(_){return p2(_,1)})},k=function(_){if(_.hasAnalyses){if(_.analyses.length===1)i(_.analyses[0].id);else{var O=_.analyses.reduce(function(E,T){return new Date(T.createdAt)>new Date(E.createdAt)?T:E});i(O.id)}u==null||u()}};return l?o?y.jsx("div",{className:"yst-absolute yst-left-0 yst-right-0 yst-top-full yst-z-50 yst-mt-1 yst-rounded-md yst-border yst-border-slate-200 yst-bg-white yst-p-4 yst-shadow-lg",children:y.jsxs("div",{className:"yst-animate-pulse yst-space-y-4",children:[y.jsx("div",{className:"yst-h-6 yst-rounded yst-bg-slate-200"}),y.jsx("div",{className:"yst-h-48 yst-rounded yst-bg-slate-200"})]})}):y.jsxs("div",{className:"yst-absolute yst-left-0 yst-right-0 yst-top-full yst-z-50 yst-mt-1 yst-min-w-80 yst-max-w-sm yst-rounded-md yst-border yst-border-slate-200 yst-bg-white yst-p-4 yst-shadow-lg",children:[y.jsxs("div",{className:"yst-mb-6 yst-flex yst-items-center yst-justify-between",children:[y.jsxs("button",{type:"button",onClick:C,className:"yst-rounded-md yst-p-1.5 yst-text-slate-400 hover:yst-bg-slate-100 hover:yst-text-slate-500",children:[y.jsx("span",{className:"yst-sr-only",children:"Previous month"}),y.jsx(L4,{className:"yst-h-5 yst-w-5"})]}),y.jsx("h2",{className:"yst-text-sm yst-font-semibold yst-text-slate-900",children:Mo(f,"MMMM yyyy")}),y.jsxs("button",{type:"button",onClick:x,className:"yst-rounded-md yst-p-1.5 yst-text-slate-400 hover:yst-bg-slate-100 hover:yst-text-slate-500",children:[y.jsx("span",{className:"yst-sr-only",children:"Next month"}),y.jsx(R4,{className:"yst-h-5 yst-w-5"})]})]}),y.jsx("div",{className:"yst-mb-0 yst-grid yst-grid-cols-7 yst-gap-x-1",children:["M","T","W","T","F","S","S"].map(function(w,_){return y.jsx("div",{className:"yst-py-2 yst-text-center yst-text-xs yst-font-medium yst-text-slate-500",children:w},"".concat(w,"-").concat(_))})}),y.jsx("div",{className:"yst-grid yst-grid-cols-7 yst-gap-x-1",children:S.map(function(w){return y.jsx("div",{className:"yst-flex yst-items-center yst-justify-center yst-py-1",children:y.jsxs("button",{type:"button",onClick:function(){return k(w)},disabled:!w.hasAnalyses,className:Oe("yst-relative yst-rounded-full yst-text-sm yst-transition-colors","yst-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center","yst-p-0",{"yst-text-slate-900":w.isCurrentMonth,"yst-text-slate-400":!w.isCurrentMonth},{"focus:yst-outline-none focus:yst-ring-2 focus:yst-ring-blue-500":w.hasAnalyses,"yst-cursor-not-allowed":!w.hasAnalyses,"yst-cursor-pointer":w.hasAnalyses},Ec({},"".concat(qn.selected.background," ").concat(qn.selected.text," ").concat(qn.selected.hover),w.isSelected),Ec({},"".concat(qn.hasAnalysis.border," ").concat(qn.hasAnalysis.text," ").concat(qn.hasAnalysis.hover),w.hasAnalyses&&!w.isSelected)),children:[y.jsx("span",{className:Oe("yst-relative yst-z-10 yst-w-4",Ec({},qn.today.underline,w.isToday&&!w.isSelected)),children:Mo(w.dateObj,"d")}),w.hasAnalyses&&w.analyses.length>1&&!w.isSelected&&y.jsx("span",{className:Oe("yst-absolute yst-right-1 yst-top-1 yst-h-2 yst-w-2 yst-rounded-full",qn.indicator.default)})]})},w.date)})}),y.jsxs("div",{className:"yst-mt-4 yst-flex yst-items-center yst-gap-4 yst-text-xs yst-text-slate-600",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-3 yst-w-3 yst-rounded-full ".concat(qn.hasAnalysis.border)}),y.jsx("span",{children:"Has analysis"})]}),y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-3 yst-w-3 yst-rounded-full ".concat(qn.selected.background)}),y.jsx("span",{children:"Selected"})]}),y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-0.5 yst-w-4 yst-bg-slate-400"}),y.jsx("span",{children:"Today"})]})]}),p&&y.jsx("div",{className:"yst-mt-6",children:y.jsx(P.Button,{onClick:v,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function Ac(e,t){return d7(e)||c7(e,t)||u7(e,t)||l7()}function l7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
49
49
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u7(e,t){if(e){if(typeof e=="string")return cg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cg(e,t):void 0}}function cg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function d7(e){if(Array.isArray(e))return e}var f7=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.disabled,l=a===void 0?!1:a,u=t.id,c=u===void 0?"analysis-date-select":u,d=z.useState(!1),f=Ac(d,2),h=f[0],g=f[1],m=z.useState("latest"),p=Ac(m,2),v=p[0],b=p[1],S=z.useRef(null),C=function(A){if(!A)return null;var M=A.slice(0,10),D=M.split("-"),H=Ac(D,3),Q=H[0],F=H[1],G=H[2],ie=Number(Q),ae=Number(F),N=Number(G);return Number.isNaN(ie)||Number.isNaN(ae)||Number.isNaN(N)||ae<1||ae>12||N<1||N>31?null:new Date(ie,ae-1,N)},x=function(A){var M=C(A.createdAt);return M?M.getTime():-1/0};z.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var R=n.reduce(function(A,M){return x(M)>x(A)?M:A});i(R.id)}},[n,r,i,o]);var k=z.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var R=n.reduce(function(A,M){return x(M)>x(A)?M:A});return R.id}return"latest"}return r},[r,n,x]);z.useEffect(function(){b(k)},[k]);var w=n.find(function(R){return String(R.id)===String(v)}),_=n.length>0?String(n.reduce(function(R,A){return x(A)>x(R)?A:R}).id):"",O=function(){if(w){var R=C(w.createdAt),A=R?Mo(R,"MMMM d, yyyy"):w.createdAt?w.createdAt.slice(0,10):"Unknown date",M=String(w.id)===_?"(latest)":"(older)";return"".concat(A," ").concat(M)}return n.length>0?"Select date...":"No analyses available"}();z.useEffect(function(){var R=function(M){S.current&&!S.current.contains(M.target)&&g(!1)};return h&&document.addEventListener("mousedown",R),function(){document.removeEventListener("mousedown",R)}},[h]);var E=function(){!l&&!o&&g(!h)},T=function(A){b(A),i(A),g(!1)},j=function(){g(!1)},B=function(A){A.key==="Enter"||A.key===" "?(A.preventDefault(),E()):A.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:S,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(P.TextInput,{id:c,onClick:E,onKeyDown:B,onChange:function(){},disabled:l||o,value:O,"aria-expanded":h,"aria-haspopup":"true","aria-label":"Select analysis date",className:Oe("yst-pr-10",{"yst-cursor-default":!l&&!o})}),y.jsx(M4,{className:Oe("yst-pointer-events-none yst-absolute yst-right-3 yst-top-1/2 yst--translate-y-1/2 yst-transform",{"yst-text-gray-400":l||o})})]}),y.jsx(a7,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:T,isLoading:o,isOpen:h,onClose:j})]})};function w2(e){if(e!=null){if(typeof e=="number"){var t=1e12;return e>t?e-Date.now():e}var n=Date.parse(e);if(!Number.isNaN(n))return n-Date.now()}}function h7(e,t){var n=w2(e);return n!==void 0&&n>t*60*1e3}var g7=2;function S2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g7,n=w2(e);return n!==void 0&&n>0&&n<=t*60*1e3}function Dd(e){if(e==null)return"a future date";var t;if(typeof e=="number"){var n=1e12;e>n?t=e:t=Date.now()+e}else{var r=Date.parse(e);Number.isNaN(r)||(t=r)}if(t===void 0)return"a future date";var i=new Date(t),s={month:"long",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0},o=i.toLocaleDateString("en-US",s),a=o.split(" ");if(a.length>=4){var l=a[0],u=a[1].replace(",",""),c=a.slice(2).join(" ");return"".concat(l," ").concat(u," at ").concat(c)}return"".concat(o)}var dg;function fg(e,t){return v7(e)||p7(e,t)||m7(e,t)||y7()}function y7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
50
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m7(e,t){if(e){if(typeof e=="string")return hg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hg(e,t):void 0}}function hg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function v7(e){if(Array.isArray(e))return e}function Ld(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Xt(b,"_invoke",function(S,C,x){var k,w,_,O=0,E=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,M){return k=A,w=0,_=e,j.n=M,o}};function B(R,A){for(w=R,_=A,t=0;!T&&O&&!M&&t<E.length;t++){var M,D=E[t],H=j.p,Q=D[2];R>3?(M=Q===A)&&(_=D[(w=D[4])?5:(w=3,3)],D[4]=D[5]=e):D[0]<=H&&((M=R<2&&H<D[1])?(w=0,j.v=A,j.n=D[1]):H<Q&&(M=R<3||D[0]>A||A>Q)&&(D[4]=R,D[5]=A,j.n=Q,w=0))}if(M||R>1)return o;throw T=!0,A}return function(R,A,M){if(O>1)throw TypeError("Generator is already running");for(T&&A===1&&B(A,M),w=A,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(D){k=e,w=1,_=D}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Xt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Xt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Xt(d,"constructor",u),Xt(u,"constructor",l),l.displayName="GeneratorFunction",Xt(u,i,"GeneratorFunction"),Xt(d),Xt(d,i,"Generator"),Xt(d,r,function(){return this}),Xt(d,"toString",function(){return"[object Generator]"}),(Ld=function(){return{w:s,m:f}})()}function Xt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Xt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Xt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Xt(e,t,n,r)}function gg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function b7(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){gg(s,r,i,o,a,"next",l)}function a(l){gg(s,r,i,o,a,"throw",l)}o(void 0)})}}function x7(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Pc=za(dg||(dg=x7(["yst-flex-1 yst-space-y-2"]))),w7=function(t){var n,r,i,s,o=t.className,a=Rn(),l=a.brandId,u=a.analysisId,c=a.model,d=Fa(),f=d.setModel,h=d.setAnalysisId,g=Gt(),m=dn(),p=Ki(),v=p.data,b=Iu({query:{select:function(Je){var Be=Je.data;return Be==null?void 0:Be.data}}}),S=b.data,C=b.isLoading,x=S==null?void 0:S.displayName,k=Gi({query:{select:function(Je){var Be=Je.data;return Be==null?void 0:Be.brands}}}),w=k.data,_=k.isLoading,O=e2(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be==null?void 0:Be.analyses}}}),E=O.data,T=O.isLoading,j=Du(l,u,{query:{enabled:!!l&&!!u,select:function(Je){var Be=Je.data;return Be}}}),B=j.data,R=j.isLoading,A=Jl(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),M=A.data,D=A.isLoading,H=L5({mutation:{onSuccess:function(){var Se=b7(Ld().m(function Be(){var An,Vt;return Ld().w(function(fn){for(;;)switch(fn.n){case 0:return fn.n=1,Promise.all([g.invalidateQueries({queryKey:Pf(l)}),g.invalidateQueries({queryKey:Xl(l,u)}),g.invalidateQueries({queryKey:Tf(l)})]);case 1:An=(E==null?void 0:E.filter(function(Nn){return String(Nn.id)!==String(u)}))||[],An.length>0?(Vt=An.reduce(function(Nn,nr){var Qi=Nn.createdAt?new Date(Nn.createdAt).getTime():0,Or=nr.createdAt?new Date(nr.createdAt).getTime():0;return Or>Qi?nr:Nn}),h(Vt.id),m("/brands/".concat(l,"/analysis/").concat(Vt.id))):(h("latest"),m("/brands/".concat(l))),N(!1);case 2:return fn.a(2)}},Be)}));function Je(){return Se.apply(this,arguments)}return Je}()}}),Q=H.mutate,F=H.isPending;z.useEffect(function(){!D&&!R&&l&&w&&(w==null?void 0:w.length)<2&&(!(M!=null&&M.queries)||Array.isArray(M==null?void 0:M.queries)&&M.queries.length===0)&&(E==null?void 0:E.length)===0&&m("/setup/".concat(l,"/queries"))},[D,R,M,l,m,w,E==null?void 0:E.length]);var G=z.useState(!1),ie=fg(G,2),ae=ie[0],N=ie[1],le=function(){N(!1)},te=w==null?void 0:w.find(function(Se){return String(Se.id)===String(l)}),me=B==null||(n=B.analysis)===null||n===void 0?void 0:n.id,J=l!=null&&typeof me=="number"&&!isNaN(me),Ce=z.useState(!1),ge=fg(Ce,2),ze=ge[0],oe=ge[1];z.useEffect(function(){if(J){var Se="yst_legal_alert_dismissed_".concat(l,"_").concat(me);oe(window.localStorage.getItem(Se)===null)}},[l,me,J]);var He=function(Je){if(Je.preventDefault(),!!J){var Be="yst_legal_alert_dismissed_".concat(l,"_").concat(me);window.localStorage.setItem(Be,"true"),oe(!1)}},lt=function(Je){switch(Je){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return Je||"Unknown"}},dt=(B==null||(r=B.analysis)===null||r===void 0||(r=r.scans)===null||r===void 0?void 0:r.map(function(Se){return{value:Se.aiProvider,label:lt(Se.aiProvider)}}))||[{value:"",label:"Default model"}],Ne=E!=null&&E.some(function(Se){return String(Se.id)===String(u)})?u:E&&E.length>0?E[0].id:"latest",Fe=Jl(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),Y=Fe.data,Pe=(Y==null?void 0:Y.name)||"your brand",tt=Dd(Y==null?void 0:Y.nextScheduledAnalysis),$e=B==null||(i=B.analysis)===null||i===void 0?void 0:i.status,ue=function(){var Se=y.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[y.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),y.jsxs("p",{children:["You've completed the setup for"," ",y.jsx("b",{className:"yst-font-medium",children:Pe}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:tt}),". You'll see the results here once it's ready. We'll also notify you by email."]})]});if($e===void 0&&(M==null?void 0:M.setupStatus)==="scheduledFirstAnalysis")return{alertContent:Se,alertVariant:"info"};switch($e){case ci.pending:return{alertContent:Se,alertVariant:"info"};case ci.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",Pe,". The analysis is now processing. You'll see the results here once it's ready. We'll also notify you by email."]}),alertVariant:"info"};case ci.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case ci.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case ci.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),W=ue.alertContent,ne=ue.alertVariant,ee=!T&&(M==null?void 0:M.setupStatus)!=="pendingQuerySelection"&&(E==null?void 0:E.length)===0&&(M==null?void 0:M.nextScheduledAnalysis)===null,we=v==null?void 0:v.isUpToDateWithBrandGroups,gt=(v==null?void 0:v.status)===_6.updating&&we===!1;return y.jsxs(y.Fragment,{children:[y.jsx(Fu,{isOpen:ae,onClose:le,onConfirm:function(){l&&u&&Q({brandId:l,analysisId:u})},isLoading:F,title:"Delete analysis?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this analysis."}),y.jsx("p",{children:"This action cannot be undone."})]}),confirmText:"Yes, delete analysis",cancelText:"No, go back"}),y.jsx(P.Card,{className:Oe("yst-relative yst-overflow-visible",o),children:y.jsxs(P.Card.Content,{className:"yst-mt-0",children:[y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-flex-wrap yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row xl:yst-items-center",children:[y.jsx("div",{className:"xl:yst-max-w-1/4",children:y.jsxs("div",{className:"yst-flex yst-flex-col xl:yst-flex-row xl:yst-items-baseline xl:yst-gap-2",children:[y.jsx(P.Title,{children:y.jsxs(y.Fragment,{children:[C||!x?y.jsx(P.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):y.jsxs(y.Fragment,{children:["Hi ",x,", "]})," "]})}),y.jsx("p",{className:"yst-text-sm yst-font-normal yst-text-slate-600",children:"welcome to your brand analysis!"})]})}),y.jsxs("div",{className:"yst-flex yst-flex-row yst-flex-wrap yst-items-center yst-justify-end yst-gap-4 yst-self-end md:yst-self-start",children:[y.jsxs(P.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return m("/setup")},disabled:T||_,children:[y.jsx(a2,{})," Analyze a different brand"]}),y.jsx("div",{className:"yst-relative",children:y.jsxs(P.DropdownMenu,{children:[y.jsx(P.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:T||_||w&&(w==null?void 0:w.length)<1,children:y.jsx(H4,{})}),y.jsx(P.DropdownMenu.List,{className:"yst-absolute yst-right-0 yst-top-full yst-z-40 yst-mt-2 yst-flex yst-w-64 yst-flex-col yst-justify-start",children:y.jsxs(P.DropdownMenu.ButtonItem,{onClick:function(){return N(!0)},disabled:T||_||(B==null||(s=B.analysis)===null||s===void 0?void 0:s.status)!=="completed"||!E||E.length===0,className:"yst-flex yst-justify-start yst-gap-1.5 yst-text-red-600 hover:yst-bg-red-50",children:[y.jsx(Mf,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(Ha,{}),y.jsxs("form",{className:"yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center",children:[y.jsxs(Pc,{children:[y.jsx(P.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(P.Select,{onChange:function(Se){m("/brands/".concat(Se.toString()))},id:"brand-name",value:l?Number(l):"loading",options:w&&w.length>0?w.map(function(Se){return{value:Se.id,label:Se.name}}):[{value:"loading",label:"Loading..."}],disabled:_||!w||w.length<2||!l})]}),y.jsxs(Pc,{children:[y.jsx(P.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(f7,{analyses:E||[],selectedAnalysisId:Ne,onAnalysisSelect:function(Se){m("/brands/".concat(l,"/analysis/").concat(String(Se)))},isLoading:T,disabled:T||!E||E.length<1,id:"analysis-date"})]}),y.jsxs(Pc,{children:[y.jsx(P.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(P.Select,{onChange:function(Se){Object.values(C6).includes(Se)?f(Se):console.error("Invalid AI provider selected:",Se)},id:"ai-tool",value:c,options:R||T?[{value:c,label:"Loading..."}]:dt,disabled:R||T||[{}].length<2})]})]})]})}),y.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[J&&ze&&y.jsx(P.Alert,{children:y.jsxs("div",{className:"yst-flex yst-w-full",children:[y.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:y.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(P.Link,{onClick:He,variant:"default",children:y.jsx(q6,{})})})]})}),$e!==ci.completed&&W&&y.jsx(P.Alert,{className:"md:yst-col-span-2",variant:ne,children:W}),typeof we=="boolean"&&!we&&y.jsxs(P.Alert,{variant:"warning",children:["Note: This scan is not up to date with your current brand groups.",gt?y.jsxs(y.Fragment,{children:[" ","We're updating your sentiment analysis to reflect your new brand groups. This may take a few minutes."]}):y.jsx(y.Fragment,{children:" Newer scans will use your newly selected brand groupings."})]})]}),ee&&y.jsx(P.Alert,{variant:"info",className:"yst-mb-6",children:y.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),y.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[y.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:te==null?void 0:te.name})," ","has not been analyzed yet, and no analyses are scheduled because this brand is set to inactive in your"," ",y.jsx("span",{className:"yst-cursor-pointer yst-font-medium yst-text-blue-900 yst-underline",onClick:function(){return m("/settings")},role:"button",tabIndex:0,onKeyPress:function(Se){(Se.key==="Enter"||Se.key===" ")&&m("/settings")},children:"Settings"}),"."]})]})})}),te&&y.jsx($_,{brand:te},te.id)]})},S7=function(){var t,n,r,i=Ki(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return y.jsx(P.Card,{className:"yst-overflow-visible",children:y.jsxs(P.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(qa,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(Ba,{score:l==null||(t=l.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value,total:l==null||(n=l.queriesWithMentions)===null||n===void 0?void 0:n.length,suffix:"queries",isLoading:o||a})]}),!o&&l?y.jsx("ul",{children:l==null||(r=l.queriesWithMentions)===null||r===void 0?void 0:r.map(function(u,c){var d=c===0,f=l.queriesWithMentions&&c===l.queriesWithMentions.length-1;return y.jsxs("li",{className:Oe("yst-flex yst-flex-row yst-items-center yst-gap-2 yst-border-l yst-border-r yst-border-slate-300 yst-p-4 yst-font-medium yst-text-slate-800",{"yst-rounded-t-lg yst-border-t":d,"yst-rounded-b-lg yst-border-b":f,"yst-border-b":!f}),children:[y.jsx("div",{className:"yst-h-4 yst-w-4",children:u!=null&&u.mentioned?y.jsx($4,{className:"yst-text-green-500"}):y.jsx(r6,{className:"yst-text-red-500"})}),y.jsx("span",{className:"yst-justify-start",children:u.query}),y.jsx("span",{className:"yst-ml-auto yst-flex yst-items-end",children:u!=null&&u.mentioned?y.jsx(P.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):y.jsx(P.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},u.query)})}):y.jsx(P.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
|
|
50
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m7(e,t){if(e){if(typeof e=="string")return hg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hg(e,t):void 0}}function hg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function v7(e){if(Array.isArray(e))return e}function Ld(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Xt(b,"_invoke",function(S,C,x){var k,w,_,O=0,E=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,M){return k=A,w=0,_=e,j.n=M,o}};function B(R,A){for(w=R,_=A,t=0;!T&&O&&!M&&t<E.length;t++){var M,D=E[t],H=j.p,Q=D[2];R>3?(M=Q===A)&&(_=D[(w=D[4])?5:(w=3,3)],D[4]=D[5]=e):D[0]<=H&&((M=R<2&&H<D[1])?(w=0,j.v=A,j.n=D[1]):H<Q&&(M=R<3||D[0]>A||A>Q)&&(D[4]=R,D[5]=A,j.n=Q,w=0))}if(M||R>1)return o;throw T=!0,A}return function(R,A,M){if(O>1)throw TypeError("Generator is already running");for(T&&A===1&&B(A,M),w=A,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(D){k=e,w=1,_=D}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Xt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Xt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Xt(d,"constructor",u),Xt(u,"constructor",l),l.displayName="GeneratorFunction",Xt(u,i,"GeneratorFunction"),Xt(d),Xt(d,i,"Generator"),Xt(d,r,function(){return this}),Xt(d,"toString",function(){return"[object Generator]"}),(Ld=function(){return{w:s,m:f}})()}function Xt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Xt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Xt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Xt(e,t,n,r)}function gg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function b7(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){gg(s,r,i,o,a,"next",l)}function a(l){gg(s,r,i,o,a,"throw",l)}o(void 0)})}}function x7(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Pc=za(dg||(dg=x7(["yst-flex-1 yst-space-y-2"]))),w7=function(t){var n,r,i,s,o=t.className,a=Rn(),l=a.brandId,u=a.analysisId,c=a.model,d=Fa(),f=d.setModel,h=d.setAnalysisId,g=Gt(),m=dn(),p=Ki(),v=p.data,b=Iu({query:{select:function(Je){var Be=Je.data;return Be==null?void 0:Be.data}}}),S=b.data,C=b.isLoading,x=S==null?void 0:S.displayName,k=Gi({query:{select:function(Je){var Be=Je.data;return Be==null?void 0:Be.brands}}}),w=k.data,_=k.isLoading,O=e2(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be==null?void 0:Be.analyses}}}),E=O.data,T=O.isLoading,j=Du(l,u,{query:{enabled:!!l&&!!u,select:function(Je){var Be=Je.data;return Be}}}),B=j.data,R=j.isLoading,A=Jl(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),M=A.data,D=A.isLoading,H=L5({mutation:{onSuccess:function(){var we=b7(Ld().m(function Be(){var An,Vt;return Ld().w(function(fn){for(;;)switch(fn.n){case 0:return fn.n=1,Promise.all([g.invalidateQueries({queryKey:Pf(l)}),g.invalidateQueries({queryKey:Xl(l,u)}),g.invalidateQueries({queryKey:Tf(l)})]);case 1:An=(E==null?void 0:E.filter(function(Nn){return String(Nn.id)!==String(u)}))||[],An.length>0?(Vt=An.reduce(function(Nn,nr){var Qi=Nn.createdAt?new Date(Nn.createdAt).getTime():0,Or=nr.createdAt?new Date(nr.createdAt).getTime():0;return Or>Qi?nr:Nn}),h(Vt.id),m("/brands/".concat(l,"/analysis/").concat(Vt.id))):(h("latest"),m("/brands/".concat(l))),N(!1);case 2:return fn.a(2)}},Be)}));function Je(){return we.apply(this,arguments)}return Je}()}}),Q=H.mutate,F=H.isPending;z.useEffect(function(){!D&&!R&&l&&w&&(w==null?void 0:w.length)<2&&(!(M!=null&&M.queries)||Array.isArray(M==null?void 0:M.queries)&&M.queries.length===0)&&(E==null?void 0:E.length)===0&&m("/setup/".concat(l,"/queries"))},[D,R,M,l,m,w,E==null?void 0:E.length]);var G=z.useState(!1),ie=fg(G,2),ae=ie[0],N=ie[1],le=function(){N(!1)},te=w==null?void 0:w.find(function(we){return String(we.id)===String(l)}),me=B==null||(n=B.analysis)===null||n===void 0?void 0:n.id,J=l!=null&&typeof me=="number"&&!isNaN(me),Se=z.useState(!1),ge=fg(Se,2),ze=ge[0],oe=ge[1];z.useEffect(function(){if(J){var we="yst_legal_alert_dismissed_".concat(l,"_").concat(me);oe(window.localStorage.getItem(we)===null)}},[l,me,J]);var He=function(Je){if(Je.preventDefault(),!!J){var Be="yst_legal_alert_dismissed_".concat(l,"_").concat(me);window.localStorage.setItem(Be,"true"),oe(!1)}},lt=function(Je){switch(Je){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return Je||"Unknown"}},dt=(B==null||(r=B.analysis)===null||r===void 0||(r=r.scans)===null||r===void 0?void 0:r.map(function(we){return{value:we.aiProvider,label:lt(we.aiProvider)}}))||[{value:"",label:"Default model"}],Ne=E!=null&&E.some(function(we){return String(we.id)===String(u)})?u:E&&E.length>0?E[0].id:"latest",Fe=Jl(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),Y=Fe.data,Pe=(Y==null?void 0:Y.name)||"your brand",tt=Dd(Y==null?void 0:Y.nextScheduledAnalysis),$e=B==null||(i=B.analysis)===null||i===void 0?void 0:i.status,ue=function(){var we=y.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[y.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),y.jsxs("p",{children:["You've completed the setup for"," ",y.jsx("b",{className:"yst-font-medium",children:Pe}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:tt}),". You'll see the results here once it's ready. We'll also notify you by email."]})]});if($e===void 0&&(M==null?void 0:M.setupStatus)==="scheduledFirstAnalysis")return{alertContent:we,alertVariant:"info"};switch($e){case ci.pending:return{alertContent:we,alertVariant:"info"};case ci.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",Pe,". The analysis is now processing. You'll see the results here once it's ready. We'll also notify you by email."]}),alertVariant:"info"};case ci.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case ci.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case ci.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),W=ue.alertContent,ne=ue.alertVariant,ee=!T&&(M==null?void 0:M.setupStatus)!=="pendingQuerySelection"&&(E==null?void 0:E.length)===0&&(M==null?void 0:M.nextScheduledAnalysis)===null,Ce=v&&["updating","completed"].includes(v.status)&&!v.isUpToDateWithBrandGroups,gt=(v==null?void 0:v.status)===_6.updating&&Ce===!1;return y.jsxs(y.Fragment,{children:[y.jsx(Fu,{isOpen:ae,onClose:le,onConfirm:function(){l&&u&&Q({brandId:l,analysisId:u})},isLoading:F,title:"Delete analysis?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this analysis."}),y.jsx("p",{children:"This action cannot be undone."})]}),confirmText:"Yes, delete analysis",cancelText:"No, go back"}),y.jsx(P.Card,{className:Oe("yst-relative yst-overflow-visible",o),children:y.jsxs(P.Card.Content,{className:"yst-mt-0",children:[y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-flex-wrap yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row xl:yst-items-center",children:[y.jsx("div",{className:"xl:yst-max-w-1/4",children:y.jsxs("div",{className:"yst-flex yst-flex-col xl:yst-flex-row xl:yst-items-baseline xl:yst-gap-2",children:[y.jsx(P.Title,{children:y.jsxs(y.Fragment,{children:[C||!x?y.jsx(P.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):y.jsxs(y.Fragment,{children:["Hi ",x,", "]})," "]})}),y.jsx("p",{className:"yst-text-sm yst-font-normal yst-text-slate-600",children:"welcome to your brand analysis!"})]})}),y.jsxs("div",{className:"yst-flex yst-flex-row yst-flex-wrap yst-items-center yst-justify-end yst-gap-4 yst-self-end md:yst-self-start",children:[y.jsxs(P.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return m("/setup")},disabled:T||_,children:[y.jsx(a2,{})," Analyze a different brand"]}),y.jsx("div",{className:"yst-relative",children:y.jsxs(P.DropdownMenu,{children:[y.jsx(P.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:T||_||w&&(w==null?void 0:w.length)<1,children:y.jsx(H4,{})}),y.jsx(P.DropdownMenu.List,{className:"yst-absolute yst-right-0 yst-top-full yst-z-40 yst-mt-2 yst-flex yst-w-64 yst-flex-col yst-justify-start",children:y.jsxs(P.DropdownMenu.ButtonItem,{onClick:function(){return N(!0)},disabled:T||_||(B==null||(s=B.analysis)===null||s===void 0?void 0:s.status)!=="completed"||!E||E.length===0,className:"yst-flex yst-justify-start yst-gap-1.5 yst-text-red-600 hover:yst-bg-red-50",children:[y.jsx(Mf,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(Ha,{}),y.jsxs("form",{className:"yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center",children:[y.jsxs(Pc,{children:[y.jsx(P.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(P.Select,{onChange:function(we){m("/brands/".concat(we.toString()))},id:"brand-name",value:l?Number(l):"loading",options:w&&w.length>0?w.map(function(we){return{value:we.id,label:we.name}}):[{value:"loading",label:"Loading..."}],disabled:_||!w||w.length<2||!l})]}),y.jsxs(Pc,{children:[y.jsx(P.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(f7,{analyses:E||[],selectedAnalysisId:Ne,onAnalysisSelect:function(we){m("/brands/".concat(l,"/analysis/").concat(String(we)))},isLoading:T,disabled:T||!E||E.length<1,id:"analysis-date"})]}),y.jsxs(Pc,{children:[y.jsx(P.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(P.Select,{onChange:function(we){Object.values(C6).includes(we)?f(we):console.error("Invalid AI provider selected:",we)},id:"ai-tool",value:c,options:R||T?[{value:c,label:"Loading..."}]:dt,disabled:R||T||[{}].length<2})]})]})]})}),y.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[J&&ze&&y.jsx(P.Alert,{children:y.jsxs("div",{className:"yst-flex yst-w-full",children:[y.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:y.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(P.Link,{onClick:He,variant:"default",children:y.jsx(q6,{})})})]})}),$e!==ci.completed&&W&&y.jsx(P.Alert,{className:"md:yst-col-span-2",variant:ne,children:W}),Ce&&y.jsxs(P.Alert,{variant:"warning",children:["Note: This scan is not up to date with your current brand groups.",gt?y.jsxs(y.Fragment,{children:[" ","We're updating your sentiment analysis to reflect your new brand groups. This may take a few minutes."]}):y.jsx(y.Fragment,{children:" Newer scans will use your newly selected brand groupings."})]})]}),ee&&y.jsx(P.Alert,{variant:"info",className:"yst-mb-6",children:y.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),y.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[y.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:te==null?void 0:te.name})," ","has not been analyzed yet, and no analyses are scheduled because this brand is set to inactive in your"," ",y.jsx("span",{className:"yst-cursor-pointer yst-font-medium yst-text-blue-900 yst-underline",onClick:function(){return m("/settings")},role:"button",tabIndex:0,onKeyPress:function(we){(we.key==="Enter"||we.key===" ")&&m("/settings")},children:"Settings"}),"."]})]})})}),te&&y.jsx($_,{brand:te},te.id)]})},S7=function(){var t,n,r,i=Ki(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return y.jsx(P.Card,{className:"yst-overflow-visible",children:y.jsxs(P.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(qa,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(Ba,{score:l==null||(t=l.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value,total:l==null||(n=l.queriesWithMentions)===null||n===void 0?void 0:n.length,suffix:"queries",isLoading:o||a})]}),!o&&l?y.jsx("ul",{children:l==null||(r=l.queriesWithMentions)===null||r===void 0?void 0:r.map(function(u,c){var d=c===0,f=l.queriesWithMentions&&c===l.queriesWithMentions.length-1;return y.jsxs("li",{className:Oe("yst-flex yst-flex-row yst-items-center yst-gap-2 yst-border-l yst-border-r yst-border-slate-300 yst-p-4 yst-font-medium yst-text-slate-800",{"yst-rounded-t-lg yst-border-t":d,"yst-rounded-b-lg yst-border-b":f,"yst-border-b":!f}),children:[y.jsx("div",{className:"yst-h-4 yst-w-4",children:u!=null&&u.mentioned?y.jsx($4,{className:"yst-text-green-500"}):y.jsx(r6,{className:"yst-text-red-500"})}),y.jsx("span",{className:"yst-justify-start",children:u.query}),y.jsx("span",{className:"yst-ml-auto yst-flex yst-items-end",children:u!=null&&u.mentioned?y.jsx(P.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):y.jsx(P.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},u.query)})}):y.jsx(P.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
|
|
51
51
|
* @kurkle/color v0.3.4
|
|
52
52
|
* https://github.com/kurkle/color#readme
|
|
53
53
|
* (c) 2024 Jukka Kurkela
|
|
@@ -65,8 +65,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
65
65
|
*/class vk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=T2.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.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,i)=>Math.max(r,i._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 i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var or=new vk;const Rg="transparent",bk={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Eg(e||Rg),i=r.valid&&Eg(t||Rg);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class xk{constructor(t,n,r,i){const s=n[r];i=dl([t.to,i,s,t.from]);const o=dl([t.from,s,i]);this._active=!0,this._fn=t.fn||bk[t.type||typeof o],this._easing=Uo[t.easing]||Uo.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=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=dl([t.to,n,i,t.from]),this._from=dl([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,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 i=0;i<r.length;i++)r[i][n]()}}class K2{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ie(t))return;const n=Object.keys(ct.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Ie(s))return;const o={};for(const a of n)o[a]=s[a];(ot(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=Sk(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&wk(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(t,n));continue}const c=n[u];let d=s[u];const f=r.get(u);if(d)if(f&&d.active()){d.update(f,c,a);continue}else d.cancel();if(!f||!f.duration){t[u]=c;continue}s[u]=d=new xk(f,t,u,c),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return or.add(this._chart,r),!0}}function wk(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function Sk(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 Ng(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function Ck(e,t,n){if(n===!1)return!1;const r=Ng(e,n),i=Ng(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function _k(e){let t,n,r,i;return Ie(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function V2(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Fg(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,u;if(t===null)return;let c=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(c=!0,r.all)continue;break}u=e.values[l],bt(u)&&(s||t===0||Hs(t)===Hs(u))&&(t+=u)}return!c&&!r.all?0:t}function kk(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],a[l]={[i]:c,[s]:e[c]};return a}function $c(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Ok(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Ek(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function Ak(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Bg(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function qg(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,u=o.axis,c=Ok(s,o,r),d=t.length;let f;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[u]:p}=g,v=g._stacks||(g._stacks={});f=v[u]=Ak(i,c,m),f[a]=p,f._top=Bg(f,o,!0,r.type),f._bottom=Bg(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function Dc(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Pk(e,t){return ri(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Tk(e,t,n){return ri(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function vo(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const Lc=e=>e==="reset"||e==="none",zg=(e,t)=>t?e:Object.assign({},e),Mk=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:V2(n,!0),values:null};class cs{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=$c(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&&vo(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,g)=>d==="x"?f:d==="r"?g:h,s=n.xAxisID=De(r.xAxisID,Dc(t,"x")),o=n.yAxisID=De(r.yAxisID,Dc(t,"y")),a=n.rAxisID=De(r.rAxisID,Dc(t,"r")),l=n.indexAxis,u=n.iAxisID=i(l,s,o,a),c=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_g(this._data,this),t._stacked&&vo(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ie(n)){const i=this._cachedMeta;this._data=kk(n,i)}else if(r!==n){if(r){_g(r,this);const i=this._cachedMeta;vo(i),i._parsed=[]}n&&Object.isExtensible(n)&&u9(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 i=!1;this._dataCheck();const s=n._stacked;n._stacked=$c(n.vScale,n),n.stack!==r.stack&&(i=!0,vo(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(qg(this,n._parsed),n._stacked=$c(n.vScale,n))}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:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,u=t>0&&r._parsed[t-1],c,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{ot(i[t])?f=this.parseArrayData(r,i,t,n):Ie(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||u&&d[a]<u[a];for(c=0;c<n;++c)r._parsed[c+t]=d=f[c],l&&(h()&&(l=!1),u=d);r._sorted=l}o&&qg(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,u=s.getLabels(),c=s===o,d=new Array(i);let f,h,g;for(f=0,h=i;f<h;++f)g=f+r,d[f]={[a]:c||s.parse(u[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,u,c,d;for(l=0,u=i;l<u;++l)c=l+r,d=n[c],a[l]={x:s.parse(d[0],c),y:o.parse(d[1],c)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,d,f,h;for(c=0,d=i;c<d;++c)f=c+r,h=n[f],u[c]={x:s.parse(ca(h,a),f),y:o.parse(ca(h,l),f)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:V2(i,!0),values:n._stacks[t.axis]._visualValues};return Fg(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=Fg(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=Mk(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=Ek(a);let f,h;function g(){h=i[f];const m=h[a.axis];return!bt(h[t.axis])||c>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(u,t,h,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(u,t,h,l);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],bt(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=_k(De(this.options.clip,Ck(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(t,s,a,l),c=a;c<a+l;++c){const d=i[c];d.hidden||(d.active&&u?o.push(d):d.draw(t,s))}for(c=0;c<o.length;++c)o[c].draw(t,s)}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 i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=Tk(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=Pk(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}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 i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&iu(r);if(a)return zg(a,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=u.getOptionScopes(this.getDataset(),c),h=Object.keys(ct.elements[t]),g=()=>this.getContext(r,i,n),m=u.resolveNamedOptions(f,h,g,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(zg(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,n),f=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(f,this.getContext(t,r,n))}const u=new K2(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Lc(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){Lc(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Lc(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,u]of this._syncList)this[a](l,u);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=u=>{for(u.length+=n,a=u.length-1;a>=o;a--)u[a]=u[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&vo(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,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])}}pe(cs,"defaults",{}),pe(cs,"datasetElementType",null),pe(cs,"dataElementType",null);class Dl extends cs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=h9(n,i,o);this._drawStart=a,this._drawCount=l,g9(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:u},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,i),f=o.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,p=da(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none",b=n+r,S=t.length;let C=n>0&&this.getParsed(n-1);for(let x=0;x<S;++x){const k=t[x],w=v?k:{};if(x<n||x>=b){w.skip=!0;continue}const _=this.getParsed(x),O=Ye(_[h]),E=w[f]=o.getPixelForValue(_[f],x),T=w[h]=s||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],x);w.skip=isNaN(E)||isNaN(T)||O,w.stop=x>0&&Math.abs(_[f]-C[f])>p,m&&(w.parsed=_,w.raw=u.data[x]),d&&(w.options=c||this.resolveDataElementOptions(x,k.active?"active":i)),v||this.updateElement(k,x,w,i),C=_}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}pe(Dl,"id","line"),pe(Dl,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pe(Dl,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ll extends cs{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,i){return K9.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],u=this.resolveDataElementOptions(a,l.active?"active":i),c=s.getPointPositionForValue(a,this.getParsed(a).r),d=o?s.xCenter:c.x,f=o?s.yCenter:c.y,h={x:d,y:f,angle:c.angle,skip:isNaN(d)||isNaN(f),options:u};this.updateElement(l,a,h,i)}}}pe(Ll,"id","radar"),pe(Ll,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),pe(Ll,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function ai(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Qf{constructor(t){pe(this,"options");this.options=t||{}}static override(t){Object.assign(Qf.prototype,t)}init(){}formats(){return ai()}parse(){return ai()}format(){return ai()}add(){return ai()}diff(){return ai()}startOf(){return ai()}endOf(){return ai()}}var jk={_date:Qf};function $k(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const u=a._reversePixels?a9:vi;if(r){if(i._sharedOptions){const c=s[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=u(s,t,n-d),h=u(s,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const c=u(s,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,h=f.slice(0,c.lo+1).reverse().findIndex(m=>!Ye(m[d.axis]));c.lo-=Math.max(0,h);const g=f.slice(c.hi).findIndex(m=>!Ye(m[d.axis]));c.hi+=Math.max(0,g)}return c}}return{lo:0,hi:s.length-1}}function Gu(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:u,data:c}=s[a],{lo:d,hi:f}=$k(s[a],t,o,i);for(let h=d;h<=f;++h){const g=c[h];g.skip||r(g,u,h)}}}function Dk(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Ic(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Gu(e,n,t,function(a,l,u){!i&&!hr(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:u})},!0),s}function Lk(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=i9(o,{x:t.x,y:t.y});A2(d,u,c)&&i.push({element:o,datasetIndex:a,index:l})}return Gu(e,n,t,s),i}function Ik(e,t,n,r,i,s){let o=[];const a=Dk(n);let l=Number.POSITIVE_INFINITY;function u(c,d,f){const h=c.inRange(t.x,t.y,i);if(r&&!h)return;const g=c.getCenterPoint(i);if(!(!!s||e.isPointInArea(g))&&!h)return;const p=a(t,g);p<l?(o=[{element:c,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:c,datasetIndex:d,index:f})}return Gu(e,n,t,u),o}function Rc(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?Lk(e,t,n,i):Ik(e,t,n,r,i,s)}function Hg(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Gu(e,n,t,(l,u,c)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:u,index:c}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var Rk={modes:{index(e,t,n,r){const i=fi(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ic(e,i,s,r,o):Rc(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=a[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=fi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ic(e,i,s,r,o):Rc(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,u=e.getDatasetMeta(l).data;a=[];for(let c=0;c<u.length;++c)a.push({element:u[c],datasetIndex:l,index:c})}return a},point(e,t,n,r){const i=fi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Ic(e,i,s,r,o)},nearest(e,t,n,r){const i=fi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Rc(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=fi(t,e);return Hg(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=fi(t,e);return Hg(e,i,"y",n.intersect,r)}}};const W2=["left","top","right","bottom"];function bo(e,t){return e.filter(n=>n.pos===t)}function Ug(e,t){return e.filter(n=>W2.indexOf(n.pos)===-1&&n.box.axis===t)}function xo(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function Nk(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function Fk(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!W2.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function Bk(e,t){const n=Fk(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,u=n[a.stack],c=u&&a.stackWeight/u.weight;a.horizontal?(a.width=c?c*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=c?c*i:l&&t.availableHeight)}return n}function qk(e){const t=Nk(e),n=xo(t.filter(u=>u.box.fullSize),!0),r=xo(bo(t,"left"),!0),i=xo(bo(t,"right")),s=xo(bo(t,"top"),!0),o=xo(bo(t,"bottom")),a=Ug(t,"x"),l=Ug(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:bo(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function Gg(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Q2(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 zk(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!Ie(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[i]+=n.size}s.getPadding&&Q2(o,s.getPadding());const a=Math.max(0,t.outerWidth-Gg(o,e,"left","right")),l=Math.max(0,t.outerHeight-Gg(o,e,"top","bottom")),u=a!==e.w,c=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function Hk(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Uk(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function $o(e,t,n,r){const i=[];let s,o,a,l,u,c;for(s=0,o=e.length,u=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,Uk(a.horizontal,t));const{same:d,other:f}=zk(t,n,a,r);u|=d&&i.length,c=c||f,l.fullSize||i.push(a)}return u&&$o(i,t,n,r)||c}function yl(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function Kg(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,u=r[a.stack]||{placed:0,weight:1},c=a.stackWeight/u.weight||1;if(a.horizontal){const d=t.w*c,f=u.size||l.height;iu(u.start)&&(o=u.start),l.fullSize?yl(l,i.left,o,n.outerWidth-i.right-i.left,f):yl(l,t.left+u.placed,o,d,f),u.start=o,u.placed+=d,o=l.bottom}else{const d=t.h*c,f=u.size||l.width;iu(u.start)&&(s=u.start),l.fullSize?yl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):yl(l,s,t.top+u.placed,f,d),u.start=s,u.placed+=d,s=l.right}}t.x=s,t.y=o}var xn={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 i=Mt(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=qk(e.boxes),l=a.vertical,u=a.horizontal;Qe(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},i);Q2(f,Mt(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=Bk(l.concat(u),d);$o(a.fullSize,h,d,g),$o(l,h,d,g),$o(u,h,d,g)&&$o(l,h,d,g),Hk(h),Kg(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Kg(a.rightAndBottom,h,d,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Qe(a.chartArea,m=>{const p=m.box;Object.assign(p,e.chartArea),p.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Y2{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class Gk extends Y2{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Il="$chartjs",Kk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vg=e=>e===null||e==="";function Vk(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Il]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Vg(i)){const s=$g(e,"width");s!==void 0&&(e.width=s)}if(Vg(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=$g(e,"height");s!==void 0&&(e.height=s)}return e}const X2=ok?{passive:!0}:!1;function Wk(e,t,n){e&&e.addEventListener(t,n,X2)}function Qk(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,X2)}function Yk(e,t){const n=Kk[e.type]||e.type,{x:r,y:i}=fi(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function uu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Xk(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||uu(a.addedNodes,r),o=o&&!uu(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Zk(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||uu(a.removedNodes,r),o=o&&!uu(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const fa=new Map;let Wg=0;function Z2(){const e=window.devicePixelRatio;e!==Wg&&(Wg=e,fa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Jk(e,t){fa.size||window.addEventListener("resize",Z2),fa.set(e,t)}function eO(e){fa.delete(e),fa.size||window.removeEventListener("resize",Z2)}function tO(e,t,n){const r=e.canvas,i=r&&Wf(r);if(!i)return;const s=M2((a,l)=>{const u=i.clientWidth;n(a,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||s(u,c)});return o.observe(i),Jk(e,s),o}function Nc(e,t,n){n&&n.disconnect(),t==="resize"&&eO(e)}function nO(e,t,n){const r=e.canvas,i=M2(s=>{e.ctx!==null&&n(Yk(s,e))},e);return Wk(r,t,i),i}class rO extends Y2{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Vk(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Il])return!1;const r=n[Il].initial;["height","width"].forEach(s=>{const o=r[s];Ye(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[Il],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:Xk,detach:Zk,resize:tO}[n]||nO;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Nc,detach:Nc,resize:Nc}[n]||Qk)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return sk(t,n,r,i)}isAttached(t){const n=t&&Wf(t);return!!(n&&n.isConnected)}}function iO(e){return!Vf()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?Gk:rO}var Ol;let Vi=(Ol=class{constructor(){pe(this,"x");pe(this,"y");pe(this,"active",!1);pe(this,"options");pe(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return da(this.x)&&da(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}},pe(Ol,"defaults",{}),pe(Ol,"defaultRoutes"),Ol);function sO(e,t){const n=e.options.ticks,r=oO(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?lO(t):[],o=s.length,a=s[0],l=s[o-1],u=[];if(o>i)return uO(t,u,s,o/i),u;const c=aO(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(ml(t,u,c,Ye(h)?0:a-h,a),d=0,f=o-1;d<f;d++)ml(t,u,c,s[d],s[d+1]);return ml(t,u,c,l,Ye(h)?t.length:l+h),u}return ml(t,u,c),u}function oO(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function aO(e,t,n){const r=cO(e),i=t.length/n;if(!r)return Math.max(i,1);const s=e9(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function lO(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function uO(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function ml(e,t,n,r,i){const s=De(r,0),o=Math.min(De(i,e.length),e.length);let a=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=s;c<0;)a++,c=Math.round(s+a*n);for(u=Math.max(s,0);u<o;u++)u===c&&(t.push(e[u]),a++,c=Math.round(s+a*n))}function cO(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 dO=e=>e==="left"?"right":e==="right"?"left":e,Qg=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Yg=(e,t)=>Math.min(t||e,e);function Xg(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function fO(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(l-s,o-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(i-1))/2,l+=i<t?u:-u,l<s-a||l>o+a)))return l}function hO(e,t){Qe(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function wo(e){return e.drawTicks?e.tickLength:0}function Zg(e,t){if(!e.display)return 0;const n=mt(e.font,t),r=Mt(e.padding);return(ot(e.text)?e.text.length:1)*n.lineHeight+r.height}function gO(e,t){return ri(e,{scale:t,type:"scale"})}function yO(e,t,n){return ri(e,{tick:n,index:t,type:"tick"})}function mO(e,t,n){let r=qf(e);return(n&&t!=="right"||!n&&t==="right")&&(r=dO(r)),r}function pO(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:u,scales:c}=l;let d=0,f,h,g;const m=o-i,p=a-s;if(e.isHorizontal()){if(h=Ot(r,s,a),Ie(n)){const v=Object.keys(n)[0],b=n[v];g=c[v].getPixelForValue(b)+m-t}else n==="center"?g=(u.bottom+u.top)/2+m-t:g=Qg(e,n,t);f=a-s}else{if(Ie(n)){const v=Object.keys(n)[0],b=n[v];h=c[v].getPixelForValue(b)-p+t}else n==="center"?h=(u.left+u.right)/2-p+t:h=Qg(e,n,t);g=Ot(r,o,i),d=n==="left"?-an:an}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class to extends Vi{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:i}=this;return t=zn(t,Number.POSITIVE_INFINITY),n=zn(n,Number.NEGATIVE_INFINITY),r=zn(r,Number.POSITIVE_INFINITY),i=zn(i,Number.NEGATIVE_INFINITY),{min:zn(t,r),max:zn(n,i),minDefined:bt(t),maxDefined:bt(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,u=a.length;l<u;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:zn(n,zn(r,n)),max:zn(r,zn(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){et(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.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=I9(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Xg(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=sO(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){et(this.options.afterUpdate,[this])}beforeSetDimensions(){et(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){et(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),et(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){et(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=et(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){et(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){et(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Yg(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,u;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),d=c.widest.width,f=c.highest.height,h=bn(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-wo(t.grid)-n.padding-Zg(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),o=Ff(Math.min(Math.asin(bn((c.highest.height+6)/a,-1,1)),Math.asin(bn(l/u,-1,1))-Math.asin(bn(f/u,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){et(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){et(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Zg(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=wo(s)+l):(t.height=this.maxHeight,t.width=wo(s)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Hr(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){const v=r.mirror?0:p*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+v+h)}else{const v=r.mirror?0:m*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+v+h)}this._calculatePadding(u,c,p,m)}}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,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?u?(f=i*t.width,h=r*n.height):(f=r*t.height,h=i*n.width):s==="start"?h=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=t.height/2;s==="start"?(c=0,d=t.height):s==="end"&&(c=n.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){et(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)Ye(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=Xg(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/Yg(n,r));let u=0,c=0,d,f,h,g,m,p,v,b,S,C,x;for(d=0;d<n;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),i.font=p=m.string,v=s[p]=s[p]||{data:{},gc:[]},b=m.lineHeight,S=C=0,!Ye(g)&&!ot(g))S=ou(i,v.data,v.gc,S,g),C=b;else if(ot(g))for(f=0,h=g.length;f<h;++f)x=g[f],!Ye(x)&&!ot(x)&&(S=ou(i,v.data,v.gc,S,x),C+=b);o.push(S),a.push(C),u=Math.max(S,u),c=Math.max(C,c)}hO(s,n);const k=o.indexOf(u),w=a.indexOf(c),_=O=>({width:o[O]||0,height:a[O]||0});return{first:_(0),last:_(n-1),widest:_(k),highest:_(w),widths:o,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 o9(this._alignToPixels?oi(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=yO(this.getContext(),t,r))}return this.$context||(this.$context=gO(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Hr(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=wo(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function(M){return oi(r,M,m)};let b,S,C,x,k,w,_,O,E,T,j,B;if(o==="top")b=v(this.bottom),w=this.bottom-f,O=b-p,T=v(t.top)+p,B=t.bottom;else if(o==="bottom")b=v(this.top),T=t.top,B=v(t.bottom)-p,w=b+p,O=this.top+f;else if(o==="left")b=v(this.right),k=this.right-f,_=b-p,E=v(t.left)+p,j=t.right;else if(o==="right")b=v(this.left),E=t.left,j=v(t.right)-p,k=b+p,_=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Ie(o)){const M=Object.keys(o)[0],D=o[M];b=v(this.chart.scales[M].getPixelForValue(D))}T=t.top,B=t.bottom,w=b+p,O=w+f}else if(n==="y"){if(o==="center")b=v((t.left+t.right)/2);else if(Ie(o)){const M=Object.keys(o)[0],D=o[M];b=v(this.chart.scales[M].getPixelForValue(D))}k=b-p,_=k-f,E=t.left,j=t.right}const R=De(i.ticks.maxTicksLimit,d),A=Math.max(1,Math.ceil(d/R));for(S=0;S<d;S+=A){const M=this.getContext(S),D=s.setContext(M),H=a.setContext(M),Q=D.lineWidth,F=D.color,G=H.dash||[],ie=H.dashOffset,ae=D.tickWidth,N=D.tickColor,le=D.tickBorderDash||[],te=D.tickBorderDashOffset;C=fO(this,S,l),C!==void 0&&(x=oi(r,C,Q),u?k=_=E=j=x:w=O=T=B=x,h.push({tx1:k,ty1:w,tx2:_,ty2:O,x1:E,y1:T,x2:j,y2:B,width:Q,color:F,borderDash:G,borderDashOffset:ie,tickWidth:ae,tickColor:N,tickBorderDash:le,tickBorderDashOffset:te}))}return this._ticksLength=d,this._borderValue=b,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:c,mirror:d}=s,f=wo(r.grid),h=f+c,g=d?-c:h,m=-Hr(this.labelRotation),p=[];let v,b,S,C,x,k,w,_,O,E,T,j,B="middle";if(i==="top")k=this.bottom-g,w=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+g,w=this._getXAxisLabelAlignment();else if(i==="left"){const A=this._getYAxisLabelAlignment(f);w=A.textAlign,x=A.x}else if(i==="right"){const A=this._getYAxisLabelAlignment(f);w=A.textAlign,x=A.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+h;else if(Ie(i)){const A=Object.keys(i)[0],M=i[A];k=this.chart.scales[A].getPixelForValue(M)+h}w=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")x=(t.left+t.right)/2-h;else if(Ie(i)){const A=Object.keys(i)[0],M=i[A];x=this.chart.scales[A].getPixelForValue(M)}w=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?B="top":l==="end"&&(B="bottom"));const R=this._getLabelSizes();for(v=0,b=a.length;v<b;++v){S=a[v],C=S.label;const A=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,O=this._resolveTickFontOptions(v),E=O.lineHeight,T=ot(C)?C.length:1;const M=T/2,D=A.color,H=A.textStrokeColor,Q=A.textStrokeWidth;let F=w;o?(x=_,w==="inner"&&(v===b-1?F=this.options.reverse?"left":"right":v===0?F=this.options.reverse?"right":"left":F="center"),i==="top"?u==="near"||m!==0?j=-T*E+E/2:u==="center"?j=-R.highest.height/2-M*E+E:j=-R.highest.height+E/2:u==="near"||m!==0?j=E/2:u==="center"?j=R.highest.height/2-M*E:j=R.highest.height-T*E,d&&(j*=-1),m!==0&&!A.showLabelBackdrop&&(x+=E/2*Math.sin(m))):(k=_,j=(1-T)*E/2);let G;if(A.showLabelBackdrop){const ie=Mt(A.backdropPadding),ae=R.heights[v],N=R.widths[v];let le=j-ie.top,te=0-ie.left;switch(B){case"middle":le-=ae/2;break;case"bottom":le-=ae;break}switch(w){case"center":te-=N/2;break;case"right":te-=N;break;case"inner":v===b-1?te-=N:v>0&&(te-=N/2);break}G={left:te,top:le,width:N+ie.width,height:ae+ie.height,color:A.backdropColor}}p.push({label:C,font:O,textOffset:j,options:{rotation:m,color:D,strokeColor:H,strokeWidth:Q,textAlign:F,textBaseline:B,translation:[x,k],backdrop:G}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Hr(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let u,c;return n==="left"?i?(c=this.right+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_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:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];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:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,d,f;this.isHorizontal()?(u=oi(t,this.left,o)-o/2,c=oi(t,this.right,a)+a/2,d=f=l):(d=oi(t,this.top,o)-o/2,f=oi(t,this.bottom,a)+a/2,u=c=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(u,d),n.lineTo(c,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&zu(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,u=o.label,c=o.textOffset;Ni(r,u,0,c,l,a)}i&&Hu(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=mt(r.font),o=Mt(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||Ie(n)?(l+=o.bottom,ot(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:f}=pO(this,l,n,a);Ni(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:mO(a,n,i),textBaseline:"middle",translation:[u,c]})}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=De(t.grid&&t.grid.z,-1),i=De(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==to.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return mt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class pl{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;xO(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,vO(t,o,r),this.override&&ct.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in ct[i]&&(delete ct[i][r],this.override&&delete Ri[r])}}function vO(e,t,n){const r=ua(Object.create(null),[n?ct.get(n):{},ct.get(t),e.defaults]);ct.set(t,r),e.defaultRoutes&&bO(t,e.defaultRoutes),e.descriptors&&ct.describe(t,e.descriptors)}function bO(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ct.route(s,i,l,a)})}function xO(e){return"id"in e&&"defaults"in e}class wO{constructor(){this.controllers=new pl(cs,"datasets",!0),this.elements=new pl(Vi,"elements"),this.plugins=new pl(Object,"plugins"),this.scales=new pl(to,"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(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):Qe(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=Nf(t);et(r["before"+i],[],r),n[t](r),et(r["after"+i],[],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 i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Gn=new wO;class SO{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(et(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Ye(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,i=De(r.options&&r.options.plugins,{}),s=CO(r);return i===!1&&!n?[]:kO(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function CO(e){const t={},n=[],r=Object.keys(Gn.plugins.items);for(let s=0;s<r.length;s++)n.push(Gn.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function _O(e,t){return!t&&e===!1?null:e===!0?{}:e}function kO(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,u=_O(r[l],i);u!==null&&s.push({plugin:a,options:OO(e.config,{plugin:a,local:n[l]},u,o)})}return s}function OO(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Bd(e,t){const n=ct.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function EO(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function AO(e,t){return e===t?"_index_":"_value_"}function Jg(e){if(e==="x"||e==="y"||e==="r")return e}function PO(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function qd(e,...t){if(Jg(e))return e;for(const n of t){const r=n.axis||PO(n.position)||e.length>1&&Jg(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ey(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function TO(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 ey(e,"x",n[0])||ey(e,"y",n[0])}return{}}function MO(e,t){const n=Ri[e.type]||{scales:{}},r=t.scales||{},i=Bd(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Ie(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=qd(o,a,TO(o,e),ct.scales[a.type]),u=AO(l,i),c=n.scales||{};s[o]=zo(Object.create(null),[{axis:l},a,c[l],c[u]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||Bd(a,t),c=(Ri[a]||{}).scales||{};Object.keys(c).forEach(d=>{const f=EO(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),zo(s[h],[{axis:f},r[h],c[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];zo(a,[ct.scales[a.type],ct.scale])}),s}function J2(e){const t=e.options||(e.options={});t.plugins=De(t.plugins,{}),t.scales=MO(e,t)}function eb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function jO(e){return e=e||{},e.data=eb(e.data),J2(e),e}const ty=new Map,tb=new Set;function vl(e,t){let n=ty.get(e);return n||(n=t(),ty.set(e,n),tb.add(n)),n}const So=(e,t,n)=>{const r=ca(t,n);r!==void 0&&e.add(r)};class $O{constructor(t){this._config=jO(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=eb(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(),J2(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return vl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return vl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return vl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return vl(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(c=>{t&&(l.add(t),c.forEach(d=>So(l,t,d))),c.forEach(d=>So(l,i,d)),c.forEach(d=>So(l,Ri[s]||{},d)),c.forEach(d=>So(l,ct,d)),c.forEach(d=>So(l,Nd,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),tb.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ri[n]||{},ct.datasets[n]||{},{type:n},ct,Nd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=ny(this._resolverCache,t,i);let l=o;if(LO(o,n)){s.$shared=!1,r=Xr(r)?r():r;const u=this.createResolver(t,r,a);l=Us(o,r,u)}for(const u of n)s[u]=l[u];return s}createResolver(t,n,r=[""],i){const{resolver:s}=ny(this._resolverCache,t,r);return Ie(n)?Us(s,n,void 0,i):s}}function ny(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:Uf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const DO=e=>Ie(e)&&Object.getOwnPropertyNames(e).some(t=>Xr(e[t]));function LO(e,t){const{isScriptable:n,isIndexable:r}=L2(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(Xr(a)||DO(a))||o&&ot(a))return!0}return!1}var IO="4.5.0";const RO=["top","bottom","left","right","chartArea"];function ry(e,t){return e==="top"||e==="bottom"||RO.indexOf(e)===-1&&t==="x"}function iy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function sy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),et(n&&n.onComplete,[e],t)}function NO(e){const t=e.chart,n=t.options.animation;et(n&&n.onProgress,[e],t)}function nb(e){return Vf()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Rl={},oy=e=>{const t=nb(e);return Object.values(Rl).filter(n=>n.canvas===t).pop()};function FO(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function BO(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var Tr;let Ku=(Tr=class{static register(...t){Gn.add(...t),ay()}static unregister(...t){Gn.remove(...t),ay()}constructor(t,n){const r=this.config=new $O(n),i=nb(t),s=oy(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||iO(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,u=l&&l.height,c=l&&l.width;if(this.id=G7(),this.ctx=a,this.canvas=l,this.width=c,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new SO,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=d9(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Rl[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}or.listen(this,"complete",sy),or.listen(this,"progress",NO),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return Ye(t)?n&&s?s:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Gn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():jg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Pg(this.canvas,this.ctx),this}stop(){return or.stop(this),this}resize(t,n){or.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,jg(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),et(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qe(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=qd(o,a),u=l==="r",c=l==="x";return{options:a,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),Qe(s,o=>{const a=o.options,l=a.id,u=qd(l,a),c=De(a.type,o.dtype);(a.position===void 0||ry(a.position,u)!==ry(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const f=Gn.getScale(c);d=new f({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qe(i,(o,a)=>{o||delete r[a]}),Qe(r,o=>{xn.configure(this,o,o.options),xn.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(iy("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||Bd(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Gn.getController(a),{datasetElementType:u,dataElementType:c}=ct.datasets[a];Object.assign(l,{dataElementType:Gn.getElement(c),datasetElementType:u&&Gn.getElement(u)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Qe(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()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),f=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||Qe(s,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(iy("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qe(this.scales,t=>{xn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!xg(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;FO(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!xg(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Qe(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),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,Xr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(or.has(this)?this.attached&&!or.running(this)&&or.start(this):(this.draw(),sy({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}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 i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}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={meta:t,index:t.index,cancelable:!0},i=G2(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&zu(n,i),t.controller.draw(),i&&Hu(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return hr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=Rk.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={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(i)),i}getContext(){return this.$context||(this.$context=ri(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 i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);iu(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i: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(),or.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(),Pg(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Rl[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=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};Qe(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),t[l]=u},i=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},s=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Qe(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Qe(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!nu(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 i=this.options.hover,s=(l,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=X7(t),u=BO(t,this._lastEvent,r,l);r&&(this._lastEvent=null,et(s.onHover,[t,a,this],this),l&&et(s.onClick,[t,a,this],this));const c=!nu(a,i);return(c||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=u,c}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}},pe(Tr,"defaults",ct),pe(Tr,"instances",Rl),pe(Tr,"overrides",Ri),pe(Tr,"registry",Gn),pe(Tr,"version",IO),pe(Tr,"getChart",oy),Tr);function ay(){return Qe(Ku.instances,e=>e._plugins.invalidate())}function rb(e,t,n=t){e.lineCap=De(n.borderCapStyle,t.borderCapStyle),e.setLineDash(De(n.borderDash,t.borderDash)),e.lineDashOffset=De(n.borderDashOffset,t.borderDashOffset),e.lineJoin=De(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=De(n.borderWidth,t.borderWidth),e.strokeStyle=De(n.borderColor,t.borderColor)}function qO(e,t,n){e.lineTo(n.x,n.y)}function zO(e){return e.stepped?O9:e.tension||e.cubicInterpolationMode==="monotone"?E9:qO}function ib(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),u=Math.min(s,a),c=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:u<l&&!c?r+u-l:u-l}}function HO(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:u}=ib(i,n,r),c=zO(s);let{move:d=!0,reverse:f}=r||{},h,g,m;for(h=0;h<=u;++h)g=i[(a+(f?u-h:h))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):c(e,m,g,f,s.stepped),m=g);return l&&(g=i[(a+(f?u:0))%o],c(e,m,g,f,s.stepped)),!!l}function UO(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=ib(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,d=0,f,h,g,m,p,v;const b=C=>(o+(u?a-C:C))%s,S=()=>{m!==p&&(e.lineTo(c,p),e.lineTo(c,m),e.lineTo(c,v))};for(l&&(h=i[b(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=i[b(f)],h.skip)continue;const C=h.x,x=h.y,k=C|0;k===g?(x<m?m=x:x>p&&(p=x),c=(d*c+C)/++d):(S(),e.lineTo(C,x),g=k,d=0,m=p=x),v=x}S()}function zd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?UO:HO}function GO(e){return e.stepped?ak:e.tension||e.cubicInterpolationMode==="monotone"?lk:hi}function KO(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),rb(e,t.options),e.stroke(i)}function VO(e,t,n,r){const{segments:i,options:s}=t,o=zd(t);for(const a of i)rb(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const WO=typeof Path2D=="function";function QO(e,t,n,r){WO&&!t.options.segment?KO(e,t,n,r):VO(e,t,n,r)}class Ur extends Vi{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 i=r.spanGaps?this._loop:this._fullLoop;J9(this._points,r,t,i,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=gk(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,i=t[n],s=this.points,o=U2(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=GO(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:d,end:f}=o[u],h=s[d],g=s[f];if(h===g){a.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),p=l(h,g,m,r.stepped);p[n]=t[n],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,n,r){return zd(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=zd(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),QO(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}pe(Ur,"id","line"),pe(Ur,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),pe(Ur,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),pe(Ur,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ly(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Nl extends Vi{constructor(n){super();pe(this,"parsed");pe(this,"skip");pe(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,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return ly(this,n,"x",r)}inYRange(n,r){return ly(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!hr(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Fd(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}pe(Nl,"id","point"),pe(Nl,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),pe(Nl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function YO(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:u}=a;u=Vu(l,u,i);const c=Hd(n,i[l],i[u],a.loop);if(!t.segments){o.push({source:a,target:c,start:i[l],end:i[u]});continue}const d=U2(t,c);for(const f of d){const h=Hd(n,s[f.start],s[f.end],f.loop),g=H2(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:uy(c,h,"start",Math.max)},end:{[n]:uy(c,h,"end",Math.min)}})}}return o}function Hd(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=rn(i),s=rn(s)),{property:e,start:i,end:s}}function XO(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Vu(o,a,i);const l=i[o],u=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:u.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:u.y}))}),s}function Vu(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function uy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function sb(e,t){let n=[],r=!1;return ot(e)?(r=!0,n=e):n=XO(e,t),n.length?new Ur({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function cy(e){return e&&e.fill!==!1}function ZO(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!bt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function JO(e,t,n){const r=rE(e);if(Ie(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return bt(i)&&Math.floor(i)===i?eE(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function eE(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function tE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Ie(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function nE(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Ie(e)?r=e.value:r=t.getBaseValue(),r}function rE(e){const t=e.options,n=t.fill;let r=De(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function iE(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=sE(t,n);a.push(sb({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const u=s[l];for(let c=u.start;c<=u.end;c++)oE(i,o[c],a)}return new Ur({points:i,options:{}})}function sE(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function oE(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=aE(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function aE(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let u=0;u<s.length;u++){const c=s[u],d=o[c.start][n],f=o[c.end][n];if(as(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class ob{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:ln},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function lE(e){const{chart:t,fill:n,line:r}=e;if(bt(n))return uE(t,n);if(n==="stack")return iE(e);if(n==="shape")return!0;const i=cE(e);return i instanceof ob?i:sb(i,r)}function uE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function cE(e){return(e.scale||{}).getPointPositionForValue?fE(e):dE(e)}function dE(e){const{scale:t={},fill:n}=e,r=tE(n,t);if(bt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function fE(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=nE(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new ob({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function Fc(e,t,n){const r=lE(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,u=o.options,c=u.fill,d=u.backgroundColor,{above:f=d,below:h=d}=c||{},g=i.getDatasetMeta(s),m=G2(i,g);r&&o.points.length&&(zu(e,n),hE(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),Hu(e))}function hE(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,u=n._loop?"angle":t.axis;e.save();let c=s;s!==i&&(u==="x"?(dy(e,r,o.top),Bc(e,{line:n,target:r,color:i,scale:a,property:u,clip:l}),e.restore(),e.save(),dy(e,r,o.bottom)):u==="y"&&(fy(e,r,o.left),Bc(e,{line:n,target:r,color:s,scale:a,property:u,clip:l}),e.restore(),e.save(),fy(e,r,o.right),c=i)),Bc(e,{line:n,target:r,color:c,scale:a,property:u,clip:l}),e.restore()}function dy(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:u}=a,c=i[l],d=i[Vu(l,u,i)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function fy(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:u}=a,c=i[l],d=i[Vu(l,u,i)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(n,c.y),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Bc(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=YO(n,r,i);for(const{source:u,target:c,start:d,end:f}of l){const{style:{backgroundColor:h=s}={}}=u,g=r!==!0;e.save(),e.fillStyle=h,gE(e,o,a,g&&Hd(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,u);let p;if(g){m?e.closePath():hy(e,r,f,i);const v=!!r.pathSegment(e,c,{move:m,reverse:!0});p=m&&v,p||hy(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function gE(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,u,c,d;s==="x"?(l=o,u=i.top,c=a,d=i.bottom):(l=i.left,u=o,c=i.right,d=a),e.beginPath(),n&&(l=Math.max(l,n.left),c=Math.min(c,n.right),u=Math.max(u,n.top),d=Math.min(d,n.bottom)),e.rect(l,u,c-l,d-u),e.clip()}}function hy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var yE={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Ur&&(l={visible:e.isDatasetVisible(o),index:o,fill:JO(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=ZO(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&Fc(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;cy(s)&&Fc(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!cy(r)||n.drawTime!=="beforeDatasetDraw"||Fc(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const gy=(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)}},mE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class yy extends Vi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=et(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,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,i=mt(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=gy(r,s);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,s,a,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,a,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+a;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,h=-c;return this.legendItems.forEach((g,m)=>{const p=r+n/2+s.measureText(g.text).width;(m===0||u[u.length-1]+p+2*a>o)&&(d+=c,u[u.length-(m>0?0:1)]=0,h+=c,f++),l[m]={left:0,top:h,row:f,width:p,height:i},u[u.length-1]+=p+a}),d}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let d=a,f=0,h=0,g=0,m=0;return this.legendItems.forEach((p,v)=>{const{itemWidth:b,itemHeight:S}=pE(r,n,s,p,i);v>0&&h+S+2*a>c&&(d+=f+a,u.push({width:f,height:h}),g+=f+a,m++,f=h=0),l[v]={left:g,top:h,col:m,width:b,height:S},f=Math.max(f,b),h+=S+a}),d+=f,u.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=us(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ot(r,this.left+i,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=Ot(r,this.left+i,this.right-this.lineWidths[a])),u.top+=this.top+t+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let a=0,l=Ot(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=Ot(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;zu(t,this),this._draw(),Hu(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=ct.color,l=us(t.rtl,this.left,this.width),u=mt(o.font),{padding:c}=o,d=u.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=gy(o,d),v=function(k,w,_){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const O=De(_.lineWidth,1);if(i.fillStyle=De(_.fillStyle,a),i.lineCap=De(_.lineCap,"butt"),i.lineDashOffset=De(_.lineDashOffset,0),i.lineJoin=De(_.lineJoin,"miter"),i.lineWidth=O,i.strokeStyle=De(_.strokeStyle,a),i.setLineDash(De(_.lineDash,[])),o.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},T=l.xPlus(k,g/2),j=w+f;$2(i,E,T,j,o.pointStyleWidth&&g)}else{const E=w+Math.max((d-m)/2,0),T=l.leftForLtr(k,g),j=ls(_.borderRadius);i.beginPath(),Object.values(j).some(B=>B!==0)?au(i,{x:T,y:E,w:g,h:m,radius:j}):i.rect(T,E,g,m),i.fill(),O!==0&&i.stroke()}i.restore()},b=function(k,w,_){Ni(i,_.text,k,w+p/2,u,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},S=this.isHorizontal(),C=this._computeTitleHeight();S?h={x:Ot(s,this.left+c,this.right-r[0]),y:this.top+c+C,line:0}:h={x:this.left+c,y:Ot(s,this.top+C+c,this.bottom-n[0].height),line:0},B2(this.ctx,t.textDirection);const x=p+c;this.legendItems.forEach((k,w)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const _=i.measureText(k.text).width,O=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),E=g+f+_;let T=h.x,j=h.y;l.setWidth(this.width),S?w>0&&T+E+c>this.right&&(j=h.y+=x,h.line++,T=h.x=Ot(s,this.left+c,this.right-r[h.line])):w>0&&j+x>this.bottom&&(T=h.x=T+n[h.line].width+c,h.line++,j=h.y=Ot(s,this.top+C+c,this.bottom-n[h.line].height));const B=l.x(T);if(v(B,j,k),T=f9(O,T+g+f,S?T+E:this.right,t.rtl),b(l.x(T),j,k),S)h.x+=E+c;else if(typeof k.text!="string"){const R=u.lineHeight;h.y+=ab(k,R)+c}else h.y+=x}),q2(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=mt(n.font),i=Mt(n.padding);if(!n.display)return;const s=us(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,u=i.top+l;let c,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),c=this.top+u,d=Ot(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);c=u+Ot(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=Ot(a,d,d+f);o.textAlign=s.textAlign(qf(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Ni(o,n.text,h,c,r)}_computeTitleHeight(){const t=this.options.title,n=mt(t.font),r=Mt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(as(t,this.left,this.right)&&as(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],as(t,i.left,i.left+i.width)&&as(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!xE(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=mE(i,r);i&&!s&&et(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&et(n.onHover,[t,r,this],this)}else r&&et(n.onClick,[t,r,this],this)}}function pE(e,t,n,r,i){const s=vE(r,e,t,n),o=bE(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function vE(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function bE(e,t,n){let r=e;return typeof t.text!="string"&&(r=ab(t,n)),r}function ab(e,t){const n=e.text?e.text.length:0;return t*n}function xE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var wE={id:"legend",_element:yy,start(e,t,n){const r=e.legend=new yy({ctx:e.ctx,options:n,chart:e});xn.configure(e,r,n),xn.addBox(e,r)},stop(e){xn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;xn.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,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.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:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),c=Mt(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:o&&(a||u.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class lb extends Vi{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 i=ot(r.text)?r.text.length:1;this._padding=Mt(r.padding);const s=i*mt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,u,c,d;return this.isHorizontal()?(c=Ot(a,r,s),d=n+t,u=s-r):(o.position==="left"?(c=r+t,d=Ot(a,i,n),l=ht*-.5):(c=s-t,d=Ot(a,n,i),l=ht*.5),u=i-n),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=mt(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(s);Ni(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:qf(n.align),textBaseline:"middle",translation:[o,a]})}}function SE(e,t){const n=new lb({ctx:e.ctx,options:t,chart:e});xn.configure(e,n,t),xn.addBox(e,n),e.titleBlock=n}var CE={id:"title",_element:lb,start(e,t,n){SE(e,n)},stop(e){const t=e.titleBlock;xn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;xn.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 Do={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=Rd(t,u);c<i&&(i=c,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Un(e,t){return t&&(ot(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ar(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
66
66
|
`)>-1?e.split(`
|
|
67
67
|
`):e}function _E(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function my(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=mt(t.bodyFont),u=mt(t.titleFont),c=mt(t.footerFont),d=s.length,f=i.length,h=r.length,g=Mt(t.padding);let m=g.height,p=0,v=r.reduce((C,x)=>C+x.before.length+x.lines.length+x.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*u.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*C+(v-h)*l.lineHeight+(v-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*c.lineHeight+(f-1)*t.footerSpacing);let b=0;const S=function(C){p=Math.max(p,n.measureText(C).width+b)};return n.save(),n.font=u.string,Qe(e.title,S),n.font=l.string,Qe(e.beforeBody.concat(e.afterBody),S),b=t.displayColors?o+2+t.boxPadding:0,Qe(r,C=>{Qe(C.before,S),Qe(C.lines,S),Qe(C.after,S)}),b=0,n.font=c.string,Qe(e.footer,S),n.restore(),p+=g.width,{width:p,height:m}}function kE(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function OE(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function EE(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let u="center";return r==="center"?u=i<=(a+l)/2?"left":"right":i<=s/2?u="left":i>=o-s/2&&(u="right"),OE(u,e,t,n)&&(u="center"),u}function py(e,t,n){const r=n.yAlign||t.yAlign||kE(e,n);return{xAlign:n.xAlign||t.xAlign||EE(e,t,n,r),yAlign:r}}function AE(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function PE(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function vy(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,u=i+s,{topLeft:c,topRight:d,bottomLeft:f,bottomRight:h}=ls(o);let g=AE(t,a);const m=PE(t,l,u);return l==="center"?a==="left"?g+=u:a==="right"&&(g-=u):a==="left"?g-=Math.max(c,f)+i:a==="right"&&(g+=Math.max(d,h)+i),{x:bn(g,0,r.width-t.width),y:bn(m,0,r.height-t.height)}}function bl(e,t,n){const r=Mt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function by(e){return Un([],ar(e))}function TE(e,t,n){return ri(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function xy(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const ub={beforeTitle:rr,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:rr,beforeBody:rr,beforeLabel:rr,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 Ye(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:rr,afterBody:rr,beforeFooter:rr,footer:rr,afterFooter:rr};function Rt(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?ub[t].call(n,r):i}class Ud extends Vi{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()),i=r.enabled&&n.options.animation&&r.animations,s=new K2(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=TE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Rt(r,"beforeTitle",this,t),s=Rt(r,"title",this,t),o=Rt(r,"afterTitle",this,t);let a=[];return a=Un(a,ar(i)),a=Un(a,ar(s)),a=Un(a,ar(o)),a}getBeforeBody(t,n){return by(Rt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Qe(t,s=>{const o={before:[],lines:[],after:[]},a=xy(r,s);Un(o.before,ar(Rt(a,"beforeLabel",this,s))),Un(o.lines,Rt(a,"label",this,s)),Un(o.after,ar(Rt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return by(Rt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Rt(r,"beforeFooter",this,t),s=Rt(r,"footer",this,t),o=Rt(r,"afterFooter",this,t);let a=[];return a=Un(a,ar(i)),a=Un(a,ar(s)),a=Un(a,ar(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(_E(this.chart,n[l]));return t.filter&&(a=a.filter((c,d,f)=>t.filter(c,d,f,r))),t.itemSort&&(a=a.sort((c,d)=>t.itemSort(c,d,r))),Qe(a,c=>{const d=xy(t.callbacks,c);i.push(Rt(d,"labelColor",this,c)),s.push(Rt(d,"labelPointStyle",this,c)),o.push(Rt(d,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=Do[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=my(this,r),u=Object.assign({},a,l),c=py(this.chart,r,u),d=vy(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,s={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:d}=ls(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,v,b,S,C,x;return s==="center"?(C=h+m/2,i==="left"?(p=f,v=p-o,S=C+o,x=C-o):(p=f+g,v=p+o,S=C-o,x=C+o),b=p):(i==="left"?v=f+Math.max(l,c)+o:i==="right"?v=f+g-Math.max(u,d)-o:v=this.caretX,s==="top"?(S=h,C=S-o,p=v-o,b=v+o):(S=h+m,C=S+o,p=v+o,b=v-o),x=S),{x1:p,x2:v,x3:b,y1:S,y2:C,y3:x}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const u=us(r.rtl,this.x,this.width);for(t.x=bl(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=mt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],u.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=s,c=mt(s.bodyFont),d=bl(this,"left",s),f=i.x(d),h=l<c.lineHeight?(c.lineHeight-l)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=i.leftForLtr(f,u)+u/2,v=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Fd(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Fd(t,m,p,v)}else{t.lineWidth=Ie(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(f,u),p=i.leftForLtr(i.xPlus(f,1),u-2),v=ls(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,au(t,{x:m,y:g,w:u,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),au(t,{x:p,y:g+1,w:u-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,g,u,l),t.strokeRect(m,g,u,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,u-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:c}=r,d=mt(r.bodyFont);let f=d.lineHeight,h=0;const g=us(r.rtl,this.x,this.width),m=function(_){n.fillText(_,g.x(t.x+h),t.y+f/2),t.y+=f+s},p=g.textAlign(o);let v,b,S,C,x,k,w;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=bl(this,p,r),n.fillStyle=r.bodyColor,Qe(this.beforeBody,m),h=a&&p!=="right"?o==="center"?u/2+c:u+2+c:0,C=0,k=i.length;C<k;++C){for(v=i[C],b=this.labelTextColors[C],n.fillStyle=b,Qe(v.before,m),S=v.lines,a&&S.length&&(this._drawColorBox(n,t,C,g,r),f=Math.max(d.lineHeight,l)),x=0,w=S.length;x<w;++x)m(S[x]),f=d.lineHeight;Qe(v.after,m)}h=0,f=d.lineHeight,Qe(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=us(r.rtl,this.x,this.width);for(t.x=bl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=mt(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:u,height:c}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:g}=ls(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+u-f,l),n.quadraticCurveTo(a+u,l,a+u,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+u,l+c-g),n.quadraticCurveTo(a+u,l+c,a+u-g,l+c),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+c),n.quadraticCurveTo(a,l+c,a,l+c-h),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=Do[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=my(this,t),l=Object.assign({},o,this._size),u=py(n,t,l),c=vy(t,l,u,n);(i._to!==c.x||s._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Mt(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(s,t,i,n),B2(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),q2(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),s=!nu(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!nu(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=Do[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}pe(Ud,"positioners",Do);var ME={id:"tooltip",_element:Ud,positioners:Do,afterInit(e,t,n){n&&(e.tooltip=new Ud({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:ub},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"]};const jE=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function $E(e,t,n,r){const i=e.indexOf(t);if(i===-1)return jE(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const DE=(e,t)=>e===null?null:bn(Math.round(e),0,t);function wy(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Gd extends to{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:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:$E(r,t,De(n,t),this._addedLabels),DE(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return wy.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}}pe(Gd,"id","category"),pe(Gd,"defaults",{ticks:{callback:wy}});function LE(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:f}=e,h=s||1,g=c-1,{min:m,max:p}=t,v=!Ye(o),b=!Ye(a),S=!Ye(u),C=(p-m)/(d+1);let x=Sg((p-m)/g/h)*h,k,w,_,O;if(x<1e-14&&!v&&!b)return[{value:m},{value:p}];O=Math.ceil(p/x)-Math.floor(m/x),O>g&&(x=Sg(O*x/g/h)*h),Ye(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),i==="ticks"?(w=Math.floor(m/x)*x,_=Math.ceil(p/x)*x):(w=m,_=p),v&&b&&s&&n9((a-o)/s,x/1e3)?(O=Math.round(Math.min((a-o)/x,c)),x=(a-o)/O,w=o,_=a):S?(w=v?o:w,_=b?a:_,O=u-1,x=(_-w)/O):(O=(_-w)/x,Ho(O,Math.round(O),x/1e3)?O=Math.round(O):O=Math.ceil(O));const E=Math.max(Cg(x),Cg(w));k=Math.pow(10,Ye(l)?E:l),w=Math.round(w*k)/k,_=Math.round(_*k)/k;let T=0;for(v&&(f&&w!==o?(n.push({value:o}),w<o&&T++,Ho(Math.round((w+T*x)*k)/k,o,Sy(o,C,e))&&T++):w<o&&T++);T<O;++T){const j=Math.round((w+T*x)*k)/k;if(b&&j>a)break;n.push({value:j})}return b&&f&&_!==a?n.length&&Ho(n[n.length-1].value,a,Sy(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function Sy(e,t,{horizontal:n,minRotation:r}){const i=Hr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Kd extends to{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 Ye(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:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=Hs(i),u=Hs(s);l<0&&u<0?a(0):l>0&&u>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={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},s=this._range||this,o=LE(i,s);return t.bounds==="ticks"&&r9(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return j2(t,this.chart.options.locale,this.options.ticks.format)}}class Vd extends Kd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=bt(t)?t:0,this.max=bt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Hr(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}pe(Vd,"id","linear"),pe(Vd,"defaults",{ticks:{callback:Hf.formatters.numeric}});function Wd(e){const t=e.ticks;if(t.display&&e.display){const n=Mt(t.backdropPadding);return De(t.font&&t.font.size,ct.font.size)+n.height}return 0}function IE(e,t,n){return n=ot(n)?n:[n],{w:k9(e,t.string,n),h:n.length*t.lineHeight}}function Cy(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function RE(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=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ht/s:0;for(let l=0;l<s;l++){const u=o.setContext(e.getPointLabelContext(l));i[l]=u.padding;const c=e.getPointPosition(l,e.drawingArea+i[l],a),d=mt(u.font),f=IE(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=rn(e.getIndexAngle(l)+a),g=Math.round(Ff(h)),m=Cy(g,c.x,f.w,0,180),p=Cy(g,c.y,f.h,90,270);NE(n,t,h,m,p)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=qE(e,r,i)}function NE(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function FE(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),u=Math.round(Ff(rn(l.angle+an))),c=UE(l.y,a.h,u),d=zE(u),f=HE(l.x,a.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:f,top:c,right:f+a.w,bottom:c+a.h}}function BE(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(hr({x:n,y:r},t)||hr({x:n,y:s},t)||hr({x:i,y:r},t)||hr({x:i,y:s},t))}function qE(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:Wd(s)/2,additionalAngle:o?ht/i:0};let u;for(let c=0;c<i;c++){l.padding=n[c],l.size=t[c];const d=FE(e,c,l);r.push(d),a==="auto"&&(d.visible=BE(d,u),d.visible&&(u=d))}return r}function zE(e){return e===0||e===180?"center":e<180?"left":"right"}function HE(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function UE(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function GE(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Ye(a)){const l=ls(t.borderRadius),u=Mt(t.backdropPadding);e.fillStyle=a;const c=r-u.left,d=i-u.top,f=s-r+u.width,h=o-i+u.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),au(e,{x:c,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(c,d,f,h)}}function KE(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));GE(n,o,s);const a=mt(o.font),{x:l,y:u,textAlign:c}=s;Ni(n,e._pointLabels[i],l,u+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}function cb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ln);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function VE(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),cb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function WE(e,t,n){return ri(e,{label:n,index:t,type:"pointLabel"})}class Lo extends Kd{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=Mt(Wd(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=bt(t)&&!isNaN(t)?t:0,this.max=bt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Wd(this.options))}generateTickLabels(t){Kd.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=et(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?RE(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ln/(this._pointLabels.length||1),r=this.options.startAngle||0;return rn(t*n+Hr(r))}getDistanceFromCenterForValue(t){if(Ye(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(Ye(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 WE(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-an+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}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:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),cb(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:i,border:s}=n,o=this._pointLabels.length;let a,l,u;if(n.pointLabels.display&&KE(this,o),i.display&&this.ticks.forEach((c,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const f=this.getContext(d),h=i.setContext(f),g=s.setContext(f);VE(this,h,l,o,g)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const c=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=c;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),u=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const u=r.setContext(this.getContext(l)),c=mt(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=c.string,o=t.measureText(a.label).width,t.fillStyle=u.backdropColor;const d=Mt(u.backdropPadding);t.fillRect(-o/2-d.left,-s-c.size/2-d.top,o+d.width,c.size+d.height)}Ni(t,a.label,0,-s,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}pe(Lo,"id","radialLinear"),pe(Lo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Hf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),pe(Lo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),pe(Lo,"descriptors",{angleLines:{_fallback:"grid"}});const Wu={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}},qt=Object.keys(Wu);function _y(e,t){return e-t}function ky(e,t){if(Ye(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),bt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(da(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function Oy(e,t,n,r){const i=qt.length;for(let s=qt.indexOf(e);s<i-1;++s){const o=Wu[qt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return qt[s]}return qt[i-1]}function QE(e,t,n,r,i){for(let s=qt.length-1;s>=qt.indexOf(n);s--){const o=qt[s];if(Wu[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return qt[n?qt.indexOf(n):0]}function YE(e){for(let t=qt.indexOf(e)+1,n=qt.length;t<n;++t)if(Wu[qt[t]].common)return qt[t]}function Ey(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Bf(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function XE(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function Ay(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:XE(e,r,i,n)}class cu extends to{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={}),i=this._adapter=new jk._date(t.adapters.date);i.init(n),zo(r.displayFormats,i.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:ky(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:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!a&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=bt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=bt(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_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,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=l9(i,s,o);return this._unit=n.unit||(r.autoSkip?Oy(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):QE(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:YE(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),Ay(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=bn(n,0,o),r=bn(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||Oy(s.minUnit,n,r,this._getLabelCapacity(n)),a=De(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,u=da(l)||l===!0,c={};let d=n,f,h;if(u&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,u?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,o),h++)Ey(c,f,g);return(f===r||i.bounds==="ticks"||h===1)&&Ey(c,f,g),Object.keys(c).sort(_y).map(m=>+m)}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 i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return et(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&a[l],d=u&&a[u],f=r[n],h=u&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:c))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.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,i=Hr(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,Ay(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[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 i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(ky(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return c9(t.sort(_y))}}pe(cu,"id","time"),pe(cu,"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 xl(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=vi(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=vi(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const u=o-s;return u?a+(l-a)*(t-s)/u:a}class Py extends cu{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=xl(n,this.min),this._tableRange=xl(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,u,c;for(o=0,a=t.length;o<a;++o)u=t[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&s.push({time:u,pos:o/(a-1)});return s}_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((i,s)=>i-s)}_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(xl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return xl(this._table,r*this._tableRange+this._minPos,!0)}}pe(Py,"id","timeseries"),pe(Py,"defaults",cu.defaults);const db="label";function Ty(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function ZE(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function fb(e,t){e.labels=t}function hb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:db;const r=[];e.datasets=t.map(i=>{const s=e.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function JE(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:db;const n={labels:[],datasets:[]};return fb(n,e.labels),hb(n,e.datasets,t),n}function eA(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:u=[],fallbackContent:c,updateMode:d,...f}=e,h=z.useRef(null),g=z.useRef(null),m=()=>{h.current&&(g.current=new Ku(h.current,{type:o,data:JE(a,s),options:l&&{...l},plugins:u}),Ty(t,g.current))},p=()=>{Ty(t,null),g.current&&(g.current.destroy(),g.current=null)};return z.useEffect(()=>{!i&&g.current&&l&&ZE(g.current,l)},[i,l]),z.useEffect(()=>{!i&&g.current&&fb(g.current.config.data,a.labels)},[i,a.labels]),z.useEffect(()=>{!i&&g.current&&a.datasets&&hb(g.current.config.data,a.datasets,s)},[i,a.datasets]),z.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,a.labels,a.datasets,d]),z.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),z.useEffect(()=>(m(),()=>p()),[]),z.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},c)}const tA=z.forwardRef(eA);function gb(e,t){return Ku.register(t),z.forwardRef((n,r)=>z.createElement(tA,{...n,ref:r,type:e}))}const nA=gb("line",Dl),rA=gb("radar",Ll);Ku.register(Gd,Vd,Lo,Ur,Nl,yE,CE,ME,wE);var Qd={elements:{line:{backgroundColor:"rgba(166, 30, 105, 0.2)",borderColor:"rgba(166, 30, 105, 1)",borderWidth:4},point:{backgroundColor:"rgba(166, 30, 105, 1)",borderColor:"rgba(255,255,255, .9)",borderWidth:2,radius:5,hoverRadius:6,hoverBorderWidth:3}},responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1}},interaction:{mode:"nearest",axis:"x",intersect:!1}},iA=function(t){var n=t.chart.ctx,r=t.chart.chartArea;if(!r)return"rgba(166, 30, 105, 0.1)";var i=(r.left+r.right)/2,s=(r.top+r.bottom)/2,o=Math.min((r.right-r.left)/2,(r.bottom-r.top)/2),a=n.createRadialGradient(i,s,0,i,s,o);return a.addColorStop(0,"rgba(255, 255, 255, 0.4)"),a.addColorStop(.3,"rgba(255, 255, 255, 0.4)"),a.addColorStop(1,"rgba(166, 30, 105, 0.2)"),a};function My(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?My(Object(n),!0).forEach(function(r){sA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):My(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sA(e,t,n){return(t=oA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oA(e){var t=aA(e,"string");return Ks(t)=="symbol"?t:t+""}function aA(e,t){if(Ks(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ks(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ks(e){"@babel/helpers - typeof";return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ks(e)}function lA(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var uA=function(){var t,n,r,i,s=Ki(),o=s.data,a=s.isLoading,l=s.isRefetching,u=o==null?void 0:o.mentions,c=u==null||(t=u.mentionedInNumberOfQueries)===null||t===void 0||(t=t.previous)===null||t===void 0?void 0:t.difference,d=u==null?void 0:u.chart,f=Array.isArray(d==null?void 0:d.labels)?d.labels:d!=null&&d.labels&&Ks(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return lA(String(v))}),g=o==null?void 0:o.numberOfQueries;if(!g){var m=0;Array.isArray(d==null?void 0:d.datasets)&&d.datasets.forEach(function(v){Array.isArray(v==null?void 0:v.data)&&v.data.forEach(function(b){typeof b=="number"&&b>m&&(m=b)})}),g=m+2}var p=jy(jy({},Qd),{},{responsive:!0,maintainAspectRatio:!1,scales:{x:{display:!0,title:{display:!1,text:"Date"},grid:{display:!1}},y:{display:!0,title:{display:!1,text:"Number of Mentions"},beginAtZero:!0,max:g,ticks:{stepSize:1}}}});return y.jsx(P.Card,{className:"yst-overflow-visible",children:y.jsxs(P.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(qa,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(Ba,{score:u==null||(n=u.mentionedInNumberOfQueries)===null||n===void 0?void 0:n.value,total:o==null?void 0:o.numberOfQueries,delta:c,deltaSuffix:"since last scan",suffix:"queries",isLoading:a||l})]}),Array.isArray(d==null||(r=d.datasets)===null||r===void 0?void 0:r.data)&&(d==null||(i=d.datasets)===null||i===void 0?void 0:i.data.length)<2?y.jsx(P.Alert,{variant:"info",children:"One more analysis needed to show more insights."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(nA,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function wl(e){var t=e.value,n=t===void 0?"—":t,r=e.label,i=e.tooltip,s=e.className,o=e.borderBottom,a=o===void 0?!1:o,l=e.borderRight,u=l===void 0?!1:l,c=e.delta,d=e.tooltipPosition,f=d===void 0?"left":d;return y.jsxs("div",{className:Oe("yst-relative yst-flex yst-flex-col yst-items-center yst-gap-1 yst-p-4 yst-text-center",a&&"yst-border-b yst-border-slate-200",u&&"yst-border-r yst-border-slate-200",s),children:[y.jsx("p",{className:"yst-text-2xl yst-font-bold yst-text-slate-900",children:n}),y.jsx("p",{className:"yst-text-tiny yst-text-slate-600",children:r}),typeof c=="number"&&y.jsxs("p",{className:Oe("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",ra(c)),children:[c>0?y.jsx(c2,{}):c<0?y.jsx(u2,{}):null,c>-1e-6&&"+",c]}),i&&y.jsx($f,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function cA(e){var t=e.children,n=e.className;return y.jsx("div",{className:Oe("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function dA(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function fA(e){var t=e.current,n=e.previous,r=e.className;if(typeof n!="number")return null;var i=t-n,s=i>0,o=i<0,a="".concat(i>0?"+":"").concat(i.toFixed(1),"%");return y.jsxs("div",{className:Oe("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",dA(i),r),"aria-label":s?"Visibility increased by ".concat(a):o?"Visibility decreased by ".concat(a):"No change in visibility",children:[s&&y.jsx(c2,{className:"yst-w-4 yst-h-4"}),o&&y.jsx(u2,{className:"yst-w-4 yst-h-4"}),a]})}function ha(e){"@babel/helpers - typeof";return ha=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ha(e)}function hA(e,t){return pA(e)||mA(e,t)||yA(e,t)||gA()}function gA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
68
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yA(e,t){if(e){if(typeof e=="string")return $y(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$y(e,t):void 0}}function $y(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mA(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function pA(e){if(Array.isArray(e))return e}function Dy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dy(Object(n),!0).forEach(function(r){vA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vA(e,t,n){return(t=bA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bA(e){var t=xA(e,"string");return ha(t)=="symbol"?t:t+""}function xA(e,t){if(ha(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ha(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wA(){var e,t,n,r,i,s,o,a,l,u,c,d,f,h,g,m,p,v,b,S,C,x,k,w,_=Rn(),O=_.brandId,E=_.analysisId,T=Du(O,E,{query:{select:function(Fe){var Y=Fe.data;return Y},enabled:!!O&&!!E}}),j=T.data,B=T.isLoading,R=j==null||(e=j.analysis)===null||e===void 0?void 0:e.scans,A=Array.isArray(R)&&R.length>0?R.reduce(function(Ne,Fe){if(!Ne)return Fe;if(!(Fe!=null&&Fe.finishedAt)||!(Ne!=null&&Ne.finishedAt))return Ne;var Y=new Date(Fe.finishedAt),Pe=new Date(Ne.finishedAt);return Y>Pe?Fe:Ne},R[0]):void 0,M=A==null||(t=A.scores)===null||t===void 0?void 0:t.standardized,D=(n=A==null||(r=A.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,H=A==null||(i=A.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,Q=(s=A==null||(o=A.scores)===null||o===void 0||(o=o.standardized)===null||o===void 0||(o=o.citations)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:0,F=(a=A==null||(l=A.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,G=A==null||(u=A.citations)===null||u===void 0||(u=u.total)===null||u===void 0||(u=u.previous)===null||u===void 0?void 0:u.difference,ie=A==null||(c=A.rankings)===null||c===void 0||(c=c.list)===null||c===void 0?void 0:c.find(function(Ne){var Fe;return((Fe=Ne.brand)===null||Fe===void 0?void 0:Fe.isSelf)===!0}),ae=(d=ie==null||(f=ie.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",N=ie==null||(h=ie.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;N&&(N=N*-1);var le=(g=M==null||(m=M.visibility)===null||m===void 0?void 0:m.value)!==null&&g!==void 0?g:0,te=M==null||(p=M.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,me=(v=M==null||(b=M.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,J=(S=M==null||(C=M.sentiment)===null||C===void 0?void 0:C.value)!==null&&S!==void 0?S:0,Ce=(x=M==null||(k=M.mentions)===null||k===void 0?void 0:k.value)!==null&&x!==void 0?x:0,ge={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[Ce,me,Q,J],backgroundColor:iA,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},ze=Sl(Sl({},Qd),{},{plugins:Sl(Sl({},Qd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(Fe){var Y=Fe.label||"",Pe=Fe.parsed.r||0;return"".concat(Y,": ").concat(Pe,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),oe=z.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),He=hA(oe,2),lt=He[0],dt=He[1];return z.useEffect(function(){function Ne(){dt(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",Ne),function(){return window.removeEventListener("resize",Ne)}},[]),y.jsx(P.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(P.Card.Content,{children:[y.jsx(P.Title,{size:"3",className:"yst-mb-2",children:"AI visibility index (AIVI)"}),y.jsx(Ba,{score:le,total:100,isLoading:B}),y.jsx(fA,{current:le,previous:te,className:"yst-mb-4"}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[y.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[y.jsx(rA,{data:ge,options:ze}),y.jsx($f,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",position:"left",children:"The AI Visibility Index (AIVI) shows how visible your brand is across major AI platforms like ChatGPT, based on mentions, citations, sentiment, and rankings."})]}),y.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:y.jsxs(cA,{children:[y.jsx(wl,{value:D,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:H,tooltipPosition:lt}),y.jsx(wl,{value:ae&&y.jsxs(y.Fragment,{children:[ae,ae===1&&" 🏆"]}),label:"Competitor ranking",tooltip:"Ranking shows the position your brand is mentioned in AI-generated answers—whether in a numbered list or the order of appearance in full-text responses.",borderBottom:!0,delta:N}),y.jsx(wl,{value:F,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:G,tooltipPosition:lt}),y.jsx(wl,{value:J?"".concat(J,"%"):"—",label:"Positive sentiment",tooltip:"Sentiment reflects how positively, neutrally, or negatively your brand is mentioned in AI-generated answers, based on the cited sources.",delta:A==null||(w=A.scores)===null||w===void 0||(w=w.standardized)===null||w===void 0||(w=w.sentiment)===null||w===void 0||(w=w.previous)===null||w===void 0?void 0:w.difference})]})})]})]})})}var qc=function(){var t=Rn(),n=t.brandId,r=t.analysisId,i=Gi({query:{select:function(m){var p=m.data;return p==null?void 0:p.brands}}}),s=i.data,o=i.isLoading,a=Du(n,r,{query:{enabled:!!n&&k6(r),select:function(m){var p=m.data;return p==null?void 0:p.analysis}}}),l=a.data,u=a.isLoading,c=l==null?void 0:l.status,d=o||u,f=s&&(s==null?void 0:s.length)>0,h=!d&&l&&c===ci.completed;return o?y.jsx(Ru,{}):f?y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(w7,{}),h&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(P.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(P.Button,{as:ti,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:Oe("yst-gap-1.5"),disabled:!n,children:[y.jsx(o2,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(wA,{}),y.jsx(S7,{}),y.jsx(uA,{}),y.jsx(M_,{}),y.jsx(k_,{}),y.jsx(c_,{}),y.jsx(j_,{})]})]})]}):y.jsx(W6,{})};function yb(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(P.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&y.jsx(P.Title,{className:Oe({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var SA=function(){return y.jsx(P.Card,{className:"yst-mb-4",children:y.jsxs(P.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(P.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(P.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(P.Badge,{children:"Example"}),y.jsx(P.Badge,{children:"Example"}),y.jsx(P.Badge,{children:"Example"}),y.jsx(P.Badge,{children:"Example"}),y.jsx(P.Badge,{children:"Example"})]}),y.jsxs(P.Table,{children:[y.jsx(P.Table.Head,{children:y.jsxs(P.Table.Row,{children:[y.jsx(P.Table.Header,{children:"URL"}),y.jsx(P.Table.Header,{children:"Associated brand"})]})}),y.jsxs(P.Table.Body,{children:[y.jsxs(P.Table.Row,{children:[y.jsx(P.Table.Cell,{children:y.jsx(P.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(P.Table.Cell,{children:"Example Brand"})]}),y.jsxs(P.Table.Row,{children:[y.jsx(P.Table.Cell,{children:y.jsx(P.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(P.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},CA=function(){return y.jsxs(P.Card,{children:[y.jsx(yb,{title:"Query history"}),y.jsx(P.Card,{className:"yst-mb-4",children:y.jsxs(P.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(P.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(SA,{},t)})]})})]})},_A=z.lazy(function(){return Promise.resolve().then(()=>DD)}),kA=z.lazy(function(){return Promise.resolve().then(()=>lL)}),OA=z.lazy(function(){return Promise.resolve().then(()=>dL)}),EA=z.lazy(function(){return Promise.resolve().then(()=>kL)}),AA=z.lazy(function(){return Promise.resolve().then(()=>zL)}),PA=z.lazy(function(){return Promise.resolve().then(()=>WL)}),TA=new Qw({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),li=function(){return y.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[y.jsx(P.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(P.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(P.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},MA=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo;return y.jsx(tw,{children:y.jsxs(_t,{element:y.jsx(w6,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(_t,{path:"/",element:y.jsx(Bs,{}),children:[y.jsx(_t,{index:!0,element:y.jsx(qc,{})}),y.jsxs(_t,{path:"brands/:brandId",element:y.jsx(T0,{}),children:[y.jsx(_t,{index:!0,element:y.jsx(qc,{})}),y.jsx(_t,{path:"brand-list",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(_A,{})})}),y.jsx(_t,{path:"analysis/:analysisId",element:y.jsx(S6,{}),children:y.jsx(_t,{index:!0,element:y.jsx(qc,{})})})]}),y.jsxs(_t,{path:"/setup",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(OA,{})}),children:[y.jsx(_t,{index:!0,element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(EA,{})})}),y.jsxs(_t,{path:":brandId",element:y.jsx(T0,{}),children:[y.jsx(_t,{path:"queries",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(AA,{})})}),y.jsx(_t,{path:"analysis",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(PA,{})})})]})]})]}),y.jsx(_t,{path:"/settings",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(kA,{})})}),y.jsx(_t,{path:"/query-history",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(CA,{})})})]})})},jA=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(e3,{client:TA,children:[y.jsx(O4,{hostAppProps:r,children:y.jsx(MA,{DebugInfo:n})}),y.jsx(qS,{initialIsOpen:!1})]})};function $A(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=dn(),s=Ut(),o=z.useRef(n),a=z.useRef(null),l=z.useRef(!1),u="".concat(s.pathname).concat(s.search).concat(s.hash),c=z.useCallback(r,[r]);return z.useEffect(function(){if(n===u){o.current=n;return}l.current||n!==o.current&&(o.current=n,a.current=n,l.current=!0,i(n,{replace:!0}),setTimeout(function(){l.current=!1},10))},[n,u,i]),z.useEffect(function(){l.current||u!==n&&u!==a.current&&(a.current=u,c(u))},[u,n,c]),null}function DA(e,t){return NA(e)||RA(e,t)||IA(e,t)||LA()}function LA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
69
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IA(e,t){if(e){if(typeof e=="string")return Ly(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ly(e,t):void 0}}function Ly(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function RA(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function NA(e){if(Array.isArray(e))return e}var FA=function(t){var n=t.isRtl,r=n===void 0?!1:n,i=t.className,s=t.style,o=t.token,a=o===void 0?"":o,l=t.apiUrl,u=t.DebugInfo,c=t.basename,d=c===void 0?"/":c,f=t.subpath,h=f===void 0?"/":f,g=t.onNavigate,m=g===void 0?function(){}:g,p=t.onLogout,v=p===void 0?function(){}:p,b=t.onAddSubscription,S=b===void 0?function(){}:b,C=function(T,j){var B=T.endsWith("/")?T.slice(0,-1):T,R=j.startsWith("/")?j:"/".concat(j);return B+R||"/"},x=z.useState(!!(a||l)),k=DA(x,2),w=k[0],_=k[1],O={onAddSubscription:S,onLogout:v,onNavigate:m,DebugInfo:u,basename:d,subpath:h};return z.useEffect(function(){l&&Zv(l),C5(typeof a!="function"?function(){return a}:a),_(!1)},[l,a]),w?y.jsx("div",{className:i,style:s,children:y.jsx(P.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(Jx,{initialEntries:[C(d,h)],basename:d||"/",children:[y.jsx($A,{subpath:h,onNavigate:m}),y.jsx(P.Root,{context:{isRtl:r},children:y.jsx(jA,{DebugInfo:u,hostAppProps:O})})]})})},BA=e=>e!=null,qA=e=>e.filter(BA);function zA(e){return(...t)=>{for(const n of e)n&&n(...t)}}var X=e=>typeof e=="function"&&!e.length?e():e,Yd=e=>Array.isArray(e)?e:e?[e]:[];function HA(e,...t){return typeof e=="function"?e(...t):e}var UA=_e;function GA(e,t,n,r){const i=e.length,s=t.length;let o=0;if(!s){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<s;o++)r(t[o]);return}for(;o<s&&t[o]===e[o];o++);let a,l;t=t.slice(o),e=e.slice(o);for(a of t)e.includes(a)||r(a);for(l of e)t.includes(l)||n(l)}function KA(e){const[t,n]=ce(),r=e!=null&&e.throw?(f,h)=>{throw n(f instanceof Error?f:new Error(h)),f}:(f,h)=>{n(f instanceof Error?f:new Error(h))},i=e!=null&&e.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),s=e!=null&&e.prefix?`${e.prefix}.`:"",o=new Map,a=new Proxy({},{get(f,h){let g=o.get(h);g||(g=ce(void 0,{equals:!1}),o.set(h,g)),g[0]();const m=i.reduce((p,v)=>{if(p!==null||!v)return p;try{return v.getItem(`${s}${h}`)}catch(b){return r(b,`Error reading ${s}${h} from ${v.name}`),null}},null);return m!==null&&(e!=null&&e.deserializer)?e.deserializer(m,h,e.options):m}}),l=(f,h,g)=>{const m=e!=null&&e.serializer?e.serializer(h,f,g!=null?g:e.options):h,p=`${s}${f}`;i.forEach(b=>{try{b.getItem(p)!==m&&b.setItem(p,m)}catch(S){r(S,`Error setting ${s}${f} to ${m} in ${b.name}`)}});const v=o.get(f);v&&v[1]()},u=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(g){r(g,`Error removing ${s}${f} from ${h.name}`)}}),c=()=>i.forEach(f=>{try{f.clear()}catch(h){r(h,`Error clearing ${f.name}`)}}),d=()=>{const f={},h=(g,m)=>{if(!f.hasOwnProperty(g)){const p=m&&(e!=null&&e.deserializer)?e.deserializer(m,g,e.options):m;p&&(f[g]=p)}};return i.forEach(g=>{if(typeof g.getAll=="function"){let m;try{m=g.getAll()}catch(p){r(p,`Error getting all values from in ${g.name}`)}for(const p of m)h(p,m[p])}else{let m=0,p;try{for(;p=g.key(m++);)f.hasOwnProperty(p)||h(p,g.getItem(p))}catch(v){r(v,`Error getting all values from ${g.name}`)}}}),f};return(e==null?void 0:e.sync)!==!1&&xr(()=>{const f=h=>{var m;let g=!1;i.forEach(p=>{try{p!==h.storageArea&&h.key&&h.newValue!==p.getItem(h.key)&&(h.newValue?p.setItem(h.key,h.newValue):p.removeItem(h.key),g=!0)}catch(v){r(v,`Error synching api ${p.name} from storage event (${h.key}=${h.newValue})`)}}),g&&h.key&&((m=o.get(h.key))==null||m[1]())};"addEventListener"in globalThis?(globalThis.addEventListener("storage",f),_e(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var g;return(g=h.addEventListener)==null?void 0:g.call(h,"storage",f)}),_e(()=>i.forEach(h=>{var g;return(g=h.removeEventListener)==null?void 0:g.call(h,"storage",f)})))}),[a,l,{clear:c,error:t,remove:u,toJSON:d}]}var mb=KA,VA=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),Iy=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r=="boolean"?`; ${n}`:`; ${n}=${r}`}return t},gn=VA({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=gn._cookies[0][gn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=gn.getItem(e);gn._cookies[0][gn._cookies[1]]=`${e}=${t}${Iy(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:gn});window.dispatchEvent(i)},removeItem:e=>{gn._cookies[0][gn._cookies[1]]=`${e}=deleted${Iy({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return gn._cookies[0][gn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return gn._cookies[0][gn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),WA=1024,Fi=796,Yf=700,QA="bottom-right",Xd="bottom",pb="system",YA=!1,vb=500,XA=500,bb=500,ZA=Object.keys(bd)[0],Ry=1,JA=Object.keys(xd)[0],Xf=wt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ye(){return St(Xf)}var xb=wt(void 0),wb=e=>{const[t,n]=ce(null),r=()=>{const o=t();o!=null&&(o.close(),n(null))},i=(o,a)=>{if(t()!=null)return;const l=window.open("","TSQD-Devtools-Panel",`width=${o},height=${a},popup`);if(!l)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");l.document.head.innerHTML="",l.document.body.innerHTML="",H3(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(ye().shadowDOMTarget||document).styleSheets].forEach(u=>{try{const c=[...u.cssRules].map(g=>g.cssText).join(""),d=document.createElement("style"),f=u.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=c,l.document.head.appendChild(d)}catch(c){const d=document.createElement("link");if(u.href==null)return;d.rel="stylesheet",d.type=u.type,d.media=u.media.toString(),d.href=u.href,l.document.head.appendChild(d)}}),ku(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],l.document),e.setLocalStore("pip_open","true"),n(l)};xe(()=>{var a;((a=e.localStore.pip_open)!=null?a:"false")==="true"&&!e.disabled&&i(Number(window.innerWidth),Number(e.localStore.height||XA))}),xe(()=>{const o=(ye().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const u=(ye().shadowDOMTarget||a.document).querySelector("#_goober");u&&(u.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),_e(()=>{l.disconnect()})}});const s=U(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return L(xb.Provider,{value:s,get children(){return e.children}})},Zf=()=>U(()=>{const t=St(xb);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),Jf=wt(()=>"dark");function xt(){return St(Jf)}var Sb={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"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",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},eP=Object.keys(Sb).join("|"),tP=new RegExp(eP,"g");function nP(e){return e.replace(tP,t=>Sb[t])}var Bt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Ny(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Bt.MATCHES,!n.accessors){const o=Fy(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=oP(e,n.accessors),s={rankedValue:e,rank:Bt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=Fy(a.itemValue,t,n);const{minRanking:u,maxRanking:c,threshold:d=n.threshold}=a.attributes;l<u&&l>=Bt.MATCHES?l=u:l>c&&(l=c),l=Math.min(l,c),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function Fy(e,t,n){return e=By(e,n),t=By(t,n),t.length>e.length?Bt.NO_MATCH:e===t?Bt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Bt.EQUAL:e.startsWith(t)?Bt.STARTS_WITH:e.includes(` ${t}`)?Bt.WORD_STARTS_WITH:e.includes(t)?Bt.CONTAINS:t.length===1?Bt.NO_MATCH:rP(e).includes(t)?Bt.ACRONYM:iP(e,t))}function rP(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function iP(e,t){let n=0,r=0;function i(l,u,c){for(let d=c,f=u.length;d<f;d++)if(u[d]===l)return n+=1,d+1;return-1}function s(l){const u=1/l,c=n/t.length;return Bt.MATCHES+c*u}const o=i(t[0],e,0);if(o<0)return Bt.NO_MATCH;r=o;for(let l=1,u=t.length;l<u;l++){const c=t[l];if(r=i(c,e,r),!(r>-1))return Bt.NO_MATCH}const a=r-o;return s(a)}function By(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=nP(e)),e}function sP(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function oP(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=aP(s),a=sP(e,s);for(let l=0,u=a.length;l<u;l++)n.push({itemValue:a[l],attributes:o})}return n}var qy={maxRanking:1/0,minRanking:-1/0};function aP(e){return typeof e=="function"?qy:{...qy,...e}}var lP={data:""},uP=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||lP,cP=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,dP=/\/\*[^]*?\*\/| +/g,zy=/\n+/g,gi=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?gi(o,s):s+"{"+gi(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=gi(o,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=gi.p?gi.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},ir={},Cb=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Cb(e[n]);return t}return e},fP=(e,t,n,r,i)=>{let s=Cb(e),o=ir[s]||(ir[s]=(l=>{let u=0,c=11;for(;u<l.length;)c=101*c+l.charCodeAt(u++)>>>0;return"go"+c})(s));if(!ir[o]){let l=s!==e?e:(u=>{let c,d,f=[{}];for(;c=cP.exec(u.replace(dP,""));)c[4]?f.shift():c[3]?(d=c[3].replace(zy," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][c[1]]=c[2].replace(zy," ").trim();return f[0]})(e);ir[o]=gi(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&ir.g?ir.g:null;return n&&(ir.g=ir[o]),((l,u,c,d)=>{d?u.data=u.data.replace(d,l):u.data.indexOf(l)===-1&&(u.data=c?l+u.data:u.data+l)})(ir[o],t,r,a),o},hP=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":gi(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function je(e){let t=this||{},n=e.call?e(t.p):e;return fP(n.unshift?n.raw?hP(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,uP(t.target),t.g,t.o,t.k)}je.bind({g:1});je.bind({k:1});function _b(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=_b(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fe(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_b(e))&&(r&&(r+=" "),r+=t);return r}function gP(e,t){const n=at(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=ce([],{equals:!1}),[l]=x3(),u=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},c=(d,f,h)=>d.splice(h,0,f);return U(d=>{const f=o(),h=e();if(h[Su],at(l))return l(),d;if(f.length){const g=d.filter(m=>!f.includes(m));return f.length=0,r({list:g,added:[],removed:[],unchanged:g,finishRemoved:u}),g}return at(()=>{const g=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const C of h)(i.has(C)?b:p).push(C);let S=!p.length;for(let C=0;C<d.length;C++){const x=d[C];g.has(x)||(s.has(x)||(v.push(x),s.add(x)),c(m,x,C)),S&&x!==m[C]&&(S=!1)}return!v.length&&S?d:(r({list:m,added:p,removed:v,unchanged:b,finishRemoved:u}),i=g,m)})},t.appear?[]:n.slice())}function It(...e){return zA(e)}var Hy=e=>e instanceof Element;function Zd(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Zd(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=Zd(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function yP(e,t=Hy,n=Hy){const r=U(e),i=U(()=>Zd(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function mP(e){return U(()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}})}function kb(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function pP(e,t,n,r){const{onBeforeEnter:i,onEnter:s,onAfterEnter:o}=t;i==null||i(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask(()=>{if(!n.parentNode)return r==null?void 0:r();s==null||s(n,()=>a())}),kb(()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),o==null||o(n))}}function vP(e,t,n,r){const{onBeforeExit:i,onExit:s,onAfterExit:o}=t;if(!n.parentNode)return r==null?void 0:r();i==null||i(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),s==null||s(n,()=>a()),kb(()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(r==null||r(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),o==null||o(n))}}var Uy=e=>{const t=mP(e);return gP(yP(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)pP(o,e,l);const a=[];for(const l of s)l.isConnected&&(l instanceof HTMLElement||l instanceof SVGElement)&&a.push({el:l,rect:l.getBoundingClientRect()});queueMicrotask(()=>{const l=[];for(const{el:u,rect:c}of a)if(u.isConnected){const d=u.getBoundingClientRect(),f=c.left-d.left,h=c.top-d.top;(f||h)&&(u.style.transform=`translate(${f}px, ${h}px)`,u.style.transitionDuration="0s",l.push(u))}document.body.offsetHeight;for(const u of l){let c=function(d){(d.target===u||/transform$/.test(d.propertyName))&&(u.removeEventListener("transitionend",c),u.classList.remove(...o.move))};u.classList.add(...o.move),u.style.transform=u.style.transitionDuration="",u.addEventListener("transitionend",c)}});for(const l of r)vP(o,e,l,()=>i([l]))}})},zc=Symbol("fallback");function Gy(e){for(const t of e)t.dispose()}function bP(e,t,n,r={}){const i=new Map;return _e(()=>Gy(i.values())),()=>{const o=e()||[];return o[Su],at(()=>{var c,d;if(!o.length)return Gy(i.values()),i.clear(),r.fallback?[mr(h=>(i.set(zc,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(zc);if(!i.size||l){l==null||l.dispose(),i.delete(zc);for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);s(a,h,f,g)}return a}const u=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);u.delete(g);const m=i.get(g);m?(a[f]=m.mapped,(c=m.setIndex)==null||c.call(m,f),m.setItem(()=>h)):s(a,h,f,g)}for(const f of u)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,u){mr(c=>{const[d,f]=ce(a),h={setItem:f,dispose:c};if(n.length>1){const[g,m]=ce(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(u,h),o[l]=h.mapped})}}function du(e){const{by:t}=e;return U(bP(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function xP(e,t,n,r){return e.addEventListener(t,n,r),UA(e.removeEventListener.bind(e,t,n,r))}function wP(e,t,n,r){const i=()=>{Yd(X(e)).forEach(s=>{s&&Yd(X(t)).forEach(o=>xP(s,o,n,r))})};typeof e=="function"?xe(i):be(i)}function SP(e,t){const n=new ResizeObserver(e);return _e(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function Ob(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=SP(o=>{for(const a of o){const{contentRect:l,target:u}=a,c=Math.round(l.width),d=Math.round(l.height),f=r.get(u);(!f||f.width!==c||f.height!==d)&&(t(l,u,a),r.set(u,{width:c,height:d}))}},n);xe(o=>{const a=qA(Yd(X(e)));return GA(a,o,i,s),a},[])}var CP=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Ky(e){const t={};let n;for(;n=CP.exec(e);)t[n[1]]=n[2];return t}function Qu(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Ky(e)}else typeof t=="string"&&(t=Ky(t));return{...e,...t}}function _P(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Jd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function kP(e){return typeof e=="number"}function ns(e){return Object.prototype.toString.call(e)==="[object String]"}function OP(e){return typeof e=="function"}function Ga(e){return t=>`${e()}-${t}`}function wn(e,t){return e?e===t||e.contains(t):!1}function Io(e,t=!1){const{activeElement:n}=Jn(e);if(!(n!=null&&n.nodeName))return null;if(Eb(n)&&n.contentDocument)return Io(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Jn(n).getElementById(r);if(i)return i}}return n}function EP(e){return Jn(e).defaultView||window}function Jn(e){return e?e.ownerDocument||e:document}function Eb(e){return e.tagName==="IFRAME"}var eh=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(eh||{});function th(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function Yu(){return th(/^Mac/i)}function AP(){return th(/^iPhone/i)}function PP(){return th(/^iPad/i)||Yu()&&navigator.maxTouchPoints>1}function TP(){return AP()||PP()}function MP(){return Yu()||TP()}function nt(e,t){return t&&(OP(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function vt(e){return t=>{for(const n of e)nt(t,n)}}function jP(e){return Yu()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function At(e){if(e)if($P())e.focus({preventScroll:!0});else{const t=DP(e);e.focus(),LP(t)}}var Cl=null;function $P(){if(Cl==null){Cl=!1;try{document.createElement("div").focus({get preventScroll(){return Cl=!0,!0}})}catch(e){}}return Cl}function DP(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function LP(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Ab=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],IP=[...Ab,'[tabindex]:not([tabindex="-1"]):not([disabled])'],nh=Ab.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",RP=IP.join(':not([hidden]):not([tabindex="-1"]),');function Pb(e,t){const r=Array.from(e.querySelectorAll(nh)).filter(Vy);return t&&Vy(e)&&r.unshift(e),r.forEach((i,s)=>{if(Eb(i)&&i.contentDocument){const o=i.contentDocument.body,a=Pb(o,!1);r.splice(s,1,...a)}}),r}function Vy(e){return Tb(e)&&!NP(e)}function Tb(e){return e.matches(nh)&&rh(e)}function NP(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function rh(e,t){return e.nodeName!=="#comment"&&FP(e)&&BP(e,t)&&(!e.parentElement||rh(e.parentElement,e))}function FP(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:s,visibility:o}=i(e);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function BP(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function qP(e,t,n){const r=t!=null&&t.tabbable?RP:nh,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var o;return(o=t==null?void 0:t.from)!=null&&o.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&rh(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function Wy(e){for(;e&&!zP(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function zP(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function HP(){}function UP(e,t){const[n,r]=e;let i=!1;const s=t.length;for(let o=s,a=0,l=o-1;a<o;l=a++){const[u,c]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],g=(c-f)*(n-u)-(u-d)*(r-c);if(f<c){if(r>=f&&r<c){if(g===0)return!0;g>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(c<f){if(r>c&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==c&&(n>=d&&n<=u||n>=u&&n<=d))return!0}return i}function Re(e,t){return Ae(e,t)}var Co=new Map,Qy=new Set;function Yy(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=Co.get(n.target);r||(r=new Set,Co.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Co.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Co.delete(n.target)),Co.size===0)){for(const i of Qy)i();Qy.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?Yy():document.addEventListener("DOMContentLoaded",Yy));function ef(e,t){const n=Xy(e,t,"left"),r=Xy(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,u=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>u&&(a+=r+s-u),e.scrollLeft=o,e.scrollTop=a}function Xy(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function GP(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=Wy(e);for(;e&&o&&e!==i&&o!==i;)ef(o,e),e=o,o=Wy(e)}else{const{left:o,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:u}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-u)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var Mb={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function Sn(e){return t=>(e(t),()=>e(void 0))}function Xu(e,t){const[n,r]=ce(Zy(t==null?void 0:t()));return xe(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||Zy(t==null?void 0:t()))}),n}function Zy(e){return ns(e)?e:void 0}function st(e){const[t,n]=Ve(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return L(eS,Ae(n,{get component(){return t.as}}))}var KP=["id","name","validationState","required","disabled","readOnly"];function VP(e){const t=`form-control-${kn()}`,n=Re({id:t},e),[r,i]=ce(),[s,o]=ce(),[a,l]=ce(),[u,c]=ce(),d=(m,p,v)=>{const b=v!=null||r()!=null;return[v,r(),b&&p!=null?m:void 0].filter(Boolean).join(" ")||void 0},f=m=>[a(),u(),m].filter(Boolean).join(" ")||void 0,h=U(()=>({"data-valid":X(n.validationState)==="valid"?"":void 0,"data-invalid":X(n.validationState)==="invalid"?"":void 0,"data-required":X(n.required)?"":void 0,"data-disabled":X(n.disabled)?"":void 0,"data-readonly":X(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=X(n.name))!=null?m:X(n.id)},dataset:h,validationState:()=>X(n.validationState),isRequired:()=>X(n.required),isDisabled:()=>X(n.disabled),isReadOnly:()=>X(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:u,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Ga(()=>X(n.id)),registerLabel:Sn(i),registerField:Sn(o),registerDescription:Sn(l),registerErrorMessage:Sn(c)}}}var jb=wt();function Ka(){const e=St(jb);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function $b(e){const t=Ka(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),L(st,Ae({as:"div"},()=>t.dataset(),n))}function Db(e){const t=Ka(),n=Re({id:t.generateId("error-message")},e),[r,i]=Ve(n,["forceMount"]),s=()=>t.validationState()==="invalid";return xe(()=>{s()&&_e(t.registerErrorMessage(i.id))}),L(ve,{get when(){return r.forceMount||s()},get children(){return L(st,Ae({as:"div"},()=>t.dataset(),i))}})}function WP(e){let t;const n=Ka(),r=Re({id:n.generateId("label")},e),[i,s]=Ve(r,["ref"]),o=Xu(()=>t,()=>"label");return xe(()=>_e(n.registerLabel(s.id))),L(st,Ae({as:"label",ref(a){const l=It(u=>t=u,i.ref);typeof l=="function"&&l(a)},get for(){return U(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function QP(e,t){xe(br(e,n=>{if(n==null)return;const r=YP(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),_e(()=>{r.removeEventListener("reset",t)}))}))}function YP(e){return XP(e)?e.form:e.closest("form")}function XP(e){return e.matches("textarea, input, select, button")}function Va(e){var o;const[t,n]=ce((o=e.defaultValue)==null?void 0:o.call(e)),r=U(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=U(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{at(()=>{var u;const l=HA(a,i());return Object.is(l,i())||(r()||n(l),(u=e.onChange)==null||u.call(e,l)),l})}]}function Lb(e){const[t,n]=Va(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function ZP(e){const[t,n]=Va(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function JP(e={}){const[t,n]=Lb({value:()=>X(e.isSelected),defaultValue:()=>!!X(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!X(e.isReadOnly)&&!X(e.isDisabled)&&n(s)},toggle:()=>{!X(e.isReadOnly)&&!X(e.isDisabled)&&n(!t())}}}var eT=Object.defineProperty,Zu=(e,t)=>{for(var n in t)eT(e,n,{get:t[n],enumerable:!0})},Ib=wt();function Rb(){return St(Ib)}function tT(){const e=Rb();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Nb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function nT(e,t){var i;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(i=e[r])==null?void 0:i.ref();if(s&&Nb(s,n))return r+1}return 0}function rT(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[s,o])=>{const a=i.ref(),l=o.ref();return a===l||!a||!l?0:Nb(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function Fb(e,t){const n=rT(e);e!==n&&t(n)}function iT(e){var i,s;const t=e[0],n=(i=e[e.length-1])==null?void 0:i.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Jn(r).body}function sT(e,t){xe(()=>{const n=setTimeout(()=>{Fb(e(),t)});_e(()=>clearTimeout(n))})}function oT(e,t){if(typeof IntersectionObserver!="function"){sT(e,t);return}let n=[];xe(()=>{const r=()=>{const o=!!n.length;n=e(),o&&Fb(e(),t)},i=iT(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}_e(()=>s.disconnect())})}function aT(e={}){const[t,n]=ZP({value:()=>X(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});oT(t,n);const r=s=>(n(o=>{const a=nT(o,s);return _P(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>L(Ib.Provider,{value:{registerItem:r},get children(){return s.children}})}}function lT(e){const t=tT(),n=Re({shouldRegisterItem:!0},e);xe(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());_e(r)})}function Bb(e){var l,u,c;let t=(l=e.startIndex)!=null?l:0;const n=(u=e.startLevel)!=null?u:0,r=[],i=d=>{var g;if(d==null)return"";const f=(g=e.getKey)!=null?g:"key",h=ns(f)?d[f]:f(d);return h!=null?String(h):""},s=d=>{var g;if(d==null)return"";const f=(g=e.getTextValue)!=null?g:"textValue",h=ns(f)?d[f]:f(d);return h!=null?String(h):""},o=d=>{var h,g;if(d==null)return!1;const f=(h=e.getDisabled)!=null?h:"disabled";return(g=ns(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return ns(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(ns(d)||kP(d)){r.push({type:"item",rawValue:d,key:String(d),textValue:String(d),disabled:o(d),level:n,index:t}),t++;continue}if(a(d)!=null){r.push({type:"section",rawValue:d,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const f=(c=a(d))!=null?c:[];if(f.length>0){const h=Bb({dataSource:f,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...h),t+=h.length}}else r.push({type:"item",rawValue:d,key:i(d),textValue:s(d),disabled:o(d),level:n,index:t}),t++}return r}function uT(e,t=[]){return U(()=>{const n=Bb({dataSource:X(e.dataSource),getKey:X(e.getKey),getTextValue:X(e.getTextValue),getDisabled:X(e.getDisabled),getSectionChildren:X(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var cT=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),dT=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function fT(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return cT.has(r)}const t=e.split("-")[0];return dT.has(t)}function hT(e){return fT(e)?"rtl":"ltr"}function qb(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:hT(e)}}var tf=qb(),Ro=new Set;function Jy(){tf=qb();for(const e of Ro)e(tf)}function gT(){const[e,t]=ce(tf),n=U(()=>e());return xr(()=>{Ro.size===0&&window.addEventListener("languagechange",Jy),Ro.add(t),_e(()=>{Ro.delete(t),Ro.size===0&&window.removeEventListener("languagechange",Jy)})}),{locale:()=>n().locale,direction:()=>n().direction}}var yT=wt();function ii(){const e=gT();return St(yT)||e}var Hc=new Map;function mT(e){const{locale:t}=ii(),n=U(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return U(()=>{const r=n();let i;return Hc.has(r)&&(i=Hc.get(r)),i||(i=new Intl.Collator(t(),e),Hc.set(r,i)),i})}var ur=class zb extends Set{constructor(n,r,i){super(n);pe(this,"anchorKey");pe(this,"currentKey");n instanceof zb?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function pT(e){const[t,n]=Va(e);return[()=>{var i;return(i=t())!=null?i:new ur},n]}function Hb(e){return MP()?e.altKey:e.ctrlKey}function rs(e){return Yu()?e.metaKey:e.ctrlKey}function em(e){return new ur(e)}function vT(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function bT(e){const t=Re({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=ce(!1),[i,s]=ce(),o=U(()=>{const m=X(t.selectedKeys);return m!=null?em(m):m}),a=U(()=>{const m=X(t.defaultSelectedKeys);return m!=null?em(m):new ur}),[l,u]=pT({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[c,d]=ce(X(t.selectionBehavior)),f=()=>X(t.selectionMode),h=()=>{var m;return(m=X(t.disallowEmptySelection))!=null?m:!1},g=m=>{(X(t.allowDuplicateSelectionEvents)||!vT(m,l()))&&u(m)};return xe(()=>{const m=l();X(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),xe(()=>{var m;d((m=X(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:c,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function xT(e){const[t,n]=ce(""),[r,i]=ce(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(X(e.isDisabled))return;const a=X(e.keyboardDelegate),l=X(e.selectionManager);if(!a.getKeyForSearch)return;const u=wT(o.key);if(!u||o.ctrlKey||o.metaKey)return;u===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let c=n(m=>m+u),d=(f=a.getKeyForSearch(c,l.focusedKey()))!=null?f:a.getKeyForSearch(c);d==null&&ST(c)&&(c=c[0],d=(h=a.getKeyForSearch(c,l.focusedKey()))!=null?h:a.getKeyForSearch(c)),d!=null&&(l.setFocusedKey(d),(g=e.onTypeSelect)==null||g.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function wT(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function ST(e){return e.split("").every(t=>t===e[0])}function CT(e,t,n){const i=Ae({selectOnFocus:()=>X(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=ii();let a={top:0,left:0};wP(()=>X(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=xT({isDisabled:()=>X(i.disallowTypeAhead),keyboardDelegate:()=>X(i.keyboardDelegate),selectionManager:()=>X(i.selectionManager)}),u=()=>{var p;return(p=X(i.orientation))!=null?p:"vertical"},c=p=>{var _,O,E,T,j,B,R,A;nt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=X(i.selectionManager),S=X(i.selectOnFocus),C=M=>{M!=null&&(b.setFocusedKey(M),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&!Hb(p)&&b.replaceSelection(M))},x=X(i.keyboardDelegate),k=X(i.shouldFocusWrap),w=b.focusedKey();switch(p.key){case(u()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){p.preventDefault();let M;w!=null?M=x.getKeyBelow(w):M=(_=x.getFirstKey)==null?void 0:_.call(x),M==null&&k&&(M=(O=x.getFirstKey)==null?void 0:O.call(x,w)),C(M)}break}case(u()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){p.preventDefault();let M;w!=null?M=x.getKeyAbove(w):M=(E=x.getLastKey)==null?void 0:E.call(x),M==null&&k&&(M=(T=x.getLastKey)==null?void 0:T.call(x,w)),C(M)}break}case(u()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){p.preventDefault();const M=o()==="rtl";let D;w!=null?D=x.getKeyLeftOf(w):D=M?(j=x.getFirstKey)==null?void 0:j.call(x):(B=x.getLastKey)==null?void 0:B.call(x),C(D)}break}case(u()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){p.preventDefault();const M=o()==="rtl";let D;w!=null?D=x.getKeyRightOf(w):D=M?(R=x.getLastKey)==null?void 0:R.call(x):(A=x.getFirstKey)==null?void 0:A.call(x),C(D)}break}case"Home":if(x.getFirstKey){p.preventDefault();const M=x.getFirstKey(w,rs(p));M!=null&&(b.setFocusedKey(M),rs(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&b.replaceSelection(M))}break;case"End":if(x.getLastKey){p.preventDefault();const M=x.getLastKey(w,rs(p));M!=null&&(b.setFocusedKey(M),rs(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&b.replaceSelection(M))}break;case"PageDown":if(x.getKeyPageBelow&&w!=null){p.preventDefault();const M=x.getKeyPageBelow(w);C(M)}break;case"PageUp":if(x.getKeyPageAbove&&w!=null){p.preventDefault();const M=x.getKeyPageAbove(w);C(M)}break;case"a":rs(p)&&b.selectionMode()==="multiple"&&X(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),X(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!X(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const M=qP(v,{tabbable:!0});let D,H;do H=M.lastChild(),H&&(D=H);while(H);D&&!D.contains(document.activeElement)&&At(D)}break}}},d=p=>{var C,x,k,w;const v=X(i.selectionManager),b=X(i.keyboardDelegate),S=X(i.selectOnFocus);if(v.isFocused()){p.currentTarget.contains(p.target)||v.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(v.setFocused(!0),v.focusedKey()==null){const _=E=>{E!=null&&(v.setFocusedKey(E),S&&v.replaceSelection(E))},O=p.relatedTarget;O&&p.currentTarget.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_FOLLOWING?_((x=v.lastSelectedKey())!=null?x:(C=b.getLastKey)==null?void 0:C.call(b)):_((w=v.firstSelectedKey())!=null?w:(k=b.getFirstKey)==null?void 0:k.call(b))}else if(!X(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const O=_.querySelector(`[data-key="${v.focusedKey()}"]`);O&&(At(O),ef(_,O))}}}},f=p=>{const v=X(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var k,w;const p=X(i.autoFocus);if(!p)return;const v=X(i.selectionManager),b=X(i.keyboardDelegate);let S;p==="first"&&(S=(k=b.getFirstKey)==null?void 0:k.call(b)),p==="last"&&(S=(w=b.getLastKey)==null?void 0:w.call(b));const C=v.selectedKeys();C.size&&(S=C.values().next().value),v.setFocused(!0),v.setFocusedKey(S);const x=t();x&&S==null&&!X(i.shouldUseVirtualFocus)&&At(x)};return xr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),xe(br([s,()=>X(i.isVirtualized),()=>X(i.selectionManager).focusedKey()],p=>{var C;const[v,b,S]=p;if(b)S&&((C=i.scrollToKey)==null||C.call(i,S));else if(S&&v){const x=v.querySelector(`[data-key="${S}"]`);x&&ef(v,x)}})),{tabIndex:U(()=>{if(!X(i.shouldUseVirtualFocus))return X(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function Ub(e,t){const n=()=>X(e.selectionManager),r=()=>X(e.key),i=()=>X(e.shouldUseVirtualFocus),s=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b!=null&&b.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||rs(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>X(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let u=null;const c=b=>{l()&&(u=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!X(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&X(e.shouldSelectOnPressUp)&&X(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(X(e.shouldSelectOnPressUp)&&!X(e.allowsDifferentPressOrigin)||u!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(Hb(b)?n().toggleSelection(r()):s(b))},g=b=>{a()&&b.preventDefault()},m=b=>{const S=t();i()||a()||!S||b.target===S&&n().setFocusedKey(r())},p=U(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=U(()=>X(e.virtualized)?void 0:r());return xe(br([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,S,C,x,k])=>{b&&S===x&&k&&!C&&document.activeElement!==b&&(e.focus?e.focus():At(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:c,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var _T=class{constructor(e,t){pe(this,"collection");pe(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new ur(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))i.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new ur(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new ur([t],t,t):new ur;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new ur;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new ur)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},tm=class{constructor(e){pe(this,"keyMap",new Map);pe(this,"iterable");pe(this,"firstKey");pe(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function kT(e){const t=bT(e),r=uT({dataSource:()=>X(e.dataSource),getKey:()=>X(e.getKey),getTextValue:()=>X(e.getTextValue),getDisabled:()=>X(e.getDisabled),getSectionChildren:()=>X(e.getSectionChildren),factory:s=>e.filter?new tm(e.filter(s)):new tm(s)},[()=>e.filter]),i=new _T(r,t);return Vp(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var Et=e=>typeof e=="function"?e():e,OT=e=>{const t=U(()=>{const o=Et(e.element);if(o)return getComputedStyle(o)}),n=()=>{var o,a;return(a=(o=t())==null?void 0:o.animationName)!=null?a:"none"},[r,i]=ce(Et(e.show)?"present":"hidden");let s="none";return xe(o=>{const a=Et(e.show);return at(()=>{var c;if(o===a)return a;const l=s,u=n();a?i("present"):u==="none"||((c=t())==null?void 0:c.display)==="none"?i("hidden"):i(o===!0&&l!==u?"hiding":"hidden")}),a}),xe(()=>{const o=Et(e.element);if(!o)return;const a=u=>{u.target===o&&(s=n())},l=u=>{const d=n().includes(u.animationName);u.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),_e(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},ET=OT,Gb=ET,fu="data-kb-top-layer",Kb,nf=!1,wr=[];function ga(e){return wr.findIndex(t=>t.node===e)}function AT(e){return wr[ga(e)]}function PT(e){return wr[wr.length-1].node===e}function Vb(){return wr.filter(e=>e.isPointerBlocking)}function TT(){return[...Vb()].slice(-1)[0]}function ih(){return Vb().length>0}function Wb(e){var n;const t=ga((n=TT())==null?void 0:n.node);return ga(e)<t}function MT(e){wr.push(e)}function jT(e){const t=ga(e);t<0||wr.splice(t,1)}function $T(){for(const{node:e}of wr)e.style.pointerEvents=Wb(e)?"none":"auto"}function DT(e){if(ih()&&!nf){const t=Jn(e);Kb=document.body.style.pointerEvents,t.body.style.pointerEvents="none",nf=!0}}function LT(e){if(ih())return;const t=Jn(e);t.body.style.pointerEvents=Kb,t.body.style.length===0&&t.body.removeAttribute("style"),nf=!1}var Wt={layers:wr,isTopMostLayer:PT,hasPointerBlockingLayer:ih,isBelowPointerBlockingLayer:Wb,addLayer:MT,removeLayer:jT,indexOf:ga,find:AT,assignPointerEventToLayers:$T,disableBodyPointerEvents:DT,restoreBodyPointerEvents:LT},IT={};Zu(IT,{Button:()=>FT,Root:()=>sh});var RT=["button","color","file","image","reset","submit"];function NT(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?RT.indexOf(e.type)!==-1:!1}function sh(e){let t;const n=Re({type:"button"},e),[r,i]=Ve(n,["ref","type","disabled"]),s=Xu(()=>t,()=>"button"),o=U(()=>{const u=s();return u==null?!1:NT({tagName:u,type:r.type})}),a=U(()=>s()==="input"),l=U(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return L(st,Ae({as:"button",ref(u){const c=It(d=>t=d,r.ref);typeof c=="function"&&c(u)},get type(){return o()||a()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return o()||a()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var FT=sh,BT=["top","right","bottom","left"],Xn=Math.min,on=Math.max,hu=Math.round,_l=Math.floor,Zr=e=>({x:e,y:e}),qT={left:"right",right:"left",bottom:"top",top:"bottom"},zT={start:"end",end:"start"};function rf(e,t,n){return on(e,Xn(t,n))}function Wi(e,t){return typeof e=="function"?e(t):e}function Jr(e){return e.split("-")[0]}function no(e){return e.split("-")[1]}function Qb(e){return e==="x"?"y":"x"}function oh(e){return e==="y"?"height":"width"}function Bi(e){return["top","bottom"].includes(Jr(e))?"y":"x"}function ah(e){return Qb(Bi(e))}function HT(e,t,n){n===void 0&&(n=!1);const r=no(e),i=ah(e),s=oh(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=gu(o)),[o,gu(o)]}function UT(e){const t=gu(e);return[sf(e),t,sf(t)]}function sf(e){return e.replace(/start|end/g,t=>zT[t])}function GT(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function KT(e,t,n,r){const i=no(e);let s=GT(Jr(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(sf)))),s}function gu(e){return e.replace(/left|right|bottom|top/g,t=>qT[t])}function VT(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yb(e){return typeof e!="number"?VT(e):{top:e,right:e,bottom:e,left:e}}function yu(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function nm(e,t,n){let{reference:r,floating:i}=e;const s=Bi(t),o=ah(t),a=oh(o),l=Jr(t),u=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(no(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}var WT=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=nm(u,r,l),f=r,h={},g=0;for(let m=0;m<a.length;m++){const{name:p,fn:v}=a[m],{x:b,y:S,data:C,reset:x}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=b!=null?b:c,d=S!=null?S:d,h={...h,[p]:{...h[p],...C}},x&&g<=50&&(g++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(u=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:c,y:d}=nm(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function ya(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Wi(t,e),g=Yb(h),p=a[f?d==="floating"?"reference":"floating":d],v=yu(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},x=yu(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:l}):b);return{top:(v.top-x.top+g.top)/C.y,bottom:(x.bottom-v.bottom+g.bottom)/C.y,left:(v.left-x.left+g.left)/C.x,right:(x.right-v.right+g.right)/C.x}}var QT=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=Wi(e,t)||{};if(u==null)return{};const d=Yb(c),f={x:n,y:r},h=ah(i),g=oh(h),m=await o.getDimensions(u),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",S=p?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[h]-f[h]-s.floating[g],x=f[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let w=k?k[S]:0;(!w||!await(o.isElement==null?void 0:o.isElement(k)))&&(w=a.floating[S]||s.floating[g]);const _=C/2-x/2,O=w/2-m[g]/2-1,E=Xn(d[v],O),T=Xn(d[b],O),j=E,B=w-m[g]-T,R=w/2-m[g]/2+_,A=rf(j,R,B),M=!l.arrow&&no(i)!=null&&R!==A&&s.reference[g]/2-(R<j?E:T)-m[g]/2<0,D=M?R<j?R-j:R-B:0;return{[h]:f[h]+D,data:{[h]:A,centerOffset:R-A-D,...M&&{alignmentOffset:D}},reset:M}}}),YT=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=Wi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Jr(i),b=Bi(a),S=Jr(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=f||(S||!m?[gu(a)]:UT(a)),k=g!=="none";!f&&k&&x.push(...KT(a,m,g,C));const w=[a,...x],_=await ya(t,p),O=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&O.push(_[v]),d){const R=HT(i,o,C);O.push(_[R[0]],_[R[1]])}if(E=[...E,{placement:i,overflows:O}],!O.every(R=>R<=0)){var T,j;const R=(((T=s.flip)==null?void 0:T.index)||0)+1,A=w[R];if(A)return{data:{index:R,overflows:E},reset:{placement:A}};let M=(j=E.filter(D=>D.overflows[0]<=0).sort((D,H)=>D.overflows[1]-H.overflows[1])[0])==null?void 0:j.placement;if(!M)switch(h){case"bestFit":{var B;const D=(B=E.filter(H=>{if(k){const Q=Bi(H.placement);return Q===b||Q==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Q=>Q>0).reduce((Q,F)=>Q+F,0)]).sort((H,Q)=>H[1]-Q[1])[0])==null?void 0:B[0];D&&(M=D);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function rm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function im(e){return BT.some(t=>e[t]>=0)}var XT=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Wi(e,t);switch(r){case"referenceHidden":{const s=await ya(t,{...i,elementContext:"reference"}),o=rm(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:im(o)}}}case"escaped":{const s=await ya(t,{...i,altBoundary:!0}),o=rm(s,n.floating);return{data:{escapedOffsets:o,escaped:im(o)}}}default:return{}}}}};async function ZT(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Jr(n),a=no(n),l=Bi(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,d=Wi(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}var JT=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await ZT(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},eM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...l}=Wi(e,t),u={x:n,y:r},c=await ya(t,l),d=Bi(Jr(i)),f=Qb(d);let h=u[f],g=u[d];if(s){const p=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+c[p],S=h-c[v];h=rf(b,h,S)}if(o){const p=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+c[p],S=g-c[v];g=rf(b,g,S)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},tM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=Wi(e,t),l=await ya(t,a),u=Jr(n),c=no(n),d=Bi(n)==="y",{width:f,height:h}=r.floating;let g,m;u==="top"||u==="bottom"?(g=u,m=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,g=c==="end"?"top":"bottom");const p=h-l.top-l.bottom,v=f-l.left-l.right,b=Xn(h-l[g],p),S=Xn(f-l[m],v),C=!t.middlewareData.shift;let x=b,k=S;if(d?k=c||C?Xn(S,v):v:x=c||C?Xn(b,p):p,C&&!c){const _=on(l.left,0),O=on(l.right,0),E=on(l.top,0),T=on(l.bottom,0);d?k=f-2*(_!==0||O!==0?_+O:on(l.left,l.right)):x=h-2*(E!==0||T!==0?E+T:on(l.top,l.bottom))}await o({...t,availableWidth:k,availableHeight:x});const w=await i.getDimensions(s.floating);return f!==w.width||h!==w.height?{reset:{rects:!0}}:{}}}};function ro(e){return Xb(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _r(e){var t;return(t=(Xb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Xb(e){return e instanceof Node||e instanceof un(e).Node}function $n(e){return e instanceof Element||e instanceof un(e).Element}function er(e){return e instanceof HTMLElement||e instanceof un(e).HTMLElement}function sm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}function Wa(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function nM(e){return["table","td","th"].includes(ro(e))}function Ju(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function lh(e){const t=uh(),n=$n(e)?Dn(e):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 rM(e){let t=ei(e);for(;er(t)&&!Vs(t);){if(lh(t))return t;if(Ju(t))return null;t=ei(t)}return null}function uh(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vs(e){return["html","body","#document"].includes(ro(e))}function Dn(e){return un(e).getComputedStyle(e)}function ec(e){return $n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ei(e){if(ro(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sm(e)&&e.host||_r(e);return sm(t)?t.host:t}function Zb(e){const t=ei(e);return Vs(t)?e.ownerDocument?e.ownerDocument.body:e.body:er(t)&&Wa(t)?t:Zb(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Zb(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=un(i);return s?t.concat(o,o.visualViewport||[],Wa(i)?i:[],o.frameElement&&n?ma(o.frameElement):[]):t.concat(i,ma(i,[],n))}function Jb(e){const t=Dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=er(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=hu(n)!==s||hu(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function ch(e){return $n(e)?e:e.contextElement}function ds(e){const t=ch(e);if(!er(t))return Zr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Jb(t);let o=(s?hu(n.width):n.width)/r,a=(s?hu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var iM=Zr(0);function e1(e){const t=un(e);return!uh()||!t.visualViewport?iM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==un(e)?!1:t}function qi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=ch(e);let o=Zr(1);t&&(r?$n(r)&&(o=ds(r)):o=ds(e));const a=sM(s,n,r)?e1(s):Zr(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=un(s),h=r&&$n(r)?un(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=ds(m),v=m.getBoundingClientRect(),b=Dn(m),S=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,d*=p.y,l+=S,u+=C,g=un(m),m=g.frameElement}}return yu({width:c,height:d,x:l,y:u})}function oM(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=_r(r),a=t?Ju(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Zr(1);const c=Zr(0),d=er(r);if((d||!d&&!s)&&((ro(r)!=="body"||Wa(o))&&(l=ec(r)),er(r))){const f=qi(r);u=ds(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function aM(e){return Array.from(e.getClientRects())}function t1(e){return qi(_r(e)).left+ec(e).scrollLeft}function lM(e){const t=_r(e),n=ec(e),r=e.ownerDocument.body,i=on(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=on(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+t1(e);const a=-n.scrollTop;return Dn(r).direction==="rtl"&&(o+=on(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function uM(e,t){const n=un(e),r=_r(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=uh();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function cM(e,t){const n=qi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=er(e)?ds(e):Zr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function om(e,t,n){let r;if(t==="viewport")r=uM(e,n);else if(t==="document")r=lM(_r(e));else if($n(t))r=cM(t,n);else{const i=e1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return yu(r)}function n1(e,t){const n=ei(e);return n===t||!$n(n)||Vs(n)?!1:Dn(n).position==="fixed"||n1(n,t)}function dM(e,t){const n=t.get(e);if(n)return n;let r=ma(e,[],!1).filter(a=>$n(a)&&ro(a)!=="body"),i=null;const s=Dn(e).position==="fixed";let o=s?ei(e):e;for(;$n(o)&&!Vs(o);){const a=Dn(o),l=lh(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Wa(o)&&!l&&n1(e,o))?r=r.filter(c=>c!==o):i=a,o=ei(o)}return t.set(e,r),r}function fM(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Ju(t)?[]:dM(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const d=om(t,c,i);return u.top=on(d.top,u.top),u.right=Xn(d.right,u.right),u.bottom=Xn(d.bottom,u.bottom),u.left=on(d.left,u.left),u},om(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function hM(e){const{width:t,height:n}=Jb(e);return{width:t,height:n}}function gM(e,t,n){const r=er(t),i=_r(t),s=n==="fixed",o=qi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Zr(0);if(r||!r&&!s)if((ro(t)!=="body"||Wa(i))&&(a=ec(t)),r){const d=qi(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=t1(i));const u=o.left+a.scrollLeft-l.x,c=o.top+a.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function Uc(e){return Dn(e).position==="static"}function am(e,t){return!er(e)||Dn(e).position==="fixed"?null:t?t(e):e.offsetParent}function r1(e,t){const n=un(e);if(Ju(e))return n;if(!er(e)){let i=ei(e);for(;i&&!Vs(i);){if($n(i)&&!Uc(i))return i;i=ei(i)}return n}let r=am(e,t);for(;r&&nM(r)&&Uc(r);)r=am(r,t);return r&&Vs(r)&&Uc(r)&&!lh(r)?n:r||rM(e)||n}var yM=async function(e){const t=this.getOffsetParent||r1,n=this.getDimensions,r=await n(e.floating);return{reference:gM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mM(e){return Dn(e).direction==="rtl"}var i1={convertOffsetParentRelativeRectToViewportRelativeRect:oM,getDocumentElement:_r,getClippingRect:fM,getOffsetParent:r1,getElementRects:yM,getClientRects:aM,getDimensions:hM,getScale:ds,isElement:$n,isRTL:mM};function pM(e,t){let n=null,r;const i=_r(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=_l(c),g=_l(i.clientWidth-(u+d)),m=_l(i.clientHeight-(c+f)),p=_l(u),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:on(0,Xn(1,l))||1};let S=!0;function C(x){const k=x[0].intersectionRatio;if(k!==l){if(!S)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch(x){n=new IntersectionObserver(C,b)}n.observe(e)}return o(!0),s}function vM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ch(e),c=i||s?[...u?ma(u):[],...ma(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=u&&a?pM(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,m=l?qi(e):null;l&&p();function p(){const v=qi(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,g=requestAnimationFrame(p)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}var bM=JT,xM=eM,wM=YT,SM=tM,CM=XT,_M=QT,kM=(e,t,n)=>{const r=new Map,i={platform:i1,...n},s={...i.platform,_c:r};return WT(e,t,{...i,platform:s})},dh=wt();function fh(){const e=St(dh);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var OM=he('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),of=30,lm=of/2,EM={top:180,right:-90,bottom:0,left:90};function hh(e){const t=fh(),n=Re({size:of},e),[r,i]=Ve(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=AM(t.contentRef),a=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},u=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},c=()=>Number.parseInt(u())*2*(of/r.size),d=()=>`rotate(${EM[s()]} ${lm} ${lm}) translate(0 2)`;return L(st,Ae({as:"div",ref(f){const h=It(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return Qu({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":c()},r.style)}},i,{get children(){const f=OM(),h=f.firstChild;return be(()=>re(h,"transform",d())),f}}))}function AM(e){const[t,n]=ce();return xe(()=>{const r=e();r&&n(EP(r).getComputedStyle(r))}),t}function PM(e){const t=fh(),[n,r]=Ve(e,["ref","style"]);return L(st,Ae({as:"div",ref(i){const s=It(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return Qu({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function um(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e!=null?e:{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const s={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...s,toJSON:()=>s}}function TM(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?um(r):e?e.getBoundingClientRect():um()}}}function MM(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var jM={top:"bottom",right:"left",bottom:"top",left:"right"};function $M(e,t){const[n,r]=e.split("-"),i=jM[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function DM(e){const t=Re({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=ce(),[i,s]=ce(),[o,a]=ce(t.placement),l=()=>{var f;return TM((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:u}=ii();async function c(){var k,w,_;const f=l(),h=n(),g=i();if(!f||!h)return;const m=((g==null?void 0:g.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(k=t.gutter)!=null?k:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[bM(({placement:O})=>{const E=!!O.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(MM))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(wM({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(xM({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(SM({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:E,rects:T}){const j=Math.round(T.reference.width);O=Math.floor(O),E=Math.floor(E),h.style.setProperty("--kb-popper-anchor-width",`${j}px`),h.style.setProperty("--kb-popper-content-available-width",`${O}px`),h.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(h.style.width=`${j}px`),t.fitViewport&&(h.style.maxWidth=`${O}px`,h.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&v.push(CM({padding:t.detachedPadding})),g&&v.push(_M({element:g,padding:t.arrowPadding}));const b=await kM(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...i1,isRTL:()=>u()==="rtl"}});if(a(b.placement),(w=t.onCurrentPlacementChange)==null||w.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",$M(b.placement,u()));const S=Math.round(b.x),C=Math.round(b.y);let x;if(t.hideWhenDetached&&(x=(_=b.middlewareData.hide)!=null&&_.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${S}px, ${C}px, 0)`,visibility:x}),g&&b.middlewareData.arrow){const{x:O,y:E}=b.middlewareData.arrow,T=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:E!=null?`${E}px`:"",[T]:"100%"})}}xe(()=>{const f=l(),h=n();if(!f||!h)return;const g=vM(f,h,c,{elementResize:typeof ResizeObserver=="function"});_e(g)}),xe(()=>{var g;const f=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:o,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return L(dh.Provider,{value:d,get children(){return t.children}})}var s1=Object.assign(DM,{Arrow:hh,Context:dh,usePopperContext:fh,Positioner:PM});function LM(e){const t=n=>{var r;n.key===eh.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};xe(()=>{var r,i;if(X(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:Jn();n.addEventListener("keydown",t),_e(()=>{n.removeEventListener("keydown",t)})})}var cm="interactOutside.pointerDownOutside",dm="interactOutside.focusOutside";function IM(e,t){let n,r=HP;const i=()=>Jn(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},o=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${fu}]`)||!wn(i(),f)||wn(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},u=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const m=vt([s,a]);g.addEventListener(cm,m,{once:!0});const p=new CustomEvent(cm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||jP(d)&&d.button===0}});g.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},c=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=vt([o,a]);h.addEventListener(dm,g,{once:!0});const m=new CustomEvent(dm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};xe(()=>{X(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",u,!0)},0),i().addEventListener("focusin",c,!0),_e(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",u,!0),i().removeEventListener("focusin",c,!0)}))})}var o1=wt();function RM(){return St(o1)}function NM(e){let t;const n=RM(),[r,i]=Ve(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};IM({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>wn(h(),d)))||[...s].some(h=>wn(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||Wt.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Wt.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:d=>{var f,h,g;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),LM({ownerDocument:()=>Jn(t),onEscapeKeyDown:d=>{var f;!t||!Wt.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),xr(()=>{if(!t)return;Wt.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Wt.assignPointerEventToLayers(),Wt.disableBodyPointerEvents(t),_e(()=>{t&&(Wt.removeLayer(t),d==null||d(),Wt.assignPointerEventToLayers(),Wt.restoreBodyPointerEvents(t))})}),xe(br([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Wt.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Wt.assignPointerEventToLayers()),f&&Wt.disableBodyPointerEvents(d),_e(()=>{Wt.restoreBodyPointerEvents(d)})},{defer:!0}));const c={registerNestedLayer:o};return L(o1.Provider,{value:c,get children(){return L(st,Ae({as:"div",ref(d){const f=It(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function a1(e={}){const[t,n]=Lb({value:()=>X(e.open),defaultValue:()=>!!X(e.defaultOpen),onChange:o=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,o)}}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var mn={};Zu(mn,{Description:()=>$b,ErrorMessage:()=>Db,Item:()=>d1,ItemControl:()=>f1,ItemDescription:()=>h1,ItemIndicator:()=>g1,ItemInput:()=>y1,ItemLabel:()=>m1,Label:()=>p1,RadioGroup:()=>FM,Root:()=>v1});var l1=wt();function u1(){const e=St(l1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var c1=wt();function Qa(){const e=St(c1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function d1(e){const t=Ka(),n=u1(),r=`${t.generateId("item")}-${kn()}`,i=Re({id:r},e),[s,o]=Ve(i,["value","disabled","onPointerDown"]),[a,l]=ce(),[u,c]=ce(),[d,f]=ce(),[h,g]=ce(),[m,p]=ce(!1),v=U(()=>n.isSelectedValue(s.value)),b=U(()=>s.disabled||t.isDisabled()||!1),S=k=>{nt(k,s.onPointerDown),m()&&k.preventDefault()},C=U(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),x={value:()=>s.value,dataset:C,isSelected:v,isDisabled:b,inputId:a,labelId:u,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Ga(()=>o.id),registerInput:Sn(l),registerLabel:Sn(c),registerDescription:Sn(f),setIsFocused:p,setInputRef:g};return L(c1.Provider,{value:x,get children(){return L(st,Ae({as:"div",role:"group",onPointerDown:S},C,o))}})}function f1(e){const t=Qa(),n=Re({id:t.generateId("control")},e),[r,i]=Ve(n,["onClick","onKeyDown"]);return L(st,Ae({as:"div",onClick:a=>{var l;nt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;nt(a,r.onKeyDown),a.key===eh.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function h1(e){const t=Qa(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),L(st,Ae({as:"div"},()=>t.dataset(),n))}function g1(e){const t=Qa(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ve(n,["ref","forceMount"]),[s,o]=ce(),{present:a}=Gb({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return L(ve,{get when(){return a()},get children(){return L(st,Ae({as:"div",ref(l){const u=It(o,r.ref);typeof u=="function"&&u(l)}},()=>t.dataset(),i))}})}function y1(e){const t=Ka(),n=u1(),r=Qa(),i=Re({id:r.generateId("input")},e),[s,o]=Ve(i,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),a=()=>[s["aria-labelledby"],r.labelId(),s["aria-labelledby"]!=null&&o["aria-label"]!=null?o.id:void 0].filter(Boolean).join(" ")||void 0,l=()=>[s["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[u,c]=ce(!1),d=g=>{if(nt(g,s.onChange),g.stopPropagation(),!u()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}c(!1)},f=g=>{nt(g,s.onFocus),r.setIsFocused(!0)},h=g=>{nt(g,s.onBlur),r.setIsFocused(!1)};return xe(br([()=>r.isSelected(),()=>r.value()],g=>{if(!g[0]&&g[1]===r.value())return;c(!0);const m=r.inputRef();m==null||m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),m==null||m.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),xe(()=>_e(r.registerInput(o.id))),L(st,Ae({as:"input",ref(g){const m=It(r.setInputRef,s.ref);typeof m=="function"&&m(g)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return Qu({...Mb},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function m1(e){const t=Qa(),n=Re({id:t.generateId("label")},e);return xe(()=>_e(t.registerLabel(n.id))),L(st,Ae({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function p1(e){return L(WP,Ae({as:"span"},e))}function v1(e){let t;const n=`radiogroup-${kn()}`,r=Re({id:n,orientation:"vertical"},e),[i,s,o]=Ve(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],KP),[a,l]=Va({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:u}=VP(s);QP(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const c=()=>u.getAriaLabelledBy(X(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>u.getAriaDescribedBy(i["aria-describedby"]),f=g=>g===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:g=>{if(!(u.isReadOnly()||u.isDisabled())&&(l(g),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return L(jb.Provider,{value:u,get children(){return L(l1.Provider,{value:h,get children(){return L(st,Ae({as:"div",ref(g){const m=It(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return X(s.id)},get"aria-invalid"(){return u.validationState()==="invalid"||void 0},get"aria-required"(){return u.isRequired()||void 0},get"aria-disabled"(){return u.isDisabled()||void 0},get"aria-readonly"(){return u.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return c()},get"aria-describedby"(){return d()}},()=>u.dataset(),o))}})}})}var FM=Object.assign(v1,{Description:$b,ErrorMessage:Db,Item:d1,ItemControl:f1,ItemDescription:h1,ItemIndicator:g1,ItemInput:y1,ItemLabel:m1,Label:p1}),BM=class{constructor(e,t,n){pe(this,"collection");pe(this,"ref");pe(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n,r;return(r=(n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))!=null?r:null}getKeyPageAbove(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){var i;const n=(i=this.collator)==null?void 0:i.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const s=this.collection().getItem(r);if(s){const o=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function qM(e,t,n){const r=mT({usage:"search",sensitivity:"base"}),i=U(()=>{const s=X(e.keyboardDelegate);return s||new BM(e.collection,t,r)});return CT({selectionManager:()=>X(e.selectionManager),keyboardDelegate:i,autoFocus:()=>X(e.autoFocus),deferAutoFocus:()=>X(e.deferAutoFocus),shouldFocusWrap:()=>X(e.shouldFocusWrap),disallowEmptySelection:()=>X(e.disallowEmptySelection),selectOnFocus:()=>X(e.selectOnFocus),disallowTypeAhead:()=>X(e.disallowTypeAhead),shouldUseVirtualFocus:()=>X(e.shouldUseVirtualFocus),allowsTabNavigation:()=>X(e.allowsTabNavigation),isVirtualized:()=>X(e.isVirtualized),scrollToKey:s=>{var o;return(o=X(e.scrollToKey))==null?void 0:o(s)},orientation:()=>X(e.orientation)},t)}var Gc="focusScope.autoFocusOnMount",Kc="focusScope.autoFocusOnUnmount",fm={bubbles:!1,cancelable:!0},hm={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Jd(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Jd(this.stack,e),(t=this.active())==null||t.resume()}};function zM(e,t){const[n,r]=ce(!1),i={pause(){r(!0)},resume(){r(!1)}};let s=null;const o=g=>{var m;return(m=e.onMountAutoFocus)==null?void 0:m.call(e,g)},a=g=>{var m;return(m=e.onUnmountAutoFocus)==null?void 0:m.call(e,g)},l=()=>Jn(t()),u=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,Mb),g},c=()=>{const g=t();return g?Pb(g,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const g=c();return g.length>0?g[0]:null},f=()=>{const g=c();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const m=Io(g);return!m||wn(g,m)?!1:Tb(m)};xe(()=>{const g=t();if(!g)return;hm.add(i);const m=Io(g);if(!wn(g,m)){const v=new CustomEvent(Gc,fm);g.addEventListener(Gc,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{At(d()),Io(g)===m&&At(g)},0)}_e(()=>{g.removeEventListener(Gc,o),setTimeout(()=>{const v=new CustomEvent(Kc,fm);h()&&v.preventDefault(),g.addEventListener(Kc,a),g.dispatchEvent(v),v.defaultPrevented||At(m!=null?m:l().body),g.removeEventListener(Kc,a),hm.remove(i)},0)})}),xe(()=>{const g=t();if(!g||!X(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${fu}]`)||(wn(g,b)?s=b:At(s))},p=v=>{const b=v.relatedTarget,S=b!=null?b:Io(g);S!=null&&S.closest(`[${fu}]`)||wn(g,S)||At(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),_e(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),xe(()=>{const g=t();if(!g||!X(e.trapFocus)||n())return;const m=u();g.insertAdjacentElement("afterbegin",m);const p=u();g.insertAdjacentElement("beforeend",p);function v(S){const C=d(),x=f();S.relatedTarget===C?At(x):At(C)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(S=>{for(const C of S)C.previousSibling===p&&(p.remove(),g.insertAdjacentElement("beforeend",p)),C.nextSibling===m&&(m.remove(),g.insertAdjacentElement("afterbegin",m))});b.observe(g,{childList:!0,subtree:!1}),_e(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var HM="data-live-announcer";function UM(e){xe(()=>{X(e.isDisabled)||_e(GM(X(e.targets),X(e.root)))})}var _o=new WeakMap,yn=[];function GM(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${HM}], [${fu}]`))n.add(f);const u=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),d=u(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=c.nextNode();for(;f!=null;)s(f),f=c.nextNode()}},s=l=>{var c;const u=(c=_o.get(l))!=null?c:0;l.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&l.setAttribute("aria-hidden","true"),r.add(l),_o.set(l,u+1))};yn.length&&yn[yn.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const u of l)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(u.target))){for(const c of u.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(const c of u.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&i(c)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return yn.push(a),()=>{o.disconnect();for(const l of r){const u=_o.get(l);if(u==null)return;u===1?(l.removeAttribute("aria-hidden"),_o.delete(l)):_o.set(l,u-1)}a===yn[yn.length-1]?(yn.pop(),yn.length&&yn[yn.length-1].observe()):yn.splice(yn.indexOf(a),1)}}var kl=new Map,KM=e=>{xe(()=>{var s,o;const t=(s=Et(e.style))!=null?s:{},n=(o=Et(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=kl.get(e.key);i?i.activeCount++:kl.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);_e(()=>{var l;const a=kl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}kl.delete(e.key);for(const[u,c]of Object.entries(a.originalStyles))e.element.style[u]=c;for(const u of a.properties)e.element.style.removeProperty(u);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},gm=KM,VM=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},WM=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},QM=(e,t,n)=>{var l;const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,s=0,o=0,a=!1;do{const[u,c,d]=VM(i,t),f=d-u-r*c;(c!==0||f!==0)&&WM(i,t)&&(s+=f,o+=c),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[ym,mm]=ce([]),YM=e=>ym().indexOf(e)===ym().length-1,XM=e=>{const t=Ae({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=kn();let r=[0,0],i=null,s=null;xe(()=>{Et(t.enabled)&&(mm(u=>[...u,n]),_e(()=>{mm(u=>u.filter(c=>c!==n))}))}),xe(()=>{if(!Et(t.enabled)||!Et(t.hideScrollbar))return;const{body:u}=document,c=window.innerWidth-u.offsetWidth;if(Et(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];c>0&&(Et(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(u).paddingRight} + ${c}px)`:d.marginRight=`calc(${window.getComputedStyle(u).marginRight} + ${c}px)`,f.push({key:"--scrollbar-width",value:`${c}px`}));const h=window.scrollY,g=window.scrollX;gm({key:"prevent-scroll",element:u,style:d,properties:f,cleanup:()=>{Et(t.restoreScrollPosition)&&c>0&&window.scrollTo(g,h)}})}else gm({key:"prevent-scroll",element:u,style:{overflow:"hidden"}})}),xe(()=>{!YM(n)||!Et(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),_e(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=u=>{r=pm(u),i=null,s=null},a=u=>{const c=u.target,d=Et(t.element),f=ZM(u),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=vm(c,h,g,d);let p;d&&af(d,c)?p=!m:p=!0,p&&u.cancelable&&u.preventDefault()},l=u=>{const c=Et(t.element),d=u.target;let f;if(u.touches.length===2)f=!Et(t.allowPinchZoom);else{if(i==null||s===null){const h=pm(u).map((m,p)=>r[p]-m),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=g,s=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=vm(d,i,s,c);c&&af(c,d)?f=!h:f=!0}}f&&u.cancelable&&u.preventDefault()}},ZM=e=>[e.deltaX,e.deltaY],pm=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],vm=(e,t,n,r)=>{const i=r!==null&&af(r,e),[s,o]=QM(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},af=(e,t)=>{var r;if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=(r=n._$host)!=null?r:n.parentElement}return!1},JM=XM,ej=JM,b1=wt();function x1(){return St(b1)}function kr(){const e=x1();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var w1=wt();function gh(){const e=St(w1);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var S1=wt();function tr(){const e=St(S1);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function yh(e){let t;const n=tr(),r=kr(),i=Re({id:n.generateId(`item-${kn()}`)},e),[s,o]=Ve(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=ce(),[u,c]=ce(),[d,f]=ce(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var O;(O=s.onSelect)==null||O.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};lT({getItem:()=>{var O,E,T,j,B;return{ref:()=>t,type:"item",key:g(),textValue:(j=(T=(E=s.textValue)!=null?E:(O=d())==null?void 0:O.textContent)!=null?T:t==null?void 0:t.textContent)!=null?j:"",disabled:(B=s.disabled)!=null?B:!1}}});const v=Ub({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=O=>{nt(O,s.onPointerMove),O.pointerType==="mouse"&&(s.disabled?r.onItemLeave(O):(r.onItemEnter(O),O.defaultPrevented||(At(O.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},S=O=>{nt(O,s.onPointerLeave),O.pointerType==="mouse"&&r.onItemLeave(O)},C=O=>{nt(O,s.onPointerUp),!s.disabled&&O.button===0&&p()},x=O=>{if(nt(O,s.onKeyDown),!O.repeat&&!s.disabled)switch(O.key){case"Enter":case" ":p();break}},k=U(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),w=U(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":m()?"":void 0})),_={isChecked:()=>s.checked,dataset:w,setLabelRef:f,generateId:Ga(()=>o.id),registerLabel:Sn(l),registerDescription:Sn(c)};return L(w1.Provider,{value:_,get children(){return L(st,Ae({as:"div",ref(O){const E=It(T=>t=T,s.ref);typeof E=="function"&&E(O)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return u()},get"data-key"(){return v.dataKey()},get onPointerDown(){return vt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return vt([C,v.onPointerUp])},get onClick(){return vt([s.onClick,v.onClick])},get onKeyDown(){return vt([x,v.onKeyDown])},get onMouseDown(){return vt([s.onMouseDown,v.onMouseDown])},get onFocus(){return vt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:S},w,o))}})}function C1(e){const t=Re({closeOnSelect:!1},e),[n,r]=Ve(t,["checked","defaultChecked","onChange","onSelect"]),i=JP({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>{var a;return(a=n.onChange)==null?void 0:a.call(n,o)},isDisabled:()=>r.disabled});return L(yh,Ae({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var tj=wt();function tc(){return St(tj)}var pa={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>pa.next(e==="ltr"?"rtl":"ltr",t)},bm={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function _1(e){const t=tr(),n=kr(),r=tc(),{direction:i}=ii(),s=Re({id:t.generateId("trigger")},e),[o,a]=Ve(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>{var v;return(v=t.value())!=null?v:o.id},r.lastValue()===void 0&&r.setLastValue(l));const u=Xu(()=>n.triggerRef(),()=>"button"),c=U(()=>{var v;return u()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});xe(br(()=>r==null?void 0:r.value(),v=>{var b;c()&&v===l()&&((b=n.triggerRef())==null||b.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=v=>{nt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{nt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},g=v=>{if(nt(v,o.onKeyDown),!o.disabled){if(c())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case bm.first(t.orientation()):v.stopPropagation(),v.preventDefault(),GP(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case bm.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case pa.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case pa.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;nt(v,o.onMouseOver),((b=n.triggerRef())==null?void 0:b.dataset.pointerType)!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},p=v=>{nt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return xe(()=>_e(n.registerTriggerId(o.id))),L(sh,Ae({ref(v){const b=It(n.setTriggerRef,o.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return U(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:m,onClick:h,onKeyDown:g,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var nj=wt();function k1(){return St(nj)}function O1(e){let t;const n=tr(),r=kr(),i=tc(),s=k1(),{direction:o}=ii(),a=Re({id:n.generateId(`content-${kn()}`)},e),[l,u]=Ve(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=qM({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);zM({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:S=>{var C;i===void 0&&((C=l.onOpenAutoFocus)==null||C.call(l,S))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=S=>{if(wn(S.currentTarget,S.target)&&(S.key==="Tab"&&r.isOpen()&&S.preventDefault(),i!==void 0&&S.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(S.key){case pa.next(o(),n.orientation()):S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case pa.previous(o(),n.orientation()):if(S.currentTarget.hasAttribute("data-closed"))break;S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},g=S=>{var C;(C=l.onEscapeKeyDown)==null||C.call(l,S),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=S=>{var C;(C=l.onFocusOutside)==null||C.call(l,S),n.isModal()&&S.preventDefault()},p=S=>{var C,x;nt(S,l.onPointerEnter),r.isOpen()&&((C=r.parentMenuContext())==null||C.listState().selectionManager().setFocused(!1),(x=r.parentMenuContext())==null||x.listState().selectionManager().setFocusedKey(void 0))},v=S=>{if(nt(S,l.onPointerMove),S.pointerType!=="mouse")return;const C=S.target,x=c!==S.clientX;wn(S.currentTarget,C)&&x&&(r.setPointerDir(S.clientX>c?"right":"left"),c=S.clientX)};xe(()=>_e(r.registerContentId(l.id)));const b={ref:It(S=>{r.setContentRef(S),t=S},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:vt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:vt([l.onMouseDown,f.onMouseDown]),onFocusIn:vt([l.onFocusIn,f.onFocusIn]),onFocusOut:vt([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return L(ve,{get when(){return r.contentPresent()},get children(){return L(ve,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return L(st,Ae({as:"div"},()=>r.dataset(),b,u))},get children(){return L(s1.Positioner,{get children(){return L(NM,Ae({get disableOutsidePointerEvents(){return U(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Qu({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:g,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),b,u))}})}})}})}function rj(e){let t;const n=tr(),r=kr(),[i,s]=Ve(e,["ref"]);return ej({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),L(O1,Ae({ref(o){const a=It(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var E1=wt();function ij(){const e=St(E1);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function mh(e){const t=tr(),n=Re({id:t.generateId(`group-${kn()}`)},e),[r,i]=ce(),s={generateId:Ga(()=>n.id),registerLabelId:Sn(i)};return L(E1.Provider,{value:s,get children(){return L(st,Ae({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function A1(e){const t=ij(),n=Re({id:t.generateId("label")},e),[r,i]=Ve(n,["id"]);return xe(()=>_e(t.registerLabelId(r.id))),L(st,Ae({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function P1(e){const t=kr(),n=Re({children:"▼"},e);return L(st,Ae({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function T1(e){return L(yh,Ae({role:"menuitem",closeOnSelect:!0},e))}function M1(e){const t=gh(),n=Re({id:t.generateId("description")},e),[r,i]=Ve(n,["id"]);return xe(()=>_e(t.registerDescription(r.id))),L(st,Ae({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function j1(e){const t=gh(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ve(n,["forceMount"]);return L(ve,{get when(){return r.forceMount||t.isChecked()},get children(){return L(st,Ae({as:"div"},()=>t.dataset(),i))}})}function $1(e){const t=gh(),n=Re({id:t.generateId("label")},e),[r,i]=Ve(n,["ref","id"]);return xe(()=>_e(t.registerLabel(r.id))),L(st,Ae({as:"div",ref(s){const o=It(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function D1(e){const t=kr();return L(ve,{get when(){return t.contentPresent()},get children(){return L(ov,e)}})}var L1=wt();function sj(){const e=St(L1);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function I1(e){const n=tr().generateId(`radiogroup-${kn()}`),r=Re({id:n},e),[i,s]=Ve(r,["value","defaultValue","onChange","disabled"]),[o,a]=Va({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:u=>{var c;return(c=i.onChange)==null?void 0:c.call(i,u)}}),l={isDisabled:()=>i.disabled,isSelectedValue:u=>u===o(),setSelectedValue:a};return L(L1.Provider,{value:l,get children(){return L(mh,s)}})}function R1(e){const t=sj(),n=Re({closeOnSelect:!1},e),[r,i]=Ve(n,["value","onSelect"]);return L(yh,Ae({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var o;(o=r.onSelect)==null||o.call(r),t.setSelectedValue(r.value)}},i))}function oj(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),s=[],o=t.clientX,a=t.clientY;switch(r){case"top":s.push([o,a+5]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]);break;case"right":s.push([o-5,a]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]);break;case"bottom":s.push([o,a-5]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]);break;case"left":s.push([o+5,a]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]);break}return s}function aj(e,t){return t?UP([e.clientX,e.clientY],t):!1}function N1(e){const t=tr(),n=Rb(),r=x1(),i=tc(),s=k1(),o=Re({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=Ve(o,["open","defaultOpen","onOpenChange"]);let u=0,c=null,d="right";const[f,h]=ce(),[g,m]=ce(),[p,v]=ce(),[b,S]=ce(),[C,x]=ce(!0),[k,w]=ce(l.placement),[_,O]=ce([]),[E,T]=ce([]),{DomCollectionProvider:j}=aT({items:E,onItemsChange:T}),B=a1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:J=>{var Ce;return(Ce=a.onOpenChange)==null?void 0:Ce.call(a,J)}}),{present:R}=Gb({show:()=>t.forceMount()||B.isOpen(),element:()=>{var J;return(J=b())!=null?J:null}}),A=kT({selectionMode:"none",dataSource:E}),M=J=>{x(J),B.open()},D=(J=!1)=>{B.close(),J&&r&&r.close(!0)},H=J=>{x(J),B.toggle()},Q=()=>{const J=b();J&&(At(J),A.selectionManager().setFocused(!0),A.selectionManager().setFocusedKey(void 0))},F=()=>{s!=null?setTimeout(()=>Q()):Q()},G=J=>{O(ge=>[...ge,J]);const Ce=r==null?void 0:r.registerNestedMenu(J);return()=>{O(ge=>Jd(ge,J)),Ce==null||Ce()}},ie=J=>d===(c==null?void 0:c.side)&&aj(J,c==null?void 0:c.area),ae=J=>{ie(J)&&J.preventDefault()},N=J=>{ie(J)||F()},le=J=>{ie(J)&&J.preventDefault()};UM({isDisabled:()=>!(r==null&&B.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),xe(()=>{const J=b();if(!J||!r)return;const Ce=r.registerNestedMenu(J);_e(()=>{Ce()})}),xe(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),xe(()=>{var J;r!==void 0||i===void 0||(i.value()===t.value()?((J=p())==null||J.focus(),i.autoFocusMenu()&&M(!0)):D())}),xe(()=>{r!==void 0||i===void 0||B.isOpen()&&i.setValue(t.value())}),_e(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const me={dataset:U(()=>({"data-expanded":B.isOpen()?"":void 0,"data-closed":B.isOpen()?void 0:""})),isOpen:B.isOpen,contentPresent:R,nestedMenus:_,currentPlacement:k,pointerGraceTimeoutId:()=>u,autoFocus:C,listState:()=>A,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:S,open:M,close:D,toggle:H,focusContent:F,onItemEnter:ae,onItemLeave:N,onTriggerLeave:le,setPointerDir:J=>d=J,setPointerGraceTimeoutId:J=>u=J,setPointerGraceIntent:J=>c=J,registerNestedMenu:G,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Sn(h),registerContentId:Sn(m)};return L(j,{get children(){return L(b1.Provider,{value:me,get children(){return L(ve,{when:s===void 0,get fallback(){return l.children},get children(){return L(s1,Ae({anchorRef:p,contentRef:b,onCurrentPlacementChange:w},l))}})}})}})}function F1(e){const{direction:t}=ii();return L(N1,Ae({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var lj={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function B1(e){const t=kr(),n=tr(),[r,i]=Ve(e,["onFocusOutside","onKeyDown"]),{direction:s}=ii();return L(O1,Ae({onOpenAutoFocus:c=>{c.preventDefault()},onCloseAutoFocus:c=>{c.preventDefault()},onFocusOutside:c=>{var f;(f=r.onFocusOutside)==null||f.call(r,c);const d=c.target;wn(t.triggerRef(),d)||t.close()},onKeyDown:c=>{nt(c,r.onKeyDown);const d=wn(c.currentTarget,c.target),f=lj.close(s(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),At(t.triggerRef()))}},i))}var xm=["Enter"," "],uj={open:(e,t)=>e==="ltr"?[...xm,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...xm,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function q1(e){let t;const n=tr(),r=kr(),i=Re({id:n.generateId(`sub-trigger-${kn()}`)},e),[s,o]=Ve(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:u}=ii(),c=()=>s.id,d=()=>{const S=r.parentMenuContext();if(S==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return S.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===c(),g=Ub({key:c,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=S=>{nt(S,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=S=>{var x;if(nt(S,s.onPointerMove),S.pointerType!=="mouse")return;const C=r.parentMenuContext();if(C==null||C.onItemEnter(S),!S.defaultPrevented){if(s.disabled){C==null||C.onItemLeave(S);return}!r.isOpen()&&!a&&((x=r.parentMenuContext())==null||x.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),C==null||C.onItemEnter(S),S.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),At(S.currentTarget),C==null||C.listState().selectionManager().setFocused(!0),C==null||C.listState().selectionManager().setFocusedKey(c()))}},v=S=>{if(nt(S,s.onPointerLeave),S.pointerType!=="mouse")return;l();const C=r.parentMenuContext(),x=r.contentRef();if(x){C==null||C.setPointerGraceIntent({area:oj(r.currentPlacement(),S,x),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const k=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(k)}else{if(C==null||C.onTriggerLeave(S),S.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(S)},b=S=>{nt(S,s.onKeyDown),!S.repeat&&(s.disabled||uj.open(u(),n.orientation()).includes(S.key)&&(S.stopPropagation(),S.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return xe(()=>{var C,x,k;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const S=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:c(),textValue:(x=(C=s.textValue)!=null?C:t==null?void 0:t.textContent)!=null?x:"",disabled:(k=s.disabled)!=null?k:!1});_e(S)}),xe(br(()=>{var S;return(S=r.parentMenuContext())==null?void 0:S.pointerGraceTimeoutId()},S=>{_e(()=>{var C;window.clearTimeout(S),(C=r.parentMenuContext())==null||C.setPointerGraceIntent(null)})})),xe(()=>_e(r.registerTriggerId(s.id))),_e(()=>{l()}),L(st,Ae({as:"div",ref(S){const C=It(x=>{r.setTriggerRef(x),t=x},s.ref);typeof C=="function"&&C(S)},get id(){return s.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return U(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return vt([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return vt([s.onPointerUp,g.onPointerUp])},get onClick(){return vt([m,g.onClick])},get onKeyDown(){return vt([b,g.onKeyDown])},get onMouseDown(){return vt([s.onMouseDown,g.onMouseDown])},get onFocus(){return vt([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function cj(e){const t=tc(),n=`menu-${kn()}`,r=Re({id:n,modal:!0},e),[i,s]=Ve(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=a1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var u;return(u=i.onOpenChange)==null?void 0:u.call(i,l)}}),a={isModal:()=>{var l;return(l=i.modal)!=null?l:!0},preventScroll:()=>{var l;return(l=i.preventScroll)!=null?l:a.isModal()},forceMount:()=>{var l;return(l=i.forceMount)!=null?l:!1},generateId:Ga(()=>i.id),value:()=>i.value,orientation:()=>{var l,u;return(u=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?u:"horizontal"}};return L(S1.Provider,{value:a,get children(){return L(N1,Ae({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var dj={};Zu(dj,{Root:()=>nc,Separator:()=>fj});function nc(e){let t;const n=Re({orientation:"horizontal"},e),[r,i]=Ve(n,["ref","orientation"]),s=Xu(()=>t,()=>"hr");return L(st,Ae({as:"hr",ref(o){const a=It(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var fj=nc,ft={};Zu(ft,{Arrow:()=>hh,CheckboxItem:()=>C1,Content:()=>z1,DropdownMenu:()=>hj,Group:()=>mh,GroupLabel:()=>A1,Icon:()=>P1,Item:()=>T1,ItemDescription:()=>M1,ItemIndicator:()=>j1,ItemLabel:()=>$1,Portal:()=>D1,RadioGroup:()=>I1,RadioItem:()=>R1,Root:()=>H1,Separator:()=>nc,Sub:()=>F1,SubContent:()=>B1,SubTrigger:()=>q1,Trigger:()=>_1});function z1(e){const t=tr(),n=kr(),[r,i]=Ve(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return L(rj,Ae({onCloseAutoFocus:l=>{var u;(u=r.onCloseAutoFocus)==null||u.call(r,l),s||At(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var u;(u=r.onInteractOutside)==null||u.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function H1(e){const t=`dropdownmenu-${kn()}`,n=Re({id:t},e);return L(cj,n)}var hj=Object.assign(H1,{Arrow:hh,CheckboxItem:C1,Content:z1,Group:mh,GroupLabel:A1,Icon:P1,Item:T1,ItemDescription:M1,ItemIndicator:j1,ItemLabel:$1,Portal:D1,RadioGroup:I1,RadioItem:R1,Separator:nc,Sub:F1,SubContent:B1,SubTrigger:q1,Trigger:_1}),K={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},gj=he('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),yj=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mj=he('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),pj=he('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),ph=he('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),vj=he('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),bj=he('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),xj=he('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),wj=he('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),Sj=he('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),Cj=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),_j=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),kj=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),Oj=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),U1=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Ej=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Aj=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),Pj=he('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Tj=he('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Mj=he('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),jj=he('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),$j=he('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Dj=he('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function Lj(){return gj()}function G1(){return yj()}function Ko(){return mj()}function wm(){return pj()}function Sm(){return ph()}function Ij(){return(()=>{var e=ph();return e.style.setProperty("transform","rotate(90deg)"),e})()}function Rj(){return(()=>{var e=ph();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function Nj(){return vj()}function Fj(){return bj()}function Bj(){return xj()}function qj(){return wj()}function zj(){return Sj()}function Hj(){return Cj()}function Uj(){return _j()}function Gj(){return kj()}function Kj(){return Oj()}function Vj(e){return(()=>{var t=U1(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function Wj(){return Ej()}function Qj(){return Aj()}function Yj(e){return[L(ve,{get when(){return e.checked},get children(){var t=U1(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),L(ve,{get when(){return!e.checked},get children(){var t=Pj(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function Xj(){return Tj()}function Zj(){return Mj()}function Jj(){return jj()}function e$(){return $j()}function Cm(){const e=kn();return(()=>{var t=Dj(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,u=l.nextSibling,c=u.firstChild,d=u.nextSibling,f=d.firstChild,h=d.nextSibling,g=h.nextSibling,m=g.firstChild,p=g.nextSibling,v=p.firstChild,b=p.nextSibling,S=b.nextSibling,C=S.firstChild,x=S.nextSibling,k=x.firstChild,w=x.nextSibling,_=w.nextSibling,O=_.firstChild,E=_.nextSibling,T=E.firstChild,j=E.nextSibling,B=j.nextSibling,R=B.firstChild,A=B.nextSibling,M=A.firstChild,D=A.nextSibling,H=D.nextSibling,Q=H.firstChild,F=H.nextSibling,G=F.firstChild,ie=F.nextSibling,ae=ie.firstChild,N=ae.nextSibling,le=N.nextSibling,te=le.nextSibling,me=te.nextSibling,J=ie.nextSibling,Ce=J.firstChild,ge=J.nextSibling,ze=ge.firstChild,oe=ge.nextSibling,He=oe.firstChild,lt=He.nextSibling,dt=lt.nextSibling,Ne=dt.firstChild,Fe=Ne.nextSibling,Y=Fe.nextSibling,Pe=Y.nextSibling,tt=Pe.nextSibling,$e=tt.nextSibling,ue=$e.nextSibling,W=ue.nextSibling,ne=W.nextSibling,ee=ne.nextSibling,we=ee.nextSibling,gt=we.nextSibling,Se=oe.nextSibling,Je=Se.firstChild,Be=Se.nextSibling,An=Be.firstChild,Vt=Be.nextSibling,fn=Vt.firstChild,Nn=fn.nextSibling,nr=Vt.nextSibling,Qi=nr.firstChild,Or=nr.nextSibling,Xa=Or.firstChild,oo=Or.nextSibling,ao=oo.firstChild,lo=ao.nextSibling,Yi=lo.nextSibling,wh=Yi.nextSibling,Sh=wh.nextSibling,Ch=Sh.nextSibling,_h=Ch.nextSibling,kh=_h.nextSibling,Oh=kh.nextSibling,Eh=Oh.nextSibling,Ah=Eh.nextSibling,Ph=Ah.nextSibling,Th=Ph.nextSibling,Mh=Th.nextSibling,jh=Mh.nextSibling,$h=jh.nextSibling,Dh=$h.nextSibling,sx=Dh.nextSibling;return re(n,"id",`a-${e}`),re(r,"fill",`url(#a-${e})`),re(s,"id",`am-${e}`),re(o,"id",`b-${e}`),re(a,"filter",`url(#am-${e})`),re(l,"mask",`url(#b-${e})`),re(c,"id",`ah-${e}`),re(d,"id",`k-${e}`),re(f,"filter",`url(#ah-${e})`),re(h,"mask",`url(#k-${e})`),re(m,"id",`ae-${e}`),re(p,"id",`j-${e}`),re(v,"filter",`url(#ae-${e})`),re(b,"mask",`url(#j-${e})`),re(C,"id",`ai-${e}`),re(x,"id",`i-${e}`),re(k,"filter",`url(#ai-${e})`),re(w,"mask",`url(#i-${e})`),re(O,"id",`aj-${e}`),re(E,"id",`h-${e}`),re(T,"filter",`url(#aj-${e})`),re(j,"mask",`url(#h-${e})`),re(R,"id",`ag-${e}`),re(A,"id",`g-${e}`),re(M,"filter",`url(#ag-${e})`),re(D,"mask",`url(#g-${e})`),re(Q,"id",`af-${e}`),re(F,"id",`f-${e}`),re(G,"filter",`url(#af-${e})`),re(ie,"mask",`url(#f-${e})`),re(te,"id",`m-${e}`),re(me,"fill",`url(#m-${e})`),re(Ce,"id",`ak-${e}`),re(ge,"id",`e-${e}`),re(ze,"filter",`url(#ak-${e})`),re(oe,"mask",`url(#e-${e})`),re(He,"id",`n-${e}`),re(lt,"fill",`url(#n-${e})`),re(Ne,"id",`r-${e}`),re(Fe,"fill",`url(#r-${e})`),re(Y,"id",`s-${e}`),re(Pe,"fill",`url(#s-${e})`),re(tt,"id",`q-${e}`),re($e,"fill",`url(#q-${e})`),re(ue,"id",`p-${e}`),re(W,"fill",`url(#p-${e})`),re(ne,"id",`o-${e}`),re(ee,"fill",`url(#o-${e})`),re(we,"id",`l-${e}`),re(gt,"fill",`url(#l-${e})`),re(Je,"id",`al-${e}`),re(Be,"id",`d-${e}`),re(An,"filter",`url(#al-${e})`),re(Vt,"mask",`url(#d-${e})`),re(fn,"id",`u-${e}`),re(Nn,"fill",`url(#u-${e})`),re(Qi,"id",`ad-${e}`),re(Or,"id",`c-${e}`),re(Xa,"filter",`url(#ad-${e})`),re(oo,"mask",`url(#c-${e})`),re(ao,"id",`t-${e}`),re(lo,"fill",`url(#t-${e})`),re(Yi,"id",`v-${e}`),re(wh,"stroke",`url(#v-${e})`),re(Sh,"id",`aa-${e}`),re(Ch,"stroke",`url(#aa-${e})`),re(_h,"id",`w-${e}`),re(kh,"stroke",`url(#w-${e})`),re(Oh,"id",`ac-${e}`),re(Eh,"stroke",`url(#ac-${e})`),re(Ah,"id",`ab-${e}`),re(Ph,"stroke",`url(#ab-${e})`),re(Th,"id",`y-${e}`),re(Mh,"stroke",`url(#y-${e})`),re(jh,"id",`x-${e}`),re($h,"stroke",`url(#x-${e})`),re(Dh,"id",`z-${e}`),re(sx,"stroke",`url(#z-${e})`),t})()}var t$=he('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),n$=he('<button title="Copy object to clipboard">'),r$=he('<button title="Remove all items"aria-label="Remove all items">'),i$=he('<button title="Delete item"aria-label="Delete item">'),s$=he('<button title="Toggle value"aria-label="Toggle value">'),o$=he('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),ko=he("<div>"),a$=he("<div><button> <span></span> <span> "),l$=he("<input>"),_m=he("<span>"),u$=he("<div><span>:"),c$=he("<div><div><button> [<!>...<!>]");function d$(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var km=e=>{const t=xt(),n=ye().shadowDOMTarget?je.bind({target:ye().shadowDOMTarget}):je,r=U(()=>t()==="dark"?so(n):io(n));return(()=>{var i=t$();return be(()=>se(i,fe(r().expander,n`
|
|
68
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yA(e,t){if(e){if(typeof e=="string")return $y(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$y(e,t):void 0}}function $y(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mA(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function pA(e){if(Array.isArray(e))return e}function Dy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dy(Object(n),!0).forEach(function(r){vA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vA(e,t,n){return(t=bA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bA(e){var t=xA(e,"string");return ha(t)=="symbol"?t:t+""}function xA(e,t){if(ha(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ha(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wA(){var e,t,n,r,i,s,o,a,l,u,c,d,f,h,g,m,p,v,b,S,C,x,k,w,_=Rn(),O=_.brandId,E=_.analysisId,T=Du(O,E,{query:{select:function(Fe){var Y=Fe.data;return Y},enabled:!!O&&!!E}}),j=T.data,B=T.isLoading,R=j==null||(e=j.analysis)===null||e===void 0?void 0:e.scans,A=Array.isArray(R)&&R.length>0?R.reduce(function(Ne,Fe){if(!Ne)return Fe;if(!(Fe!=null&&Fe.finishedAt)||!(Ne!=null&&Ne.finishedAt))return Ne;var Y=new Date(Fe.finishedAt),Pe=new Date(Ne.finishedAt);return Y>Pe?Fe:Ne},R[0]):void 0,M=A==null||(t=A.scores)===null||t===void 0?void 0:t.standardized,D=(n=A==null||(r=A.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,H=A==null||(i=A.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,Q=(s=A==null||(o=A.scores)===null||o===void 0||(o=o.standardized)===null||o===void 0||(o=o.citations)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:0,F=(a=A==null||(l=A.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,G=A==null||(u=A.citations)===null||u===void 0||(u=u.total)===null||u===void 0||(u=u.previous)===null||u===void 0?void 0:u.difference,ie=A==null||(c=A.rankings)===null||c===void 0||(c=c.list)===null||c===void 0?void 0:c.find(function(Ne){var Fe;return((Fe=Ne.brand)===null||Fe===void 0?void 0:Fe.isSelf)===!0}),ae=(d=ie==null||(f=ie.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",N=ie==null||(h=ie.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;N&&(N=N*-1);var le=(g=M==null||(m=M.visibility)===null||m===void 0?void 0:m.value)!==null&&g!==void 0?g:0,te=M==null||(p=M.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,me=(v=M==null||(b=M.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,J=(S=M==null||(C=M.sentiment)===null||C===void 0?void 0:C.value)!==null&&S!==void 0?S:0,Se=(x=M==null||(k=M.mentions)===null||k===void 0?void 0:k.value)!==null&&x!==void 0?x:0,ge={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[Se,me,Q,J],backgroundColor:iA,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},ze=Sl(Sl({},Qd),{},{plugins:Sl(Sl({},Qd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(Fe){var Y=Fe.label||"",Pe=Fe.parsed.r||0;return"".concat(Y,": ").concat(Pe,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),oe=z.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),He=hA(oe,2),lt=He[0],dt=He[1];return z.useEffect(function(){function Ne(){dt(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",Ne),function(){return window.removeEventListener("resize",Ne)}},[]),y.jsx(P.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(P.Card.Content,{children:[y.jsx(P.Title,{size:"3",className:"yst-mb-2",children:"AI visibility index (AIVI)"}),y.jsx(Ba,{score:le,total:100,isLoading:B}),y.jsx(fA,{current:le,previous:te,className:"yst-mb-4"}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[y.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[y.jsx(rA,{data:ge,options:ze}),y.jsx($f,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",position:"left",children:"The AI Visibility Index (AIVI) shows how visible your brand is across major AI platforms like ChatGPT, based on mentions, citations, sentiment, and rankings."})]}),y.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:y.jsxs(cA,{children:[y.jsx(wl,{value:D,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:H,tooltipPosition:lt}),y.jsx(wl,{value:ae&&y.jsxs(y.Fragment,{children:[ae,ae===1&&" 🏆"]}),label:"Competitor ranking",tooltip:"Ranking shows the position your brand is mentioned in AI-generated answers—whether in a numbered list or the order of appearance in full-text responses.",borderBottom:!0,delta:N}),y.jsx(wl,{value:F,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:G,tooltipPosition:lt}),y.jsx(wl,{value:J?"".concat(J,"%"):"—",label:"Positive sentiment",tooltip:"Sentiment reflects how positively, neutrally, or negatively your brand is mentioned in AI-generated answers, based on the cited sources.",delta:A==null||(w=A.scores)===null||w===void 0||(w=w.standardized)===null||w===void 0||(w=w.sentiment)===null||w===void 0||(w=w.previous)===null||w===void 0?void 0:w.difference})]})})]})]})})}var qc=function(){var t=Rn(),n=t.brandId,r=t.analysisId,i=Gi({query:{select:function(m){var p=m.data;return p==null?void 0:p.brands}}}),s=i.data,o=i.isLoading,a=Du(n,r,{query:{enabled:!!n&&k6(r),select:function(m){var p=m.data;return p==null?void 0:p.analysis}}}),l=a.data,u=a.isLoading,c=l==null?void 0:l.status,d=o||u,f=s&&(s==null?void 0:s.length)>0,h=!d&&l&&c===ci.completed;return o?y.jsx(Ru,{}):f?y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(w7,{}),h&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(P.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(P.Button,{as:ti,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:Oe("yst-gap-1.5"),disabled:!n,children:[y.jsx(o2,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(wA,{}),y.jsx(S7,{}),y.jsx(uA,{}),y.jsx(M_,{}),y.jsx(k_,{}),y.jsx(c_,{}),y.jsx(j_,{})]})]})]}):y.jsx(W6,{})};function yb(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(P.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&y.jsx(P.Title,{className:Oe({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var SA=function(){return y.jsx(P.Card,{className:"yst-mb-4",children:y.jsxs(P.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(P.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(P.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(P.Badge,{children:"Example"}),y.jsx(P.Badge,{children:"Example"}),y.jsx(P.Badge,{children:"Example"}),y.jsx(P.Badge,{children:"Example"}),y.jsx(P.Badge,{children:"Example"})]}),y.jsxs(P.Table,{children:[y.jsx(P.Table.Head,{children:y.jsxs(P.Table.Row,{children:[y.jsx(P.Table.Header,{children:"URL"}),y.jsx(P.Table.Header,{children:"Associated brand"})]})}),y.jsxs(P.Table.Body,{children:[y.jsxs(P.Table.Row,{children:[y.jsx(P.Table.Cell,{children:y.jsx(P.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(P.Table.Cell,{children:"Example Brand"})]}),y.jsxs(P.Table.Row,{children:[y.jsx(P.Table.Cell,{children:y.jsx(P.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(P.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},CA=function(){return y.jsxs(P.Card,{children:[y.jsx(yb,{title:"Query history"}),y.jsx(P.Card,{className:"yst-mb-4",children:y.jsxs(P.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(P.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(SA,{},t)})]})})]})},_A=z.lazy(function(){return Promise.resolve().then(()=>DD)}),kA=z.lazy(function(){return Promise.resolve().then(()=>lL)}),OA=z.lazy(function(){return Promise.resolve().then(()=>dL)}),EA=z.lazy(function(){return Promise.resolve().then(()=>kL)}),AA=z.lazy(function(){return Promise.resolve().then(()=>zL)}),PA=z.lazy(function(){return Promise.resolve().then(()=>WL)}),TA=new Qw({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),li=function(){return y.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[y.jsx(P.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(P.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(P.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},MA=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo;return y.jsx(tw,{children:y.jsxs(_t,{element:y.jsx(w6,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(_t,{path:"/",element:y.jsx(Bs,{}),children:[y.jsx(_t,{index:!0,element:y.jsx(qc,{})}),y.jsxs(_t,{path:"brands/:brandId",element:y.jsx(T0,{}),children:[y.jsx(_t,{index:!0,element:y.jsx(qc,{})}),y.jsx(_t,{path:"brand-list",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(_A,{})})}),y.jsx(_t,{path:"analysis/:analysisId",element:y.jsx(S6,{}),children:y.jsx(_t,{index:!0,element:y.jsx(qc,{})})})]}),y.jsxs(_t,{path:"/setup",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(OA,{})}),children:[y.jsx(_t,{index:!0,element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(EA,{})})}),y.jsxs(_t,{path:":brandId",element:y.jsx(T0,{}),children:[y.jsx(_t,{path:"queries",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(AA,{})})}),y.jsx(_t,{path:"analysis",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(PA,{})})})]})]})]}),y.jsx(_t,{path:"/settings",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(kA,{})})}),y.jsx(_t,{path:"/query-history",element:y.jsx(z.Suspense,{fallback:y.jsx(li,{}),children:y.jsx(CA,{})})})]})})},jA=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(e3,{client:TA,children:[y.jsx(O4,{hostAppProps:r,children:y.jsx(MA,{DebugInfo:n})}),y.jsx(qS,{initialIsOpen:!1})]})};function $A(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=dn(),s=Ut(),o=z.useRef(n),a=z.useRef(null),l=z.useRef(!1),u="".concat(s.pathname).concat(s.search).concat(s.hash),c=z.useCallback(r,[r]);return z.useEffect(function(){if(n===u){o.current=n;return}l.current||n!==o.current&&(o.current=n,a.current=n,l.current=!0,i(n,{replace:!0}),setTimeout(function(){l.current=!1},10))},[n,u,i]),z.useEffect(function(){l.current||u!==n&&u!==a.current&&(a.current=u,c(u))},[u,n,c]),null}function DA(e,t){return NA(e)||RA(e,t)||IA(e,t)||LA()}function LA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
69
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IA(e,t){if(e){if(typeof e=="string")return Ly(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ly(e,t):void 0}}function Ly(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function RA(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function NA(e){if(Array.isArray(e))return e}var FA=function(t){var n=t.isRtl,r=n===void 0?!1:n,i=t.className,s=t.style,o=t.token,a=o===void 0?"":o,l=t.apiUrl,u=t.DebugInfo,c=t.basename,d=c===void 0?"/":c,f=t.subpath,h=f===void 0?"/":f,g=t.onNavigate,m=g===void 0?function(){}:g,p=t.onLogout,v=p===void 0?function(){}:p,b=t.onAddSubscription,S=b===void 0?function(){}:b,C=function(T,j){var B=T.endsWith("/")?T.slice(0,-1):T,R=j.startsWith("/")?j:"/".concat(j);return B+R||"/"},x=z.useState(!!(a||l)),k=DA(x,2),w=k[0],_=k[1],O={onAddSubscription:S,onLogout:v,onNavigate:m,DebugInfo:u,basename:d,subpath:h};return z.useEffect(function(){l&&Zv(l),C5(typeof a!="function"?function(){return a}:a),_(!1)},[l,a]),w?y.jsx("div",{className:i,style:s,children:y.jsx(P.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(Jx,{initialEntries:[C(d,h)],basename:d||"/",children:[y.jsx($A,{subpath:h,onNavigate:m}),y.jsx(P.Root,{context:{isRtl:r},children:y.jsx(jA,{DebugInfo:u,hostAppProps:O})})]})})},BA=e=>e!=null,qA=e=>e.filter(BA);function zA(e){return(...t)=>{for(const n of e)n&&n(...t)}}var X=e=>typeof e=="function"&&!e.length?e():e,Yd=e=>Array.isArray(e)?e:e?[e]:[];function HA(e,...t){return typeof e=="function"?e(...t):e}var UA=_e;function GA(e,t,n,r){const i=e.length,s=t.length;let o=0;if(!s){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<s;o++)r(t[o]);return}for(;o<s&&t[o]===e[o];o++);let a,l;t=t.slice(o),e=e.slice(o);for(a of t)e.includes(a)||r(a);for(l of e)t.includes(l)||n(l)}function KA(e){const[t,n]=ce(),r=e!=null&&e.throw?(f,h)=>{throw n(f instanceof Error?f:new Error(h)),f}:(f,h)=>{n(f instanceof Error?f:new Error(h))},i=e!=null&&e.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),s=e!=null&&e.prefix?`${e.prefix}.`:"",o=new Map,a=new Proxy({},{get(f,h){let g=o.get(h);g||(g=ce(void 0,{equals:!1}),o.set(h,g)),g[0]();const m=i.reduce((p,v)=>{if(p!==null||!v)return p;try{return v.getItem(`${s}${h}`)}catch(b){return r(b,`Error reading ${s}${h} from ${v.name}`),null}},null);return m!==null&&(e!=null&&e.deserializer)?e.deserializer(m,h,e.options):m}}),l=(f,h,g)=>{const m=e!=null&&e.serializer?e.serializer(h,f,g!=null?g:e.options):h,p=`${s}${f}`;i.forEach(b=>{try{b.getItem(p)!==m&&b.setItem(p,m)}catch(S){r(S,`Error setting ${s}${f} to ${m} in ${b.name}`)}});const v=o.get(f);v&&v[1]()},u=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(g){r(g,`Error removing ${s}${f} from ${h.name}`)}}),c=()=>i.forEach(f=>{try{f.clear()}catch(h){r(h,`Error clearing ${f.name}`)}}),d=()=>{const f={},h=(g,m)=>{if(!f.hasOwnProperty(g)){const p=m&&(e!=null&&e.deserializer)?e.deserializer(m,g,e.options):m;p&&(f[g]=p)}};return i.forEach(g=>{if(typeof g.getAll=="function"){let m;try{m=g.getAll()}catch(p){r(p,`Error getting all values from in ${g.name}`)}for(const p of m)h(p,m[p])}else{let m=0,p;try{for(;p=g.key(m++);)f.hasOwnProperty(p)||h(p,g.getItem(p))}catch(v){r(v,`Error getting all values from ${g.name}`)}}}),f};return(e==null?void 0:e.sync)!==!1&&xr(()=>{const f=h=>{var m;let g=!1;i.forEach(p=>{try{p!==h.storageArea&&h.key&&h.newValue!==p.getItem(h.key)&&(h.newValue?p.setItem(h.key,h.newValue):p.removeItem(h.key),g=!0)}catch(v){r(v,`Error synching api ${p.name} from storage event (${h.key}=${h.newValue})`)}}),g&&h.key&&((m=o.get(h.key))==null||m[1]())};"addEventListener"in globalThis?(globalThis.addEventListener("storage",f),_e(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var g;return(g=h.addEventListener)==null?void 0:g.call(h,"storage",f)}),_e(()=>i.forEach(h=>{var g;return(g=h.removeEventListener)==null?void 0:g.call(h,"storage",f)})))}),[a,l,{clear:c,error:t,remove:u,toJSON:d}]}var mb=KA,VA=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),Iy=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r=="boolean"?`; ${n}`:`; ${n}=${r}`}return t},gn=VA({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=gn._cookies[0][gn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=gn.getItem(e);gn._cookies[0][gn._cookies[1]]=`${e}=${t}${Iy(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:gn});window.dispatchEvent(i)},removeItem:e=>{gn._cookies[0][gn._cookies[1]]=`${e}=deleted${Iy({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return gn._cookies[0][gn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return gn._cookies[0][gn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),WA=1024,Fi=796,Yf=700,QA="bottom-right",Xd="bottom",pb="system",YA=!1,vb=500,XA=500,bb=500,ZA=Object.keys(bd)[0],Ry=1,JA=Object.keys(xd)[0],Xf=wt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ye(){return St(Xf)}var xb=wt(void 0),wb=e=>{const[t,n]=ce(null),r=()=>{const o=t();o!=null&&(o.close(),n(null))},i=(o,a)=>{if(t()!=null)return;const l=window.open("","TSQD-Devtools-Panel",`width=${o},height=${a},popup`);if(!l)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");l.document.head.innerHTML="",l.document.body.innerHTML="",H3(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(ye().shadowDOMTarget||document).styleSheets].forEach(u=>{try{const c=[...u.cssRules].map(g=>g.cssText).join(""),d=document.createElement("style"),f=u.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=c,l.document.head.appendChild(d)}catch(c){const d=document.createElement("link");if(u.href==null)return;d.rel="stylesheet",d.type=u.type,d.media=u.media.toString(),d.href=u.href,l.document.head.appendChild(d)}}),ku(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],l.document),e.setLocalStore("pip_open","true"),n(l)};xe(()=>{var a;((a=e.localStore.pip_open)!=null?a:"false")==="true"&&!e.disabled&&i(Number(window.innerWidth),Number(e.localStore.height||XA))}),xe(()=>{const o=(ye().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const u=(ye().shadowDOMTarget||a.document).querySelector("#_goober");u&&(u.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),_e(()=>{l.disconnect()})}});const s=U(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return L(xb.Provider,{value:s,get children(){return e.children}})},Zf=()=>U(()=>{const t=St(xb);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),Jf=wt(()=>"dark");function xt(){return St(Jf)}var Sb={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"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",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},eP=Object.keys(Sb).join("|"),tP=new RegExp(eP,"g");function nP(e){return e.replace(tP,t=>Sb[t])}var Bt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Ny(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Bt.MATCHES,!n.accessors){const o=Fy(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=oP(e,n.accessors),s={rankedValue:e,rank:Bt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=Fy(a.itemValue,t,n);const{minRanking:u,maxRanking:c,threshold:d=n.threshold}=a.attributes;l<u&&l>=Bt.MATCHES?l=u:l>c&&(l=c),l=Math.min(l,c),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function Fy(e,t,n){return e=By(e,n),t=By(t,n),t.length>e.length?Bt.NO_MATCH:e===t?Bt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Bt.EQUAL:e.startsWith(t)?Bt.STARTS_WITH:e.includes(` ${t}`)?Bt.WORD_STARTS_WITH:e.includes(t)?Bt.CONTAINS:t.length===1?Bt.NO_MATCH:rP(e).includes(t)?Bt.ACRONYM:iP(e,t))}function rP(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function iP(e,t){let n=0,r=0;function i(l,u,c){for(let d=c,f=u.length;d<f;d++)if(u[d]===l)return n+=1,d+1;return-1}function s(l){const u=1/l,c=n/t.length;return Bt.MATCHES+c*u}const o=i(t[0],e,0);if(o<0)return Bt.NO_MATCH;r=o;for(let l=1,u=t.length;l<u;l++){const c=t[l];if(r=i(c,e,r),!(r>-1))return Bt.NO_MATCH}const a=r-o;return s(a)}function By(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=nP(e)),e}function sP(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function oP(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=aP(s),a=sP(e,s);for(let l=0,u=a.length;l<u;l++)n.push({itemValue:a[l],attributes:o})}return n}var qy={maxRanking:1/0,minRanking:-1/0};function aP(e){return typeof e=="function"?qy:{...qy,...e}}var lP={data:""},uP=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||lP,cP=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,dP=/\/\*[^]*?\*\/| +/g,zy=/\n+/g,gi=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?gi(o,s):s+"{"+gi(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=gi(o,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=gi.p?gi.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},ir={},Cb=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Cb(e[n]);return t}return e},fP=(e,t,n,r,i)=>{let s=Cb(e),o=ir[s]||(ir[s]=(l=>{let u=0,c=11;for(;u<l.length;)c=101*c+l.charCodeAt(u++)>>>0;return"go"+c})(s));if(!ir[o]){let l=s!==e?e:(u=>{let c,d,f=[{}];for(;c=cP.exec(u.replace(dP,""));)c[4]?f.shift():c[3]?(d=c[3].replace(zy," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][c[1]]=c[2].replace(zy," ").trim();return f[0]})(e);ir[o]=gi(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&ir.g?ir.g:null;return n&&(ir.g=ir[o]),((l,u,c,d)=>{d?u.data=u.data.replace(d,l):u.data.indexOf(l)===-1&&(u.data=c?l+u.data:u.data+l)})(ir[o],t,r,a),o},hP=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":gi(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function je(e){let t=this||{},n=e.call?e(t.p):e;return fP(n.unshift?n.raw?hP(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,uP(t.target),t.g,t.o,t.k)}je.bind({g:1});je.bind({k:1});function _b(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=_b(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fe(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_b(e))&&(r&&(r+=" "),r+=t);return r}function gP(e,t){const n=at(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=ce([],{equals:!1}),[l]=x3(),u=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},c=(d,f,h)=>d.splice(h,0,f);return U(d=>{const f=o(),h=e();if(h[Su],at(l))return l(),d;if(f.length){const g=d.filter(m=>!f.includes(m));return f.length=0,r({list:g,added:[],removed:[],unchanged:g,finishRemoved:u}),g}return at(()=>{const g=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const C of h)(i.has(C)?b:p).push(C);let S=!p.length;for(let C=0;C<d.length;C++){const x=d[C];g.has(x)||(s.has(x)||(v.push(x),s.add(x)),c(m,x,C)),S&&x!==m[C]&&(S=!1)}return!v.length&&S?d:(r({list:m,added:p,removed:v,unchanged:b,finishRemoved:u}),i=g,m)})},t.appear?[]:n.slice())}function It(...e){return zA(e)}var Hy=e=>e instanceof Element;function Zd(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Zd(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=Zd(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function yP(e,t=Hy,n=Hy){const r=U(e),i=U(()=>Zd(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function mP(e){return U(()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}})}function kb(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function pP(e,t,n,r){const{onBeforeEnter:i,onEnter:s,onAfterEnter:o}=t;i==null||i(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask(()=>{if(!n.parentNode)return r==null?void 0:r();s==null||s(n,()=>a())}),kb(()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),o==null||o(n))}}function vP(e,t,n,r){const{onBeforeExit:i,onExit:s,onAfterExit:o}=t;if(!n.parentNode)return r==null?void 0:r();i==null||i(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),s==null||s(n,()=>a()),kb(()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(r==null||r(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),o==null||o(n))}}var Uy=e=>{const t=mP(e);return gP(yP(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)pP(o,e,l);const a=[];for(const l of s)l.isConnected&&(l instanceof HTMLElement||l instanceof SVGElement)&&a.push({el:l,rect:l.getBoundingClientRect()});queueMicrotask(()=>{const l=[];for(const{el:u,rect:c}of a)if(u.isConnected){const d=u.getBoundingClientRect(),f=c.left-d.left,h=c.top-d.top;(f||h)&&(u.style.transform=`translate(${f}px, ${h}px)`,u.style.transitionDuration="0s",l.push(u))}document.body.offsetHeight;for(const u of l){let c=function(d){(d.target===u||/transform$/.test(d.propertyName))&&(u.removeEventListener("transitionend",c),u.classList.remove(...o.move))};u.classList.add(...o.move),u.style.transform=u.style.transitionDuration="",u.addEventListener("transitionend",c)}});for(const l of r)vP(o,e,l,()=>i([l]))}})},zc=Symbol("fallback");function Gy(e){for(const t of e)t.dispose()}function bP(e,t,n,r={}){const i=new Map;return _e(()=>Gy(i.values())),()=>{const o=e()||[];return o[Su],at(()=>{var c,d;if(!o.length)return Gy(i.values()),i.clear(),r.fallback?[mr(h=>(i.set(zc,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(zc);if(!i.size||l){l==null||l.dispose(),i.delete(zc);for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);s(a,h,f,g)}return a}const u=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);u.delete(g);const m=i.get(g);m?(a[f]=m.mapped,(c=m.setIndex)==null||c.call(m,f),m.setItem(()=>h)):s(a,h,f,g)}for(const f of u)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,u){mr(c=>{const[d,f]=ce(a),h={setItem:f,dispose:c};if(n.length>1){const[g,m]=ce(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(u,h),o[l]=h.mapped})}}function du(e){const{by:t}=e;return U(bP(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function xP(e,t,n,r){return e.addEventListener(t,n,r),UA(e.removeEventListener.bind(e,t,n,r))}function wP(e,t,n,r){const i=()=>{Yd(X(e)).forEach(s=>{s&&Yd(X(t)).forEach(o=>xP(s,o,n,r))})};typeof e=="function"?xe(i):be(i)}function SP(e,t){const n=new ResizeObserver(e);return _e(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function Ob(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=SP(o=>{for(const a of o){const{contentRect:l,target:u}=a,c=Math.round(l.width),d=Math.round(l.height),f=r.get(u);(!f||f.width!==c||f.height!==d)&&(t(l,u,a),r.set(u,{width:c,height:d}))}},n);xe(o=>{const a=qA(Yd(X(e)));return GA(a,o,i,s),a},[])}var CP=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Ky(e){const t={};let n;for(;n=CP.exec(e);)t[n[1]]=n[2];return t}function Qu(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Ky(e)}else typeof t=="string"&&(t=Ky(t));return{...e,...t}}function _P(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Jd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function kP(e){return typeof e=="number"}function ns(e){return Object.prototype.toString.call(e)==="[object String]"}function OP(e){return typeof e=="function"}function Ga(e){return t=>`${e()}-${t}`}function wn(e,t){return e?e===t||e.contains(t):!1}function Io(e,t=!1){const{activeElement:n}=Jn(e);if(!(n!=null&&n.nodeName))return null;if(Eb(n)&&n.contentDocument)return Io(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Jn(n).getElementById(r);if(i)return i}}return n}function EP(e){return Jn(e).defaultView||window}function Jn(e){return e?e.ownerDocument||e:document}function Eb(e){return e.tagName==="IFRAME"}var eh=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(eh||{});function th(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function Yu(){return th(/^Mac/i)}function AP(){return th(/^iPhone/i)}function PP(){return th(/^iPad/i)||Yu()&&navigator.maxTouchPoints>1}function TP(){return AP()||PP()}function MP(){return Yu()||TP()}function nt(e,t){return t&&(OP(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function vt(e){return t=>{for(const n of e)nt(t,n)}}function jP(e){return Yu()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function At(e){if(e)if($P())e.focus({preventScroll:!0});else{const t=DP(e);e.focus(),LP(t)}}var Cl=null;function $P(){if(Cl==null){Cl=!1;try{document.createElement("div").focus({get preventScroll(){return Cl=!0,!0}})}catch(e){}}return Cl}function DP(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function LP(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Ab=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],IP=[...Ab,'[tabindex]:not([tabindex="-1"]):not([disabled])'],nh=Ab.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",RP=IP.join(':not([hidden]):not([tabindex="-1"]),');function Pb(e,t){const r=Array.from(e.querySelectorAll(nh)).filter(Vy);return t&&Vy(e)&&r.unshift(e),r.forEach((i,s)=>{if(Eb(i)&&i.contentDocument){const o=i.contentDocument.body,a=Pb(o,!1);r.splice(s,1,...a)}}),r}function Vy(e){return Tb(e)&&!NP(e)}function Tb(e){return e.matches(nh)&&rh(e)}function NP(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function rh(e,t){return e.nodeName!=="#comment"&&FP(e)&&BP(e,t)&&(!e.parentElement||rh(e.parentElement,e))}function FP(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:s,visibility:o}=i(e);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function BP(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function qP(e,t,n){const r=t!=null&&t.tabbable?RP:nh,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var o;return(o=t==null?void 0:t.from)!=null&&o.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&rh(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function Wy(e){for(;e&&!zP(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function zP(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function HP(){}function UP(e,t){const[n,r]=e;let i=!1;const s=t.length;for(let o=s,a=0,l=o-1;a<o;l=a++){const[u,c]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],g=(c-f)*(n-u)-(u-d)*(r-c);if(f<c){if(r>=f&&r<c){if(g===0)return!0;g>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(c<f){if(r>c&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==c&&(n>=d&&n<=u||n>=u&&n<=d))return!0}return i}function Re(e,t){return Ae(e,t)}var Co=new Map,Qy=new Set;function Yy(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=Co.get(n.target);r||(r=new Set,Co.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Co.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Co.delete(n.target)),Co.size===0)){for(const i of Qy)i();Qy.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?Yy():document.addEventListener("DOMContentLoaded",Yy));function ef(e,t){const n=Xy(e,t,"left"),r=Xy(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,u=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>u&&(a+=r+s-u),e.scrollLeft=o,e.scrollTop=a}function Xy(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function GP(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=Wy(e);for(;e&&o&&e!==i&&o!==i;)ef(o,e),e=o,o=Wy(e)}else{const{left:o,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:u}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-u)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var Mb={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function Sn(e){return t=>(e(t),()=>e(void 0))}function Xu(e,t){const[n,r]=ce(Zy(t==null?void 0:t()));return xe(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||Zy(t==null?void 0:t()))}),n}function Zy(e){return ns(e)?e:void 0}function st(e){const[t,n]=Ve(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return L(eS,Ae(n,{get component(){return t.as}}))}var KP=["id","name","validationState","required","disabled","readOnly"];function VP(e){const t=`form-control-${kn()}`,n=Re({id:t},e),[r,i]=ce(),[s,o]=ce(),[a,l]=ce(),[u,c]=ce(),d=(m,p,v)=>{const b=v!=null||r()!=null;return[v,r(),b&&p!=null?m:void 0].filter(Boolean).join(" ")||void 0},f=m=>[a(),u(),m].filter(Boolean).join(" ")||void 0,h=U(()=>({"data-valid":X(n.validationState)==="valid"?"":void 0,"data-invalid":X(n.validationState)==="invalid"?"":void 0,"data-required":X(n.required)?"":void 0,"data-disabled":X(n.disabled)?"":void 0,"data-readonly":X(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=X(n.name))!=null?m:X(n.id)},dataset:h,validationState:()=>X(n.validationState),isRequired:()=>X(n.required),isDisabled:()=>X(n.disabled),isReadOnly:()=>X(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:u,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Ga(()=>X(n.id)),registerLabel:Sn(i),registerField:Sn(o),registerDescription:Sn(l),registerErrorMessage:Sn(c)}}}var jb=wt();function Ka(){const e=St(jb);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function $b(e){const t=Ka(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),L(st,Ae({as:"div"},()=>t.dataset(),n))}function Db(e){const t=Ka(),n=Re({id:t.generateId("error-message")},e),[r,i]=Ve(n,["forceMount"]),s=()=>t.validationState()==="invalid";return xe(()=>{s()&&_e(t.registerErrorMessage(i.id))}),L(ve,{get when(){return r.forceMount||s()},get children(){return L(st,Ae({as:"div"},()=>t.dataset(),i))}})}function WP(e){let t;const n=Ka(),r=Re({id:n.generateId("label")},e),[i,s]=Ve(r,["ref"]),o=Xu(()=>t,()=>"label");return xe(()=>_e(n.registerLabel(s.id))),L(st,Ae({as:"label",ref(a){const l=It(u=>t=u,i.ref);typeof l=="function"&&l(a)},get for(){return U(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function QP(e,t){xe(br(e,n=>{if(n==null)return;const r=YP(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),_e(()=>{r.removeEventListener("reset",t)}))}))}function YP(e){return XP(e)?e.form:e.closest("form")}function XP(e){return e.matches("textarea, input, select, button")}function Va(e){var o;const[t,n]=ce((o=e.defaultValue)==null?void 0:o.call(e)),r=U(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=U(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{at(()=>{var u;const l=HA(a,i());return Object.is(l,i())||(r()||n(l),(u=e.onChange)==null||u.call(e,l)),l})}]}function Lb(e){const[t,n]=Va(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function ZP(e){const[t,n]=Va(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function JP(e={}){const[t,n]=Lb({value:()=>X(e.isSelected),defaultValue:()=>!!X(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!X(e.isReadOnly)&&!X(e.isDisabled)&&n(s)},toggle:()=>{!X(e.isReadOnly)&&!X(e.isDisabled)&&n(!t())}}}var eT=Object.defineProperty,Zu=(e,t)=>{for(var n in t)eT(e,n,{get:t[n],enumerable:!0})},Ib=wt();function Rb(){return St(Ib)}function tT(){const e=Rb();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Nb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function nT(e,t){var i;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(i=e[r])==null?void 0:i.ref();if(s&&Nb(s,n))return r+1}return 0}function rT(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[s,o])=>{const a=i.ref(),l=o.ref();return a===l||!a||!l?0:Nb(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function Fb(e,t){const n=rT(e);e!==n&&t(n)}function iT(e){var i,s;const t=e[0],n=(i=e[e.length-1])==null?void 0:i.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Jn(r).body}function sT(e,t){xe(()=>{const n=setTimeout(()=>{Fb(e(),t)});_e(()=>clearTimeout(n))})}function oT(e,t){if(typeof IntersectionObserver!="function"){sT(e,t);return}let n=[];xe(()=>{const r=()=>{const o=!!n.length;n=e(),o&&Fb(e(),t)},i=iT(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}_e(()=>s.disconnect())})}function aT(e={}){const[t,n]=ZP({value:()=>X(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});oT(t,n);const r=s=>(n(o=>{const a=nT(o,s);return _P(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>L(Ib.Provider,{value:{registerItem:r},get children(){return s.children}})}}function lT(e){const t=tT(),n=Re({shouldRegisterItem:!0},e);xe(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());_e(r)})}function Bb(e){var l,u,c;let t=(l=e.startIndex)!=null?l:0;const n=(u=e.startLevel)!=null?u:0,r=[],i=d=>{var g;if(d==null)return"";const f=(g=e.getKey)!=null?g:"key",h=ns(f)?d[f]:f(d);return h!=null?String(h):""},s=d=>{var g;if(d==null)return"";const f=(g=e.getTextValue)!=null?g:"textValue",h=ns(f)?d[f]:f(d);return h!=null?String(h):""},o=d=>{var h,g;if(d==null)return!1;const f=(h=e.getDisabled)!=null?h:"disabled";return(g=ns(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return ns(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(ns(d)||kP(d)){r.push({type:"item",rawValue:d,key:String(d),textValue:String(d),disabled:o(d),level:n,index:t}),t++;continue}if(a(d)!=null){r.push({type:"section",rawValue:d,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const f=(c=a(d))!=null?c:[];if(f.length>0){const h=Bb({dataSource:f,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...h),t+=h.length}}else r.push({type:"item",rawValue:d,key:i(d),textValue:s(d),disabled:o(d),level:n,index:t}),t++}return r}function uT(e,t=[]){return U(()=>{const n=Bb({dataSource:X(e.dataSource),getKey:X(e.getKey),getTextValue:X(e.getTextValue),getDisabled:X(e.getDisabled),getSectionChildren:X(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var cT=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),dT=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function fT(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return cT.has(r)}const t=e.split("-")[0];return dT.has(t)}function hT(e){return fT(e)?"rtl":"ltr"}function qb(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:hT(e)}}var tf=qb(),Ro=new Set;function Jy(){tf=qb();for(const e of Ro)e(tf)}function gT(){const[e,t]=ce(tf),n=U(()=>e());return xr(()=>{Ro.size===0&&window.addEventListener("languagechange",Jy),Ro.add(t),_e(()=>{Ro.delete(t),Ro.size===0&&window.removeEventListener("languagechange",Jy)})}),{locale:()=>n().locale,direction:()=>n().direction}}var yT=wt();function ii(){const e=gT();return St(yT)||e}var Hc=new Map;function mT(e){const{locale:t}=ii(),n=U(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return U(()=>{const r=n();let i;return Hc.has(r)&&(i=Hc.get(r)),i||(i=new Intl.Collator(t(),e),Hc.set(r,i)),i})}var ur=class zb extends Set{constructor(n,r,i){super(n);pe(this,"anchorKey");pe(this,"currentKey");n instanceof zb?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function pT(e){const[t,n]=Va(e);return[()=>{var i;return(i=t())!=null?i:new ur},n]}function Hb(e){return MP()?e.altKey:e.ctrlKey}function rs(e){return Yu()?e.metaKey:e.ctrlKey}function em(e){return new ur(e)}function vT(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function bT(e){const t=Re({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=ce(!1),[i,s]=ce(),o=U(()=>{const m=X(t.selectedKeys);return m!=null?em(m):m}),a=U(()=>{const m=X(t.defaultSelectedKeys);return m!=null?em(m):new ur}),[l,u]=pT({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[c,d]=ce(X(t.selectionBehavior)),f=()=>X(t.selectionMode),h=()=>{var m;return(m=X(t.disallowEmptySelection))!=null?m:!1},g=m=>{(X(t.allowDuplicateSelectionEvents)||!vT(m,l()))&&u(m)};return xe(()=>{const m=l();X(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),xe(()=>{var m;d((m=X(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:c,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function xT(e){const[t,n]=ce(""),[r,i]=ce(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(X(e.isDisabled))return;const a=X(e.keyboardDelegate),l=X(e.selectionManager);if(!a.getKeyForSearch)return;const u=wT(o.key);if(!u||o.ctrlKey||o.metaKey)return;u===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let c=n(m=>m+u),d=(f=a.getKeyForSearch(c,l.focusedKey()))!=null?f:a.getKeyForSearch(c);d==null&&ST(c)&&(c=c[0],d=(h=a.getKeyForSearch(c,l.focusedKey()))!=null?h:a.getKeyForSearch(c)),d!=null&&(l.setFocusedKey(d),(g=e.onTypeSelect)==null||g.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function wT(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function ST(e){return e.split("").every(t=>t===e[0])}function CT(e,t,n){const i=Ae({selectOnFocus:()=>X(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=ii();let a={top:0,left:0};wP(()=>X(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=xT({isDisabled:()=>X(i.disallowTypeAhead),keyboardDelegate:()=>X(i.keyboardDelegate),selectionManager:()=>X(i.selectionManager)}),u=()=>{var p;return(p=X(i.orientation))!=null?p:"vertical"},c=p=>{var _,O,E,T,j,B,R,A;nt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=X(i.selectionManager),S=X(i.selectOnFocus),C=M=>{M!=null&&(b.setFocusedKey(M),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&!Hb(p)&&b.replaceSelection(M))},x=X(i.keyboardDelegate),k=X(i.shouldFocusWrap),w=b.focusedKey();switch(p.key){case(u()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){p.preventDefault();let M;w!=null?M=x.getKeyBelow(w):M=(_=x.getFirstKey)==null?void 0:_.call(x),M==null&&k&&(M=(O=x.getFirstKey)==null?void 0:O.call(x,w)),C(M)}break}case(u()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){p.preventDefault();let M;w!=null?M=x.getKeyAbove(w):M=(E=x.getLastKey)==null?void 0:E.call(x),M==null&&k&&(M=(T=x.getLastKey)==null?void 0:T.call(x,w)),C(M)}break}case(u()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){p.preventDefault();const M=o()==="rtl";let D;w!=null?D=x.getKeyLeftOf(w):D=M?(j=x.getFirstKey)==null?void 0:j.call(x):(B=x.getLastKey)==null?void 0:B.call(x),C(D)}break}case(u()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){p.preventDefault();const M=o()==="rtl";let D;w!=null?D=x.getKeyRightOf(w):D=M?(R=x.getLastKey)==null?void 0:R.call(x):(A=x.getFirstKey)==null?void 0:A.call(x),C(D)}break}case"Home":if(x.getFirstKey){p.preventDefault();const M=x.getFirstKey(w,rs(p));M!=null&&(b.setFocusedKey(M),rs(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&b.replaceSelection(M))}break;case"End":if(x.getLastKey){p.preventDefault();const M=x.getLastKey(w,rs(p));M!=null&&(b.setFocusedKey(M),rs(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&b.replaceSelection(M))}break;case"PageDown":if(x.getKeyPageBelow&&w!=null){p.preventDefault();const M=x.getKeyPageBelow(w);C(M)}break;case"PageUp":if(x.getKeyPageAbove&&w!=null){p.preventDefault();const M=x.getKeyPageAbove(w);C(M)}break;case"a":rs(p)&&b.selectionMode()==="multiple"&&X(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),X(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!X(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const M=qP(v,{tabbable:!0});let D,H;do H=M.lastChild(),H&&(D=H);while(H);D&&!D.contains(document.activeElement)&&At(D)}break}}},d=p=>{var C,x,k,w;const v=X(i.selectionManager),b=X(i.keyboardDelegate),S=X(i.selectOnFocus);if(v.isFocused()){p.currentTarget.contains(p.target)||v.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(v.setFocused(!0),v.focusedKey()==null){const _=E=>{E!=null&&(v.setFocusedKey(E),S&&v.replaceSelection(E))},O=p.relatedTarget;O&&p.currentTarget.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_FOLLOWING?_((x=v.lastSelectedKey())!=null?x:(C=b.getLastKey)==null?void 0:C.call(b)):_((w=v.firstSelectedKey())!=null?w:(k=b.getFirstKey)==null?void 0:k.call(b))}else if(!X(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const O=_.querySelector(`[data-key="${v.focusedKey()}"]`);O&&(At(O),ef(_,O))}}}},f=p=>{const v=X(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var k,w;const p=X(i.autoFocus);if(!p)return;const v=X(i.selectionManager),b=X(i.keyboardDelegate);let S;p==="first"&&(S=(k=b.getFirstKey)==null?void 0:k.call(b)),p==="last"&&(S=(w=b.getLastKey)==null?void 0:w.call(b));const C=v.selectedKeys();C.size&&(S=C.values().next().value),v.setFocused(!0),v.setFocusedKey(S);const x=t();x&&S==null&&!X(i.shouldUseVirtualFocus)&&At(x)};return xr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),xe(br([s,()=>X(i.isVirtualized),()=>X(i.selectionManager).focusedKey()],p=>{var C;const[v,b,S]=p;if(b)S&&((C=i.scrollToKey)==null||C.call(i,S));else if(S&&v){const x=v.querySelector(`[data-key="${S}"]`);x&&ef(v,x)}})),{tabIndex:U(()=>{if(!X(i.shouldUseVirtualFocus))return X(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function Ub(e,t){const n=()=>X(e.selectionManager),r=()=>X(e.key),i=()=>X(e.shouldUseVirtualFocus),s=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b!=null&&b.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||rs(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>X(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let u=null;const c=b=>{l()&&(u=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!X(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&X(e.shouldSelectOnPressUp)&&X(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(X(e.shouldSelectOnPressUp)&&!X(e.allowsDifferentPressOrigin)||u!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(Hb(b)?n().toggleSelection(r()):s(b))},g=b=>{a()&&b.preventDefault()},m=b=>{const S=t();i()||a()||!S||b.target===S&&n().setFocusedKey(r())},p=U(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=U(()=>X(e.virtualized)?void 0:r());return xe(br([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,S,C,x,k])=>{b&&S===x&&k&&!C&&document.activeElement!==b&&(e.focus?e.focus():At(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:c,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var _T=class{constructor(e,t){pe(this,"collection");pe(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new ur(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))i.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new ur(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new ur([t],t,t):new ur;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new ur;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new ur)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},tm=class{constructor(e){pe(this,"keyMap",new Map);pe(this,"iterable");pe(this,"firstKey");pe(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function kT(e){const t=bT(e),r=uT({dataSource:()=>X(e.dataSource),getKey:()=>X(e.getKey),getTextValue:()=>X(e.getTextValue),getDisabled:()=>X(e.getDisabled),getSectionChildren:()=>X(e.getSectionChildren),factory:s=>e.filter?new tm(e.filter(s)):new tm(s)},[()=>e.filter]),i=new _T(r,t);return Vp(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var Et=e=>typeof e=="function"?e():e,OT=e=>{const t=U(()=>{const o=Et(e.element);if(o)return getComputedStyle(o)}),n=()=>{var o,a;return(a=(o=t())==null?void 0:o.animationName)!=null?a:"none"},[r,i]=ce(Et(e.show)?"present":"hidden");let s="none";return xe(o=>{const a=Et(e.show);return at(()=>{var c;if(o===a)return a;const l=s,u=n();a?i("present"):u==="none"||((c=t())==null?void 0:c.display)==="none"?i("hidden"):i(o===!0&&l!==u?"hiding":"hidden")}),a}),xe(()=>{const o=Et(e.element);if(!o)return;const a=u=>{u.target===o&&(s=n())},l=u=>{const d=n().includes(u.animationName);u.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),_e(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},ET=OT,Gb=ET,fu="data-kb-top-layer",Kb,nf=!1,wr=[];function ga(e){return wr.findIndex(t=>t.node===e)}function AT(e){return wr[ga(e)]}function PT(e){return wr[wr.length-1].node===e}function Vb(){return wr.filter(e=>e.isPointerBlocking)}function TT(){return[...Vb()].slice(-1)[0]}function ih(){return Vb().length>0}function Wb(e){var n;const t=ga((n=TT())==null?void 0:n.node);return ga(e)<t}function MT(e){wr.push(e)}function jT(e){const t=ga(e);t<0||wr.splice(t,1)}function $T(){for(const{node:e}of wr)e.style.pointerEvents=Wb(e)?"none":"auto"}function DT(e){if(ih()&&!nf){const t=Jn(e);Kb=document.body.style.pointerEvents,t.body.style.pointerEvents="none",nf=!0}}function LT(e){if(ih())return;const t=Jn(e);t.body.style.pointerEvents=Kb,t.body.style.length===0&&t.body.removeAttribute("style"),nf=!1}var Wt={layers:wr,isTopMostLayer:PT,hasPointerBlockingLayer:ih,isBelowPointerBlockingLayer:Wb,addLayer:MT,removeLayer:jT,indexOf:ga,find:AT,assignPointerEventToLayers:$T,disableBodyPointerEvents:DT,restoreBodyPointerEvents:LT},IT={};Zu(IT,{Button:()=>FT,Root:()=>sh});var RT=["button","color","file","image","reset","submit"];function NT(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?RT.indexOf(e.type)!==-1:!1}function sh(e){let t;const n=Re({type:"button"},e),[r,i]=Ve(n,["ref","type","disabled"]),s=Xu(()=>t,()=>"button"),o=U(()=>{const u=s();return u==null?!1:NT({tagName:u,type:r.type})}),a=U(()=>s()==="input"),l=U(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return L(st,Ae({as:"button",ref(u){const c=It(d=>t=d,r.ref);typeof c=="function"&&c(u)},get type(){return o()||a()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return o()||a()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var FT=sh,BT=["top","right","bottom","left"],Xn=Math.min,on=Math.max,hu=Math.round,_l=Math.floor,Zr=e=>({x:e,y:e}),qT={left:"right",right:"left",bottom:"top",top:"bottom"},zT={start:"end",end:"start"};function rf(e,t,n){return on(e,Xn(t,n))}function Wi(e,t){return typeof e=="function"?e(t):e}function Jr(e){return e.split("-")[0]}function no(e){return e.split("-")[1]}function Qb(e){return e==="x"?"y":"x"}function oh(e){return e==="y"?"height":"width"}function Bi(e){return["top","bottom"].includes(Jr(e))?"y":"x"}function ah(e){return Qb(Bi(e))}function HT(e,t,n){n===void 0&&(n=!1);const r=no(e),i=ah(e),s=oh(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=gu(o)),[o,gu(o)]}function UT(e){const t=gu(e);return[sf(e),t,sf(t)]}function sf(e){return e.replace(/start|end/g,t=>zT[t])}function GT(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function KT(e,t,n,r){const i=no(e);let s=GT(Jr(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(sf)))),s}function gu(e){return e.replace(/left|right|bottom|top/g,t=>qT[t])}function VT(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yb(e){return typeof e!="number"?VT(e):{top:e,right:e,bottom:e,left:e}}function yu(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function nm(e,t,n){let{reference:r,floating:i}=e;const s=Bi(t),o=ah(t),a=oh(o),l=Jr(t),u=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(no(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}var WT=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=nm(u,r,l),f=r,h={},g=0;for(let m=0;m<a.length;m++){const{name:p,fn:v}=a[m],{x:b,y:S,data:C,reset:x}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=b!=null?b:c,d=S!=null?S:d,h={...h,[p]:{...h[p],...C}},x&&g<=50&&(g++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(u=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:c,y:d}=nm(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function ya(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Wi(t,e),g=Yb(h),p=a[f?d==="floating"?"reference":"floating":d],v=yu(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},x=yu(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:l}):b);return{top:(v.top-x.top+g.top)/C.y,bottom:(x.bottom-v.bottom+g.bottom)/C.y,left:(v.left-x.left+g.left)/C.x,right:(x.right-v.right+g.right)/C.x}}var QT=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=Wi(e,t)||{};if(u==null)return{};const d=Yb(c),f={x:n,y:r},h=ah(i),g=oh(h),m=await o.getDimensions(u),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",S=p?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[h]-f[h]-s.floating[g],x=f[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let w=k?k[S]:0;(!w||!await(o.isElement==null?void 0:o.isElement(k)))&&(w=a.floating[S]||s.floating[g]);const _=C/2-x/2,O=w/2-m[g]/2-1,E=Xn(d[v],O),T=Xn(d[b],O),j=E,B=w-m[g]-T,R=w/2-m[g]/2+_,A=rf(j,R,B),M=!l.arrow&&no(i)!=null&&R!==A&&s.reference[g]/2-(R<j?E:T)-m[g]/2<0,D=M?R<j?R-j:R-B:0;return{[h]:f[h]+D,data:{[h]:A,centerOffset:R-A-D,...M&&{alignmentOffset:D}},reset:M}}}),YT=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=Wi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Jr(i),b=Bi(a),S=Jr(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=f||(S||!m?[gu(a)]:UT(a)),k=g!=="none";!f&&k&&x.push(...KT(a,m,g,C));const w=[a,...x],_=await ya(t,p),O=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&O.push(_[v]),d){const R=HT(i,o,C);O.push(_[R[0]],_[R[1]])}if(E=[...E,{placement:i,overflows:O}],!O.every(R=>R<=0)){var T,j;const R=(((T=s.flip)==null?void 0:T.index)||0)+1,A=w[R];if(A)return{data:{index:R,overflows:E},reset:{placement:A}};let M=(j=E.filter(D=>D.overflows[0]<=0).sort((D,H)=>D.overflows[1]-H.overflows[1])[0])==null?void 0:j.placement;if(!M)switch(h){case"bestFit":{var B;const D=(B=E.filter(H=>{if(k){const Q=Bi(H.placement);return Q===b||Q==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Q=>Q>0).reduce((Q,F)=>Q+F,0)]).sort((H,Q)=>H[1]-Q[1])[0])==null?void 0:B[0];D&&(M=D);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function rm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function im(e){return BT.some(t=>e[t]>=0)}var XT=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Wi(e,t);switch(r){case"referenceHidden":{const s=await ya(t,{...i,elementContext:"reference"}),o=rm(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:im(o)}}}case"escaped":{const s=await ya(t,{...i,altBoundary:!0}),o=rm(s,n.floating);return{data:{escapedOffsets:o,escaped:im(o)}}}default:return{}}}}};async function ZT(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Jr(n),a=no(n),l=Bi(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,d=Wi(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}var JT=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await ZT(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},eM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...l}=Wi(e,t),u={x:n,y:r},c=await ya(t,l),d=Bi(Jr(i)),f=Qb(d);let h=u[f],g=u[d];if(s){const p=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+c[p],S=h-c[v];h=rf(b,h,S)}if(o){const p=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+c[p],S=g-c[v];g=rf(b,g,S)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},tM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=Wi(e,t),l=await ya(t,a),u=Jr(n),c=no(n),d=Bi(n)==="y",{width:f,height:h}=r.floating;let g,m;u==="top"||u==="bottom"?(g=u,m=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,g=c==="end"?"top":"bottom");const p=h-l.top-l.bottom,v=f-l.left-l.right,b=Xn(h-l[g],p),S=Xn(f-l[m],v),C=!t.middlewareData.shift;let x=b,k=S;if(d?k=c||C?Xn(S,v):v:x=c||C?Xn(b,p):p,C&&!c){const _=on(l.left,0),O=on(l.right,0),E=on(l.top,0),T=on(l.bottom,0);d?k=f-2*(_!==0||O!==0?_+O:on(l.left,l.right)):x=h-2*(E!==0||T!==0?E+T:on(l.top,l.bottom))}await o({...t,availableWidth:k,availableHeight:x});const w=await i.getDimensions(s.floating);return f!==w.width||h!==w.height?{reset:{rects:!0}}:{}}}};function ro(e){return Xb(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _r(e){var t;return(t=(Xb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Xb(e){return e instanceof Node||e instanceof un(e).Node}function $n(e){return e instanceof Element||e instanceof un(e).Element}function er(e){return e instanceof HTMLElement||e instanceof un(e).HTMLElement}function sm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}function Wa(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function nM(e){return["table","td","th"].includes(ro(e))}function Ju(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function lh(e){const t=uh(),n=$n(e)?Dn(e):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 rM(e){let t=ei(e);for(;er(t)&&!Vs(t);){if(lh(t))return t;if(Ju(t))return null;t=ei(t)}return null}function uh(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vs(e){return["html","body","#document"].includes(ro(e))}function Dn(e){return un(e).getComputedStyle(e)}function ec(e){return $n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ei(e){if(ro(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sm(e)&&e.host||_r(e);return sm(t)?t.host:t}function Zb(e){const t=ei(e);return Vs(t)?e.ownerDocument?e.ownerDocument.body:e.body:er(t)&&Wa(t)?t:Zb(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Zb(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=un(i);return s?t.concat(o,o.visualViewport||[],Wa(i)?i:[],o.frameElement&&n?ma(o.frameElement):[]):t.concat(i,ma(i,[],n))}function Jb(e){const t=Dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=er(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=hu(n)!==s||hu(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function ch(e){return $n(e)?e:e.contextElement}function ds(e){const t=ch(e);if(!er(t))return Zr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Jb(t);let o=(s?hu(n.width):n.width)/r,a=(s?hu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var iM=Zr(0);function e1(e){const t=un(e);return!uh()||!t.visualViewport?iM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==un(e)?!1:t}function qi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=ch(e);let o=Zr(1);t&&(r?$n(r)&&(o=ds(r)):o=ds(e));const a=sM(s,n,r)?e1(s):Zr(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=un(s),h=r&&$n(r)?un(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=ds(m),v=m.getBoundingClientRect(),b=Dn(m),S=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,d*=p.y,l+=S,u+=C,g=un(m),m=g.frameElement}}return yu({width:c,height:d,x:l,y:u})}function oM(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=_r(r),a=t?Ju(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Zr(1);const c=Zr(0),d=er(r);if((d||!d&&!s)&&((ro(r)!=="body"||Wa(o))&&(l=ec(r)),er(r))){const f=qi(r);u=ds(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function aM(e){return Array.from(e.getClientRects())}function t1(e){return qi(_r(e)).left+ec(e).scrollLeft}function lM(e){const t=_r(e),n=ec(e),r=e.ownerDocument.body,i=on(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=on(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+t1(e);const a=-n.scrollTop;return Dn(r).direction==="rtl"&&(o+=on(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function uM(e,t){const n=un(e),r=_r(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=uh();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function cM(e,t){const n=qi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=er(e)?ds(e):Zr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function om(e,t,n){let r;if(t==="viewport")r=uM(e,n);else if(t==="document")r=lM(_r(e));else if($n(t))r=cM(t,n);else{const i=e1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return yu(r)}function n1(e,t){const n=ei(e);return n===t||!$n(n)||Vs(n)?!1:Dn(n).position==="fixed"||n1(n,t)}function dM(e,t){const n=t.get(e);if(n)return n;let r=ma(e,[],!1).filter(a=>$n(a)&&ro(a)!=="body"),i=null;const s=Dn(e).position==="fixed";let o=s?ei(e):e;for(;$n(o)&&!Vs(o);){const a=Dn(o),l=lh(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Wa(o)&&!l&&n1(e,o))?r=r.filter(c=>c!==o):i=a,o=ei(o)}return t.set(e,r),r}function fM(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Ju(t)?[]:dM(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const d=om(t,c,i);return u.top=on(d.top,u.top),u.right=Xn(d.right,u.right),u.bottom=Xn(d.bottom,u.bottom),u.left=on(d.left,u.left),u},om(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function hM(e){const{width:t,height:n}=Jb(e);return{width:t,height:n}}function gM(e,t,n){const r=er(t),i=_r(t),s=n==="fixed",o=qi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Zr(0);if(r||!r&&!s)if((ro(t)!=="body"||Wa(i))&&(a=ec(t)),r){const d=qi(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=t1(i));const u=o.left+a.scrollLeft-l.x,c=o.top+a.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function Uc(e){return Dn(e).position==="static"}function am(e,t){return!er(e)||Dn(e).position==="fixed"?null:t?t(e):e.offsetParent}function r1(e,t){const n=un(e);if(Ju(e))return n;if(!er(e)){let i=ei(e);for(;i&&!Vs(i);){if($n(i)&&!Uc(i))return i;i=ei(i)}return n}let r=am(e,t);for(;r&&nM(r)&&Uc(r);)r=am(r,t);return r&&Vs(r)&&Uc(r)&&!lh(r)?n:r||rM(e)||n}var yM=async function(e){const t=this.getOffsetParent||r1,n=this.getDimensions,r=await n(e.floating);return{reference:gM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mM(e){return Dn(e).direction==="rtl"}var i1={convertOffsetParentRelativeRectToViewportRelativeRect:oM,getDocumentElement:_r,getClippingRect:fM,getOffsetParent:r1,getElementRects:yM,getClientRects:aM,getDimensions:hM,getScale:ds,isElement:$n,isRTL:mM};function pM(e,t){let n=null,r;const i=_r(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=_l(c),g=_l(i.clientWidth-(u+d)),m=_l(i.clientHeight-(c+f)),p=_l(u),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:on(0,Xn(1,l))||1};let S=!0;function C(x){const k=x[0].intersectionRatio;if(k!==l){if(!S)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch(x){n=new IntersectionObserver(C,b)}n.observe(e)}return o(!0),s}function vM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ch(e),c=i||s?[...u?ma(u):[],...ma(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=u&&a?pM(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,m=l?qi(e):null;l&&p();function p(){const v=qi(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,g=requestAnimationFrame(p)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}var bM=JT,xM=eM,wM=YT,SM=tM,CM=XT,_M=QT,kM=(e,t,n)=>{const r=new Map,i={platform:i1,...n},s={...i.platform,_c:r};return WT(e,t,{...i,platform:s})},dh=wt();function fh(){const e=St(dh);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var OM=he('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),of=30,lm=of/2,EM={top:180,right:-90,bottom:0,left:90};function hh(e){const t=fh(),n=Re({size:of},e),[r,i]=Ve(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=AM(t.contentRef),a=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},u=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},c=()=>Number.parseInt(u())*2*(of/r.size),d=()=>`rotate(${EM[s()]} ${lm} ${lm}) translate(0 2)`;return L(st,Ae({as:"div",ref(f){const h=It(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return Qu({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":c()},r.style)}},i,{get children(){const f=OM(),h=f.firstChild;return be(()=>re(h,"transform",d())),f}}))}function AM(e){const[t,n]=ce();return xe(()=>{const r=e();r&&n(EP(r).getComputedStyle(r))}),t}function PM(e){const t=fh(),[n,r]=Ve(e,["ref","style"]);return L(st,Ae({as:"div",ref(i){const s=It(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return Qu({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function um(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e!=null?e:{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const s={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...s,toJSON:()=>s}}function TM(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?um(r):e?e.getBoundingClientRect():um()}}}function MM(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var jM={top:"bottom",right:"left",bottom:"top",left:"right"};function $M(e,t){const[n,r]=e.split("-"),i=jM[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function DM(e){const t=Re({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=ce(),[i,s]=ce(),[o,a]=ce(t.placement),l=()=>{var f;return TM((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:u}=ii();async function c(){var k,w,_;const f=l(),h=n(),g=i();if(!f||!h)return;const m=((g==null?void 0:g.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(k=t.gutter)!=null?k:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[bM(({placement:O})=>{const E=!!O.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(MM))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(wM({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(xM({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(SM({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:E,rects:T}){const j=Math.round(T.reference.width);O=Math.floor(O),E=Math.floor(E),h.style.setProperty("--kb-popper-anchor-width",`${j}px`),h.style.setProperty("--kb-popper-content-available-width",`${O}px`),h.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(h.style.width=`${j}px`),t.fitViewport&&(h.style.maxWidth=`${O}px`,h.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&v.push(CM({padding:t.detachedPadding})),g&&v.push(_M({element:g,padding:t.arrowPadding}));const b=await kM(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...i1,isRTL:()=>u()==="rtl"}});if(a(b.placement),(w=t.onCurrentPlacementChange)==null||w.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",$M(b.placement,u()));const S=Math.round(b.x),C=Math.round(b.y);let x;if(t.hideWhenDetached&&(x=(_=b.middlewareData.hide)!=null&&_.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${S}px, ${C}px, 0)`,visibility:x}),g&&b.middlewareData.arrow){const{x:O,y:E}=b.middlewareData.arrow,T=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:E!=null?`${E}px`:"",[T]:"100%"})}}xe(()=>{const f=l(),h=n();if(!f||!h)return;const g=vM(f,h,c,{elementResize:typeof ResizeObserver=="function"});_e(g)}),xe(()=>{var g;const f=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:o,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return L(dh.Provider,{value:d,get children(){return t.children}})}var s1=Object.assign(DM,{Arrow:hh,Context:dh,usePopperContext:fh,Positioner:PM});function LM(e){const t=n=>{var r;n.key===eh.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};xe(()=>{var r,i;if(X(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:Jn();n.addEventListener("keydown",t),_e(()=>{n.removeEventListener("keydown",t)})})}var cm="interactOutside.pointerDownOutside",dm="interactOutside.focusOutside";function IM(e,t){let n,r=HP;const i=()=>Jn(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},o=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${fu}]`)||!wn(i(),f)||wn(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},u=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const m=vt([s,a]);g.addEventListener(cm,m,{once:!0});const p=new CustomEvent(cm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||jP(d)&&d.button===0}});g.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},c=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=vt([o,a]);h.addEventListener(dm,g,{once:!0});const m=new CustomEvent(dm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};xe(()=>{X(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",u,!0)},0),i().addEventListener("focusin",c,!0),_e(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",u,!0),i().removeEventListener("focusin",c,!0)}))})}var o1=wt();function RM(){return St(o1)}function NM(e){let t;const n=RM(),[r,i]=Ve(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};IM({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>wn(h(),d)))||[...s].some(h=>wn(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||Wt.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Wt.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:d=>{var f,h,g;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),LM({ownerDocument:()=>Jn(t),onEscapeKeyDown:d=>{var f;!t||!Wt.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),xr(()=>{if(!t)return;Wt.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Wt.assignPointerEventToLayers(),Wt.disableBodyPointerEvents(t),_e(()=>{t&&(Wt.removeLayer(t),d==null||d(),Wt.assignPointerEventToLayers(),Wt.restoreBodyPointerEvents(t))})}),xe(br([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Wt.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Wt.assignPointerEventToLayers()),f&&Wt.disableBodyPointerEvents(d),_e(()=>{Wt.restoreBodyPointerEvents(d)})},{defer:!0}));const c={registerNestedLayer:o};return L(o1.Provider,{value:c,get children(){return L(st,Ae({as:"div",ref(d){const f=It(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function a1(e={}){const[t,n]=Lb({value:()=>X(e.open),defaultValue:()=>!!X(e.defaultOpen),onChange:o=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,o)}}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var mn={};Zu(mn,{Description:()=>$b,ErrorMessage:()=>Db,Item:()=>d1,ItemControl:()=>f1,ItemDescription:()=>h1,ItemIndicator:()=>g1,ItemInput:()=>y1,ItemLabel:()=>m1,Label:()=>p1,RadioGroup:()=>FM,Root:()=>v1});var l1=wt();function u1(){const e=St(l1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var c1=wt();function Qa(){const e=St(c1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function d1(e){const t=Ka(),n=u1(),r=`${t.generateId("item")}-${kn()}`,i=Re({id:r},e),[s,o]=Ve(i,["value","disabled","onPointerDown"]),[a,l]=ce(),[u,c]=ce(),[d,f]=ce(),[h,g]=ce(),[m,p]=ce(!1),v=U(()=>n.isSelectedValue(s.value)),b=U(()=>s.disabled||t.isDisabled()||!1),S=k=>{nt(k,s.onPointerDown),m()&&k.preventDefault()},C=U(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),x={value:()=>s.value,dataset:C,isSelected:v,isDisabled:b,inputId:a,labelId:u,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Ga(()=>o.id),registerInput:Sn(l),registerLabel:Sn(c),registerDescription:Sn(f),setIsFocused:p,setInputRef:g};return L(c1.Provider,{value:x,get children(){return L(st,Ae({as:"div",role:"group",onPointerDown:S},C,o))}})}function f1(e){const t=Qa(),n=Re({id:t.generateId("control")},e),[r,i]=Ve(n,["onClick","onKeyDown"]);return L(st,Ae({as:"div",onClick:a=>{var l;nt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;nt(a,r.onKeyDown),a.key===eh.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function h1(e){const t=Qa(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),L(st,Ae({as:"div"},()=>t.dataset(),n))}function g1(e){const t=Qa(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ve(n,["ref","forceMount"]),[s,o]=ce(),{present:a}=Gb({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return L(ve,{get when(){return a()},get children(){return L(st,Ae({as:"div",ref(l){const u=It(o,r.ref);typeof u=="function"&&u(l)}},()=>t.dataset(),i))}})}function y1(e){const t=Ka(),n=u1(),r=Qa(),i=Re({id:r.generateId("input")},e),[s,o]=Ve(i,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),a=()=>[s["aria-labelledby"],r.labelId(),s["aria-labelledby"]!=null&&o["aria-label"]!=null?o.id:void 0].filter(Boolean).join(" ")||void 0,l=()=>[s["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[u,c]=ce(!1),d=g=>{if(nt(g,s.onChange),g.stopPropagation(),!u()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}c(!1)},f=g=>{nt(g,s.onFocus),r.setIsFocused(!0)},h=g=>{nt(g,s.onBlur),r.setIsFocused(!1)};return xe(br([()=>r.isSelected(),()=>r.value()],g=>{if(!g[0]&&g[1]===r.value())return;c(!0);const m=r.inputRef();m==null||m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),m==null||m.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),xe(()=>_e(r.registerInput(o.id))),L(st,Ae({as:"input",ref(g){const m=It(r.setInputRef,s.ref);typeof m=="function"&&m(g)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return Qu({...Mb},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function m1(e){const t=Qa(),n=Re({id:t.generateId("label")},e);return xe(()=>_e(t.registerLabel(n.id))),L(st,Ae({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function p1(e){return L(WP,Ae({as:"span"},e))}function v1(e){let t;const n=`radiogroup-${kn()}`,r=Re({id:n,orientation:"vertical"},e),[i,s,o]=Ve(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],KP),[a,l]=Va({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:u}=VP(s);QP(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const c=()=>u.getAriaLabelledBy(X(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>u.getAriaDescribedBy(i["aria-describedby"]),f=g=>g===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:g=>{if(!(u.isReadOnly()||u.isDisabled())&&(l(g),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return L(jb.Provider,{value:u,get children(){return L(l1.Provider,{value:h,get children(){return L(st,Ae({as:"div",ref(g){const m=It(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return X(s.id)},get"aria-invalid"(){return u.validationState()==="invalid"||void 0},get"aria-required"(){return u.isRequired()||void 0},get"aria-disabled"(){return u.isDisabled()||void 0},get"aria-readonly"(){return u.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return c()},get"aria-describedby"(){return d()}},()=>u.dataset(),o))}})}})}var FM=Object.assign(v1,{Description:$b,ErrorMessage:Db,Item:d1,ItemControl:f1,ItemDescription:h1,ItemIndicator:g1,ItemInput:y1,ItemLabel:m1,Label:p1}),BM=class{constructor(e,t,n){pe(this,"collection");pe(this,"ref");pe(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n,r;return(r=(n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))!=null?r:null}getKeyPageAbove(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){var i;const n=(i=this.collator)==null?void 0:i.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const s=this.collection().getItem(r);if(s){const o=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function qM(e,t,n){const r=mT({usage:"search",sensitivity:"base"}),i=U(()=>{const s=X(e.keyboardDelegate);return s||new BM(e.collection,t,r)});return CT({selectionManager:()=>X(e.selectionManager),keyboardDelegate:i,autoFocus:()=>X(e.autoFocus),deferAutoFocus:()=>X(e.deferAutoFocus),shouldFocusWrap:()=>X(e.shouldFocusWrap),disallowEmptySelection:()=>X(e.disallowEmptySelection),selectOnFocus:()=>X(e.selectOnFocus),disallowTypeAhead:()=>X(e.disallowTypeAhead),shouldUseVirtualFocus:()=>X(e.shouldUseVirtualFocus),allowsTabNavigation:()=>X(e.allowsTabNavigation),isVirtualized:()=>X(e.isVirtualized),scrollToKey:s=>{var o;return(o=X(e.scrollToKey))==null?void 0:o(s)},orientation:()=>X(e.orientation)},t)}var Gc="focusScope.autoFocusOnMount",Kc="focusScope.autoFocusOnUnmount",fm={bubbles:!1,cancelable:!0},hm={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Jd(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Jd(this.stack,e),(t=this.active())==null||t.resume()}};function zM(e,t){const[n,r]=ce(!1),i={pause(){r(!0)},resume(){r(!1)}};let s=null;const o=g=>{var m;return(m=e.onMountAutoFocus)==null?void 0:m.call(e,g)},a=g=>{var m;return(m=e.onUnmountAutoFocus)==null?void 0:m.call(e,g)},l=()=>Jn(t()),u=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,Mb),g},c=()=>{const g=t();return g?Pb(g,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const g=c();return g.length>0?g[0]:null},f=()=>{const g=c();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const m=Io(g);return!m||wn(g,m)?!1:Tb(m)};xe(()=>{const g=t();if(!g)return;hm.add(i);const m=Io(g);if(!wn(g,m)){const v=new CustomEvent(Gc,fm);g.addEventListener(Gc,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{At(d()),Io(g)===m&&At(g)},0)}_e(()=>{g.removeEventListener(Gc,o),setTimeout(()=>{const v=new CustomEvent(Kc,fm);h()&&v.preventDefault(),g.addEventListener(Kc,a),g.dispatchEvent(v),v.defaultPrevented||At(m!=null?m:l().body),g.removeEventListener(Kc,a),hm.remove(i)},0)})}),xe(()=>{const g=t();if(!g||!X(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${fu}]`)||(wn(g,b)?s=b:At(s))},p=v=>{const b=v.relatedTarget,S=b!=null?b:Io(g);S!=null&&S.closest(`[${fu}]`)||wn(g,S)||At(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),_e(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),xe(()=>{const g=t();if(!g||!X(e.trapFocus)||n())return;const m=u();g.insertAdjacentElement("afterbegin",m);const p=u();g.insertAdjacentElement("beforeend",p);function v(S){const C=d(),x=f();S.relatedTarget===C?At(x):At(C)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(S=>{for(const C of S)C.previousSibling===p&&(p.remove(),g.insertAdjacentElement("beforeend",p)),C.nextSibling===m&&(m.remove(),g.insertAdjacentElement("afterbegin",m))});b.observe(g,{childList:!0,subtree:!1}),_e(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var HM="data-live-announcer";function UM(e){xe(()=>{X(e.isDisabled)||_e(GM(X(e.targets),X(e.root)))})}var _o=new WeakMap,yn=[];function GM(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${HM}], [${fu}]`))n.add(f);const u=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),d=u(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=c.nextNode();for(;f!=null;)s(f),f=c.nextNode()}},s=l=>{var c;const u=(c=_o.get(l))!=null?c:0;l.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&l.setAttribute("aria-hidden","true"),r.add(l),_o.set(l,u+1))};yn.length&&yn[yn.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const u of l)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(u.target))){for(const c of u.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(const c of u.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&i(c)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return yn.push(a),()=>{o.disconnect();for(const l of r){const u=_o.get(l);if(u==null)return;u===1?(l.removeAttribute("aria-hidden"),_o.delete(l)):_o.set(l,u-1)}a===yn[yn.length-1]?(yn.pop(),yn.length&&yn[yn.length-1].observe()):yn.splice(yn.indexOf(a),1)}}var kl=new Map,KM=e=>{xe(()=>{var s,o;const t=(s=Et(e.style))!=null?s:{},n=(o=Et(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=kl.get(e.key);i?i.activeCount++:kl.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);_e(()=>{var l;const a=kl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}kl.delete(e.key);for(const[u,c]of Object.entries(a.originalStyles))e.element.style[u]=c;for(const u of a.properties)e.element.style.removeProperty(u);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},gm=KM,VM=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},WM=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},QM=(e,t,n)=>{var l;const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,s=0,o=0,a=!1;do{const[u,c,d]=VM(i,t),f=d-u-r*c;(c!==0||f!==0)&&WM(i,t)&&(s+=f,o+=c),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[ym,mm]=ce([]),YM=e=>ym().indexOf(e)===ym().length-1,XM=e=>{const t=Ae({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=kn();let r=[0,0],i=null,s=null;xe(()=>{Et(t.enabled)&&(mm(u=>[...u,n]),_e(()=>{mm(u=>u.filter(c=>c!==n))}))}),xe(()=>{if(!Et(t.enabled)||!Et(t.hideScrollbar))return;const{body:u}=document,c=window.innerWidth-u.offsetWidth;if(Et(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];c>0&&(Et(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(u).paddingRight} + ${c}px)`:d.marginRight=`calc(${window.getComputedStyle(u).marginRight} + ${c}px)`,f.push({key:"--scrollbar-width",value:`${c}px`}));const h=window.scrollY,g=window.scrollX;gm({key:"prevent-scroll",element:u,style:d,properties:f,cleanup:()=>{Et(t.restoreScrollPosition)&&c>0&&window.scrollTo(g,h)}})}else gm({key:"prevent-scroll",element:u,style:{overflow:"hidden"}})}),xe(()=>{!YM(n)||!Et(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),_e(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=u=>{r=pm(u),i=null,s=null},a=u=>{const c=u.target,d=Et(t.element),f=ZM(u),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=vm(c,h,g,d);let p;d&&af(d,c)?p=!m:p=!0,p&&u.cancelable&&u.preventDefault()},l=u=>{const c=Et(t.element),d=u.target;let f;if(u.touches.length===2)f=!Et(t.allowPinchZoom);else{if(i==null||s===null){const h=pm(u).map((m,p)=>r[p]-m),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=g,s=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=vm(d,i,s,c);c&&af(c,d)?f=!h:f=!0}}f&&u.cancelable&&u.preventDefault()}},ZM=e=>[e.deltaX,e.deltaY],pm=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],vm=(e,t,n,r)=>{const i=r!==null&&af(r,e),[s,o]=QM(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},af=(e,t)=>{var r;if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=(r=n._$host)!=null?r:n.parentElement}return!1},JM=XM,ej=JM,b1=wt();function x1(){return St(b1)}function kr(){const e=x1();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var w1=wt();function gh(){const e=St(w1);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var S1=wt();function tr(){const e=St(S1);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function yh(e){let t;const n=tr(),r=kr(),i=Re({id:n.generateId(`item-${kn()}`)},e),[s,o]=Ve(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=ce(),[u,c]=ce(),[d,f]=ce(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var O;(O=s.onSelect)==null||O.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};lT({getItem:()=>{var O,E,T,j,B;return{ref:()=>t,type:"item",key:g(),textValue:(j=(T=(E=s.textValue)!=null?E:(O=d())==null?void 0:O.textContent)!=null?T:t==null?void 0:t.textContent)!=null?j:"",disabled:(B=s.disabled)!=null?B:!1}}});const v=Ub({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=O=>{nt(O,s.onPointerMove),O.pointerType==="mouse"&&(s.disabled?r.onItemLeave(O):(r.onItemEnter(O),O.defaultPrevented||(At(O.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},S=O=>{nt(O,s.onPointerLeave),O.pointerType==="mouse"&&r.onItemLeave(O)},C=O=>{nt(O,s.onPointerUp),!s.disabled&&O.button===0&&p()},x=O=>{if(nt(O,s.onKeyDown),!O.repeat&&!s.disabled)switch(O.key){case"Enter":case" ":p();break}},k=U(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),w=U(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":m()?"":void 0})),_={isChecked:()=>s.checked,dataset:w,setLabelRef:f,generateId:Ga(()=>o.id),registerLabel:Sn(l),registerDescription:Sn(c)};return L(w1.Provider,{value:_,get children(){return L(st,Ae({as:"div",ref(O){const E=It(T=>t=T,s.ref);typeof E=="function"&&E(O)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return u()},get"data-key"(){return v.dataKey()},get onPointerDown(){return vt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return vt([C,v.onPointerUp])},get onClick(){return vt([s.onClick,v.onClick])},get onKeyDown(){return vt([x,v.onKeyDown])},get onMouseDown(){return vt([s.onMouseDown,v.onMouseDown])},get onFocus(){return vt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:S},w,o))}})}function C1(e){const t=Re({closeOnSelect:!1},e),[n,r]=Ve(t,["checked","defaultChecked","onChange","onSelect"]),i=JP({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>{var a;return(a=n.onChange)==null?void 0:a.call(n,o)},isDisabled:()=>r.disabled});return L(yh,Ae({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var tj=wt();function tc(){return St(tj)}var pa={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>pa.next(e==="ltr"?"rtl":"ltr",t)},bm={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function _1(e){const t=tr(),n=kr(),r=tc(),{direction:i}=ii(),s=Re({id:t.generateId("trigger")},e),[o,a]=Ve(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>{var v;return(v=t.value())!=null?v:o.id},r.lastValue()===void 0&&r.setLastValue(l));const u=Xu(()=>n.triggerRef(),()=>"button"),c=U(()=>{var v;return u()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});xe(br(()=>r==null?void 0:r.value(),v=>{var b;c()&&v===l()&&((b=n.triggerRef())==null||b.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=v=>{nt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{nt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},g=v=>{if(nt(v,o.onKeyDown),!o.disabled){if(c())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case bm.first(t.orientation()):v.stopPropagation(),v.preventDefault(),GP(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case bm.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case pa.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case pa.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;nt(v,o.onMouseOver),((b=n.triggerRef())==null?void 0:b.dataset.pointerType)!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},p=v=>{nt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return xe(()=>_e(n.registerTriggerId(o.id))),L(sh,Ae({ref(v){const b=It(n.setTriggerRef,o.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return U(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:m,onClick:h,onKeyDown:g,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var nj=wt();function k1(){return St(nj)}function O1(e){let t;const n=tr(),r=kr(),i=tc(),s=k1(),{direction:o}=ii(),a=Re({id:n.generateId(`content-${kn()}`)},e),[l,u]=Ve(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=qM({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);zM({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:S=>{var C;i===void 0&&((C=l.onOpenAutoFocus)==null||C.call(l,S))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=S=>{if(wn(S.currentTarget,S.target)&&(S.key==="Tab"&&r.isOpen()&&S.preventDefault(),i!==void 0&&S.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(S.key){case pa.next(o(),n.orientation()):S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case pa.previous(o(),n.orientation()):if(S.currentTarget.hasAttribute("data-closed"))break;S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},g=S=>{var C;(C=l.onEscapeKeyDown)==null||C.call(l,S),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=S=>{var C;(C=l.onFocusOutside)==null||C.call(l,S),n.isModal()&&S.preventDefault()},p=S=>{var C,x;nt(S,l.onPointerEnter),r.isOpen()&&((C=r.parentMenuContext())==null||C.listState().selectionManager().setFocused(!1),(x=r.parentMenuContext())==null||x.listState().selectionManager().setFocusedKey(void 0))},v=S=>{if(nt(S,l.onPointerMove),S.pointerType!=="mouse")return;const C=S.target,x=c!==S.clientX;wn(S.currentTarget,C)&&x&&(r.setPointerDir(S.clientX>c?"right":"left"),c=S.clientX)};xe(()=>_e(r.registerContentId(l.id)));const b={ref:It(S=>{r.setContentRef(S),t=S},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:vt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:vt([l.onMouseDown,f.onMouseDown]),onFocusIn:vt([l.onFocusIn,f.onFocusIn]),onFocusOut:vt([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return L(ve,{get when(){return r.contentPresent()},get children(){return L(ve,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return L(st,Ae({as:"div"},()=>r.dataset(),b,u))},get children(){return L(s1.Positioner,{get children(){return L(NM,Ae({get disableOutsidePointerEvents(){return U(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Qu({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:g,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),b,u))}})}})}})}function rj(e){let t;const n=tr(),r=kr(),[i,s]=Ve(e,["ref"]);return ej({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),L(O1,Ae({ref(o){const a=It(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var E1=wt();function ij(){const e=St(E1);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function mh(e){const t=tr(),n=Re({id:t.generateId(`group-${kn()}`)},e),[r,i]=ce(),s={generateId:Ga(()=>n.id),registerLabelId:Sn(i)};return L(E1.Provider,{value:s,get children(){return L(st,Ae({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function A1(e){const t=ij(),n=Re({id:t.generateId("label")},e),[r,i]=Ve(n,["id"]);return xe(()=>_e(t.registerLabelId(r.id))),L(st,Ae({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function P1(e){const t=kr(),n=Re({children:"▼"},e);return L(st,Ae({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function T1(e){return L(yh,Ae({role:"menuitem",closeOnSelect:!0},e))}function M1(e){const t=gh(),n=Re({id:t.generateId("description")},e),[r,i]=Ve(n,["id"]);return xe(()=>_e(t.registerDescription(r.id))),L(st,Ae({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function j1(e){const t=gh(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ve(n,["forceMount"]);return L(ve,{get when(){return r.forceMount||t.isChecked()},get children(){return L(st,Ae({as:"div"},()=>t.dataset(),i))}})}function $1(e){const t=gh(),n=Re({id:t.generateId("label")},e),[r,i]=Ve(n,["ref","id"]);return xe(()=>_e(t.registerLabel(r.id))),L(st,Ae({as:"div",ref(s){const o=It(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function D1(e){const t=kr();return L(ve,{get when(){return t.contentPresent()},get children(){return L(ov,e)}})}var L1=wt();function sj(){const e=St(L1);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function I1(e){const n=tr().generateId(`radiogroup-${kn()}`),r=Re({id:n},e),[i,s]=Ve(r,["value","defaultValue","onChange","disabled"]),[o,a]=Va({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:u=>{var c;return(c=i.onChange)==null?void 0:c.call(i,u)}}),l={isDisabled:()=>i.disabled,isSelectedValue:u=>u===o(),setSelectedValue:a};return L(L1.Provider,{value:l,get children(){return L(mh,s)}})}function R1(e){const t=sj(),n=Re({closeOnSelect:!1},e),[r,i]=Ve(n,["value","onSelect"]);return L(yh,Ae({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var o;(o=r.onSelect)==null||o.call(r),t.setSelectedValue(r.value)}},i))}function oj(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),s=[],o=t.clientX,a=t.clientY;switch(r){case"top":s.push([o,a+5]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]);break;case"right":s.push([o-5,a]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]);break;case"bottom":s.push([o,a-5]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]);break;case"left":s.push([o+5,a]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]);break}return s}function aj(e,t){return t?UP([e.clientX,e.clientY],t):!1}function N1(e){const t=tr(),n=Rb(),r=x1(),i=tc(),s=k1(),o=Re({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=Ve(o,["open","defaultOpen","onOpenChange"]);let u=0,c=null,d="right";const[f,h]=ce(),[g,m]=ce(),[p,v]=ce(),[b,S]=ce(),[C,x]=ce(!0),[k,w]=ce(l.placement),[_,O]=ce([]),[E,T]=ce([]),{DomCollectionProvider:j}=aT({items:E,onItemsChange:T}),B=a1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:J=>{var Se;return(Se=a.onOpenChange)==null?void 0:Se.call(a,J)}}),{present:R}=Gb({show:()=>t.forceMount()||B.isOpen(),element:()=>{var J;return(J=b())!=null?J:null}}),A=kT({selectionMode:"none",dataSource:E}),M=J=>{x(J),B.open()},D=(J=!1)=>{B.close(),J&&r&&r.close(!0)},H=J=>{x(J),B.toggle()},Q=()=>{const J=b();J&&(At(J),A.selectionManager().setFocused(!0),A.selectionManager().setFocusedKey(void 0))},F=()=>{s!=null?setTimeout(()=>Q()):Q()},G=J=>{O(ge=>[...ge,J]);const Se=r==null?void 0:r.registerNestedMenu(J);return()=>{O(ge=>Jd(ge,J)),Se==null||Se()}},ie=J=>d===(c==null?void 0:c.side)&&aj(J,c==null?void 0:c.area),ae=J=>{ie(J)&&J.preventDefault()},N=J=>{ie(J)||F()},le=J=>{ie(J)&&J.preventDefault()};UM({isDisabled:()=>!(r==null&&B.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),xe(()=>{const J=b();if(!J||!r)return;const Se=r.registerNestedMenu(J);_e(()=>{Se()})}),xe(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),xe(()=>{var J;r!==void 0||i===void 0||(i.value()===t.value()?((J=p())==null||J.focus(),i.autoFocusMenu()&&M(!0)):D())}),xe(()=>{r!==void 0||i===void 0||B.isOpen()&&i.setValue(t.value())}),_e(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const me={dataset:U(()=>({"data-expanded":B.isOpen()?"":void 0,"data-closed":B.isOpen()?void 0:""})),isOpen:B.isOpen,contentPresent:R,nestedMenus:_,currentPlacement:k,pointerGraceTimeoutId:()=>u,autoFocus:C,listState:()=>A,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:S,open:M,close:D,toggle:H,focusContent:F,onItemEnter:ae,onItemLeave:N,onTriggerLeave:le,setPointerDir:J=>d=J,setPointerGraceTimeoutId:J=>u=J,setPointerGraceIntent:J=>c=J,registerNestedMenu:G,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Sn(h),registerContentId:Sn(m)};return L(j,{get children(){return L(b1.Provider,{value:me,get children(){return L(ve,{when:s===void 0,get fallback(){return l.children},get children(){return L(s1,Ae({anchorRef:p,contentRef:b,onCurrentPlacementChange:w},l))}})}})}})}function F1(e){const{direction:t}=ii();return L(N1,Ae({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var lj={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function B1(e){const t=kr(),n=tr(),[r,i]=Ve(e,["onFocusOutside","onKeyDown"]),{direction:s}=ii();return L(O1,Ae({onOpenAutoFocus:c=>{c.preventDefault()},onCloseAutoFocus:c=>{c.preventDefault()},onFocusOutside:c=>{var f;(f=r.onFocusOutside)==null||f.call(r,c);const d=c.target;wn(t.triggerRef(),d)||t.close()},onKeyDown:c=>{nt(c,r.onKeyDown);const d=wn(c.currentTarget,c.target),f=lj.close(s(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),At(t.triggerRef()))}},i))}var xm=["Enter"," "],uj={open:(e,t)=>e==="ltr"?[...xm,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...xm,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function q1(e){let t;const n=tr(),r=kr(),i=Re({id:n.generateId(`sub-trigger-${kn()}`)},e),[s,o]=Ve(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:u}=ii(),c=()=>s.id,d=()=>{const S=r.parentMenuContext();if(S==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return S.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===c(),g=Ub({key:c,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=S=>{nt(S,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=S=>{var x;if(nt(S,s.onPointerMove),S.pointerType!=="mouse")return;const C=r.parentMenuContext();if(C==null||C.onItemEnter(S),!S.defaultPrevented){if(s.disabled){C==null||C.onItemLeave(S);return}!r.isOpen()&&!a&&((x=r.parentMenuContext())==null||x.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),C==null||C.onItemEnter(S),S.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),At(S.currentTarget),C==null||C.listState().selectionManager().setFocused(!0),C==null||C.listState().selectionManager().setFocusedKey(c()))}},v=S=>{if(nt(S,s.onPointerLeave),S.pointerType!=="mouse")return;l();const C=r.parentMenuContext(),x=r.contentRef();if(x){C==null||C.setPointerGraceIntent({area:oj(r.currentPlacement(),S,x),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const k=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(k)}else{if(C==null||C.onTriggerLeave(S),S.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(S)},b=S=>{nt(S,s.onKeyDown),!S.repeat&&(s.disabled||uj.open(u(),n.orientation()).includes(S.key)&&(S.stopPropagation(),S.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return xe(()=>{var C,x,k;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const S=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:c(),textValue:(x=(C=s.textValue)!=null?C:t==null?void 0:t.textContent)!=null?x:"",disabled:(k=s.disabled)!=null?k:!1});_e(S)}),xe(br(()=>{var S;return(S=r.parentMenuContext())==null?void 0:S.pointerGraceTimeoutId()},S=>{_e(()=>{var C;window.clearTimeout(S),(C=r.parentMenuContext())==null||C.setPointerGraceIntent(null)})})),xe(()=>_e(r.registerTriggerId(s.id))),_e(()=>{l()}),L(st,Ae({as:"div",ref(S){const C=It(x=>{r.setTriggerRef(x),t=x},s.ref);typeof C=="function"&&C(S)},get id(){return s.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return U(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return vt([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return vt([s.onPointerUp,g.onPointerUp])},get onClick(){return vt([m,g.onClick])},get onKeyDown(){return vt([b,g.onKeyDown])},get onMouseDown(){return vt([s.onMouseDown,g.onMouseDown])},get onFocus(){return vt([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function cj(e){const t=tc(),n=`menu-${kn()}`,r=Re({id:n,modal:!0},e),[i,s]=Ve(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=a1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var u;return(u=i.onOpenChange)==null?void 0:u.call(i,l)}}),a={isModal:()=>{var l;return(l=i.modal)!=null?l:!0},preventScroll:()=>{var l;return(l=i.preventScroll)!=null?l:a.isModal()},forceMount:()=>{var l;return(l=i.forceMount)!=null?l:!1},generateId:Ga(()=>i.id),value:()=>i.value,orientation:()=>{var l,u;return(u=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?u:"horizontal"}};return L(S1.Provider,{value:a,get children(){return L(N1,Ae({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var dj={};Zu(dj,{Root:()=>nc,Separator:()=>fj});function nc(e){let t;const n=Re({orientation:"horizontal"},e),[r,i]=Ve(n,["ref","orientation"]),s=Xu(()=>t,()=>"hr");return L(st,Ae({as:"hr",ref(o){const a=It(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var fj=nc,ft={};Zu(ft,{Arrow:()=>hh,CheckboxItem:()=>C1,Content:()=>z1,DropdownMenu:()=>hj,Group:()=>mh,GroupLabel:()=>A1,Icon:()=>P1,Item:()=>T1,ItemDescription:()=>M1,ItemIndicator:()=>j1,ItemLabel:()=>$1,Portal:()=>D1,RadioGroup:()=>I1,RadioItem:()=>R1,Root:()=>H1,Separator:()=>nc,Sub:()=>F1,SubContent:()=>B1,SubTrigger:()=>q1,Trigger:()=>_1});function z1(e){const t=tr(),n=kr(),[r,i]=Ve(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return L(rj,Ae({onCloseAutoFocus:l=>{var u;(u=r.onCloseAutoFocus)==null||u.call(r,l),s||At(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var u;(u=r.onInteractOutside)==null||u.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function H1(e){const t=`dropdownmenu-${kn()}`,n=Re({id:t},e);return L(cj,n)}var hj=Object.assign(H1,{Arrow:hh,CheckboxItem:C1,Content:z1,Group:mh,GroupLabel:A1,Icon:P1,Item:T1,ItemDescription:M1,ItemIndicator:j1,ItemLabel:$1,Portal:D1,RadioGroup:I1,RadioItem:R1,Separator:nc,Sub:F1,SubContent:B1,SubTrigger:q1,Trigger:_1}),K={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},gj=he('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),yj=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mj=he('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),pj=he('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),ph=he('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),vj=he('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),bj=he('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),xj=he('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),wj=he('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),Sj=he('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),Cj=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),_j=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),kj=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),Oj=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),U1=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Ej=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Aj=he('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),Pj=he('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Tj=he('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Mj=he('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),jj=he('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),$j=he('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Dj=he('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function Lj(){return gj()}function G1(){return yj()}function Ko(){return mj()}function wm(){return pj()}function Sm(){return ph()}function Ij(){return(()=>{var e=ph();return e.style.setProperty("transform","rotate(90deg)"),e})()}function Rj(){return(()=>{var e=ph();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function Nj(){return vj()}function Fj(){return bj()}function Bj(){return xj()}function qj(){return wj()}function zj(){return Sj()}function Hj(){return Cj()}function Uj(){return _j()}function Gj(){return kj()}function Kj(){return Oj()}function Vj(e){return(()=>{var t=U1(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function Wj(){return Ej()}function Qj(){return Aj()}function Yj(e){return[L(ve,{get when(){return e.checked},get children(){var t=U1(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),L(ve,{get when(){return!e.checked},get children(){var t=Pj(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function Xj(){return Tj()}function Zj(){return Mj()}function Jj(){return jj()}function e$(){return $j()}function Cm(){const e=kn();return(()=>{var t=Dj(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,u=l.nextSibling,c=u.firstChild,d=u.nextSibling,f=d.firstChild,h=d.nextSibling,g=h.nextSibling,m=g.firstChild,p=g.nextSibling,v=p.firstChild,b=p.nextSibling,S=b.nextSibling,C=S.firstChild,x=S.nextSibling,k=x.firstChild,w=x.nextSibling,_=w.nextSibling,O=_.firstChild,E=_.nextSibling,T=E.firstChild,j=E.nextSibling,B=j.nextSibling,R=B.firstChild,A=B.nextSibling,M=A.firstChild,D=A.nextSibling,H=D.nextSibling,Q=H.firstChild,F=H.nextSibling,G=F.firstChild,ie=F.nextSibling,ae=ie.firstChild,N=ae.nextSibling,le=N.nextSibling,te=le.nextSibling,me=te.nextSibling,J=ie.nextSibling,Se=J.firstChild,ge=J.nextSibling,ze=ge.firstChild,oe=ge.nextSibling,He=oe.firstChild,lt=He.nextSibling,dt=lt.nextSibling,Ne=dt.firstChild,Fe=Ne.nextSibling,Y=Fe.nextSibling,Pe=Y.nextSibling,tt=Pe.nextSibling,$e=tt.nextSibling,ue=$e.nextSibling,W=ue.nextSibling,ne=W.nextSibling,ee=ne.nextSibling,Ce=ee.nextSibling,gt=Ce.nextSibling,we=oe.nextSibling,Je=we.firstChild,Be=we.nextSibling,An=Be.firstChild,Vt=Be.nextSibling,fn=Vt.firstChild,Nn=fn.nextSibling,nr=Vt.nextSibling,Qi=nr.firstChild,Or=nr.nextSibling,Xa=Or.firstChild,oo=Or.nextSibling,ao=oo.firstChild,lo=ao.nextSibling,Yi=lo.nextSibling,wh=Yi.nextSibling,Sh=wh.nextSibling,Ch=Sh.nextSibling,_h=Ch.nextSibling,kh=_h.nextSibling,Oh=kh.nextSibling,Eh=Oh.nextSibling,Ah=Eh.nextSibling,Ph=Ah.nextSibling,Th=Ph.nextSibling,Mh=Th.nextSibling,jh=Mh.nextSibling,$h=jh.nextSibling,Dh=$h.nextSibling,sx=Dh.nextSibling;return re(n,"id",`a-${e}`),re(r,"fill",`url(#a-${e})`),re(s,"id",`am-${e}`),re(o,"id",`b-${e}`),re(a,"filter",`url(#am-${e})`),re(l,"mask",`url(#b-${e})`),re(c,"id",`ah-${e}`),re(d,"id",`k-${e}`),re(f,"filter",`url(#ah-${e})`),re(h,"mask",`url(#k-${e})`),re(m,"id",`ae-${e}`),re(p,"id",`j-${e}`),re(v,"filter",`url(#ae-${e})`),re(b,"mask",`url(#j-${e})`),re(C,"id",`ai-${e}`),re(x,"id",`i-${e}`),re(k,"filter",`url(#ai-${e})`),re(w,"mask",`url(#i-${e})`),re(O,"id",`aj-${e}`),re(E,"id",`h-${e}`),re(T,"filter",`url(#aj-${e})`),re(j,"mask",`url(#h-${e})`),re(R,"id",`ag-${e}`),re(A,"id",`g-${e}`),re(M,"filter",`url(#ag-${e})`),re(D,"mask",`url(#g-${e})`),re(Q,"id",`af-${e}`),re(F,"id",`f-${e}`),re(G,"filter",`url(#af-${e})`),re(ie,"mask",`url(#f-${e})`),re(te,"id",`m-${e}`),re(me,"fill",`url(#m-${e})`),re(Se,"id",`ak-${e}`),re(ge,"id",`e-${e}`),re(ze,"filter",`url(#ak-${e})`),re(oe,"mask",`url(#e-${e})`),re(He,"id",`n-${e}`),re(lt,"fill",`url(#n-${e})`),re(Ne,"id",`r-${e}`),re(Fe,"fill",`url(#r-${e})`),re(Y,"id",`s-${e}`),re(Pe,"fill",`url(#s-${e})`),re(tt,"id",`q-${e}`),re($e,"fill",`url(#q-${e})`),re(ue,"id",`p-${e}`),re(W,"fill",`url(#p-${e})`),re(ne,"id",`o-${e}`),re(ee,"fill",`url(#o-${e})`),re(Ce,"id",`l-${e}`),re(gt,"fill",`url(#l-${e})`),re(Je,"id",`al-${e}`),re(Be,"id",`d-${e}`),re(An,"filter",`url(#al-${e})`),re(Vt,"mask",`url(#d-${e})`),re(fn,"id",`u-${e}`),re(Nn,"fill",`url(#u-${e})`),re(Qi,"id",`ad-${e}`),re(Or,"id",`c-${e}`),re(Xa,"filter",`url(#ad-${e})`),re(oo,"mask",`url(#c-${e})`),re(ao,"id",`t-${e}`),re(lo,"fill",`url(#t-${e})`),re(Yi,"id",`v-${e}`),re(wh,"stroke",`url(#v-${e})`),re(Sh,"id",`aa-${e}`),re(Ch,"stroke",`url(#aa-${e})`),re(_h,"id",`w-${e}`),re(kh,"stroke",`url(#w-${e})`),re(Oh,"id",`ac-${e}`),re(Eh,"stroke",`url(#ac-${e})`),re(Ah,"id",`ab-${e}`),re(Ph,"stroke",`url(#ab-${e})`),re(Th,"id",`y-${e}`),re(Mh,"stroke",`url(#y-${e})`),re(jh,"id",`x-${e}`),re($h,"stroke",`url(#x-${e})`),re(Dh,"id",`z-${e}`),re(sx,"stroke",`url(#z-${e})`),t})()}var t$=he('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),n$=he('<button title="Copy object to clipboard">'),r$=he('<button title="Remove all items"aria-label="Remove all items">'),i$=he('<button title="Delete item"aria-label="Delete item">'),s$=he('<button title="Toggle value"aria-label="Toggle value">'),o$=he('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),ko=he("<div>"),a$=he("<div><button> <span></span> <span> "),l$=he("<input>"),_m=he("<span>"),u$=he("<div><span>:"),c$=he("<div><div><button> [<!>...<!>]");function d$(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var km=e=>{const t=xt(),n=ye().shadowDOMTarget?je.bind({target:ye().shadowDOMTarget}):je,r=U(()=>t()==="dark"?so(n):io(n));return(()=>{var i=t$();return be(()=>se(i,fe(r().expander,n`
|
|
70
70
|
transform: rotate(${e.expanded?90:0}deg);
|
|
71
71
|
`,e.expanded&&n`
|
|
72
72
|
& svg {
|
|
@@ -243,7 +243,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
243
243
|
`,jn()<Fi&&!(sn()||Wr())&&r`
|
|
244
244
|
height: 100%;
|
|
245
245
|
max-height: 100%;
|
|
246
|
-
`,"tsqd-queries-container"),te=fe(i().row,"tsqd-header"),me=i().logoAndToggleContainer,J=fe(i().logo,"tsqd-text-logo-container"),
|
|
246
|
+
`,"tsqd-queries-container"),te=fe(i().row,"tsqd-header"),me=i().logoAndToggleContainer,J=fe(i().logo,"tsqd-text-logo-container"),Se=fe(i().tanstackLogo,"tsqd-text-logo-tanstack"),ge=fe(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),ze=fe(i().row,"tsqd-filters-actions-container"),oe=fe(i().filtersContainer,"tsqd-filters-container"),He=fe(i().filterInput,"tsqd-query-filter-textfield-container"),lt=fe("tsqd-query-filter-textfield"),dt=fe(i().filterSelect,"tsqd-query-filter-sort-container"),Ne=`Sort order ${(o()==="queries"?u():d())===-1?"descending":"ascending"}`,Fe=(o()==="queries"?u():d())===-1,Y=fe(i().actionsContainer,"tsqd-actions-container"),Pe=fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-clear-cache"),tt=`Clear ${o()} cache`,$e=fe(i().actionsBtn,Oo()&&i().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),ue=`${Oo()?"Unset offline mocking behavior":"Mock offline behavior"}`,W=Oo(),ne=`${Oo()?"Unset offline mocking behavior":"Mock offline behavior"}`;return le!==N.e&&se(w,N.e=le),te!==N.t&&se(_,N.t=te),me!==N.a&&se(O,N.a=me),J!==N.o&&se(E,N.o=J),Se!==N.i&&se(T,N.i=Se),ge!==N.n&&se(j,N.n=ge),ze!==N.s&&se(R,N.s=ze),oe!==N.h&&se(A,N.h=oe),He!==N.r&&se(M,N.r=He),lt!==N.d&&se(D,N.d=lt),dt!==N.l&&se(H,N.l=dt),Ne!==N.u&&re(Q,"aria-label",N.u=Ne),Fe!==N.c&&re(Q,"aria-pressed",N.c=Fe),Y!==N.w&&se(F,N.w=Y),Pe!==N.m&&se(G,N.m=Pe),tt!==N.f&&re(G,"title",N.f=tt),$e!==N.y&&se(ie,N.y=$e),ue!==N.g&&re(ie,"aria-label",N.g=ue),W!==N.p&&re(ie,"aria-pressed",N.p=W),ne!==N.b&&re(ie,"title",N.b=ne),N},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0}),be(()=>D.value=o()==="queries"?e.localStore.filter||"":e.localStore.mutationFilter||""),w})(),L(ve,{get when(){return U(()=>o()==="queries")()&&sn()},get children(){return L(nD,{})}}),L(ve,{get when(){return U(()=>o()==="mutations")()&&Wr()},get children(){return L(rD,{})}})]},Z$=e=>{const t=xt(),n=ye().shadowDOMTarget?je.bind({target:ye().shadowDOMTarget}):je,r=U(()=>t()==="dark"?En(n):On(n)),{colors:i,alpha:s}=K,o=(g,m)=>t()==="dark"?m:g,a=pt(g=>{var m;return(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.state},!0,g=>g.query.queryHash===e.query.queryHash),l=pt(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.isDisabled())!=null?p:!1},!0,g=>g.query.queryHash===e.query.queryHash),u=pt(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.isStatic())!=null?p:!1},!0,g=>g.query.queryHash===e.query.queryHash),c=pt(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.isStale())!=null?p:!1},!0,g=>g.query.queryHash===e.query.queryHash),d=pt(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.getObserversCount())!=null?p:0},!0,g=>g.query.queryHash===e.query.queryHash),f=U(()=>jS({queryState:a(),observerCount:d(),isStale:c()})),h=()=>f()==="gray"?n`
|
|
247
247
|
background-color: ${o(i[f()][200],i[f()][700])};
|
|
248
248
|
color: ${o(i[f()][700],i[f()][300])};
|
|
249
249
|
`:n`
|
|
@@ -276,21 +276,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
276
276
|
background-color: ${i(r[C()][100],r[C()][900])};
|
|
277
277
|
color: ${i(r[C()][700],r[C()][300])};
|
|
278
278
|
border-color: ${i(r[C()][400],r[C()][600])};
|
|
279
|
-
`;return L(ve,{get when(){return U(()=>!!h())()&&m()},get children(){var O=U$(),E=O.firstChild,T=E.nextSibling,j=T.firstChild,B=j.firstChild,R=B.firstChild,A=B.nextSibling,M=j.nextSibling,D=M.firstChild,H=D.nextSibling,Q=M.nextSibling,F=Q.firstChild,G=F.nextSibling,ie=T.nextSibling,ae=ie.nextSibling,N=ae.firstChild,le=N.firstChild,te=N.nextSibling,me=te.firstChild,J=te.nextSibling,
|
|
279
|
+
`;return L(ve,{get when(){return U(()=>!!h())()&&m()},get children(){var O=U$(),E=O.firstChild,T=E.nextSibling,j=T.firstChild,B=j.firstChild,R=B.firstChild,A=B.nextSibling,M=j.nextSibling,D=M.firstChild,H=D.nextSibling,Q=M.nextSibling,F=Q.firstChild,G=F.nextSibling,ie=T.nextSibling,ae=ie.nextSibling,N=ae.firstChild,le=N.firstChild,te=N.nextSibling,me=te.firstChild,J=te.nextSibling,Se=J.firstChild,ge=J.nextSibling,ze=ge.firstChild,oe=ge.nextSibling,He=oe.firstChild,lt=He.nextSibling,dt=ae.nextSibling;dt.firstChild;var Ne=dt.nextSibling,Fe=Ne.nextSibling;return V(R,()=>Wl(h().queryKey,!0)),V(A,v),V(H,S),V(G,()=>new Date(m().dataUpdatedAt).toLocaleTimeString()),N.$$click=x,te.$$click=()=>{var Y;Kn({type:"INVALIDATE",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.invalidateQueries(h())},J.$$click=()=>{var Y;Kn({type:"RESET",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.resetQueries(h())},ge.$$click=()=>{var Y;Kn({type:"REMOVE",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.removeQueries(h()),rc(null)},oe.$$click=()=>{var Y;if(((Y=h())==null?void 0:Y.state.data)===void 0)a(!0),w();else{const Pe=h();if(!Pe)return;Kn({type:"TRIGGER_LOADING",queryHash:Pe.queryHash});const tt=Pe.options;Pe.fetch({...tt,queryFn:()=>new Promise(()=>{}),gcTime:-1}),Pe.setState({data:void 0,status:"pending",fetchMeta:{...Pe.state.fetchMeta,__previousQueryOptions:tt}})}},V(oe,()=>b()==="pending"?"Restore":"Trigger",lt),V(ae,L(ve,{get when(){return f().length===0||b()==="error"},get children(){var Y=B$(),Pe=Y.firstChild,tt=Pe.nextSibling;return Y.$$click=()=>{var $e;h().state.error?(Kn({type:"RESTORE_ERROR",queryHash:($e=h())==null?void 0:$e.queryHash}),s.resetQueries(h())):k()},V(Y,()=>b()==="error"?"Restore":"Trigger",tt),be($e=>{var ue=fe(t`
|
|
280
280
|
color: ${i(r.red[500],r.red[400])};
|
|
281
281
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),W=b()==="pending",ne=t`
|
|
282
282
|
background-color: ${i(r.red[500],r.red[400])};
|
|
283
283
|
`;return ue!==$e.e&&se(Y,$e.e=ue),W!==$e.t&&(Y.disabled=$e.t=W),ne!==$e.a&&se(Pe,$e.a=ne),$e},{e:void 0,t:void 0,a:void 0}),Y}}),null),V(ae,L(ve,{get when(){return!(f().length===0||b()==="error")},get children(){var Y=q$(),Pe=Y.firstChild,tt=Pe.nextSibling,$e=tt.nextSibling;return $e.firstChild,$e.addEventListener("change",ue=>{const W=f().find(ne=>ne.name===ue.currentTarget.value);k(W)}),V($e,L(T3,{get each(){return f()},children:ue=>(()=>{var W=G$();return V(W,()=>ue.name),be(()=>W.value=ue.name),W})()}),null),V(Y,L(Ko,{}),null),be(ue=>{var W=fe(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),ne=t`
|
|
284
284
|
background-color: ${K.colors.red[400]};
|
|
285
|
-
`,ee=b()==="pending";return W!==ue.e&&se(Y,ue.e=W),ne!==ue.t&&se(Pe,ue.t=ne),ee!==ue.a&&($e.disabled=ue.a=ee),ue},{e:void 0,t:void 0,a:void 0}),Y}}),null),V(dt,()=>l()==="view"?"Explorer":"Editor",null),V(O,L(ve,{get when(){return l()==="view"},get children(){var Y=z$();return V(Y,L(Gr,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>u("edit"),get activeQuery(){return h()}})),be(Pe=>(Pe=K.size[2])!=null?Y.style.setProperty("padding",Pe):Y.style.removeProperty("padding")),Y}}),Ne),V(O,L(ve,{get when(){return l()==="edit"},get children(){var Y=H$(),Pe=Y.firstChild,tt=Pe.nextSibling,$e=tt.firstChild,ue=$e.nextSibling,W=ue.firstChild,ne=W.nextSibling;return Y.addEventListener("submit",ee=>{ee.preventDefault();const gt=new FormData(ee.currentTarget).get("data");try{const
|
|
285
|
+
`,ee=b()==="pending";return W!==ue.e&&se(Y,ue.e=W),ne!==ue.t&&se(Pe,ue.t=ne),ee!==ue.a&&($e.disabled=ue.a=ee),ue},{e:void 0,t:void 0,a:void 0}),Y}}),null),V(dt,()=>l()==="view"?"Explorer":"Editor",null),V(O,L(ve,{get when(){return l()==="view"},get children(){var Y=z$();return V(Y,L(Gr,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>u("edit"),get activeQuery(){return h()}})),be(Pe=>(Pe=K.size[2])!=null?Y.style.setProperty("padding",Pe):Y.style.removeProperty("padding")),Y}}),Ne),V(O,L(ve,{get when(){return l()==="edit"},get children(){var Y=H$(),Pe=Y.firstChild,tt=Pe.nextSibling,$e=tt.firstChild,ue=$e.nextSibling,W=ue.firstChild,ne=W.nextSibling;return Y.addEventListener("submit",ee=>{ee.preventDefault();const gt=new FormData(ee.currentTarget).get("data");try{const we=JSON.parse(gt);h().setState({...h().state,data:we}),u("view")}catch(we){d(!0)}}),Pe.addEventListener("focus",()=>d(!1)),V($e,()=>c()?"Invalid Value":""),W.$$click=()=>u("view"),be(ee=>{var Ce=fe(n().devtoolsEditForm,"tsqd-query-details-data-editor"),gt=n().devtoolsEditTextarea,we=c(),Je=n().devtoolsEditFormActions,Be=n().devtoolsEditFormError,An=n().devtoolsEditFormActionContainer,Vt=fe(n().devtoolsEditFormAction,t`
|
|
286
286
|
color: ${i(r.gray[600],r.gray[300])};
|
|
287
287
|
`),fn=fe(n().devtoolsEditFormAction,t`
|
|
288
288
|
color: ${i(r.blue[600],r.blue[400])};
|
|
289
|
-
`);return
|
|
289
|
+
`);return Ce!==ee.e&&se(Y,ee.e=Ce),gt!==ee.t&&se(Pe,ee.t=gt),we!==ee.a&&re(Pe,"data-error",ee.a=we),Je!==ee.o&&se(tt,ee.o=Je),Be!==ee.i&&se($e,ee.i=Be),An!==ee.n&&se(ue,ee.n=An),Vt!==ee.s&&se(W,ee.s=Vt),fn!==ee.h&&se(ne,ee.h=fn),ee},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),be(()=>Pe.value=JSON.stringify(p(),null,2)),Y}}),Ne),V(Fe,L(Gr,{label:"Query",defaultExpanded:["Query","queryKey"],get value(){return g()}})),be(Y=>{var Pe=fe(n().detailsContainer,"tsqd-query-details-container"),tt=fe(n().detailsHeader,"tsqd-query-details-header"),$e=fe(n().detailsBody,"tsqd-query-details-summary-container"),ue=fe(n().queryDetailsStatus,_()),W=fe(n().detailsHeader,"tsqd-query-details-header"),ne=fe(n().actionsBody,"tsqd-query-details-actions-container"),ee=fe(t`
|
|
290
290
|
color: ${i(r.blue[600],r.blue[400])};
|
|
291
|
-
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-refetch"),
|
|
291
|
+
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-refetch"),Ce=v()==="fetching",gt=t`
|
|
292
292
|
background-color: ${i(r.blue[600],r.blue[400])};
|
|
293
|
-
`,
|
|
293
|
+
`,we=fe(t`
|
|
294
294
|
color: ${i(r.yellow[600],r.yellow[400])};
|
|
295
295
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-invalidate"),Je=b()==="pending",Be=t`
|
|
296
296
|
background-color: ${i(r.yellow[600],r.yellow[400])};
|
|
@@ -306,7 +306,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
306
306
|
color: ${i(r.cyan[500],r.cyan[400])};
|
|
307
307
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),Xa=o(),oo=t`
|
|
308
308
|
background-color: ${i(r.cyan[500],r.cyan[400])};
|
|
309
|
-
`,ao=fe(n().detailsHeader,"tsqd-query-details-header"),lo=fe(n().detailsHeader,"tsqd-query-details-header"),Yi=K.size[2];return Pe!==Y.e&&se(O,Y.e=Pe),tt!==Y.t&&se(E,Y.t=tt),$e!==Y.a&&se(T,Y.a=$e),ue!==Y.o&&se(A,Y.o=ue),W!==Y.i&&se(ie,Y.i=W),ne!==Y.n&&se(ae,Y.n=ne),ee!==Y.s&&se(N,Y.s=ee),
|
|
309
|
+
`,ao=fe(n().detailsHeader,"tsqd-query-details-header"),lo=fe(n().detailsHeader,"tsqd-query-details-header"),Yi=K.size[2];return Pe!==Y.e&&se(O,Y.e=Pe),tt!==Y.t&&se(E,Y.t=tt),$e!==Y.a&&se(T,Y.a=$e),ue!==Y.o&&se(A,Y.o=ue),W!==Y.i&&se(ie,Y.i=W),ne!==Y.n&&se(ae,Y.n=ne),ee!==Y.s&&se(N,Y.s=ee),Ce!==Y.h&&(N.disabled=Y.h=Ce),gt!==Y.r&&se(le,Y.r=gt),we!==Y.d&&se(te,Y.d=we),Je!==Y.l&&(te.disabled=Y.l=Je),Be!==Y.u&&se(me,Y.u=Be),An!==Y.c&&se(J,Y.c=An),Vt!==Y.w&&(J.disabled=Y.w=Vt),fn!==Y.m&&se(Se,Y.m=fn),Nn!==Y.f&&se(ge,Y.f=Nn),nr!==Y.y&&(ge.disabled=Y.y=nr),Qi!==Y.g&&se(ze,Y.g=Qi),Or!==Y.p&&se(oe,Y.p=Or),Xa!==Y.b&&(oe.disabled=Y.b=Xa),oo!==Y.T&&se(He,Y.T=oo),ao!==Y.A&&se(dt,Y.A=ao),lo!==Y.O&&se(Ne,Y.O=lo),Yi!==Y.I&&((Y.I=Yi)!=null?Fe.style.setProperty("padding",Yi):Fe.style.removeProperty("padding")),Y},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0}),O}})},rD=()=>{const e=xt(),t=ye().shadowDOMTarget?je.bind({target:ye().shadowDOMTarget}):je,n=U(()=>e()==="dark"?En(t):On(t)),{colors:r}=K,i=(c,d)=>e()==="dark"?d:c,s=Mn(c=>{const f=c().getAll().find(h=>h.mutationId===Wr());return f?f.state.isPaused:!1}),o=Mn(c=>{const f=c().getAll().find(h=>h.mutationId===Wr());return f?f.state.status:"idle"}),a=U(()=>os({isPaused:s(),status:o()})),l=Mn(c=>c().getAll().find(d=>d.mutationId===Wr()),!1),u=()=>a()==="gray"?t`
|
|
310
310
|
background-color: ${i(r[a()][200],r[a()][700])};
|
|
311
311
|
color: ${i(r[a()][700],r[a()][300])};
|
|
312
312
|
border-color: ${i(r[a()][400],r[a()][600])};
|
|
@@ -1283,7 +1283,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1283
1283
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gD(e,t){if(e){if(typeof e=="string")return Pm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pm(e,t):void 0}}function Pm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function mD(e){if(Array.isArray(e))return e}var pD=function(t){var n=t.isOpen,r=t.onClose,i=t.groupToEdit,s=t.allBrands,o=Rn(),a=o.brandId,l=z.useState(""),u=Vc(l,2),c=u[0],d=u[1],f=z.useState([]),h=Vc(f,2),g=h[0],m=h[1],p=z.useState(!1),v=Vc(p,2),b=v[0],S=v[1],C=Gt();z.useEffect(function(){if(n&&i&&i.type==="group"){var D;d(String(i.name||""));var H=((D=i.groupedBrands)===null||D===void 0?void 0:D.map(function(Q){return String(Q.id||"")}))||[];m(H)}},[n,i]);var x=t2({mutation:{onSuccess:function(){C.invalidateQueries({queryKey:Zl(a)}),j()},onError:function(H){console.error("Error creating brand group:",H)}}}),k=x.mutate,w=x.isPending,_=Q5({mutation:{onSuccess:function(){C.invalidateQueries({queryKey:Zl(a)}),j(),A()},onError:function(H){console.error("Error deleting brand group:",H),window.alert("An error occurred while ungrouping the brands. Please try again later.")}}}),O=_.mutate,E=_.isPending,T=function(){!c.trim()||!(i!=null&&i.id)||k({brandId:a,data:{groupName:c.trim(),brandIds:g.map(function(H){return Number(H)})}})},j=function(){d(""),m([]),r()},B=function(){return g.map(function(H){if(i&&i.type==="group"){var Q,F=(Q=i.groupedBrands)===null||Q===void 0?void 0:Q.find(function(ie){return String(ie.id)===H});if(F)return F.name||""}var G=s.find(function(ie){return String(ie.id)===H});return G?G.type==="group"?"Group: ".concat(G.name):G.name||"":""}).filter(Boolean)},R=function(){S(!0)},A=function(){return S(!1)},M=function(){typeof(i==null?void 0:i.id)=="number"&&O({brandId:a,brandGroupId:i.id})};return!i||i.type!=="group"?null:y.jsxs(y.Fragment,{children:[y.jsx(P.Modal,{isOpen:n,onClose:b?function(){}:j,as:"div",children:y.jsx(P.Modal.Panel,{children:y.jsxs(P.Modal.Container,{children:[y.jsx(P.Modal.Container.Header,{className:"yst-mb-4",children:y.jsx(P.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Edit brand group"})}),y.jsxs(P.Modal.Container.Content,{className:"yst-mb-8 yst-space-y-4",children:[y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"Update the group name or ungroup brands by removing their tags."}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"editGroupName",className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:"Group name"}),y.jsx(P.TextInput,{id:"editGroupName",value:c,onChange:function(D){return d(D.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(P.TagField,{readOnly:!0,id:"editGroupedBrands",label:"Grouped brands",tags:B(),onRemoveTag:function(D){if(g.length<2)return S(!0);m(function(H){return H.filter(function(Q,F){return F!==D})})},onAddTag:function(){}}),g.length===0?y.jsx("p",{className:"yst-mt-2 yst-text-sm",children:'Click "Ungroup brands" to remove this group.'}):y.jsx("p",{className:"yst-mt-2 yst-text-sm yst-italic yst-text-gray-500",children:"Note: To add brands to this group, save this group, then use the checkboxes to select this group as well as any additional brands to be grouped."})]})]}),y.jsx(P.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-w-full yst-items-center yst-justify-between",children:[y.jsx("div",{className:"yst-flex yst-justify-start",children:y.jsx(P.Button,{variant:"tertiary",onClick:R,disabled:w,className:"yst-text-red-600",children:"Ungroup brands"})}),y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(P.Button,{variant:"secondary",onClick:j,children:"Cancel"}),y.jsx(P.Button,{variant:"primary",onClick:T,disabled:!c.trim()||w,isLoading:w,children:w?"Saving...":"Save changes"})]})]})})]})})}),y.jsx(Fu,{isOpen:b,onClose:A,onConfirm:M,title:"Ungroup this brand group?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"The group will be removed, but the brands inside will remain in your brand list."}),y.jsx("p",{children:"This action cannot be undone. To create a new group with these brands, simply select them and create a new group."})]}),confirmText:"Yes, ungroup",isLoading:E})]})};function lf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Zt(b,"_invoke",function(S,C,x){var k,w,_,O=0,E=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,M){return k=A,w=0,_=e,j.n=M,o}};function B(R,A){for(w=R,_=A,t=0;!T&&O&&!M&&t<E.length;t++){var M,D=E[t],H=j.p,Q=D[2];R>3?(M=Q===A)&&(_=D[(w=D[4])?5:(w=3,3)],D[4]=D[5]=e):D[0]<=H&&((M=R<2&&H<D[1])?(w=0,j.v=A,j.n=D[1]):H<Q&&(M=R<3||D[0]>A||A>Q)&&(D[4]=R,D[5]=A,j.n=Q,w=0))}if(M||R>1)return o;throw T=!0,A}return function(R,A,M){if(O>1)throw TypeError("Generator is already running");for(T&&A===1&&B(A,M),w=A,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(D){k=e,w=1,_=D}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Zt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Zt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Zt(d,"constructor",u),Zt(u,"constructor",l),l.displayName="GeneratorFunction",Zt(u,i,"GeneratorFunction"),Zt(d),Zt(d,i,"Generator"),Zt(d,r,function(){return this}),Zt(d,"toString",function(){return"[object Generator]"}),(lf=function(){return{w:s,m:f}})()}function Zt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Zt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Zt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Zt(e,t,n,r)}function Tm(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function vD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Tm(s,r,i,o,a,"next",l)}function a(l){Tm(s,r,i,o,a,"throw",l)}o(void 0)})}}function Mm(e,t){return SD(e)||wD(e,t)||xD(e,t)||bD()}function bD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1284
1284
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xD(e,t){if(e){if(typeof e=="string")return jm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jm(e,t):void 0}}function jm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function SD(e){if(Array.isArray(e))return e}var CD=function(t){var n=t.isOpen,r=t.onClose,i=t.brandId,s=t.brandsToGroup,o=t.onGroupCreated,a=Gt(),l=Rn(),u=l.analysisId,c=z.useState(""),d=Mm(c,2),f=d[0],h=d[1],g=z.useState([]),m=Mm(g,2),p=m[0],v=m[1];z.useEffect(function(){if(n&&s.length>0){var _,O=(_=s[0])===null||_===void 0?void 0:_.name;h(String(O||"New Group")),v(s.map(function(E){var T;return String((T=E.id)!==null&&T!==void 0?T:"")}))}},[n,s]);var b=t2({mutation:{onSuccess:function(){var _=vD(lf().m(function E(){return lf().w(function(T){for(;;)switch(T.n){case 0:return T.n=1,Promise.all([a.invalidateQueries({queryKey:Zl(i)}),a.invalidateQueries({queryKey:Pf(i)}),a.invalidateQueries({queryKey:Td(i,"latest")}),a.invalidateQueries({queryKey:Xl(i,"latest")}),a.invalidateQueries({queryKey:Td(i,u)}),a.invalidateQueries({queryKey:Xl(i,u)})]);case 1:o==null||o(),x();case 2:return T.a(2)}},E)}));function O(){return _.apply(this,arguments)}return O}(),onError:function(O){console.error("Error creating group:",O)}}}),S=b.mutate,C=b.isPending,x=function(){h(""),v([]),r()},k=function(){if(!(!f.trim()||p.length===0)){var O=p.flatMap(function(E){var T=s.find(function(j){return String(j.id)===E});return T&&T.type==="group"&&Array.isArray(T.groupedBrands)?T.groupedBrands.map(function(j){return String(j.id)}):E});S({brandId:i,data:{groupName:f.trim(),brandIds:O.filter(function(E){return E!==""}).map(function(E){return Number(E)})}})}},w=function(O){v(function(E){return E.filter(function(T){return T!==O})})};return y.jsx(P.Modal,{isOpen:n,onClose:x,children:y.jsx(P.Modal.Panel,{children:y.jsxs(P.Modal.Container,{children:[y.jsx(P.Modal.Container.Header,{children:y.jsx(P.Modal.Title,{children:"Edit brand group"})}),y.jsxs(P.Modal.Container.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{children:[y.jsx("label",{htmlFor:"groupName",className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:"Group name"}),y.jsx(P.TextInput,{id:"groupName",value:f,onChange:function(_){return h(_.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(P.TagField,{readOnly:!0,id:"groupedBrands",label:"Brands in group (".concat(p.length,")"),tags:p.map(function(_){var O=s.find(function(E){return String(E.id)===_});return O?O.type==="group"?"Group: ".concat(O.name):O.name||"":""}).filter(Boolean),onRemoveTag:function(_){var O=p.find(function(E){var T=s.find(function(B){return String(B.id)===E});if(!T)return!1;var j=T.type==="group"?"Group: ".concat(T.name):T.name||"";return j===_});O&&w(O)},onAddTag:function(){}}),p.length===0&&y.jsx("p",{className:"yst-text-sm yst-italic yst-text-gray-500",children:"No brands selected"})]}),y.jsx("p",{children:"Note: To add brands to this group, save this group, then use the checkboxes to select this group as well as any additional brands to be grouped."})]}),y.jsx(P.Modal.Container.Footer,{className:"yst-pt-4",children:y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(P.Button,{variant:"secondary",onClick:x,disabled:C,children:"Cancel"}),y.jsx(P.Button,{variant:"primary",onClick:k,disabled:!f.trim()||p.length===0||C,children:C?"Saving...":"Save group"})]})})]})})})};function va(e){"@babel/helpers - typeof";return va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},va(e)}function $m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$m(Object(n),!0).forEach(function(r){X1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$m(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function X1(e,t,n){return(t=_D(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _D(e){var t=kD(e,"string");return va(t)=="symbol"?t:t+""}function kD(e,t){if(va(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(va(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OD(e){return PD(e)||AD(e)||Z1(e)||ED()}function ED(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1285
1285
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PD(e){if(Array.isArray(e))return uf(e)}function Hn(e,t){return jD(e)||MD(e,t)||Z1(e,t)||TD()}function TD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1286
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z1(e,t){if(e){if(typeof e=="string")return uf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uf(e,t):void 0}}function uf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function MD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function jD(e){if(Array.isArray(e))return e}var $D=function(){var t,n=dn(),r=z.useState(!1),i=Hn(r,2),s=i[0],o=i[1],a=z.useState({}),l=Hn(a,2),u=l[0],c=l[1],d=z.useState(""),f=Hn(d,2),h=f[0],g=f[1],m=z.useState(1),p=Hn(m,2),v=p[0],b=p[1],S=z.useState({}),C=Hn(S,2),x=C[0],k=C[1],w=z.useState(!1),_=Hn(w,2),O=_[0],E=_[1],T=z.useState(!1),j=Hn(T,2),B=j[0],R=j[1],A=z.useState(null),M=Hn(A,2),D=M[0],H=M[1],Q=Rn(),F=Q.brandId;function G(W){return String(W.id)}var ie=U5(F,{query:{enabled:!!F}}),ae=ie.data,N=ie.isLoading,le=10,te=(ae==null||(t=ae.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(W){var ne,ee;return h?((ne=(ee=W.name)===null||ee===void 0?void 0:ee.toLowerCase())!==null&&ne!==void 0?ne:"").includes(h.toLowerCase()):!0}))||[],me=Math.ceil(te.length/le),J=(v-1)*le,
|
|
1286
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z1(e,t){if(e){if(typeof e=="string")return uf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uf(e,t):void 0}}function uf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function MD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function jD(e){if(Array.isArray(e))return e}var $D=function(){var t,n=dn(),r=z.useState(!1),i=Hn(r,2),s=i[0],o=i[1],a=z.useState({}),l=Hn(a,2),u=l[0],c=l[1],d=z.useState(""),f=Hn(d,2),h=f[0],g=f[1],m=z.useState(1),p=Hn(m,2),v=p[0],b=p[1],S=z.useState({}),C=Hn(S,2),x=C[0],k=C[1],w=z.useState(!1),_=Hn(w,2),O=_[0],E=_[1],T=z.useState(!1),j=Hn(T,2),B=j[0],R=j[1],A=z.useState(null),M=Hn(A,2),D=M[0],H=M[1],Q=Rn(),F=Q.brandId;function G(W){return String(W.id)}var ie=U5(F,{query:{enabled:!!F}}),ae=ie.data,N=ie.isLoading,le=10,te=(ae==null||(t=ae.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(W){var ne,ee;return h?((ne=(ee=W.name)===null||ee===void 0?void 0:ee.toLowerCase())!==null&&ne!==void 0?ne:"").includes(h.toLowerCase()):!0}))||[],me=Math.ceil(te.length/le),J=(v-1)*le,Se=OD(te).sort(function(W,ne){return W.type==="group"&&ne.type!=="group"?-1:W.type!=="group"&&ne.type==="group"?1:0}),ge=Se.slice(J,J+le),ze=function(ne){var ee=te.find(function(Ce){return G(Ce)===ne});ee&&ee.type==="group"&&(H(ee),R(!0))},oe=Object.entries(x).filter(function(W){var ne=Hn(W,2),ee=ne[1];return ee}).map(function(W){var ne=Hn(W,1),ee=ne[0];return ee}),He=function(){E(!0)},lt=function(ne){g(ne.target.value),b(1)},dt=function(ne){k(function(ee){return Dm(Dm({},ee),{},X1({},ne,!ee[ne]))})},Ne=function(){n("/")},Fe=function(){k({}),c({}),o(!1)},Y=function(){E(!1)},Pe=function(){k({}),b(1),g("")},tt=function(){R(!1),H(null)},$e=function(ne,ee){return ne in u?!!u[ne]:!ee.isHidden},ue=[{Header:"Brand name",accessor:"name",Cell:function(ne){var ee=ne.value,Ce=ne.row;return y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-2",children:[y.jsx(P.Checkbox,{id:"brand-checkbox-".concat(Ce.id),checked:!!x[G(Ce)],onChange:function(){return dt(G(Ce))},value:G(Ce),label:Ce.isSelf?y.jsx(Nu,{children:ee}):ee,name:"brand-checkbox-".concat(Ce.id),disabled:!$e(G(Ce),Ce)}),Ce.type==="group"&&y.jsx(F6,{className:"yst-h-4 yst-w-4 yst-text-slate-400"})]})})},LoadingComponent:function(ne){var ee=ne.id,Ce=ee===void 0?"":ee;return y.jsxs("div",{className:"yst-flex",children:[y.jsx(P.Checkbox,{id:"loading-row-checkbox-".concat(Ce),value:"loading",label:"",disabled:!0,name:"brand-checkbox-".concat(Ce)})," ",y.jsx(P.SkeletonLoader,{className:"yst-h-6 yst-w-32",id:"loading-row-skeleton-".concat(Ce)})]})}},{Header:"Actions",accessor:"id",Cell:function(ne){var ee=ne.value,Ce=ne.row;return y.jsx(y.Fragment,{children:Ce.type==="group"?y.jsxs(P.Button,{variant:"tertiary",size:"small",onClick:function(){return ze(String(ee!=null?ee:""))},className:"yst-gap-1.5 yst-px-0",disabled:!$e(G(Ce),Ce),children:[y.jsx(o2,{className:"yst-h-4 yst-w-4"}),"Edit group"]}):void 0})},LoadingComponent:function(){return y.jsx(P.SkeletonLoader,{className:"yst-h-6 yst-w-24"})}}];return y.jsxs(P.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(Y1,{title:"Brand list ".concat(""),children:y.jsx("p",{children:"These are the brands found in responses to your example prompts. Group related brands to improve your analysis. You can rename or exclude irrelevant brands, and new brands will be added automatically if they appear in future analysis runs."})}),y.jsxs(P.Paper.Content,{children:[y.jsx("div",{className:"yst-mb-6",children:y.jsx(P.TextInput,{id:"brand-search",label:"Search brands",placeholder:"Search brands",value:h,onChange:lt})}),y.jsx("div",{className:"yst-mb-6",children:y.jsxs(P.Table,{columns:ue,className:"yst-w-full",variant:"minimal",children:[y.jsx(P.Table.Head,{children:y.jsx(P.Table.Row,{children:ue.map(function(W){return y.jsx(P.Table.Header,{children:W.Header},W.accessor)})})}),y.jsx(P.Table.Body,{children:N?[1,2,3].map(function(W,ne){return y.jsx(P.Table.Row,{children:ue.map(function(ee,Ce){return y.jsx(P.Table.Cell,{children:y.jsx(ee.LoadingComponent,{id:"skeleton-".concat(ne,"-").concat(Ce)},ee.accessor)},"cell-".concat(Ce))})},ne)}):ge.length===0?y.jsx(P.Table.Row,{children:y.jsx(P.Table.Cell,{colSpan:ue.length,children:y.jsxs("div",{className:"yst-py-12 yst-text-center",children:[y.jsx("h3",{className:"yst-mt-4 yst-text-lg yst-font-medium yst-text-slate-900",children:"No brands found"}),y.jsx("p",{className:"yst-mt-2 yst-text-sm yst-text-slate-500",children:h?'No brands match "'.concat(h,'". Try a different search term.'):"No brands have been found yet. Run an analysis to discover brands."}),h&&y.jsx(P.Button,{variant:"secondary",size:"small",onClick:function(){g(""),b(1)},className:"yst-mt-4",children:"Clear search"})]})})}):ge.map(function(W){return y.jsx(P.Table.Row,{children:ue.map(function(ne){return y.jsx(P.Table.Cell,{children:ne.Cell?ne.Cell({value:W[ne.accessor],row:W}):W[ne.accessor]},ne.accessor)})},W.id)})})]})}),y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsxs(P.Button,{variant:"secondary",onClick:He,className:"yst-mb-0 yst-gap-2",disabled:oe.length<2,children:[y.jsx(Z4,{})," Group brands"]}),y.jsx(P.Pagination,{variant:"text",current:v,total:me,onNavigate:b,className:"yst-flex-row",screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]}),y.jsx(jf,{children:y.jsx("div",{className:"yst-flex yst-items-center yst-justify-end yst-gap-4",children:s?y.jsxs(y.Fragment,{children:[y.jsx(P.Button,{variant:"secondary",className:"yst-mb-0",onClick:Fe,children:"Discard changes"}),y.jsx(P.Button,{variant:"primary",className:"yst-mb-0",onClick:Ne,children:"Save changes"})]}):y.jsx(P.Button,{as:ti,to:"/brands/".concat(F),variant:"tertiary",className:"yst-mb-0",children:"Return to analysis"})})}),y.jsx(CD,{isOpen:O,onClose:Y,brandId:F,brandsToGroup:te.filter(function(W){return oe.includes(G(W))}),onGroupCreated:Pe}),y.jsx(pD,{isOpen:B,onClose:tt,groupToEdit:D,allBrands:te})]})};const DD=Object.freeze(Object.defineProperty({__proto__:null,default:$D},Symbol.toStringTag,{value:"Module"}));function LD(e,t){return FD(e)||ND(e,t)||RD(e,t)||ID()}function ID(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1287
1287
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RD(e,t){if(e){if(typeof e=="string")return Lm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lm(e,t):void 0}}function Lm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ND(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function FD(e){if(Array.isArray(e))return e}var BD=function(t){var n=t.isOpen,r=t.onClose,i=Gt(),s=z.useState(""),o=LD(s,2),a=o[0],l=o[1],u=b4({mutation:{onSuccess:function(){i.clear(),r()}}}),c=u.mutate,d=u.isPending;return z.useEffect(function(){n&&l("")},[n]),y.jsx(Fu,{isOpen:n,onClose:r,onConfirm:function(){c()},isLoading:d,disabled:a!=="DELETE ALL",title:"Delete all data?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently erase all brands, analysis results, and queries from your account."}),y.jsx("p",{children:"This action cannot be undone."}),y.jsx(P.TextField,{id:"delete-all-confirmation",label:"To confirm, please type DELETE ALL:",value:a,onChange:function(f){return l(f.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete all data",cancelText:"No, go back"})};function cf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Jt(b,"_invoke",function(S,C,x){var k,w,_,O=0,E=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,M){return k=A,w=0,_=e,j.n=M,o}};function B(R,A){for(w=R,_=A,t=0;!T&&O&&!M&&t<E.length;t++){var M,D=E[t],H=j.p,Q=D[2];R>3?(M=Q===A)&&(_=D[(w=D[4])?5:(w=3,3)],D[4]=D[5]=e):D[0]<=H&&((M=R<2&&H<D[1])?(w=0,j.v=A,j.n=D[1]):H<Q&&(M=R<3||D[0]>A||A>Q)&&(D[4]=R,D[5]=A,j.n=Q,w=0))}if(M||R>1)return o;throw T=!0,A}return function(R,A,M){if(O>1)throw TypeError("Generator is already running");for(T&&A===1&&B(A,M),w=A,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(D){k=e,w=1,_=D}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Jt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Jt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Jt(d,"constructor",u),Jt(u,"constructor",l),l.displayName="GeneratorFunction",Jt(u,i,"GeneratorFunction"),Jt(d),Jt(d,i,"Generator"),Jt(d,r,function(){return this}),Jt(d,"toString",function(){return"[object Generator]"}),(cf=function(){return{w:s,m:f}})()}function Jt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Jt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Jt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Jt(e,t,n,r)}function Im(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function qD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Im(s,r,i,o,a,"next",l)}function a(l){Im(s,r,i,o,a,"throw",l)}o(void 0)})}}function zD(e,t){return KD(e)||GD(e,t)||UD(e,t)||HD()}function HD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1288
1288
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UD(e,t){if(e){if(typeof e=="string")return Rm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rm(e,t):void 0}}function Rm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function GD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function KD(e){if(Array.isArray(e))return e}var VD=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=Gt(),a=z.useState(""),l=zD(a,2),u=l[0],c=l[1],d=s4({mutation:{onSuccess:function(){var g=qD(cf().m(function p(){return cf().w(function(v){for(;;)switch(v.n){case 0:return v.n=1,Promise.all([o.invalidateQueries({queryKey:Yn()}),o.invalidateQueries({queryKey:Lu()})]);case 1:i();case 2:return v.a(2)}},p)}));function m(){return g.apply(this,arguments)}return m}()}}),f=d.mutate,h=d.isPending;return z.useEffect(function(){n&&c("")},[n]),y.jsx(Fu,{isOpen:n,onClose:i,onConfirm:function(){if(!s){console.error("Brand name is required for deletion confirmation");return}f({brandId:r})},isLoading:h,disabled:u.toLowerCase()!==(s==null?void 0:s.toLowerCase()),title:"Delete brand?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this brand, including past analyses and query history."}),y.jsx("p",{children:"This action cannot be undone."}),y.jsx(P.TextField,{id:"delete-modal-brand-name-confirmation",label:"To confirm, please type your brand name ".concat(s,":"),value:u,onChange:function(g){return c(g.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete brand",cancelText:"No, go back"})};function ba(e){"@babel/helpers - typeof";return ba=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ba(e)}function No(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return en(b,"_invoke",function(S,C,x){var k,w,_,O=0,E=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,M){return k=A,w=0,_=e,j.n=M,o}};function B(R,A){for(w=R,_=A,t=0;!T&&O&&!M&&t<E.length;t++){var M,D=E[t],H=j.p,Q=D[2];R>3?(M=Q===A)&&(_=D[(w=D[4])?5:(w=3,3)],D[4]=D[5]=e):D[0]<=H&&((M=R<2&&H<D[1])?(w=0,j.v=A,j.n=D[1]):H<Q&&(M=R<3||D[0]>A||A>Q)&&(D[4]=R,D[5]=A,j.n=Q,w=0))}if(M||R>1)return o;throw T=!0,A}return function(R,A,M){if(O>1)throw TypeError("Generator is already running");for(T&&A===1&&B(A,M),w=A,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(D){k=e,w=1,_=D}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(en(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,en(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,en(d,"constructor",u),en(u,"constructor",l),l.displayName="GeneratorFunction",en(u,i,"GeneratorFunction"),en(d),en(d,i,"Generator"),en(d,r,function(){return this}),en(d,"toString",function(){return"[object Generator]"}),(No=function(){return{w:s,m:f}})()}function en(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}en=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){en(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},en(e,t,n,r)}function Nm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nm(Object(n),!0).forEach(function(r){WD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WD(e,t,n){return(t=QD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QD(e){var t=YD(e,"string");return ba(t)=="symbol"?t:t+""}function YD(e,t){if(ba(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ba(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fm(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function Bm(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Fm(s,r,i,o,a,"next",l)}function a(l){Fm(s,r,i,o,a,"throw",l)}o(void 0)})}}function XD(e,t){return tL(e)||eL(e,t)||JD(e,t)||ZD()}function ZD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1289
1289
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JD(e,t){if(e){if(typeof e=="string")return qm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qm(e,t):void 0}}function qm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eL(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function tL(e){if(Array.isArray(e))return e}var nL=function(t){var n,r,i=t.brand,s=t.isLast,o=t.onDelete,a=i.id,l=Rn(),u=l.hostAppProps,c=u.onAddSubscription,d=dn(),f=Fa(),h=f.setBrandId,g=z.useState(!1),m=XD(g,2),p=m[0],v=m[1],b=Gt(),S=Iu({query:{select:function(B){var R=B.data;return R}}}),C=S.data,x=n2({mutation:{onMutate:function(){var j=Bm(No().m(function R(A){var M,D,H;return No().w(function(Q){for(;;)switch(Q.n){case 0:return M=A.brandId,D=A.data,Q.n=1,b.cancelQueries({queryKey:Yn()});case 1:return H=b.getQueryData(Yn()),b.setQueryData(Yn(),function(F){var G,ie;return F&&Ar(Ar({},F),{},{data:Ar(Ar({},F.data),{},{brands:((G=(ie=F.data)===null||ie===void 0?void 0:ie.brands)!==null&&G!==void 0?G:[]).map(function(ae){return ae.id===M?Ar(Ar({},ae),{},{settings:Ar(Ar({},ae.settings),{},{enableAutomaticAnalysis:D.enableAutomaticAnalysis})}):ae})})})}),Q.a(2,{previous:H})}},R)}));function B(R){return j.apply(this,arguments)}return B}(),onSuccess:function(){if(i&&i.settings&&i.settings.enableAutomaticAnalysis===!1)return v(!1);v(!T)},onError:function(B,R,A){A!=null&&A.previous&&b.setQueryData(Yn(),A.previous)},onSettled:function(){var j=Bm(No().m(function R(){return No().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,Promise.all([b.invalidateQueries({queryKey:Yn()}),b.invalidateQueries({queryKey:Lu()})]);case 1:return A.a(2)}},R)}));function B(){return j.apply(this,arguments)}return B}()}}),k=x.mutate,w=x.isPending,_=function(B){k({brandId:a,data:{enableAutomaticAnalysis:B}})},O=function(B){if(B){if(!E)return v(!0);if(!T)return _(!0);v(!0)}else _(!1)},E=Number(C==null?void 0:C.maxNumberOfActiveBrands)-Number(C==null?void 0:C.numberOfActiveBrands)>0||!!(i!=null&&(n=i.settings)!==null&&n!==void 0&&n.enableAutomaticAnalysis),T=S2(i==null?void 0:i.firstNextAnalysisOpportunity);return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:Oe("yst-flex yst-max-w-2xl yst-flex-1 yst-flex-row yst-items-center yst-justify-start yst-gap-4 yst-py-4 yst-text-slate-800",{"yst-border-b-[1px] yst-border-b-slate-200":!s}),children:[y.jsx(P.Toggle,{id:"toggle-brand-".concat(i==null?void 0:i.id),checked:i==null||(r=i.settings)===null||r===void 0?void 0:r.enableAutomaticAnalysis,screenReaderLabel:"Enable or disable automatic analysis for this brand",onChange:O,disabled:(i==null?void 0:i.id)==="loading"||w}),y.jsxs("div",{className:"yst-font-medium",children:[(i==null?void 0:i.id)==="loading"?y.jsx(P.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):i==null?void 0:i.name,(i==null?void 0:i.setupStatus)==="pendingQuerySelection"&&y.jsx("div",{children:y.jsx(P.Link,{onClick:function(){i.id?(h(i.id),d("/setup/".concat(i.id,"/queries"))):console.error("Brand ID is missing.")},children:"Finish setup"})}),(i==null?void 0:i.nextScheduledAnalysis)&&y.jsxs("div",{className:"yst-italic yst-font-normal yst-text-slate-500",children:["Next analysis:"," ",Dd(i.nextScheduledAnalysis)]})]}),y.jsx("div",{className:"yst-ml-auto yst-flex yst-flex-row yst-items-center yst-justify-end yst-gap-2 yst-text-slate-800",children:(i==null?void 0:i.id)==="loading"?y.jsx(P.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(P.Button,{size:"small",variant:"tertiary",className:"yst-gap-1 yst-text-red-600 *:hover:yst-text-red-700",onClick:function(){i!=null&&i.id&&o(i.id)},disabled:(i==null?void 0:i.id)==="loading",children:[y.jsx(Mf,{})," Delete brand"]})})]}),y.jsx(P.Modal,{isOpen:p,onClose:function(){return v(!1)},position:"center",as:"div",className:Oe({"yst-mx-auto yst-max-w-xl":E}),children:E?y.jsx(P.Modal.Panel,{children:T?y.jsxs(y.Fragment,{children:[y.jsx(P.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(P.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Start brand analysis now?"})}),y.jsxs(P.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[y.jsx("p",{children:"Activating this brand will immediately start a new analysis."}),y.jsx("p",{children:"This will use one of your weekly analyses included in your subscription."})]}),y.jsxs(P.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(P.Button,{variant:"secondary",onClick:function(){return v(!1)},children:"Cancel"}),y.jsx(P.Button,{variant:"primary",onClick:function(){_(!0)},isLoading:w,children:"Yes, start analysis"})]})]}):y.jsxs(y.Fragment,{children:[y.jsx(P.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(P.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Automatic analysis enabled"})}),y.jsxs(P.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[y.jsx("p",{children:"You've turned on the weekly automatic analysis for this brand."}),y.jsxs("p",{children:["The next analysis will run on"," ",y.jsx("span",{className:"yst-font-medium",children:Dd(i==null?void 0:i.nextScheduledAnalysis)||"the next analysis cycle"}),"."]})]}),y.jsx(P.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:y.jsx(P.Button,{variant:"primary",onClick:function(){return v(!1)},children:"Got it"})})]})}):y.jsxs(P.Modal.Panel,{children:[y.jsx("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(P.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(P.Modal.Title,{as:"h3",className:"yst-text-center yst-text-lg yst-font-medium",children:"You've reached your active brand limit"})}),y.jsx(P.Modal.Container.Content,{children:y.jsx("p",{className:"yst-text-center",children:"Each subscription lets you activate 1 brand. Add another subscription or deactivate an existing brand to activate this brand."})})]})}),y.jsx(P.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-flex-col yst-justify-stretch yst-gap-2",children:[c&&y.jsxs(P.Button,{variant:"upsell",className:"yst-flex yst-gap-1",onClick:c,children:[y.jsx(a2,{}),"Add a subscription"]}),y.jsx(P.Button,{variant:"tertiary",className:"",onClick:function(){return v(!1)},children:"Manage active brands"})]})})]})})]})},zm,Hm,Um;function Wc(e,t){return oL(e)||sL(e,t)||iL(e,t)||rL()}function rL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -1291,5 +1291,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1291
1291
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wL(e,t){if(e){if(typeof e=="string")return Jm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jm(e,t):void 0}}function Jm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function SL(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function CL(e){if(Array.isArray(e))return e}var _L=function(){var t,n=dn(),r=Fa(),i=Gt(),s=z.useState(),o=Eo(s,2),a=o[0],l=o[1],u=z.useState(!1),c=Eo(u,2),d=c[0],f=c[1],h=z.useState({name:"",url:"",description:"",language:"en",isLocal:!1,country:"",region:""}),g=Eo(h,2),m=g[0],p=g[1],v=z.useState(null),b=Eo(v,2),S=b[0],C=b[1],x=e4({mutation:{onSuccess:function(){var A=bL(ff().m(function D(H){var Q;return ff().w(function(F){for(;;)switch(F.n){case 0:return Q=H.data.id,F.n=1,Promise.all([i.invalidateQueries({queryKey:Lu()}),i.invalidateQueries({queryKey:Yn()})]);case 1:Q&&r.setBrandId(Q),H!=null&&H.status&&H.status>=200&&H.status<300&&Q&&(r.setBrandId(Q),l(Q));case 2:return F.a(2)}},D)}));function M(D){return A.apply(this,arguments)}return M}(),onError:function(){f(!1)}}}),k=x.mutate,w=x.isPending,_=x.error,O=Gi({query:{enabled:!!a,select:function(M){var D=M.data;return D==null?void 0:D.brands},refetchInterval:function(M){var D;return((M==null||(D=M.state)===null||D===void 0||(D=D.data)===null||D===void 0||(D=D.data)===null||D===void 0?void 0:D.brands)||[]).find(function(H){return H.id===a})?!1:2*1e3}}}),E=O.data;z.useEffect(function(){a&&E!==null&&E!==void 0&&E.find(function(A){return A.id===a})&&n("/setup/".concat(a,"/queries"),{replace:!0})},[a,E,n]);var T=function(M,D){p(function(H){return Xm(Xm({},H),{},tx({},M,D))})},j=function(M){if(M.preventDefault(),C(null),m.description.length>250){C("Your brand description is too long. Please keep it within the 250-character limit."),f(!1);return}f(!0);var D=m.url;D&&!/^https?:\/\//i.test(D)&&(D="https://".concat(D)),k({data:{name:m.name,url:D,description:m.description,focusLanguage:m.language,country:m.country,regionOrCity:m.region}})};function B(A){return Qr(A)==="object"&&A!==null&&"response"in A&&Qr(A.response)==="object"&&A.response!==void 0&&"data"in A.response}var R=B(_)?_.response.data.errors:void 0;return y.jsxs("form",{onSubmit:j,children:[y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(P.Title,{size:"2",children:"Brand info"}),!!_&&y.jsx(P.Alert,{variant:"error",title:"Error",isVisible:!!_,children:y.jsx("ul",{children:R&&Qr(R)==="object"?Object.entries(R).flatMap(function(A){var M=Eo(A,2),D=M[0],H=M[1];return Array.isArray(H)?H.map(function(Q,F){return y.jsx("li",{children:Q},"".concat(D,"-").concat(F))}):null}):"There was an error creating the brand."})}),S&&y.jsx(P.Alert,{variant:"error",title:"Error",isVisible:!!S,children:y.jsx("ul",{children:y.jsx("li",{children:"Your brand description is too long. Please keep it within the 250-character limit."})})}),y.jsx(P.TextField,{id:"name",label:"Brand name",value:m.name,onChange:function(A){return T("name",A.target.value)}}),y.jsx(P.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:m.url,onChange:function(A){return T("url",A.target.value)}}),y.jsxs("div",{id:"brand-description-textarea",children:[y.jsx(P.TextareaField,{id:"brand-description",label:"Brand description",value:m.description,onChange:function(A){var M=A.target.value;T("description",M)},...m.description.length>250?{validation:{variant:"error",message:"Your brand description is too long. Please keep it within the 250-character limit."}}:{},placeholder:"e.g. We design eco-friendly yoga mats for busy professionals who want sustainable gear that’s durable, stylish and kind to the planet."}),y.jsxs("div",{className:"yst-flex yst-mt-1",children:[y.jsxs("div",{className:"yst-flex-grow yst-flex-col",children:[m.description.length>250&&y.jsx("div",{className:"yst-text-red-500 yst-mb-2",children:"Your brand description is too long. Please keep it within the 250-character limit."}),"Tell us about your brand: what you do, who it’s for and what makes it special."]}),y.jsxs("div",{className:Oe("yst-text-xs yst-mt-[-4px] yst-ml-6",{"yst-text-slate-500":m.description.length<=250,"yst-text-red-500":m.description.length>250}),children:[m.description.length,"/250"]})]})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(P.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:m.language,onChange:function(A){return T("language",A)},options:mL.map(function(A){return{label:A.label,value:A.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Ha,{}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(P.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"Specify a location to enhance the accuracy of the analysis."}),y.jsx(P.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:m.country,nullable:!0,placeholder:"Select...",onChange:function(A){return T("country",A)},onQueryChange:function(){},selectedLabel:((t=Qm.find(function(A){return A.value===m.country}))===null||t===void 0?void 0:t.label)||"",children:Qm.map(function(A){return y.jsx(P.Autocomplete.Option,{value:A.value,children:A.label},A.value)})}),m.country&&y.jsx(P.TextField,{id:"region",label:"Target city, state, or region (optional)",value:m.region,onChange:function(A){return T("region",A.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
|
|
1292
1292
|
example: California, Bavaria, or Paris.`})]}),y.jsx(ex,{onBack:function(){return n(-1)},buttonText:"Generate queries",isButtonDisabled:w||!!a||d,isLoading:w||!!a})]})};const kL=Object.freeze(Object.defineProperty({__proto__:null,default:_L},Symbol.toStringTag,{value:"Module"})),ep=e=>I.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M3.33284 2V4.66667M1.99951 3.33333H4.66618M3.99951 11.3333V14M2.66618 12.6667H5.33284M8.66618 2L10.19 6.57143L13.9995 8L10.19 9.42857L8.66618 14L7.14237 9.42857L3.33284 8L7.14237 6.57143L8.66618 2Z",stroke:"url(#paint0_linear_3891_2757)",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("defs",null,I.createElement("linearGradient",{id:"paint0_linear_3891_2757",x1:1.99951,y1:2,x2:15.3308,y2:3.72773,gradientUnits:"userSpaceOnUse"},I.createElement("stop",{stopColor:"#A61E69"}),I.createElement("stop",{offset:1,stopColor:"#6366F1"}))));function xa(e){"@babel/helpers - typeof";return xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xa(e)}function OL(e){return PL(e)||AL(e)||nx(e)||EL()}function EL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1293
1293
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AL(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PL(e){if(Array.isArray(e))return gf(e)}function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tp(Object(n),!0).forEach(function(r){TL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TL(e,t,n){return(t=ML(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ML(e){var t=jL(e,"string");return xa(t)=="symbol"?t:t+""}function jL(e,t){if(xa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return nn(b,"_invoke",function(S,C,x){var k,w,_,O=0,E=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,M){return k=A,w=0,_=e,j.n=M,o}};function B(R,A){for(w=R,_=A,t=0;!T&&O&&!M&&t<E.length;t++){var M,D=E[t],H=j.p,Q=D[2];R>3?(M=Q===A)&&(_=D[(w=D[4])?5:(w=3,3)],D[4]=D[5]=e):D[0]<=H&&((M=R<2&&H<D[1])?(w=0,j.v=A,j.n=D[1]):H<Q&&(M=R<3||D[0]>A||A>Q)&&(D[4]=R,D[5]=A,j.n=Q,w=0))}if(M||R>1)return o;throw T=!0,A}return function(R,A,M){if(O>1)throw TypeError("Generator is already running");for(T&&A===1&&B(A,M),w=A,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(D){k=e,w=1,_=D}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(nn(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,nn(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,nn(d,"constructor",u),nn(u,"constructor",l),l.displayName="GeneratorFunction",nn(u,i,"GeneratorFunction"),nn(d),nn(d,i,"Generator"),nn(d,r,function(){return this}),nn(d,"toString",function(){return"[object Generator]"}),(hf=function(){return{w:s,m:f}})()}function nn(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}nn=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){nn(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},nn(e,t,n,r)}function np(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function $L(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){np(s,r,i,o,a,"next",l)}function a(l){np(s,r,i,o,a,"throw",l)}o(void 0)})}}function ui(e,t){return IL(e)||LL(e,t)||nx(e,t)||DL()}function DL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1294
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nx(e,t){if(e){if(typeof e=="string")return gf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gf(e,t):void 0}}function gf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function LL(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function IL(e){if(Array.isArray(e))return e}var is=5,Fo="Generating...",RL="Re-generating...",NL=100,FL=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],BL=Array.from({length:is},function(e,t){return{id:"query-".concat(t),text:Fo,isRegenerating:!0}}),qL=function(){var t,n=xu(),r=n.brandId,i="/setup/".concat(r,"/analysis"),s=dn(),o=Gt(),a=z.useState(BL),l=ui(a,2),u=l[0],c=l[1],d=z.useState(!1),f=ui(d,2),h=f[0],g=f[1],m=z.useState([]),p=ui(m,2),v=p[0],b=p[1],S=z.useState([]),C=ui(S,2),x=C[0],k=C[1],w=z.useState(!1),_=ui(w,2),O=_[0],E=_[1],T=z.useState(null),j=ui(T,2),B=j[0],R=j[1],A=z.useState(!1),M=ui(A,2),D=M[0],H=M[1],Q=g4(r||"",{query:{enabled:!!r}}),F=Q.data,G=Q.isRefetching,ie=Q.isError,ae=Q.refetch,N=Jl(r||"",{query:{enabled:!!r}}),le=N.data,te=z.useCallback(function(ue){var W;if(!(le!=null&&(W=le.data)!==null&&W!==void 0&&W.name))return!1;var ne=le.data.name.toLowerCase().trim();return ne?ue.toLowerCase().includes(ne):!1},[le==null||(t=le.data)===null||t===void 0?void 0:t.name]),me=z.useCallback(function(){return u.some(function(ue){return te(ue.text)})},[u,te]),J=function(){H(!1)},Ce=function(){H(!1),r&&oe({brandId:r,data:{queries:u.map(function(W){return W.text})}})},ge=function(){H(!1);var W=u.findIndex(function(ne){return te(ne.text)});W!==-1&&setTimeout(function(){var ne=document.getElementById("query-text-".concat(W));ne&&(ne.focus(),ne.select())},NL)},ze=c4({mutation:{onSuccess:function(){var ue=$L(hf().m(function ne(ee){return hf().w(function(we){for(;;)switch(we.n){case 0:if(R(null),!(ee!=null&&ee.status&&ee.status>=200&&ee.status<300)){we.n=2;break}return we.n=1,Promise.all([o.invalidateQueries({queryKey:Tf(r||"")}),o.invalidateQueries({queryKey:Yn()})]);case 1:s(i);case 2:return we.a(2)}},ne)}));function W(ne){return ue.apply(this,arguments)}return W}(),onError:function(W){var ne,ee;if((W==null||(ne=W.response)===null||ne===void 0||(ne=ne.data)===null||ne===void 0?void 0:ne.message)==="Cannot update queries for a brand that has existing analyses."){s(i,{replace:!0});return}var we=(W==null||(ee=W.response)===null||ee===void 0||(ee=ee.data)===null||ee===void 0?void 0:ee.message)||(W==null?void 0:W.message)||"An unexpected error occurred.";R(we)}}}),oe=ze.mutate,He=ze.isPending;z.useEffect(function(){r||s("/setup",{replace:!0})},[r,s]),z.useEffect(function(){var ue;if(F!=null&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)){var W=F.data.queries.slice(0,is);c(W.map(function(ne,ee){return{id:"query-".concat(ee),text:ne,isRegenerating:!1}})),k(F.data.queries.slice(is))}else ie&&(c(Array.from({length:is},function(ne,ee){return{id:"query-".concat(ee),text:"",isRegenerating:!1}})),k([]))},[F,ie]),z.useEffect(function(){var ue;if(O&&F!==null&&F!==void 0&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)&&!G){var W=F.data.queries.slice(0,is),ne=v.map(Number);c(function(ee){return ee.map(function(we,gt){var Se=ne.indexOf(gt);return Pr(Pr({},we),{},{text:Se>=0&&W[Se]?W[Se]:we.text,isRegenerating:!1})})}),E(!1),b([])}},[F,G,O,v]);var lt=z.useCallback(function(ue,W){var ne=new Set(W);return x.filter(function(ee){return!ne.has(ee)}).slice(0,ue)},[x]),dt=z.useMemo(function(){return G||u.length===0||u.some(function(ue){return ue.isRegenerating||ue.text===Fo&&!ie||ue.text.trim()===""})||h},[G,u,h,ie]),Ne=G||u.some(function(ue){return ue.text===Fo})&&!ie,Fe=z.useCallback(function(ue){var W=ue.toString();b(function(ne){return ne.includes(W)?ne.filter(function(ee){return ee!==W}):[].concat(OL(ne),[W])})},[]),Y=z.useCallback(function(ue,W){c(function(ne){return ne.map(function(ee,we){return we===ue?Pr(Pr({},ee),{},{text:W}):ee})})},[]),Pe=function(){g(!h),b([])},tt=z.useCallback(function(){if(!(G||v.length===0)){c(function(ee){return ee.map(function(we,gt){return Pr(Pr({},we),{},{isRegenerating:v.includes(gt.toString())})})});var ue=u.map(function(ee){return ee.text}),W=v.length,ne=lt(W,ue);ne.length===W?(c(function(ee){return ee.map(function(we,gt){var Se=v.indexOf(gt.toString());return Se>=0?Pr(Pr({},we),{},{text:ne[Se],isRegenerating:!1}):we})}),k(function(ee){var we=new Set(ne);return ee.filter(function(gt){return!we.has(gt)})}),b([])):(E(!0),ae())}},[G,v,ae,u,lt]),$e=z.useCallback(function(ue){if(ue.preventDefault(),!!r){if(me()){H(!0);return}oe({brandId:r,data:{queries:u.map(function(W){return W.text})}})}},[r,u,oe,me]);return y.jsxs("div",{children:[B&&y.jsx(P.Alert,{className:"yst-mb-4",variant:"error",children:B}),y.jsxs("form",{onSubmit:$e,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(P.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:Oe("yst-flex yst-gap-2",h?"yst-justify-end":"yst-justify-start"),children:h?y.jsxs(y.Fragment,{children:[y.jsx(P.Button,{size:"small",variant:"secondary",onClick:Pe,children:"Done"}),y.jsxs(P.Button,{variant:"secondary",size:"small",onClick:tt,className:"yst-gap-1",isLoading:G,disabled:G||v.length===0,children:[y.jsx(ep,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(P.Button,{size:"small",variant:"secondary",onClick:Pe,className:"yst-gap-1.5",disabled:Ne,children:[y.jsx(q4,{}),"Select queries to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:u.length===0?FL.map(function(ue,W){return y.jsx("div",{className:Oe("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:y.jsx(P.SkeletonLoader,{children:ue||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(W))}):u.slice(0,is).map(function(ue,W){var ne=ue.isRegenerating?ue.text===Fo?Fo:RL:ue.text;return y.jsx("div",{className:Oe("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[h&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(P.Checkbox,{id:"query-regenerate-".concat(W),name:"query-regenerate-".concat(W),value:W.toString(),checked:v.includes(W.toString()),onChange:function(){return Fe(W)},disabled:G})}),y.jsx("div",{className:"yst-flex-1",children:y.jsx(P.TextField,{id:"query-text-".concat(W),label:"Query ".concat(W+1),type:"text",value:ne,onChange:function(ee){ue.isRegenerating||Y(W,ee.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:ue.isRegenerating,required:!0,maxLength:255,validation:te(ue.text)?{variant:"warning",message:"For more accurate insights, avoid using your brand name in the query."}:void 0})})]})},ue.id)})}),y.jsx(ex,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:dt,isLoading:He})]}),y.jsx(P.Modal,{isOpen:D,onClose:J,position:"center",as:"div",children:y.jsx(P.Modal.Panel,{children:y.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[y.jsx("div",{children:y.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-amber-100",children:y.jsx(s2,{className:"yst-h-6 yst-w-6 yst-text-amber-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(P.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(P.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Brand name detected in your queries"})}),y.jsxs(P.Modal.Container.Content,{className:"yst-mb-6 yst-space-y-3",children:[y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"We found your brand name in one or more of your queries. Using your brand name in queries often show more mentions and more positive sentiment, which can skew your results."}),y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"For more balanced results, remove your brand name or make the queries more general."})]}),y.jsxs(P.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[y.jsxs(P.Button,{onClick:Ce,variant:"secondary",className:"yst-gap-1.5",disabled:He,isLoading:He,children:[y.jsx(ep,{}),"Run analysis anyway"]}),y.jsx(P.Button,{variant:"primary",onClick:ge,children:"Review and edit queries"})]})]})]})})})]})};const zL=Object.freeze(Object.defineProperty({__proto__:null,default:qL},Symbol.toStringTag,{value:"Module"}));var HL=["min","max","progress","className"];function UL(e,t){if(e==null)return{};var n,r,i=GL(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rx=z.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=UL(e,HL),a=z.useMemo(function(){var u=Math.max(0,r-n);if(u===0)return 0;var c=(i-n)/u*100;return Math.max(0,Math.min(100,c))},[n,r,i]),l=Math.min(Math.max(i,n),r);return y.jsx("div",{ref:t,role:"progressbar","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":"".concat(Math.round(a),"%"),className:Oe(s),...o,children:y.jsx("div",{className:"yst-relative yst-h-2 yst-w-full yst-overflow-hidden yst-rounded-full yst-bg-slate-200/40",children:y.jsx("div",{className:"yst-absolute yst-left-0 yst-top-0 yst-h-full yst-rounded-full yst-bg-[linear-gradient(97.38deg,_#A61E69_0%,_#6366F1_100%)] yst-transition-[width] yst-duration-300 yst-ease-out",style:{width:"".concat(a,"%")}})})})});rx.displayName="ProgressBarGradient";var es=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],ix=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var u=0;u<es.length;u++)if(r<=es[u].threshold)return es[u];return es[es.length-1]},a=o();return y.jsxs("div",{className:Oe("yst-font-medium yst-text-slate-800",s),children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-center yst-gap-2",children:[r<100?y.jsx(P.Spinner,{}):y.jsx(d2,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(rx,{className:"yst-mt-3",progress:r,min:0,max:100}),y.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:es.map(function(l){return y.jsx("span",{children:y.jsx(Nu,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};ix.propTypes={progress:$d.number,className:$d.string};var KL=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},VL=function(){var t,n,r,i=dn(),s=Gt(),o=xu(),a=Rn(),l=a.brandId,u=o.brandId||l,c=Jl(u,{query:{enabled:!!u,select:function(C){var x=C.data;return x}}}),d=c.data,f=N5(u,"latest",{query:{enabled:!!u,select:function(C){var x=C.data;return x},refetchInterval:function(C){var x,k=C==null||(x=C.state)===null||x===void 0||(x=x.data)===null||x===void 0?void 0:x.data;return KL(k==null?void 0:k.status)}}}),h=f.data,g=h==null?void 0:h.id,m=g?"/brands/".concat(u,"/analysis/").concat(g):"/brands/".concat(u);z.useEffect(function(){var S=(h==null?void 0:h.status)==="pending"||(h==null?void 0:h.status)==="processing"||(h==null?void 0:h.status)==="completed";d!=null&&d.nextScheduledAnalysis&&h!==null&&h!==void 0&&h.status&&h7(d.nextScheduledAnalysis,5)&&!S&&i("/brands/".concat(u),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,u,i,h==null?void 0:h.status]),z.useEffect(function(){((d==null?void 0:d.setupStatus)==="completed"||(d==null?void 0:d.setupStatus)==="scheduledFirstAnalysis"&&d!==null&&d!==void 0&&d.firstNextAnalysisOpportunity&&!S2(d.firstNextAnalysisOpportunity,2))&&i(m,{replace:!0})},[d==null?void 0:d.firstNextAnalysisOpportunity,d==null?void 0:d.setupStatus,m,i]);var p=d==null||(t=d.queries)===null||t===void 0?void 0:t.length,v=(h==null||(n=h.completedQueries)===null||n===void 0?void 0:n.length)||0,b=function(){if(p&&p>0){var S=80/p,C=v*S;return(h==null?void 0:h.status)==="completed"?100:Math.round(Math.min(C,80))}return 0}();return y.jsxs("div",{children:[y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(ix,{progress:b}),y.jsx(Ha,{}),y.jsx("div",{className:"yst-space-y-8",children:d==null||(r=d.queries)===null||r===void 0?void 0:r.map(function(S){var C,x=S.id,k=S.query,w=x&&(h==null||(C=h.completedQueries)===null||C===void 0?void 0:C.includes(x));return y.jsxs("div",{className:Oe("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[w===!0?y.jsx(d2,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):y.jsx(P.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:k})]},"result-item-".concat(k))})})]}),y.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(P.Button,{as:ti,to:m,onClick:function(S){if(b!==100){S.preventDefault();return}s.clear()},disabled:b!==100,children:"Continue →"})})]})};const WL=Object.freeze(Object.defineProperty({__proto__:null,default:VL},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=FA;exports.setApiBaseUrl=Zv;
|
|
1294
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nx(e,t){if(e){if(typeof e=="string")return gf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gf(e,t):void 0}}function gf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function LL(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function IL(e){if(Array.isArray(e))return e}var is=5,Fo="Generating...",RL="Re-generating...",NL=100,FL=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],BL=Array.from({length:is},function(e,t){return{id:"query-".concat(t),text:Fo,isRegenerating:!0}}),qL=function(){var t,n=xu(),r=n.brandId,i="/setup/".concat(r,"/analysis"),s=dn(),o=Gt(),a=z.useState(BL),l=ui(a,2),u=l[0],c=l[1],d=z.useState(!1),f=ui(d,2),h=f[0],g=f[1],m=z.useState([]),p=ui(m,2),v=p[0],b=p[1],S=z.useState([]),C=ui(S,2),x=C[0],k=C[1],w=z.useState(!1),_=ui(w,2),O=_[0],E=_[1],T=z.useState(null),j=ui(T,2),B=j[0],R=j[1],A=z.useState(!1),M=ui(A,2),D=M[0],H=M[1],Q=g4(r||"",{query:{enabled:!!r}}),F=Q.data,G=Q.isRefetching,ie=Q.isError,ae=Q.refetch,N=Jl(r||"",{query:{enabled:!!r}}),le=N.data,te=z.useCallback(function(ue){var W;if(!(le!=null&&(W=le.data)!==null&&W!==void 0&&W.name))return!1;var ne=le.data.name.toLowerCase().trim();return ne?ue.toLowerCase().includes(ne):!1},[le==null||(t=le.data)===null||t===void 0?void 0:t.name]),me=z.useCallback(function(){return u.some(function(ue){return te(ue.text)})},[u,te]),J=function(){H(!1)},Se=function(){H(!1),r&&oe({brandId:r,data:{queries:u.map(function(W){return W.text})}})},ge=function(){H(!1);var W=u.findIndex(function(ne){return te(ne.text)});W!==-1&&setTimeout(function(){var ne=document.getElementById("query-text-".concat(W));ne&&(ne.focus(),ne.select())},NL)},ze=c4({mutation:{onSuccess:function(){var ue=$L(hf().m(function ne(ee){return hf().w(function(Ce){for(;;)switch(Ce.n){case 0:if(R(null),!(ee!=null&&ee.status&&ee.status>=200&&ee.status<300)){Ce.n=2;break}return Ce.n=1,Promise.all([o.invalidateQueries({queryKey:Tf(r||"")}),o.invalidateQueries({queryKey:Yn()})]);case 1:s(i);case 2:return Ce.a(2)}},ne)}));function W(ne){return ue.apply(this,arguments)}return W}(),onError:function(W){var ne,ee;if((W==null||(ne=W.response)===null||ne===void 0||(ne=ne.data)===null||ne===void 0?void 0:ne.message)==="Cannot update queries for a brand that has existing analyses."){s(i,{replace:!0});return}var Ce=(W==null||(ee=W.response)===null||ee===void 0||(ee=ee.data)===null||ee===void 0?void 0:ee.message)||(W==null?void 0:W.message)||"An unexpected error occurred.";R(Ce)}}}),oe=ze.mutate,He=ze.isPending;z.useEffect(function(){r||s("/setup",{replace:!0})},[r,s]),z.useEffect(function(){var ue;if(F!=null&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)){var W=F.data.queries.slice(0,is);c(W.map(function(ne,ee){return{id:"query-".concat(ee),text:ne,isRegenerating:!1}})),k(F.data.queries.slice(is))}else ie&&(c(Array.from({length:is},function(ne,ee){return{id:"query-".concat(ee),text:"",isRegenerating:!1}})),k([]))},[F,ie]),z.useEffect(function(){var ue;if(O&&F!==null&&F!==void 0&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)&&!G){var W=F.data.queries.slice(0,is),ne=v.map(Number);c(function(ee){return ee.map(function(Ce,gt){var we=ne.indexOf(gt);return Pr(Pr({},Ce),{},{text:we>=0&&W[we]?W[we]:Ce.text,isRegenerating:!1})})}),E(!1),b([])}},[F,G,O,v]);var lt=z.useCallback(function(ue,W){var ne=new Set(W);return x.filter(function(ee){return!ne.has(ee)}).slice(0,ue)},[x]),dt=z.useMemo(function(){return G||u.length===0||u.some(function(ue){return ue.isRegenerating||ue.text===Fo&&!ie||ue.text.trim()===""})||h},[G,u,h,ie]),Ne=G||u.some(function(ue){return ue.text===Fo})&&!ie,Fe=z.useCallback(function(ue){var W=ue.toString();b(function(ne){return ne.includes(W)?ne.filter(function(ee){return ee!==W}):[].concat(OL(ne),[W])})},[]),Y=z.useCallback(function(ue,W){c(function(ne){return ne.map(function(ee,Ce){return Ce===ue?Pr(Pr({},ee),{},{text:W}):ee})})},[]),Pe=function(){g(!h),b([])},tt=z.useCallback(function(){if(!(G||v.length===0)){c(function(ee){return ee.map(function(Ce,gt){return Pr(Pr({},Ce),{},{isRegenerating:v.includes(gt.toString())})})});var ue=u.map(function(ee){return ee.text}),W=v.length,ne=lt(W,ue);ne.length===W?(c(function(ee){return ee.map(function(Ce,gt){var we=v.indexOf(gt.toString());return we>=0?Pr(Pr({},Ce),{},{text:ne[we],isRegenerating:!1}):Ce})}),k(function(ee){var Ce=new Set(ne);return ee.filter(function(gt){return!Ce.has(gt)})}),b([])):(E(!0),ae())}},[G,v,ae,u,lt]),$e=z.useCallback(function(ue){if(ue.preventDefault(),!!r){if(me()){H(!0);return}oe({brandId:r,data:{queries:u.map(function(W){return W.text})}})}},[r,u,oe,me]);return y.jsxs("div",{children:[B&&y.jsx(P.Alert,{className:"yst-mb-4",variant:"error",children:B}),y.jsxs("form",{onSubmit:$e,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(P.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:Oe("yst-flex yst-gap-2",h?"yst-justify-end":"yst-justify-start"),children:h?y.jsxs(y.Fragment,{children:[y.jsx(P.Button,{size:"small",variant:"secondary",onClick:Pe,children:"Done"}),y.jsxs(P.Button,{variant:"secondary",size:"small",onClick:tt,className:"yst-gap-1",isLoading:G,disabled:G||v.length===0,children:[y.jsx(ep,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(P.Button,{size:"small",variant:"secondary",onClick:Pe,className:"yst-gap-1.5",disabled:Ne,children:[y.jsx(q4,{}),"Select queries to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:u.length===0?FL.map(function(ue,W){return y.jsx("div",{className:Oe("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:y.jsx(P.SkeletonLoader,{children:ue||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(W))}):u.slice(0,is).map(function(ue,W){var ne=ue.isRegenerating?ue.text===Fo?Fo:RL:ue.text;return y.jsx("div",{className:Oe("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[h&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(P.Checkbox,{id:"query-regenerate-".concat(W),name:"query-regenerate-".concat(W),value:W.toString(),checked:v.includes(W.toString()),onChange:function(){return Fe(W)},disabled:G})}),y.jsx("div",{className:"yst-flex-1",children:y.jsx(P.TextField,{id:"query-text-".concat(W),label:"Query ".concat(W+1),type:"text",value:ne,onChange:function(ee){ue.isRegenerating||Y(W,ee.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:ue.isRegenerating,required:!0,maxLength:255,validation:te(ue.text)?{variant:"warning",message:"For more accurate insights, avoid using your brand name in the query."}:void 0})})]})},ue.id)})}),y.jsx(ex,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:dt,isLoading:He})]}),y.jsx(P.Modal,{isOpen:D,onClose:J,position:"center",as:"div",children:y.jsx(P.Modal.Panel,{children:y.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[y.jsx("div",{children:y.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-amber-100",children:y.jsx(s2,{className:"yst-h-6 yst-w-6 yst-text-amber-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(P.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(P.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Brand name detected in your queries"})}),y.jsxs(P.Modal.Container.Content,{className:"yst-mb-6 yst-space-y-3",children:[y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"We found your brand name in one or more of your queries. Using your brand name in queries often show more mentions and more positive sentiment, which can skew your results."}),y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"For more balanced results, remove your brand name or make the queries more general."})]}),y.jsxs(P.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[y.jsxs(P.Button,{onClick:Se,variant:"secondary",className:"yst-gap-1.5",disabled:He,isLoading:He,children:[y.jsx(ep,{}),"Run analysis anyway"]}),y.jsx(P.Button,{variant:"primary",onClick:ge,children:"Review and edit queries"})]})]})]})})})]})};const zL=Object.freeze(Object.defineProperty({__proto__:null,default:qL},Symbol.toStringTag,{value:"Module"}));var HL=["min","max","progress","className"];function UL(e,t){if(e==null)return{};var n,r,i=GL(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rx=z.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=UL(e,HL),a=z.useMemo(function(){var u=Math.max(0,r-n);if(u===0)return 0;var c=(i-n)/u*100;return Math.max(0,Math.min(100,c))},[n,r,i]),l=Math.min(Math.max(i,n),r);return y.jsx("div",{ref:t,role:"progressbar","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":"".concat(Math.round(a),"%"),className:Oe(s),...o,children:y.jsx("div",{className:"yst-relative yst-h-2 yst-w-full yst-overflow-hidden yst-rounded-full yst-bg-slate-200/40",children:y.jsx("div",{className:"yst-absolute yst-left-0 yst-top-0 yst-h-full yst-rounded-full yst-bg-[linear-gradient(97.38deg,_#A61E69_0%,_#6366F1_100%)] yst-transition-[width] yst-duration-300 yst-ease-out",style:{width:"".concat(a,"%")}})})})});rx.displayName="ProgressBarGradient";var es=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],ix=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var u=0;u<es.length;u++)if(r<=es[u].threshold)return es[u];return es[es.length-1]},a=o();return y.jsxs("div",{className:Oe("yst-font-medium yst-text-slate-800",s),children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-center yst-gap-2",children:[r<100?y.jsx(P.Spinner,{}):y.jsx(d2,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(rx,{className:"yst-mt-3",progress:r,min:0,max:100}),y.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:es.map(function(l){return y.jsx("span",{children:y.jsx(Nu,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};ix.propTypes={progress:$d.number,className:$d.string};var KL=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},VL=function(){var t,n,r,i=dn(),s=Gt(),o=xu(),a=Rn(),l=a.brandId,u=o.brandId||l,c=Jl(u,{query:{enabled:!!u,select:function(C){var x=C.data;return x}}}),d=c.data,f=N5(u,"latest",{query:{enabled:!!u,select:function(C){var x=C.data;return x},refetchInterval:function(C){var x,k=C==null||(x=C.state)===null||x===void 0||(x=x.data)===null||x===void 0?void 0:x.data;return KL(k==null?void 0:k.status)}}}),h=f.data,g=h==null?void 0:h.id,m=g?"/brands/".concat(u,"/analysis/").concat(g):"/brands/".concat(u);z.useEffect(function(){var S=(h==null?void 0:h.status)==="pending"||(h==null?void 0:h.status)==="processing"||(h==null?void 0:h.status)==="completed";d!=null&&d.nextScheduledAnalysis&&h!==null&&h!==void 0&&h.status&&h7(d.nextScheduledAnalysis,5)&&!S&&i("/brands/".concat(u),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,u,i,h==null?void 0:h.status]),z.useEffect(function(){((d==null?void 0:d.setupStatus)==="completed"||(d==null?void 0:d.setupStatus)==="scheduledFirstAnalysis"&&d!==null&&d!==void 0&&d.firstNextAnalysisOpportunity&&!S2(d.firstNextAnalysisOpportunity,2))&&i(m,{replace:!0})},[d==null?void 0:d.firstNextAnalysisOpportunity,d==null?void 0:d.setupStatus,m,i]);var p=d==null||(t=d.queries)===null||t===void 0?void 0:t.length,v=(h==null||(n=h.completedQueries)===null||n===void 0?void 0:n.length)||0,b=function(){if(p&&p>0){var S=80/p,C=v*S;return(h==null?void 0:h.status)==="completed"?100:Math.round(Math.min(C,80))}return 0}();return y.jsxs("div",{children:[y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(ix,{progress:b}),y.jsx(Ha,{}),y.jsx("div",{className:"yst-space-y-8",children:d==null||(r=d.queries)===null||r===void 0?void 0:r.map(function(S){var C,x=S.id,k=S.query,w=x&&(h==null||(C=h.completedQueries)===null||C===void 0?void 0:C.includes(x));return y.jsxs("div",{className:Oe("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[w===!0?y.jsx(d2,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):y.jsx(P.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:k})]},"result-item-".concat(k))})})]}),y.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(P.Button,{as:ti,to:m,onClick:function(S){if(b!==100){S.preventDefault();return}s.clear()},disabled:b!==100,children:"Continue →"})})]})};const WL=Object.freeze(Object.defineProperty({__proto__:null,default:VL},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=FA;exports.setApiBaseUrl=Zv;
|
|
1295
1295
|
//# sourceMappingURL=ai-insights-client.cjs.js.map
|